nis-ruby 0.0.6.1 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +119 -0
- data/demo/request_account.rb +8 -8
- data/demo/request_block.rb +11 -0
- data/demo/request_debug.rb +7 -14
- data/demo/request_local.rb +20 -0
- data/demo/request_namespace.rb +11 -0
- data/demo/request_nis.rb +0 -1
- data/demo/request_node.rb +31 -0
- data/demo/request_transaction.rb +6 -7
- data/lib/nis/client.rb +1 -1
- data/lib/nis/endpoint/account/get.rb +4 -4
- data/lib/nis/endpoint/account/harvests.rb +3 -3
- data/lib/nis/endpoint/account/historical.rb +5 -5
- data/lib/nis/endpoint/account/lock.rb +1 -1
- data/lib/nis/endpoint/account/mosaic.rb +4 -4
- data/lib/nis/endpoint/account/namespace.rb +5 -5
- data/lib/nis/endpoint/account/status.rb +1 -1
- data/lib/nis/endpoint/account/transfers.rb +12 -12
- data/lib/nis/endpoint/account/unconfirmed_transactions.rb +7 -2
- data/lib/nis/endpoint/account/unlock.rb +1 -1
- data/lib/nis/endpoint/block/at.rb +10 -0
- data/lib/nis/endpoint/block/get.rb +10 -0
- data/lib/nis/endpoint/block.rb +4 -0
- data/lib/nis/endpoint/chain/height.rb +11 -0
- data/lib/nis/endpoint/chain/last_block.rb +14 -0
- data/lib/nis/endpoint/chain/score.rb +11 -0
- data/lib/nis/endpoint/local/account/transfers.rb +34 -0
- data/lib/nis/endpoint/local/chain.rb +16 -0
- data/lib/nis/endpoint/namespace/mosaic.rb +15 -0
- data/lib/nis/endpoint/namespace/root.rb +14 -0
- data/lib/nis/endpoint/namespace.rb +10 -0
- data/lib/nis/endpoint/node/active_peers.rb +11 -0
- data/lib/nis/endpoint/node/boot.rb +10 -0
- data/lib/nis/endpoint/node/experiences.rb +9 -0
- data/lib/nis/endpoint/node/extended_info.rb +9 -0
- data/lib/nis/endpoint/node/info.rb +9 -0
- data/lib/nis/endpoint/node/peer_list.rb +25 -0
- data/lib/nis/endpoint/node.rb +4 -0
- data/lib/nis/endpoint/transaction/announce.rb +1 -1
- data/lib/nis/endpoint/transaction/prepareAnnounce.rb +1 -1
- data/lib/nis/error.rb +1 -0
- data/lib/nis/struct/account_meta_data.rb +1 -1
- data/lib/nis/struct/account_meta_data_pair.rb +4 -4
- data/lib/nis/struct/account_private_key_transactions_page.rb +14 -0
- data/lib/nis/struct/application_meta_data.rb +21 -0
- data/lib/nis/struct/block.rb +24 -0
- data/lib/nis/struct/block_height.rb +22 -0
- data/lib/nis/struct/block_score.rb +17 -0
- data/lib/nis/struct/boot_node_request.rb +23 -0
- data/lib/nis/struct/error.rb +18 -0
- data/lib/nis/struct/explorer_block_view_model.rb +17 -0
- data/lib/nis/struct/explorer_transfer_view_model.rb +18 -0
- data/lib/nis/struct/explorer_view_model_transaction.rb +16 -0
- data/lib/nis/struct/extended_node_experience_pair.rb +14 -0
- data/lib/nis/struct/harvest_info.rb +2 -2
- data/lib/nis/struct/mosaic_definition.rb +2 -0
- data/lib/nis/struct/mosaic_definition_meta_data.rb +12 -0
- data/lib/nis/struct/mosaic_definition_meta_data_pair.rb +16 -0
- data/lib/nis/struct/mosaic_levy.rb +18 -0
- data/lib/nis/struct/mosaic_properties.rb +8 -3
- data/lib/nis/struct/namespace_meta_data.rb +12 -0
- data/lib/nis/struct/namespace_meta_data_pair.rb +16 -0
- data/lib/nis/struct/nis_node_info.rb +19 -0
- data/lib/nis/struct/node_collection.rb +20 -0
- data/lib/nis/struct/node_experience.rb +13 -0
- data/lib/nis/struct/node_info.rb +28 -0
- data/lib/nis/struct/request_announce.rb +13 -0
- data/lib/nis/struct/transaction_meta_data.rb +3 -6
- data/lib/nis/struct/transaction_meta_data_pair.rb +2 -5
- data/lib/nis/struct/unconfirmed_transaction_meta_data_pair.rb +5 -5
- data/lib/nis/util.rb +2 -1
- data/lib/nis/version.rb +1 -1
- data/lib/nis.rb +21 -0
- metadata +46 -2
@@ -0,0 +1,34 @@
|
|
1
|
+
module Nis::Endpoint
|
2
|
+
module Local
|
3
|
+
module Account
|
4
|
+
module Transfers
|
5
|
+
# @param [Nis::Struct::AccountPrivateKeyTransactionsPage] page
|
6
|
+
# @return [Array <Nis::Struct::TransactionMetaDataPair>]
|
7
|
+
# @see http://bob.nem.ninja/docs/#transaction-data-with-decoded-messages
|
8
|
+
def local_account_transfers_incoming(page:)
|
9
|
+
request!(:post, '/local/account/transfers/incoming', page) do |res|
|
10
|
+
res[:data].map { |tmdp| Nis::Struct::TransactionMetaDataPair.build(tmdp) }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# @param [Nis::Struct::AccountPrivateKeyTransactionsPage] page
|
15
|
+
# @return [Array <Nis::Struct::TransactionMetaDataPair>]
|
16
|
+
# @see http://bob.nem.ninja/docs/#transaction-data-with-decoded-messages
|
17
|
+
def local_account_transfers_outgoing(page:)
|
18
|
+
request!(:post, '/local/account/transfers/outgoing', page) do |res|
|
19
|
+
res[:data].map { |tmdp| Nis::Struct::TransactionMetaDataPair.build(tmdp) }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# @param [Nis::Struct::AccountPrivateKeyTransactionsPage] page
|
24
|
+
# @return [Array <Nis::Struct::TransactionMetaDataPair>]
|
25
|
+
# @see http://bob.nem.ninja/docs/#transaction-data-with-decoded-messages
|
26
|
+
def local_account_transfers_all(page:)
|
27
|
+
request!(:post, '/local/account/transfers/all', page) do |res|
|
28
|
+
res[:data].map { |tmdp| Nis::Struct::TransactionMetaDataPair.build(tmdp) }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Nis::Endpoint
|
2
|
+
module Local
|
3
|
+
module Chain
|
4
|
+
# @param [String] block_height
|
5
|
+
# @return [Array <Nis::Struct::Block>]
|
6
|
+
# @see http://bob.nem.ninja/docs/#getting-part-of-a-chain
|
7
|
+
def local_chain_blocks_after(block_height:)
|
8
|
+
request!(:post, '/local/chain/blocks-after',
|
9
|
+
height: block_height
|
10
|
+
) do |res|
|
11
|
+
res[:data].map { |ebvm| Nis::Struct::ExplorerBlockViewModel.build(ebvm) }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Nis::Endpoint
|
2
|
+
module Namespace::Mosaic
|
3
|
+
# @return [Array <Nis::Struct::MosaicDefinitionMetaDataPair>]
|
4
|
+
# @see http://bob.nem.ninja/docs/#retrieving-mosaic-definitions
|
5
|
+
def namespace_mosaic_definition_page(namespace:, id: nil, page_size: nil)
|
6
|
+
request!(:get, '/namespace/mosaic/definition/page',
|
7
|
+
namespace: namespace,
|
8
|
+
id: id,
|
9
|
+
pageSize: page_size
|
10
|
+
) do |res|
|
11
|
+
res[:data].map { |mdmdp| Nis::Struct::MosaicDefinitionMetaDataPair.build(mdmdp) }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Nis::Endpoint
|
2
|
+
module Namespace::Root
|
3
|
+
# @return [Array <Nis::Struct::NamespaceMetaDataPair>]
|
4
|
+
# @see http://bob.nem.ninja/docs/#retrieving-root-namespaces
|
5
|
+
def namespace_root_page(id: nil, page_size: nil)
|
6
|
+
request!(:get, '/namespace/root/page',
|
7
|
+
id: id,
|
8
|
+
pageSize: page_size
|
9
|
+
) do |res|
|
10
|
+
res[:data].map { |nsmdp| Nis::Struct::NamespaceMetaDataPair.build(nsmdp) }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module Nis::Endpoint
|
2
|
+
module Namespace
|
3
|
+
# @param [String] namespace
|
4
|
+
# @return [Nis::Struct::Namespace]
|
5
|
+
# @see http://bob.nem.ninja/docs/#retrieving-a-specific-namespace
|
6
|
+
def namespace(namespace:)
|
7
|
+
Nis::Struct::Namespace.build request!(:get, '/namespace', namespace: namespace)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Nis::Endpoint
|
2
|
+
module Node::ActivePeers
|
3
|
+
# @return [Nis::Struct::NodeInfo]
|
4
|
+
# @see http://bob.nem.ninja/docs/#maximum-chain-height-in-the-active-neighborhood
|
5
|
+
def node_active_peers_max_chain_height
|
6
|
+
request!(:get, '/node/active-peers/max-chain-height') do |res|
|
7
|
+
Nis::Struct::BlockHeight.build res
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module Nis::Endpoint
|
2
|
+
module Node::Boot
|
3
|
+
# @param boot_node_request [Nis::Struct::BootNodeRequest]
|
4
|
+
# @return [nil]
|
5
|
+
# @see http://bob.nem.ninja/docs/#booting-the-local-node
|
6
|
+
def node_boot(boot_node_request:)
|
7
|
+
request!(:post, '/node/boot', boot_node_request: boot_node_request)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Nis::Endpoint
|
2
|
+
module Node::Experiences
|
3
|
+
# @return [Nis::Struct::ExtendedNodeExperiencePair]
|
4
|
+
# @see http://bob.nem.ninja/docs/#requesting-node-experiences
|
5
|
+
def node_experiences
|
6
|
+
Nis::Struct::ExtendedNodeExperiencePair.build request!(:get, '/node/experiences')
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Nis::Endpoint
|
2
|
+
module Node::PeerList
|
3
|
+
# @return [Nis::Struct::NodeCollection]
|
4
|
+
# @see http://bob.nem.ninja/docs/#complete-neighborhood
|
5
|
+
def node_peerlist_all
|
6
|
+
Nis::Struct::NodeCollection.build request!(:get, '/node/peer-list/all')
|
7
|
+
end
|
8
|
+
|
9
|
+
# @return [Array <Nis::Struct::NodeInfo>]
|
10
|
+
# @see http://bob.nem.ninja/docs/#reachable-neighborhood
|
11
|
+
def node_peerlist_reachable
|
12
|
+
request!(:get, '/node/peer-list/reachable') do |res|
|
13
|
+
res[:data].map { |n| Nis::Struct::NodeInfo.build(n) }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [Array <Nis::Struct::NodeInfo>]
|
18
|
+
# @see http://bob.nem.ninja/docs/#active-neighborhood
|
19
|
+
def node_peerlist_active
|
20
|
+
request!(:get, '/node/peer-list/active') do |res|
|
21
|
+
res[:data].map { |n| Nis::Struct::NodeInfo.build(n) }
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Nis::Endpoint
|
2
2
|
module Transaction::Announce
|
3
|
-
# @
|
3
|
+
# @param [Nis::Struct::RequestAnnounce] request_announce
|
4
4
|
# @return [Nis::Struct::NodeInfo]
|
5
5
|
# @see http://bob.nem.ninja/docs/#sending-the-data-to-NIS
|
6
6
|
def transaction_announce(request_announce:)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Nis::Endpoint
|
2
2
|
module Transaction::PrepareAnnounce
|
3
|
-
# @
|
3
|
+
# @param [Nis::Struct::RequestPrepareAnnounce] request_prepare_announce
|
4
4
|
# @return [Nis::Struct::NodeInfo]
|
5
5
|
# @see http://bob.nem.ninja/docs/#initiating-a-transaction
|
6
6
|
def transaction_prepare_announce(request_prepare_announce:)
|
data/lib/nis/error.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Nis::Struct
|
2
2
|
# @attr [String] status
|
3
3
|
# @attr [String] remoteStatus
|
4
|
-
# @attr [Array <Nis::Struct::AccountInfo>]
|
4
|
+
# @attr [Array <Nis::Struct::AccountInfo>] cosignatoryOf
|
5
5
|
# @attr [Array <Nis::Struct::AccountInfo>] cosignatories
|
6
6
|
# @see http://bob.nem.ninja/docs/#accountMetaData
|
7
7
|
class AccountMetaData
|
@@ -1,15 +1,15 @@
|
|
1
1
|
class Nis::Struct
|
2
|
-
# @attr [AccountInfo]
|
2
|
+
# @attr [AccountInfo] account
|
3
3
|
# @attr [AccountMetaData] meta
|
4
4
|
# @see http://bob.nem.ninja/docs/#accountMetaDataPair
|
5
5
|
class AccountMetaDataPair
|
6
6
|
include Nis::Util::Assignable
|
7
7
|
attr_accessor :account, :meta
|
8
8
|
|
9
|
-
def self.build(
|
9
|
+
def self.build(meta:, account:)
|
10
10
|
new(
|
11
|
-
|
12
|
-
|
11
|
+
meta: AccountMetaData.build(meta),
|
12
|
+
account: AccountInfo.build(account)
|
13
13
|
)
|
14
14
|
end
|
15
15
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [String] value
|
3
|
+
# @attr [String] hash
|
4
|
+
# @attr [Integer] id
|
5
|
+
# @see http://bob.nem.ninja/docs/#accountPrivateKeyTransactionsPage
|
6
|
+
class AccountPrivateKeyTransactionsPage
|
7
|
+
include Nis::Util::Assignable
|
8
|
+
attr_accessor :value, :hash, :id
|
9
|
+
|
10
|
+
def self.build(attrs)
|
11
|
+
new(attrs)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [Integer] currentTime
|
3
|
+
# @attr [String] application
|
4
|
+
# @attr [Integer] startTime
|
5
|
+
# @attr [String] version
|
6
|
+
# @attr [String] signer
|
7
|
+
# @see http://bob.nem.ninja/docs/#applicationMetaData
|
8
|
+
class ApplicationMetaData
|
9
|
+
include Nis::Util::Assignable
|
10
|
+
attr_accessor :currentTime, :application, :startTime, :version, :signer
|
11
|
+
|
12
|
+
alias :current_time :currentTime
|
13
|
+
alias :current_time= :currentTime=
|
14
|
+
alias :start_time :startTime
|
15
|
+
alias :start_time= :startTime=
|
16
|
+
|
17
|
+
def self.build(attrs)
|
18
|
+
new(attrs)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [Integer] timeStamp
|
3
|
+
# @attr [String] signature
|
4
|
+
# @attr [String] prevBlockHash
|
5
|
+
# @attr [Integer] type
|
6
|
+
# @attr [Array <Nis::Struct::transaction>] transactions
|
7
|
+
# @attr [Integer] version
|
8
|
+
# @attr [String] signer
|
9
|
+
# @attr [Integer] height
|
10
|
+
# @see http://bob.nem.ninja/docs/#block
|
11
|
+
class Block
|
12
|
+
include Nis::Util::Assignable
|
13
|
+
attr_accessor :timeStamp, :signature, :prevBlockHash, :type, :transactions, :version, :signer, :height
|
14
|
+
|
15
|
+
alias :timestamp :timeStamp
|
16
|
+
alias :timestamp= :timeStamp=
|
17
|
+
alias :prev_block_hash :prevBlockHash
|
18
|
+
alias :prev_block_hash= :prevBlockHash=
|
19
|
+
|
20
|
+
def self.build(attrs)
|
21
|
+
new(attrs)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [Integer] height
|
3
|
+
# @see http://bob.nem.ninja/docs/#blockHeight
|
4
|
+
class BlockHeight
|
5
|
+
include Nis::Util::Assignable
|
6
|
+
attr_accessor :height
|
7
|
+
|
8
|
+
def self.build(attrs)
|
9
|
+
new(attrs)
|
10
|
+
end
|
11
|
+
|
12
|
+
# @return [Integer]
|
13
|
+
def to_i
|
14
|
+
@height
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [String]
|
18
|
+
def to_s
|
19
|
+
@height.to_s
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [String] score
|
3
|
+
# @see http://bob.nem.ninja/docs/#blockChainScore
|
4
|
+
class BlockScore
|
5
|
+
include Nis::Util::Assignable
|
6
|
+
attr_accessor :score
|
7
|
+
|
8
|
+
def self.build(attrs)
|
9
|
+
new(attrs)
|
10
|
+
end
|
11
|
+
|
12
|
+
# @return [String]
|
13
|
+
def to_s
|
14
|
+
@score
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [String] metaData
|
3
|
+
# @attr [String] application
|
4
|
+
# @attr [String] endpoint
|
5
|
+
# @attr [String] protocol
|
6
|
+
# @attr [String] port
|
7
|
+
# @attr [String] host
|
8
|
+
# @attr [String] identity
|
9
|
+
# @attr [String] private_key
|
10
|
+
# @attr [String] name
|
11
|
+
# @see http://bob.nem.ninja/docs/#bootNodeRequest
|
12
|
+
class BootNodeRequest
|
13
|
+
include Nis::Util::Assignable
|
14
|
+
attr_accessor :metaData, :application, :endpoint, :protocol, :port, :host, :identity, :private_key, :name
|
15
|
+
|
16
|
+
alias metadata metaData
|
17
|
+
alias metadata= metaData=
|
18
|
+
|
19
|
+
def self.build(attrs)
|
20
|
+
new(attrs)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [Integer] timeStamp
|
3
|
+
# @attr [String] error
|
4
|
+
# @attr [String] message
|
5
|
+
# @attr [Integer] status
|
6
|
+
# @see http://bob.nem.ninja/docs/#error-object
|
7
|
+
class Error
|
8
|
+
include Nis::Util::Assignable
|
9
|
+
attr_accessor :timeStamp, :error, :message, :status
|
10
|
+
|
11
|
+
alias :timestamp :timeStamp
|
12
|
+
alias :timestamp= :timeStamp=
|
13
|
+
|
14
|
+
def self.build(attrs)
|
15
|
+
new(attrs)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [Array <Nis::Struct::ExplorerTransferViewModel>] txes
|
3
|
+
# @attr [Nis::Struct::Block] block
|
4
|
+
# @attr [String] hash
|
5
|
+
# @attr [String] difficulty
|
6
|
+
# @see http://bob.nem.ninja/docs/#explorerBlockViewModel
|
7
|
+
class ExplorerBlockViewModel
|
8
|
+
include Nis::Util::Assignable
|
9
|
+
attr_accessor :txes, :block, :hash, :difficulty
|
10
|
+
|
11
|
+
def self.build(attrs)
|
12
|
+
attrs[:txes] = attrs[:txes].map { |tx| ExplorerTransferViewModel.build(tx) }
|
13
|
+
attrs[:block] = Block.build(attrs[:block])
|
14
|
+
new(attrs)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [Nis::Struct::Transaction] tx
|
3
|
+
# @attr [String] hash
|
4
|
+
# @attr [String] innerHash
|
5
|
+
# @see http://bob.nem.ninja/docs/#explorerTransferViewModel
|
6
|
+
class ExplorerTransferViewModel
|
7
|
+
include Nis::Util::Assignable
|
8
|
+
attr_accessor :tx, :hash, :innerHash
|
9
|
+
|
10
|
+
alias inner_hash innerHash
|
11
|
+
alias inner_hash= innerHash=
|
12
|
+
|
13
|
+
def self.build(attrs)
|
14
|
+
attrs[:tx] = Transaction.build(attrs[:tx])
|
15
|
+
new(attrs)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [Array <Nis::Struct::Transaction>] txes
|
3
|
+
# @attr [String] block
|
4
|
+
# @attr [String] hash
|
5
|
+
# @see http://bob.nem.ninja/docs/#explorerViewModelTransaction
|
6
|
+
class ExplorerViewModelTransaction
|
7
|
+
include Nis::Util::Assignable
|
8
|
+
attr_accessor :txes, :block, :hash
|
9
|
+
|
10
|
+
def self.build(attrs)
|
11
|
+
attrs[:txes] = attrs[:txes].map { |tx| Transaction.build(tx) }
|
12
|
+
attrs[:block] = Block.build(attrs[:block])
|
13
|
+
new(attrs)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [Nis::Struct::NodeInfo] node
|
3
|
+
# @attr [Integer] syncs
|
4
|
+
# @attr [Nis::Struct::NodeExperience] experience
|
5
|
+
# @see http://bob.nem.ninja/docs/#extendedNodeExperiencePair
|
6
|
+
class ExtendedNodeExperiencePair
|
7
|
+
include Nis::Util::Assignable
|
8
|
+
attr_accessor :node, :syncs, :experiences
|
9
|
+
|
10
|
+
def self.build(attrs)
|
11
|
+
new(attrs)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class Nis::Struct
|
2
|
-
# @attr [Integer]
|
2
|
+
# @attr [Integer] timeStamp
|
3
3
|
# @attr [String] id
|
4
4
|
# @attr [Integer] difficulty
|
5
|
-
# @attr [Integer]
|
5
|
+
# @attr [Integer] totalFee
|
6
6
|
# @attr [Integer] height
|
7
7
|
# @see http://bob.nem.ninja/docs/#harvestInfo
|
8
8
|
class HarvestInfo
|
@@ -10,7 +10,9 @@ class Nis::Struct
|
|
10
10
|
attr_accessor :creator, :id, :description, :properties, :levy
|
11
11
|
|
12
12
|
def self.build(attrs)
|
13
|
+
attrs[:id] = MosaicId.build(attrs[:id])
|
13
14
|
attrs[:properties] = attrs[:properties].map { |p| MosaicProperties.build(p) }
|
15
|
+
attrs[:levy] = MosaicLevy.build(attrs[:levy]) if attrs[:levy]
|
14
16
|
new(attrs)
|
15
17
|
end
|
16
18
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [Nis::Struct::MosaicMetaData] meta
|
3
|
+
# @attr [Nis::Struct::Mosaic] mosaic
|
4
|
+
# @see http://bob.nem.ninja/docs/#mosaicDefinitionMetaDataPair
|
5
|
+
class MosaicDefinitionMetaDataPair
|
6
|
+
include Nis::Util::Assignable
|
7
|
+
attr_accessor :meta, :mosaic
|
8
|
+
|
9
|
+
def self.build(attrs)
|
10
|
+
new(
|
11
|
+
meta: MosaicDefinitionMetaData.build(attrs[:meta]),
|
12
|
+
mosaic: MosaicDefinition.build(attrs[:mosaic])
|
13
|
+
)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [Integer] type
|
3
|
+
# @attr [String] recipient
|
4
|
+
# @attr [Nis::Struct::MosaicId] mosaicId
|
5
|
+
# @attr [Integer] fee
|
6
|
+
# @see http://bob.nem.ninja/docs/#mosaicLevy
|
7
|
+
class MosaicLevy
|
8
|
+
include Nis::Util::Assignable
|
9
|
+
attr_accessor :type, :recipient, :mosaicId, :fee
|
10
|
+
|
11
|
+
alias :mosaid_id :mosaicId
|
12
|
+
|
13
|
+
def self.build(attrs)
|
14
|
+
attrs[:mosaicId] = MosaicId.build(attrs[:mosaicId])
|
15
|
+
new(attrs)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,13 +1,18 @@
|
|
1
1
|
class Nis::Struct
|
2
2
|
# @attr [Array] properties
|
3
3
|
# @attr [Integer] divisibility
|
4
|
-
# @attr [Integer]
|
5
|
-
# @attr [Boolean]
|
4
|
+
# @attr [Integer] initialSupply
|
5
|
+
# @attr [Boolean] supplyMutable
|
6
6
|
# @attr [Boolean] transferable
|
7
7
|
# @see http://bob.nem.ninja/docs/#mosaicProperties
|
8
8
|
class MosaicProperties
|
9
9
|
include Nis::Util::Assignable
|
10
|
-
attr_accessor :divisibility, :
|
10
|
+
attr_accessor :divisibility, :initialSupply, :supplyMutable, :transferable
|
11
|
+
|
12
|
+
alias initial_supply initialSupply
|
13
|
+
alias initial_supply= initialSupply=
|
14
|
+
alias supply_mutable supplyMutable
|
15
|
+
alias supply_mutable= supplyMutable=
|
11
16
|
|
12
17
|
def self.build(attrs)
|
13
18
|
new(attrs)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [String] meta
|
3
|
+
# @attr [String] namespace
|
4
|
+
# @see http://bob.nem.ninja/docs/#namespaceMetaDataPair
|
5
|
+
class NamespaceMetaDataPair
|
6
|
+
include Nis::Util::Assignable
|
7
|
+
attr_accessor :meta, :namespace
|
8
|
+
|
9
|
+
def self.build(meta:, namespace:)
|
10
|
+
new(
|
11
|
+
meta: NamespaceMetaData.build(meta),
|
12
|
+
namespace: Namespace.build(namespace)
|
13
|
+
)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [Nis::Struct::NodeInfo] node
|
3
|
+
# @attr [Nis::Struct::NodeInfo] nis_info
|
4
|
+
# @see http://bob.nem.ninja/docs/#nisNodeInfo
|
5
|
+
class NisNodeInfo
|
6
|
+
include Nis::Util::Assignable
|
7
|
+
attr_accessor :node, :nisInfo
|
8
|
+
|
9
|
+
alias :nis_info :nisInfo
|
10
|
+
alias :nis_info= :nisInfo=
|
11
|
+
|
12
|
+
def self.build(attrs)
|
13
|
+
new(
|
14
|
+
node: Nis::Struct::NodeInfo.build(attrs[:node]),
|
15
|
+
nisInfo: Nis::Struct::NodeInfo.build(attrs[:nisInfo])
|
16
|
+
)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class Nis::Struct
|
2
|
+
# @attr [Array] inactive
|
3
|
+
# @attr [Array] active
|
4
|
+
# @attr [Array] busy
|
5
|
+
# @attr [Array] failure
|
6
|
+
# @see http://bob.nem.ninja/docs/#nodeCollection
|
7
|
+
class NodeCollection
|
8
|
+
include Nis::Util::Assignable
|
9
|
+
attr_accessor :inactive, :active, :busy, :failure
|
10
|
+
|
11
|
+
def self.build(attrs)
|
12
|
+
new(
|
13
|
+
inactive: attrs[:inactive].map { |n| NodeInfo.build(n) },
|
14
|
+
active: attrs[:active].map { |n| NodeInfo.build(n) },
|
15
|
+
busy: attrs[:busy].map { |n| NodeInfo.build(n) },
|
16
|
+
failure: attrs[:failure].map { |n| NodeInfo.build(n) }
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|