Documentation
¶
Index ¶
- Constants
- type APIRawBlock
- type Balance
- type BinBlockTemplate
- type BinRootBlock
- type BinTransaction
- type BinTransactionInput
- type BinTransactionOutput
- type BinTransactionPrefix
- type Block
- type BlockHeader
- type BlockHeaderLegacy
- type CMBranchElement
- type CheckPoint
- type CheckSendproofReq
- type CheckSendproofResp
- type CreateAddressesReq
- type CreateAddressesResp
- type CreateSendproofReq
- type CreateSendproofResp
- type CreateTransactionReq
- type CreateTransactionResp
- type GetAddressesReq
- type GetAddressesResp
- type GetBalanceReq
- type GetBalanceResp
- type GetBlockHeaderByHashLegacyReq
- type GetBlockHeaderByHashLegacyResp
- type GetBlockHeaderByHeightLegacyReq
- type GetBlockHeaderByHeightLegacyResp
- type GetBlockHeaderReq
- type GetBlockHeaderResp
- type GetBlockTemplateReq
- type GetBlockTemplateResp
- type GetCurrencyIDReq
- type GetCurrencyIDResp
- type GetLastBlockHeaderLegacyReq
- type GetLastBlockHeaderLegacyResp
- type GetRandomOutputsReq
- type GetRandomOutputsResp
- type GetRawBlockReq
- type GetRawBlockResp
- type GetRawTransactionReq
- type GetRawTransactionResp
- type GetStatisticsReq
- type GetStatisticsResp
- type GetStatusReq
- type GetStatusResp
- type GetTransactionReq
- type GetTransactionResp
- type GetTransfersReq
- type GetTransfersResp
- type GetUnspentsReq
- type GetUnspentsResp
- type GetViewKeyPairReq
- type GetViewKeyPairResp
- type Hash
- type HexBlob
- type KeyImage
- type Output
- type PublicKey
- type SendTransactionReq
- type SendTransactionResp
- type Sendproof
- type SignedCheckPoint
- type SubmitBlockLegacyReq
- type SubmitBlockLegacyResp
- type SubmitBlockReq
- type SubmitBlockResp
- type SyncBlocksReq
- type SyncBlocksResp
- type SyncMemPoolReq
- type SyncMemPoolResp
- type Transaction
- type Transfer
Constants ¶
View Source
const ( // walletd GetStatusMethod = "get_status" GetAddressesMethod = "get_addresses" GetViewKeyPairMethod = "get_view_key_pair" CreateAddressesMethod = "create_addresses" GetBalanceMethod = "get_balance" GetUnspentsMethod = "get_unspents" GetTransfersMethod = "get_transfers" CreateTransactionMethod = "create_transaction" SendTransactionMethod = "send_transaction" CreateSendproofMethod = "create_sendproof" GetTransactionMethod = "get_transaction" // bytecoind GetRawBlockMethod = "get_raw_block" GetBlockHeaderMethod = "get_block_header" SyncBlocksMethod = "sync_blocks" GetRawTransactionMethod = "get_raw_transaction" SyncMemPoolMethod = "sync_mem_pool" GetRandomOutputsMethod = "get_random_outputs" CheckSendproofMethod = "check_sendproof" GetStatisticsMethod = "get_statistics" GetBlockTemplateMethodLegacy = "getblocktemplate" GetBlockTemplateMethod = "get_block_template" GetCurrencyIDMethodLegacy = "getcurrencyid" GetCurrencyIDMethod = "get_currency_id" SubmitBlockMethodLegacy = "submitblock" SubmitBlockMethod = "submit_block" GetLastBlockHeaderLegacyMethod = "getlastblockheader" GetBlockHeaderByHashLegacyMethod = "getblockheaderbyhash" GetBlockHeaderByHeightLegacyMethod = "getblockheaderbyheight" )
View Source
const ( GetBalance_ADDRESS_FAILED_TO_PARSE = -4 GetBalance_INVALID_HEIGHT_OR_DEPTH = -2 GetBalance_ADDRESS_NOT_IN_WALLET = -1002 GetUnspents_ADDRESS_FAILED_TO_PARSE = -4 GetUnspents_INVALID_HEIGHT_OR_DEPTH = -2 GetUnspents_ADDRESS_NOT_IN_WALLET = -1002 GetTransfers_ADDRESS_FAILED_TO_PARSE = -4 GetTransfers_ADDRESS_NOT_IN_WALLET = -1002 CreateTransaction_NOT_ENOUGH_FUNDS = -301 CreateTransaction_TRANSACTION_DOES_NOT_FIT_IN_BLOCK = -302 CreateTransaction_NOT_ENOUGH_ANONYMITY = -303 CreateTransaction_VIEW_ONLY_WALLET = -304 CreateTransaction_INVALID_HEIGHT_OR_DEPTH = -2 CreateTransaction_ADDRESS_FAILED_TO_PARSE = -4 CreateTransaction_ADDRESS_NOT_IN_WALLET = -1002 SendTransaction_INVALID_TRANSACTION_BINARY_FORMAT = -101 SendTransaction_WRONG_OUTPUT_REFERENCE = -102 SendTransaction_OUTPUT_ALREADY_SPENT = -103 CreateSendproofResp_ADDRESS_FAILED_TO_PARSE = -4 GetRawBlock_HASH_NOT_FOUND = -4 GetRawBlock_INVALID_HEIGHT_OR_DEPTH = -2 GetBlockHeader_HASH_NOT_FOUND = -4 GetBlockHeader_INVALID_HEIGHT_OR_DEPTH = -2 GetRawTransaction_HASH_NOT_FOUND = -4 GetRandomOutputs_INVALID_HEIGHT_OR_DEPTH = -2 CheckSendproof_FAILED_TO_PARSE = -201 CheckSendproof_NOT_IN_MAIN_CHAIN = -202 CheckSendproof_WRONG_SIGNATURE = -203 CheckSendproof_ADDRESS_NOT_IN_TRANSACTION = -204 CheckSendproof_WRONG_AMOUNT = -205 GetBlockTemplate_ADDRESS_FAILED_TO_PARSE = -4 GetBlockTemplate_TOO_BIG_RESERVE_SIZE = -3 SubmitBlock_WRONG_BLOCKBLOB = -6 SubmitBlock_BLOCK_NOT_ACCEPTED = -7 SubmitBlockLegacy_WRONG_BLOCKBLOB = -6 SubmitBlockLegacy_BLOCK_NOT_ACCEPTED = -7 GetBlockHeaderByHashLegacy_HASH_NOT_FOUND = -5 GetBlockHeaderByHeight_INVALID_HEIGHT_OR_DEPTH = -2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIRawBlock ¶
type APIRawBlock struct {
Header BlockHeader `json:"header"`
RawHeader BinBlockTemplate `json:"raw_header"`
RawTransactions []BinTransactionPrefix `json:"raw_transactions,omitempty"`
Signatures [][][]string `json:"signatures,omitempty"`
Transactions []Transaction `json:"transactions,omitempty"`
OutputStackIndexes [][]int `json:"output_stack_indexes,omitempty"`
}
type Balance ¶
type Balance struct {
Spendable uint64 `json:"spendable"`
SpendableDust uint64 `json:"spendable_dust"`
LockedOrUnconfirmed uint64 `json:"locked_or_unconfirmed"`
SpendableOutputs int `json:"spendable_outputs"`
SpendableDustOutputs int `json:"spendable_dust_outputs"`
LockedOrUnconfirmedOutputs int `json:"locked_or_unconfirmed_outputs"`
}
type BinBlockTemplate ¶
type BinBlockTemplate struct {
MajorVersion int `json:"major_version"`
MinorVersion int `json:"minor_version"`
Nonce HexBlob `json:"nonce"`
Timestamp uint32 `json:"timestamp"`
PreviousBlockHash Hash `json:"previous_block_hash"`
RootBlock BinRootBlock `json:"root_block"`
CMMerkleBranch []CMBranchElement `json:"cm_merkle_branch,omitempty"`
CoinbaseTransaction BinTransaction `json:"coinbase_transaction"`
TransactionHashes []Hash `json:"transaction_hashes,omitempty"`
}
type BinRootBlock ¶
type BinRootBlock struct {
MajorVersion int `json:"major_version"`
MinorVersion int `json:"minor_version"`
Nonce HexBlob `json:"nonce"`
Timestamp uint32 `json:"timestamp"`
PreviousBlockHash Hash `json:"previous_block_hash"`
TransactionCount int `json:"transaction_count"`
CoinbaseTransactionBranch []Hash `json:"coinbase_transaction_branch,omitempty"`
CoinbaseTransaction BinTransactionPrefix `json:"coinbase_transaction"`
BlockChainBranch []Hash `json:"blockchain_branch,omitempty"`
}
type BinTransaction ¶
type BinTransaction struct {
BinTransactionPrefix
Signatures [][]string `json:"signatures"`
}
type BinTransactionInput ¶
type BinTransactionOutput ¶
type BinTransactionOutput struct {
Amount uint64 `json:"amount"`
PublicKey PublicKey `json:"public_key"`
AmountCommitment *PublicKey `json:"amount_commitment,omitempty"`
EncryptedSecret *PublicKey `json:"encrypted_secret,omitempty"`
EncryptedAddressType HexBlob `json:"encrypted_address_type"` // actually single byte
Type string `json:"type"` // "key" - key output
}
type BinTransactionPrefix ¶
type BinTransactionPrefix struct {
Version int `json:"version"`
UnlockTime uint64 `json:"unlock_block_or_timestamp"`
Inputs []BinTransactionInput `json:"inputs,omitempty"`
Outputs []BinTransactionOutput `json:"outputs,omitempty"`
Extra HexBlob `json:"extra"`
}
type Block ¶
type Block struct {
Header BlockHeader `json:"header"`
Transactions []Transaction `json:"transactions,omitempty"`
}
type BlockHeader ¶
type BlockHeader struct {
MajorVersion int `json:"major_version"`
MinorVersion int `json:"minor_version"`
Timestamp uint32 `json:"timestamp"`
PreviousBlockHash Hash `json:"previous_block_hash"`
Nonce uint32 `json:"nonce"`
BinaryNonce HexBlob `json:"binary_nonce"`
Height int `json:"height"`
Hash Hash `json:"hash"`
Reward uint64 `json:"reward"`
CumulativeDifficulty uint64 `json:"cumulative_difficulty"`
CumulativeDifficultyHi uint64 `json:"cumulative_difficulty_hi"`
Difficulty uint64 `json:"difficulty"`
BaseReward uint64 `json:"base_reward"`
BlockSize int `json:"block_size"`
TransactionsSize int `json:"transactions_size"`
AlreadyGeneratedKeyOutputs int `json:"already_generated_key_outputs"`
AlreadyGeneratedCoins uint64 `json:"already_generated_coins"`
AlreadyGeneratedTransactions int `json:"already_generated_transactions"`
SizeMedian int `json:"size_median"`
EffectiveSizeMedian int `json:"effective_size_median"`
TimestampMedian uint32 `json:"timestamp_median"`
BlockCapacityVote int `json:"block_capacity_vote"`
BlockCapacityVoteMedian int `json:"block_capacity_vote_median"`
TransactionsFee uint64 `json:"transactions_fee"`
}
func (BlockHeader) Capacity ¶
func (p BlockHeader) Capacity() int
type BlockHeaderLegacy ¶
type BlockHeaderLegacy struct {
BlockHeader
OrphanStatus bool `json:"orphan_status"`
Depth int `json:"depth"`
}
type CMBranchElement ¶
type CheckPoint ¶
type CheckSendproofReq ¶
type CheckSendproofReq struct {
Sendproof string `json:"sendproof"`
}
type CheckSendproofResp ¶
type CreateAddressesReq ¶
type CreateAddressesResp ¶
type CreateSendproofReq ¶
type CreateSendproofResp ¶
type CreateSendproofResp struct {
Sendproofs []string `json:"sendproofs,omitempty"`
}
type CreateTransactionReq ¶
type CreateTransactionReq struct {
Transaction Transaction `json:"transaction"`
SpendAddresses []string `json:"spend_addresses,omitempty"`
AnySpendAddress bool `json:"any_spend_address"`
ChangeAddress string `json:"change_address,omitempty"`
ConfirmedHeightOrDepth int `json:"confirmed_height_or_depth"`
FeePerByte uint64 `json:"fee_per_byte"`
Optimization string `json:"optimization,omitempty"`
SaveHistory bool `json:"save_history"`
SubtractFeeFromAmount bool `json:"subtract_fee_from_amount"`
PreventConflictWithTransactions []string `json:"prevent_conflict_with_transactions,omitempty"`
}
type CreateTransactionResp ¶
type CreateTransactionResp struct {
BinaryTransaction HexBlob `json:"binary_transaction,omitempty"`
Transaction Transaction `json:"transaction"`
SaveHistoryError bool `json:"save_history_error"`
TransactionsRequired []string `json:"transactions_required,omitempty"`
}
type GetAddressesReq ¶
type GetAddressesResp ¶
type GetBalanceReq ¶
type GetBalanceResp ¶
type GetBalanceResp struct {
Balance
}
type GetBlockHeaderByHashLegacyReq ¶
type GetBlockHeaderByHashLegacyReq struct {
Hash Hash `json:"hash"`
}
type GetBlockHeaderByHashLegacyResp ¶
type GetBlockHeaderByHashLegacyResp struct {
BlockHeader BlockHeaderLegacy `json:"block_header"`
Status string `json:"status"`
}
type GetBlockHeaderByHeightLegacyReq ¶
type GetBlockHeaderByHeightLegacyReq struct {
Height int `json:"height"`
}
type GetBlockHeaderByHeightLegacyResp ¶
type GetBlockHeaderByHeightLegacyResp struct {
BlockHeader BlockHeaderLegacy `json:"block_header"`
Status string `json:"status"`
}
type GetBlockHeaderReq ¶
type GetBlockHeaderResp ¶
type GetBlockHeaderResp struct {
BlockHeader `json:"block_header"`
OrphanStatus bool `json:"orphan_status"`
Depth int `json:"depth"`
}
type GetBlockTemplateReq ¶
type GetBlockTemplateResp ¶
type GetBlockTemplateResp struct {
Difficulty uint64 `json:"difficulty"`
Height int `json:"height"`
ReserveOffset int `json:"reserved_offset"`
BlockTemplateBlob HexBlob `json:"blocktemplate_blob"`
Status string `json:"status"`
TopBlockHash Hash `json:"top_block_hash"` // for longpoll
TransactionPoolVersion int `json:"transaction_pool_version"` // for longpoll
CMPreHash Hash `json:"cm_prehash"`
CMPath Hash `json:"cm_path"`
}
type GetCurrencyIDReq ¶
type GetCurrencyIDReq struct{}
type GetCurrencyIDResp ¶
type GetCurrencyIDResp struct {
CurrencyIDBlob Hash `json:"currency_id_blob"`
}
type GetLastBlockHeaderLegacyReq ¶
type GetLastBlockHeaderLegacyReq struct{}
type GetLastBlockHeaderLegacyResp ¶
type GetLastBlockHeaderLegacyResp struct {
BlockHeader BlockHeaderLegacy `json:"block_header"`
Status string `json:"status"`
}
type GetRandomOutputsReq ¶
type GetRandomOutputsResp ¶
type GetRawBlockReq ¶
type GetRawBlockResp ¶
type GetRawBlockResp struct {
Block APIRawBlock `json:"block"`
OrphanStatus bool `json:"orphan_status"`
Depth int `json:"depth"`
}
type GetRawTransactionReq ¶
type GetRawTransactionReq struct {
Hash Hash `json:"hash"`
}
type GetRawTransactionResp ¶
type GetRawTransactionResp struct {
Transaction Transaction `json:"transaction"`
RawTransaction BinTransactionPrefix `json:"raw_transaction"`
Signatures [][]string `json:"signatures,omitempty"`
}
type GetStatisticsReq ¶
type GetStatisticsReq struct{}
type GetStatisticsResp ¶
type GetStatisticsResp struct {
Version string `json:"version"`
Platform string `json:"platform"`
StartTime uint32 `json:"start_time"`
Net string `json:"net"`
GenesisBlockHash Hash `json:"genesis_block_hash"`
PeerID uint64 `json:"peer_id"`
// TODO peer_list_white
// TODO peer_list_gray
// TODO connected_peers
Checkpoints []SignedCheckPoint `json:"checkpoints,omitempty"`
UpgradeDecidedHeight int `json:"upgrade_decided_height"`
NodeDatabaseSize uint64 `json:"node_database_size"`
}
type GetStatusReq ¶
type GetStatusReq struct {
TopBlockHash *Hash `json:"top_block_hash,omitempty"`
TxPoolVersion *int `json:"transaction_pool_version,omitempty"`
OutgoingPeerCount *int `json:"outgoing_peer_count,omitempty"`
IncomingPeerCount *int `json:"incoming_peer_count,omitempty"`
LowerLevelError *string `json:"lower_level_error,omitempty"`
}
type GetStatusResp ¶
type GetStatusResp struct {
TopBlockHash Hash `json:"top_block_hash,omitempty"`
TxPoolVersion int `json:"transaction_pool_version,omitempty"`
OutgoingPeerCount int `json:"outgoing_peer_count,omitempty"`
IncomingPeerCount int `json:"incoming_peer_count,omitempty"`
LowerLevelError string `json:"lower_level_error,omitempty"`
TopBlockHeight int `json:"top_block_height"`
TopKnownBlockHeight int `json:"top_known_block_height"`
TopBlockDifficulty uint64 `json:"top_block_difficulty"`
TopBlockCumulativeDifficulty uint64 `json:"top_block_cumulative_difficulty"`
TopBlockCumulativeDifficultyHi uint64 `json:"top_block_cumulative_difficulty_hi"`
RecommendedFeePerKb uint64 `json:"recommended_fee_per_byte"`
TopBlockTimestamp uint32 `json:"top_block_timestamp"`
TopBlockTimestampMedian uint32 `json:"top_block_timestamp_median"`
RecommendedMaxTransactionSize int `json:"recommended_max_transaction_size"`
}
type GetTransactionReq ¶
type GetTransactionReq struct {
Hash Hash `json:"hash,omitempty"`
}
type GetTransactionResp ¶
type GetTransactionResp struct {
Transaction Transaction `json:"transaction"`
}
type GetTransfersReq ¶
type GetTransfersResp ¶
type GetUnspentsReq ¶
type GetUnspentsResp ¶
type GetViewKeyPairReq ¶
type GetViewKeyPairReq struct{}
type GetViewKeyPairResp ¶
type Hash ¶
type Hash [hashSize]byte
func (Hash) MarshalBinary ¶
func (Hash) MarshalJSON ¶
func (*Hash) UnmarshalBinary ¶
func (*Hash) UnmarshalJSON ¶
type KeyImage ¶
type KeyImage [keyImageSize]byte
func (KeyImage) MarshalBinary ¶
func (KeyImage) MarshalJSON ¶
func (*KeyImage) UnmarshalBinary ¶
func (*KeyImage) UnmarshalJSON ¶
type Output ¶
type Output struct {
TxVersion int `json:"transaction_version"`
Amount uint64 `json:"amount"`
PK PublicKey `json:"public_key"`
AmountCommitment PublicKey `json:"amount_commitment,omitempty"`
GlobalIndex int `json:"global_index"`
StackIndex int `json:"stack_index,omitempty"`
// Added from transaction
UnlockTime uint64 `json:"unlock_block_or_timestamp"`
IndexInTx int `json:"index_in_transaction"`
// Added from block
Height int `json:"height"`
// Added by wallet for recognized outputs
KeyImage KeyImage `json:"key_image"`
TransactionHash Hash `json:"transaction_hash"`
Address string `json:"address"`
}
type PublicKey ¶
type PublicKey [publicKeySize]byte
func (PublicKey) MarshalBinary ¶
func (PublicKey) MarshalJSON ¶
func (*PublicKey) UnmarshalBinary ¶
func (*PublicKey) UnmarshalJSON ¶
type SendTransactionReq ¶
type SendTransactionReq struct {
BinaryTransaction HexBlob `json:"binary_transaction,omitempty"`
}
type SendTransactionResp ¶
type SendTransactionResp struct {
SendResult string `json:"send_result,omitempty"`
}
type SignedCheckPoint ¶
type SignedCheckPoint struct {
CheckPoint
Signature string `json:"signature"`
}
type SubmitBlockLegacyReq ¶
type SubmitBlockLegacyReq []HexBlob
type SubmitBlockLegacyResp ¶
type SubmitBlockLegacyResp struct {
Status string `json:"status"`
}
type SubmitBlockReq ¶
type SubmitBlockReq struct {
BlockTemplateBlob HexBlob `json:"blocktemplate_blob"`
CMNonce HexBlob `json:"cm_nonce"`
CMMerkleBranch []CMBranchElement `json:"cm_merkle_branch,omitempty"`
}
type SubmitBlockResp ¶
type SubmitBlockResp struct {
BlockHeader BlockHeader `json:"block_header"`
OrphanStatus bool `json:"orphan_status"`
Depth int `json:"depth"`
}
type SyncBlocksReq ¶
type SyncBlocksResp ¶
type SyncBlocksResp struct {
Blocks []APIRawBlock `json:"blocks,omitempty"`
StartHeight int `json:"start_height"`
Status GetStatusResp `json:"status"`
}
type SyncMemPoolReq ¶
type SyncMemPoolResp ¶
type SyncMemPoolResp struct {
RemovedHashes []Hash `json:"removed_hashes,omitempty"`
AddedRawTransactions []BinTransactionPrefix `json:"added_raw_transactions,omitempty"`
AddedSignatures [][][]string `json:"added_signatures,omitempty"`
AddedTransactions []Transaction `json:"added_transactions,omitempty"`
Status GetStatusResp `json:"status"`
}
type Transaction ¶
type Transaction struct {
// fields for new transactions
UnlockTime uint64 `json:"unlock_block_or_timestamp,omitempty"`
Transfers []Transfer `json:"transfers,omitempty"`
PaymentID Hash `json:"payment_id,omitempty"`
Anonymity int `json:"anonymity"`
// after transaction is created
Hash Hash `json:"hash"`
Fee uint64 `json:"fee"`
PK string `json:"public_key"`
Extra HexBlob `json:"extra"`
IsBase bool `json:"coinbase"`
Amount uint64 `json:"amount"`
// after transaction is included in block
BlockHeight int `json:"block_height"`
BlockHash Hash `json:"block_hash"`
Timestamp uint32 `json:"timestamp"`
Size int `json:"size,omitempty"`
}
type Transfer ¶
type Transfer struct {
Address string `json:"address"`
Amount int64 `json:"amount"`
Ours bool `json:"ours,omitempty"`
Locked bool `json:"locked,omitempty"`
UnlockTime uint64 `json:"unlock_block_or_timestamp,omitempty"`
Outputs []Output `json:"outputs,omitempty"`
TransactionHash Hash `json:"transaction_hash"`
}
Click to show internal directories.
Click to hide internal directories.