Class: Bytom::Client

Inherits:
Object
  • Object
show all
Includes:
Constants
Defined in:
lib/bytom/client.rb

Overview

The entry point to the SDK. API endpoint categories are accessed through this object’s readable attributes.

Constant Summary

Constants included from Constants

Bytom::Constants::API_URL

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url: API_URL, token: nil) ⇒ Client

Returns a new instance of Client.



62
63
64
65
66
67
68
# File 'lib/bytom/client.rb', line 62

def initialize(
    base_url: API_URL,
    token: nil
)
  @client = Request.new(base_url: base_url, token: token)
  build_categories
end

Instance Attribute Details

#access_tokenAccessToken (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#accountsAccounts (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#addressAddress (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#assetAsset (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#balancesBalances (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#blockBlock (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#clientClient (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#coinbaseCoinbase (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#core_configCoreConfig (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#keysKeys (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#messageMessage (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#otherOther (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#peerPeer (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#transactionsTransactions (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#walletWallet (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

#workWork (readonly)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bytom/client.rb', line 57

class Client
  include Bytom::Constants
  attr_reader :client, :keys, :accounts, :address, :coinbase, :asset, :balances, :access_token,
              :transactions, :block, :core_config, :peer, :wallet, :message, :work, :other

  def initialize(
      base_url: API_URL,
      token: nil
  )
    @client = Request.new(base_url: base_url, token: token)
    build_categories
  end

  def build_categories
    @keys = Keys.new(client)
    @accounts = Accounts.new(client)
    @address = Address.new(client)
    @coinbase = Coinbase.new(client)
    @asset = Asset.new(client)
    @balances = Balances.new(client)
    @access_token = AccessToken.new(client)
    @transactions = Transactions.new(client)
    @block = Block.new(client)
    @core_config = CoreConfig.new(client)
    @peer = Peer.new(client)
    @wallet = Wallet.new(client)
    @message = Message.new(client)
    @work = Work.new(client)
    @other = Other.new(client)
  end

end

Instance Method Details

#build_categoriesObject



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/bytom/client.rb', line 70

def build_categories
  @keys = Keys.new(client)
  @accounts = Accounts.new(client)
  @address = Address.new(client)
  @coinbase = Coinbase.new(client)
  @asset = Asset.new(client)
  @balances = Balances.new(client)
  @access_token = AccessToken.new(client)
  @transactions = Transactions.new(client)
  @block = Block.new(client)
  @core_config = CoreConfig.new(client)
  @peer = Peer.new(client)
  @wallet = Wallet.new(client)
  @message = Message.new(client)
  @work = Work.new(client)
  @other = Other.new(client)
end