Sha256: 1b7d54e5f4467eb8b730e67075483569e076b4c34238f2d37dd2e12f0f8efcf1

Contents?: true

Size: 1.97 KB

Versions: 6

Compression:

Stored size: 1.97 KB

Contents

# frozen_string_literal: true
class NanoRpc::Wallet
  include NanoRpc::Proxy
  include NanoRpc::WalletHelper

  attr_reader :seed

  def initialize(seed = nil, opts = {})
    unless seed.is_a?(String)
      raise NanoRpc::MissingParameters,
            'Missing argument: seed (str)'
    end

    @seed = seed
    super(opts)
  end

  # Hide secret seed on object inspection
  def inspect
    "#{inspect_prefix}, @node=#{@node.inspect}>"
  end

  proxy_params wallet: :seed

  proxy_method :account_create, optional: %i[work]
  proxy_method :accounts_create, required: %i[count], optional: %i[work]
  proxy_method :account_list
  proxy_method :account_remove, required: %i[account]
  proxy_method :password_change, required: %i[password]
  proxy_method :password_enter, required: %i[password]
  proxy_method :password_valid
  proxy_method :payment_begin
  proxy_method :payment_init
  proxy_method :payment_end, required: %i[account]
  proxy_method :receive, required: %i[account block], optional: %i[work]
  proxy_method :send,
               required: %i[wallet source destination amount],
               optional: %i[id work]
  proxy_method :search_pending
  proxy_method :wallet_add, required: %i[key], optional: %i[work]
  proxy_method :wallet_add_watch, required: %i[accounts]
  proxy_method :wallet_balance_total
  proxy_method :wallet_balances, optional: %i[threshold]
  proxy_method :wallet_change_seed, required: %i[seed]
  proxy_method :wallet_contains, required: %i[account]
  proxy_method :wallet_destroy
  proxy_method :wallet_export
  proxy_method :wallet_frontiers
  proxy_method :wallet_ledger
  proxy_method :wallet_locked
  proxy_method :wallet_pending,
               required: %i[count], optional: %i[threshold source]
  proxy_method :wallet_representative
  proxy_method :wallet_representative_set, required: %i[representative]
  proxy_method :wallet_republish, required: %i[count]
  proxy_method :wallet_work_get
  proxy_method :work_get, required: %i[account]
  proxy_method :work_set
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nano_rpc-0.15.0 lib/nano_rpc/proxies/wallet.rb
nano_rpc-0.14.0 lib/nano_rpc/proxies/wallet.rb
nano_rpc-0.13.0 lib/nano_rpc/proxies/wallet.rb
nano_rpc-0.12.0 lib/nano_rpc/proxies/wallet.rb
nano_rpc-0.11.0 lib/nano_rpc/proxies/wallet.rb
nano_rpc-0.10.0 lib/nano_rpc/proxies/wallet.rb