Skip to content

Commit

Permalink
Merge pull request #17 from piotr-iohk/delegation_action
Browse files Browse the repository at this point in the history
Coin selection - delegation action
  • Loading branch information
piotr-iohk authored Oct 19, 2020
2 parents 29f85d1 + 9be618d commit cb132a8
Show file tree
Hide file tree
Showing 5 changed files with 208 additions and 133 deletions.
13 changes: 13 additions & 0 deletions lib/cardano_wallet/shelley.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,19 @@ def random(wid, payments)
:body => {:payments => payments_formatted}.to_json,
:headers => { 'Content-Type' => 'application/json' })
end

# Coin selection -> Delegation action
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/selectCoins
#
# @example
# random(wid, {action: "join", pool: "poolid"})
# random(wid, {action: "quit"})
def random_deleg(wid, deleg_action)
payments_formatted = Utils.verify_param_is_hash!(deleg_action)
self.class.post("/wallets/#{wid}/coin-selections/random",
:body => {:delegation_action => deleg_action}.to_json,
:headers => { 'Content-Type' => 'application/json' })
end
end

# API for Transactions
Expand Down
2 changes: 1 addition & 1 deletion lib/cardano_wallet/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module CardanoWallet
VERSION = "0.2.2"
VERSION = "0.2.3"
end
1 change: 1 addition & 0 deletions spec/byron_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_byron_tx(source_wid, target_wid)
it "I can send transaction and funds are received, icarus -> shelley" do
test_byron_tx(@wid_ic, @target_id_ic)
end

end

describe CardanoWallet::Byron::Wallets do
Expand Down
Loading

0 comments on commit cb132a8

Please sign in to comment.