Class: Kortana::Modules::Wallets
- Inherits:
-
Object
- Object
- Kortana::Modules::Wallets
- Defined in:
- lib/kortana/modules/wallets.rb
Instance Method Summary collapse
- #get_address(index = nil) ⇒ Object
- #get_balance ⇒ Object
- #get_transaction(id) ⇒ Object
-
#initialize(client) ⇒ Wallets
constructor
A new instance of Wallets.
- #list_addresses ⇒ Object
- #list_transactions(options = {}) ⇒ Object
- #transfer(to:, amount:, currency: "DNR", chain: nil) ⇒ Object
Constructor Details
#initialize(client) ⇒ Wallets
Returns a new instance of Wallets.
4 5 6 |
# File 'lib/kortana/modules/wallets.rb', line 4 def initialize(client) @client = client end |
Instance Method Details
#get_address(index = nil) ⇒ Object
16 17 18 19 |
# File 'lib/kortana/modules/wallets.rb', line 16 def get_address(index = nil) params = index ? { index: index } : {} @client.get("/wallets/address", params) end |
#get_balance ⇒ Object
8 9 10 |
# File 'lib/kortana/modules/wallets.rb', line 8 def get_balance @client.get("/wallets/balance") end |
#get_transaction(id) ⇒ Object
34 35 36 |
# File 'lib/kortana/modules/wallets.rb', line 34 def get_transaction(id) @client.get("/wallets/transactions/#{id}") end |
#list_addresses ⇒ Object
12 13 14 |
# File 'lib/kortana/modules/wallets.rb', line 12 def list_addresses @client.get("/wallets/addresses") end |
#list_transactions(options = {}) ⇒ Object
30 31 32 |
# File 'lib/kortana/modules/wallets.rb', line 30 def list_transactions( = {}) @client.get("/wallets/transactions", ) end |
#transfer(to:, amount:, currency: "DNR", chain: nil) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/kortana/modules/wallets.rb', line 21 def transfer(to:, amount:, currency: "DNR", chain: nil) @client.post("/wallets/transfers", { to: to, amount: amount.to_s, currency: currency, chain: chain }) end |