Documentation ¶
Index ¶
- type BlockHeader
- type Client
- type MetaData
- type ResponseGetAddressTransaction
- type ResponseGetAddresses
- type ResponseGetAllTransactions
- type ResponseGetBlock
- type ResponseGetBlockByHash
- type ResponseGetBlockByHeight
- type ResponseGetRegisteredName
- type ResponseGetRegisteredNameByAddress
- type ResponseGetSigchain
- type ResponseGetSingleAddress
- type ResponseGetTransaction
- type ResponseStatsBlocksPerDay
- type ResponseStatsSupply
- type ResponseStatsTransactionsPerDay
- type SigChain
- type SigchainElems
- type Stats
- type TransactionPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockHeader ¶
type Client ¶
type Client interface { // Addressbook GetRegisteredNames() (*ResponseGetRegisteredName, error) GetRegisteredNamesByAddress(string) ([]*ResponseGetRegisteredNameByAddress, error) GetAddressByRegisteredName(string) (*ResponseGetRegisteredNameByAddress, error) // Addresses GetAddresses() (*ResponseGetAddresses, error) GetSingleAddress(string) (*ResponseGetSingleAddress, error) GetAddressTransactions(string) (*ResponseGetAddressTransaction, error) // Blocks GetAllBlocks() (*ResponseGetBlock, error) GetBlockByHeight(int) (*ResponseGetBlockByHeight, error) GetBlockByHash(string) (*ResponseGetBlockByHash, error) GetTransactionsByBlockHeight(int) (*ResponseGetTransaction, error) GetTransactionsByBlockHash(string) (*ResponseGetTransaction, error) // Sigchain GetAllSigchains() (*ResponseGetSigchain, error) // Transactions GetAllTransactions() (*ResponseGetAllTransactions, error) GetTransactionByHash(string) (*ResponseGetTransaction, error) // Statistics StatsBlocksPerDay() ([]*ResponseStatsBlocksPerDay, error) StatsTransactionsPerDay() ([]*ResponseStatsTransactionsPerDay, error) StatsSupplies() (*ResponseStatsSupply, error) SetDebug(debug bool) SetAddress(address string) Next(interface{}) error }
Client is an NKN OpenAPI client
type MetaData ¶
type MetaData struct { From int `json:"from,omitempty"` To int `json:"to,omitempty"` PerPage interface{} `json:"per_page,omitempty"` CurrentPage int `json:"current_page,omitempty"` FirstPageURL string `json:"first_page_url,omitempty"` PrevPageUrl string `json:"prev_page_url,omitempty"` NextPageUrl string `json:"next_page_url,omitempty"` Path string `json:"path,omitempty"` }
type ResponseGetAddressTransaction ¶
type ResponseGetAddressTransaction struct { *MetaData Data []struct { ID int `json:"id"` BlockID int `json:"block_id"` Attributes string `json:"attributes"` Fee int `json:"fee"` Hash string `json:"hash"` Nonce string `json:"nonce"` TxType string `json:"txType"` BlockHeight int `json:"block_height"` CreatedAt string `json:"created_at"` Payload *TransactionPayload } `json:"data"` }
type ResponseGetAddresses ¶
type ResponseGetAddresses struct { Addresses struct { *MetaData Data []struct { Address string `json:"address"` TransactionCount int `json:"count_transactions"` FirstTransactionAt string `json:"first_transaction"` LastTransactionAt string `json:"last_transaction"` Balance int `json:"balance"` } `json:"data"` } `json:"addresses"` SumAddresses int `json:"sumAddresses"` }
type ResponseGetAllTransactions ¶
type ResponseGetAllTransactions struct { Transactions struct { *MetaData Data []struct { ID int `json:"id"` BlockID int `json:"block_id"` Attributes string `json:"attributes"` Fee int `json:"fee"` Hash string `json:"hash"` Nonce string `json:"nonce"` TxType string `json:"txType"` BlockHeight int `json:"block_height"` CreatedAt string `json:"created_at"` Payload *TransactionPayload } `json:"data"` } `json:"transactions"` AvgSize float64 `json:"avgSize"` SumTransactions int `json:"sumTransactions"` }
type ResponseGetBlock ¶
type ResponseGetBlock struct { Blocks struct { *MetaData Data []struct { ID int `json:"id"` Hash string `json:"hash"` Size int `json:"size"` TransactionsCount int `json:"transactions_count"` Header *BlockHeader } `json:"data"` } `json:"blocks"` AvgSize string `json:"avgSize"` SumBlocks int `json:"sumBlocks"` }
Blocks
type ResponseGetBlockByHash ¶
type ResponseGetBlockByHash struct { ID int `json:"id"` Hash string `json:"hash"` Size int `json:"size"` TransactionsCount int `json:"transactions_count"` Header *BlockHeader }
type ResponseGetBlockByHeight ¶
type ResponseGetBlockByHeight struct { ID int `json:"id"` Hash string `json:"hash"` Size int `json:"size"` TransactionsCount int `json:"transactions_count"` Header *BlockHeader }
type ResponseGetRegisteredName ¶
type ResponseGetRegisteredName struct { *MetaData Data []struct { Name string `json:"name"` PublicKey string `json:"public_key"` Address string `json:"address"` ExpiresAt string `json:"expires_at"` } `json:"data"` }
Addressbook
type ResponseGetSigchain ¶
type ResponseGetSigchain struct { *MetaData Data []struct { ID int `json:"id"` PayloadID int `json:"payload_id"` Nonce int `json:"nonce"` DataSize int `json:"dataSize"` BlockHash string `json:"blockHash"` SrcID string `json:"srcId"` SrcPubkey string `json:"srcPubkey"` DestID string `json:"destId"` DestPubkey string `json:"destPubkey"` AddedAt string `json:"added_at"` CreatedAt string `json:"created_at"` SigchainElems []*SigchainElems } `json:"data"` }
type ResponseGetSingleAddress ¶
type ResponseGetSingleAddress struct { Address string `json:"address"` TransactionCount int `json:"count_transactions"` FirstTransactionAt string `json:"first_transaction"` LastTransactionAt string `json:"last_transaction"` Balance int `json:"balance"` }
Addresses
type ResponseGetTransaction ¶
type ResponseGetTransaction struct { ID int `json:"id"` BlockID int `json:"block_id"` Attributes string `json:"attributes"` Fee int `json:"fee"` Hash string `json:"hash"` Nonce string `json:"nonce"` TxType string `json:"txType"` BlockHeight int `json:"block_height"` CreatedAt string `json:"created_at"` Payload *TransactionPayload }
type ResponseStatsBlocksPerDay ¶
type ResponseStatsBlocksPerDay struct {
Stats
}
type ResponseStatsSupply ¶
type ResponseStatsTransactionsPerDay ¶
type ResponseStatsTransactionsPerDay struct {
Stats
}
type SigChain ¶
type SigChain struct { ID int `json:"id"` PayloadID int `json:"payload_id"` Nonce int `json:"nonce"` DataSize int `json:"dataSize"` BlockHash string `json:"blockHash"` SrcID string `json:"srcId"` SrcPubkey string `json:"srcPubkey"` DestID string `json:"destId"` DestPubkey string `json:"destPubkey"` AddedAt string `json:"added_at"` CreatedAt string `json:"created_at"` SigchainElems []*SigchainElems }
type SigchainElems ¶
type SigchainElems struct { ID int `json:"id"` SigchainID int `json:"sigchain_id"` ID2 string `json:"id2"` Pubkey string `json:"pubkey"` Wallet string `json:"wallet"` NextPubkey string `json:"nextPubkey"` Mining bool `json:"mining"` SignAlgo string `json:"signAlgo"` Signature string `json:"signature"` VRF string `json:"vrf"` Proof string `json:"proof"` AddedAt string `json:"added_at"` CreatedAt string `json:"created_at"` }
type TransactionPayload ¶
type TransactionPayload struct { ID int `json:"id"` TransactionID int `json:"transaction_id"` PayloadType string `json:"payloadType"` Sender string `json:"sender"` SenderWallet string `json:"senderWallet"` Recipient string `json:"recipient"` RecipientWallet string `json:"recipientWallet"` Amount common.Fixed64 `json:"amount"` Submitter string `json:"submitter"` Registrant string `json:"registrant"` RegistrantWallet string `json:"registrantWallet"` Name string `json:"name"` Subscriber string `json:"subscriber"` Identifier string `json:"identifier"` Topic string `json:"topic"` Bucket int `json:"bucket"` Duration int `json:"duration"` Meta string `json:"meta"` PublicKey string `json:"public_key"` RegistrationFee int `json:"registration_fee"` Nonce string `json:"nonce"` TXNExpiration int `json:"txn_expiration"` Symbol string `json:"symbol"` TotalSupply int `json:"total_supply"` Precision int `json:"precision"` NanoPayExpiration int `json:"nano_pay_expiration"` SignerPK string `json:"signerPk"` AddedAt string `json:"added_at"` CreatedAt string `json:"created_at"` GenerateWallet string `json:"generateWallet"` SubscriberWallet string `json:"subscriberWallet"` Sigchain SigChain `json:"sigchain"` }
Click to show internal directories.
Click to hide internal directories.