Class: RaiblocksRpc::Wallet

Inherits:
Proxy
  • Object
show all
Defined in:
lib/raiblocks_rpc/proxies/wallet.rb

Instance Attribute Summary collapse

Attributes inherited from Proxy

#m, #param_signature, #params

Instance Method Summary collapse

Constructor Details

#initialize(wallet_seed) ⇒ Wallet

Returns a new instance of Wallet.



5
6
7
8
9
10
11
12
# File 'lib/raiblocks_rpc/proxies/wallet.rb', line 5

def initialize(wallet_seed)
  unless wallet_address.is_a?(String) || public_key.is_a?(Symbol)
    raise RaiblocksRpc::MissingArguments,
          'Missing argument: wallet_seed (str)'
  end

  self.seed = wallet_seed
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RaiblocksRpc::Proxy

Instance Attribute Details

#seedObject

Returns the value of attribute seed.



3
4
5
# File 'lib/raiblocks_rpc/proxies/wallet.rb', line 3

def seed
  @seed
end

Instance Method Details

#proxy_methodsObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/raiblocks_rpc/proxies/wallet.rb', line 18

def proxy_methods
  {
    wallet_balances: nil,
    wallet_add: { required: %i[key], optional: %i[work] },
    password_change: { required: %i[password] },
    wallet_change_seed: { required: %i[seed] },
    wallet_contains: { required: %i[account] },
    wallet_create: nil,
    wallet_destroy: nil,
    wallet_export: nil,
    wallet_frontiers: nil,
    wallet_locked: nil,
    password_enter: { required: %i[password] },
    wallet_pending: { required: %i[count], optional: %i[threshold source] },
    wallet_republish: { required: %i[count] },
    wallet_balance_total: nil,
    password_valid: nil,
    wallet_work_get: nil,
    send: { required: %[wallet source destination amount] },
    work_get: nil,
    work_set: nil,
    search_pending: nil,
    wallet_representative: nil,
    wallet_representative_set: %i[representative],
    payment_begin: nil,
    payment_init: nil,
    payment_end: { required: %i[account] },
    receive: { required: %i[account block] }
  }
end

#proxy_paramsObject



14
15
16
# File 'lib/raiblocks_rpc/proxies/wallet.rb', line 14

def proxy_params
  { wallet: :seed }
end