Class: SilaRuby::Wallets

Inherits:
Object
  • Object
show all
Includes:
ApiHelpers
Defined in:
lib/sila-ruby/wallets.rb

Overview

==============================================

WALLETS ======================================

Class Method Summary collapse

Methods included from ApiHelpers

included

Class Method Details

.get_sila_balance(params = {}) ⇒ Object


GET-SILA-BALANCE ---------------------------

Checks token balance on a blockchain address.



64
65
66
67
68
69
70
71
72
# File 'lib/sila-ruby/wallets.rb', line 64

def self.get_sila_balance(params={})
  # Example of params passed
  #
  # params = {
  #   address: "0x..."
  # }

  sila_post_signed('get_sila_balance', nil, nil, params, nil)
end

.get_wallet(handle, user_key) ⇒ Object


GET-WALLET ---------------------------------

Gets details about the user wallet used to generate the usersignature header.



26
27
28
29
# File 'lib/sila-ruby/wallets.rb', line 26

def self.get_wallet(handle, user_key)
  header = { user_handle: handle }
  sila_post_signed('get_wallet', header, nil, nil, user_key)
end

.get_wallets(handle, params = {}, user_key) ⇒ Object


GET-WALLETS --------------------------------

Gets array of user handle's transactions with detailed status information.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/sila-ruby/wallets.rb', line 35

def self.get_wallets(handle, params={}, user_key)
  header = { user_handle: handle }

  # Example of params passed
  #
  # params = {
  #   search_filters: {
  #     page: 1,
  #     per_page: 20,
  #     sort_ascending: false,
  #     blockchain_network: "ETH",
  #     blockchain_address: "",
  #     nickname: ""
  #   }
  # }

  sila_post_signed('get_wallets', header, nil, params, user_key)
end