Class: Kortana::Modules::Wallets

Inherits:
Object
  • Object
show all
Defined in:
lib/kortana/modules/wallets.rb

Instance Method Summary collapse

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_balanceObject



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_addressesObject



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(options = {})
  @client.get("/wallets/transactions", options)
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