diff --git a/lib/bitgo_client/v2.rb b/lib/bitgo_client/v2.rb index f6da947..c145897 100644 --- a/lib/bitgo_client/v2.rb +++ b/lib/bitgo_client/v2.rb @@ -41,6 +41,15 @@ def get_transfer(wallet_id, transfer_id, coin_code: :tbtc, logger: nil) client.request("#{base_path}/#{coin_code}/wallet/#{wallet_id}/transfer/#{transfer_id}", logger: logger) end + def send_many(wallet_id, payload, coin_code: :tbtc, logger: nil) + client.request( + "#{express_path}/api/v2/#{coin_code}/wallet/#{wallet_id}/sendmany", + payload, + method: :post, + logger: logger + ) + end + def send_transaction(wallet_id, payload, coin_code: :tbtc, logger: nil) client.request( "#{express_path}/api/v2/#{coin_code}/wallet/#{wallet_id}/sendcoins", diff --git a/spec/bitgo_client/v2_spec.rb b/spec/bitgo_client/v2_spec.rb index bd9f9b8..9097292 100644 --- a/spec/bitgo_client/v2_spec.rb +++ b/spec/bitgo_client/v2_spec.rb @@ -133,6 +133,28 @@ end end + describe "#send_many" do + let(:payload) { { key: :value } } + + context "with default coin_code" do + it "calls client request with the correct path" do + api.send_transaction(wallet_id, payload) + + expect(client).to have_received(:request) + .with("#{api.express_path}/api/v2/tbtc/wallet/#{wallet_id}/sendmany", payload, method: :post, logger: nil) + end + end + + context "with specific coin_code" do + it "calls client request with the correct path" do + api.send_transaction(wallet_id, payload, coin_code: :xxx) + + expect(client).to have_received(:request) + .with("#{api.express_path}/api/v2/xxx/wallet/#{wallet_id}/sendmany", payload, method: :post, logger: nil) + end + end + end + describe "#transactions" do context "with default params" do it "calls client request with the correct path" do