Documentation ¶
Index ¶
- Constants
- func ContextWithKeyPair(ctx context.Context, keyPair key.KeyPair) context.Context
- type AccessKey
- type AccessKeyList
- type AccessKeyPermission
- type AccessKeyView
- type AccessKeyViewInfo
- type AccountView
- type BlockHeaderInnerLiteView
- type BlockHeaderView
- type BlockView
- type CallResult
- type ChallengesResult
- type ChunkHeaderView
- type ChunkView
- type Client
- func (c *Client) AccessKeyView(ctx context.Context, accountID types.AccountID, publicKey key.Base58PublicKey, ...) (resp AccessKeyView, err error)
- func (c *Client) AccessKeyViewChanges(ctx context.Context, accountID types.AccountID, publicKey key.Base58PublicKey, ...) (res jsonrpc.Response, err error)
- func (c *Client) AccessKeyViewChangesAll(ctx context.Context, accountIDs []types.AccountID, ...) (res jsonrpc.Response, err error)
- func (c *Client) AccessKeyViewList(ctx context.Context, accountID types.AccountID, ...) (resp AccessKeyList, err error)
- func (c *Client) AccountView(ctx context.Context, accountID types.AccountID, ...) (res AccountView, err error)
- func (c *Client) AccountViewChanges(ctx context.Context, accountIDs []types.AccountID, ...) (res jsonrpc.Response, err error)
- func (c *Client) BlockChanges(ctx context.Context, block block.BlockCharacteristic) (res jsonrpc.Response, err error)
- func (c *Client) BlockDetails(ctx context.Context, block block.BlockCharacteristic) (resp BlockView, err error)
- func (c *Client) ChunkDetails(ctx context.Context, chunkHash hash.CryptoHash) (res ChunkView, err error)
- func (c *Client) ContractViewCallFunction(ctx context.Context, accountID, methodName, argsBase64 string, ...) (res CallResult, err error)
- func (c *Client) ContractViewCodeChanges(ctx context.Context, accountIDs []types.AccountID, ...) (res jsonrpc.Response, err error)
- func (c *Client) ContractViewState(ctx context.Context, accountID types.AccountID, prefixBase64 string, ...) (res ViewStateResult, err error)
- func (c *Client) ContractViewStateChanges(ctx context.Context, accountIDs []types.AccountID, keyPrefixBase64 string, ...) (res jsonrpc.Response, err error)
- func (c *Client) GasPriceView(ctx context.Context, block block.BlockCharacteristic) (res GasPrice, err error)
- func (c *Client) GenesisConfig(ctx context.Context) (res map[string]interface{}, err error)
- func (c *Client) LightClientProof(ctx context.Context, tor TransactionOrReceiptId) (resp RpcLightClientExecutionProofResponse, err error)
- func (c *Client) NetworkAddr() string
- func (c *Client) NetworkInfo(ctx context.Context) (res NetworkInfo, err error)
- func (c *Client) NetworkStatusValidators(ctx context.Context) (res StatusResponse, err error)
- func (c *Client) NetworkStatusValidatorsDetailed(ctx context.Context, block block.BlockCharacteristic) (res ValidatorsResponse, err error)
- func (c *Client) NextLightClientBlock(ctx context.Context, lastHash hash.CryptoHash) (resp LightClientBlockView, err error)
- func (c *Client) RPCTransactionSend(ctx context.Context, signedTxnBase64 string) (resp hash.CryptoHash, err error)
- func (c *Client) RPCTransactionSendAwait(ctx context.Context, signedTxnBase64 string) (resp FinalExecutionOutcomeView, err error)
- func (c *Client) TransactionSend(ctx context.Context, from, to types.AccountID, actions []action.Action, ...) (res hash.CryptoHash, err error)
- func (c *Client) TransactionSendAwait(ctx context.Context, from, to types.AccountID, actions []action.Action, ...) (res FinalExecutionOutcomeView, err error)
- func (c *Client) TransactionStatus(ctx context.Context, tx hash.CryptoHash, sender types.AccountID) (resp FinalExecutionOutcomeView, err error)
- func (c *Client) TransactionStatusWithReceipts(ctx context.Context, tx hash.CryptoHash, sender types.AccountID) (resp FinalExecutionOutcomeWithReceiptView, err error)
- type CurrentEpochValidatorInfo
- type EdgeInfo
- type ExecutionOutcomeView
- type ExecutionOutcomeWithIdView
- type FinalExecutionOutcomeView
- type FinalExecutionOutcomeWithReceiptView
- type FullPeerInfo
- type FunctionCallPermission
- type GasPrice
- type GenesisID
- type KnownProducer
- type LightClientBlockLiteView
- type LightClientBlockView
- type MerklePath
- type MerklePathItem
- type MetricRecorder
- type NetworkInfo
- type NodeVersion
- type PeerChainInfo
- type PeerInfo
- type QueryResponse
- type Receipt
- type ReceiptView
- type RpcLightClientExecutionProofResponse
- type SignedTransactionView
- type SlashedValidator
- type StateItem
- type StatusResponse
- type StatusSyncInfo
- type Transaction
- type TransactionOpt
- type TransactionOrReceiptId
- type TransactionStatus
- type TrieProofPath
- type ValidatorInfo
- type ValidatorStakeView
- type ValidatorStakeWithVersion
- type ValidatorsResponse
- type ViewStateResult
Constants ¶
const ( TypeReceipt = "receipt" TypeTransaction = "transaction" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessKey ¶
type AccessKey struct { Nonce types.Nonce `json:"nonce"` // Permission holds parsed access key permission info Permission AccessKeyPermission `json:"-"` }
func (*AccessKey) UnmarshalJSON ¶
type AccessKeyList ¶
type AccessKeyList struct {
Keys []AccessKeyViewInfo `json:"keys"`
}
type AccessKeyPermission ¶
type AccessKeyPermission struct { FullAccess bool `json:"-"` FunctionCall FunctionCallPermission `json:"-"` }
AccessKeyPermission holds info whether access key is a FullAccess, or FunctionCall key
func (*AccessKeyPermission) UnmarshalJSON ¶
func (akp *AccessKeyPermission) UnmarshalJSON(b []byte) (err error)
type AccessKeyView ¶
type AccessKeyView struct { AccessKey QueryResponse }
func (*AccessKeyView) UnmarshalJSON ¶
func (a *AccessKeyView) UnmarshalJSON(data []byte) (err error)
type AccessKeyViewInfo ¶
type AccessKeyViewInfo struct { PublicKey key.Base58PublicKey `json:"public_key"` AccessKey AccessKey `json:"access_key"` }
type AccountView ¶
type AccountView struct { Amount types.Balance `json:"amount"` Locked types.Balance `json:"locked"` CodeHash hash.CryptoHash `json:"code_hash"` StorageUsage types.StorageUsage `json:"storage_usage"` StoragePaidAt types.BlockHeight `json:"storage_paid_at"` QueryResponse }
type BlockHeaderInnerLiteView ¶
type BlockHeaderInnerLiteView struct { Height types.BlockHeight `json:"height"` EpochID hash.CryptoHash `json:"epoch_id"` NextEpochId hash.CryptoHash `json:"next_epoch_id"` PrevStateRoot hash.CryptoHash `json:"prev_state_root"` OutcomeRoot hash.CryptoHash `json:"outcome_root"` Timestamp uint64 `json:"timestamp"` TimestampNanoSec string `json:"timestamp_nanosec"` NextBpHash hash.CryptoHash `json:"next_bp_hash"` BlockMerkleRoot hash.CryptoHash `json:"block_merkle_root"` }
type BlockHeaderView ¶
type BlockHeaderView struct { Height types.BlockHeight `json:"height"` EpochID hash.CryptoHash `json:"epoch_id"` NextEpochID hash.CryptoHash `json:"next_epoch_id"` Hash hash.CryptoHash `json:"hash"` PrevHash hash.CryptoHash `json:"prev_hash"` PrevStateRoot hash.CryptoHash `json:"prev_state_root"` ChunkReceiptsRoot hash.CryptoHash `json:"chunk_receipts_root"` ChunkHeadersRoot hash.CryptoHash `json:"chunk_headers_root"` ChunkTxRoot hash.CryptoHash `json:"chunk_tx_root"` OutcomeRoot hash.CryptoHash `json:"outcome_root"` ChunksIncluded uint64 `json:"chunks_included"` ChallengesRoot hash.CryptoHash `json:"challenges_root"` Timestamp uint64 `json:"timestamp"` // milliseconds TimestampNanosec types.TimeNanos `json:"timestamp_nanosec"` // nanoseconds, uint128 RandomValue hash.CryptoHash `json:"random_value"` ValidatorProposals []ValidatorStakeView `json:"validator_proposals"` ChunkMask []bool `json:"chunk_mask"` GasPrice types.Balance `json:"gas_price"` RentPaid types.Balance `json:"rent_paid"` // NOTE: deprecated - 2021-05-14 ValidatorReward types.Balance `json:"validator_reward"` // NOTE: deprecated - 2021-05-14 TotalSupply types.Balance `json:"total_supply"` ChallengesResult ChallengesResult `json:"challenges_result"` LastFinalBlock hash.CryptoHash `json:"last_final_block"` LastDSFinalBlock hash.CryptoHash `json:"last_ds_final_block"` NextBPHash hash.CryptoHash `json:"next_bp_hash"` BlockMerkleRoot hash.CryptoHash `json:"block_merkle_root"` Approvals []*signature.Base58Signature `json:"approvals"` Signature signature.Base58Signature `json:"signature"` LatestProtocolVersion uint64 `json:"latest_protocol_version"` }
type BlockView ¶
type BlockView struct { Author types.AccountID `json:"author"` Header BlockHeaderView `json:"header"` Chunks []ChunkHeaderView `json:"chunks"` }
type CallResult ¶
type CallResult struct { Result []byte `json:"result"` Logs []string `json:"logs"` QueryResponse }
type ChallengesResult ¶
type ChallengesResult = []SlashedValidator
type ChunkHeaderView ¶
type ChunkHeaderView struct { ChunkHash hash.CryptoHash `json:"chunk_hash"` PrevBlockHash hash.CryptoHash `json:"prev_block_hash"` OutcomeRoot hash.CryptoHash `json:"outcome_root"` PrevStateRoot json.RawMessage `json:"prev_state_root"` // TODO: needs a type! EncodedMerkleRoot hash.CryptoHash `json:"encoded_merkle_root"` EncodedLength uint64 `json:"encoded_length"` HeightCreated types.BlockHeight `json:"height_created"` HeightIncluded types.BlockHeight `json:"height_included"` ShardID types.ShardID `json:"shard_id"` GasUsed types.Gas `json:"gas_used"` GasLimit types.Gas `json:"gas_limit"` RentPaid types.Balance `json:"rent_paid"` // TODO: deprecated ValidatorReward types.Balance `json:"validator_reward"` // TODO: deprecated BalanceBurnt types.Balance `json:"balance_burnt"` OutgoingReceiptsRoot hash.CryptoHash `json:"outgoing_receipts_root"` TxRoot hash.CryptoHash `json:"tx_root"` ValidatorProposals []ValidatorStakeView `json:"validator_proposals"` Signature signature.Base58Signature `json:"signature"` }
type ChunkView ¶
type ChunkView struct { Author types.AccountID `json:"author"` Header ChunkHeaderView `json:"header"` Transactions []SignedTransactionView `json:"transactions"` Receipts []ReceiptView `json:"receipts"` }
type Client ¶
func (*Client) AccessKeyView ¶
func (c *Client) AccessKeyView(ctx context.Context, accountID types.AccountID, publicKey key.Base58PublicKey, block block.BlockCharacteristic) (resp AccessKeyView, err error)
func (*Client) AccessKeyViewChanges ¶
func (c *Client) AccessKeyViewChanges(ctx context.Context, accountID types.AccountID, publicKey key.Base58PublicKey, block block.BlockCharacteristic) (res jsonrpc.Response, err error)
TODO: decode response https://docs.near.org/docs/api/rpc#view-access-key-changes-single
func (*Client) AccessKeyViewChangesAll ¶
func (c *Client) AccessKeyViewChangesAll(ctx context.Context, accountIDs []types.AccountID, block block.BlockCharacteristic) (res jsonrpc.Response, err error)
TODO: decode response https://docs.near.org/docs/api/rpc#view-access-key-changes-all
func (*Client) AccessKeyViewList ¶
func (c *Client) AccessKeyViewList(ctx context.Context, accountID types.AccountID, block block.BlockCharacteristic) (resp AccessKeyList, err error)
func (*Client) AccountView ¶
func (c *Client) AccountView(ctx context.Context, accountID types.AccountID, block block.BlockCharacteristic) (res AccountView, err error)
func (*Client) AccountViewChanges ¶
func (c *Client) AccountViewChanges(ctx context.Context, accountIDs []types.AccountID, block block.BlockCharacteristic) (res jsonrpc.Response, err error)
TODO: decode response https://docs.near.org/docs/api/rpc#view-account-changes
func (*Client) BlockChanges ¶
func (c *Client) BlockChanges(ctx context.Context, block block.BlockCharacteristic) (res jsonrpc.Response, err error)
TODO: decode resposne https://docs.near.org/docs/api/rpc#changes-in-block
func (*Client) BlockDetails ¶
func (*Client) ChunkDetails ¶
func (*Client) ContractViewCallFunction ¶
func (c *Client) ContractViewCallFunction(ctx context.Context, accountID, methodName, argsBase64 string, block block.BlockCharacteristic) (res CallResult, err error)
func (*Client) ContractViewCodeChanges ¶
func (c *Client) ContractViewCodeChanges(ctx context.Context, accountIDs []types.AccountID, block block.BlockCharacteristic) (res jsonrpc.Response, err error)
TODO: decode response https://docs.near.org/docs/api/rpc#view-contract-code-changes
func (*Client) ContractViewState ¶
func (c *Client) ContractViewState(ctx context.Context, accountID types.AccountID, prefixBase64 string, block block.BlockCharacteristic) (res ViewStateResult, err error)
func (*Client) ContractViewStateChanges ¶
func (c *Client) ContractViewStateChanges(ctx context.Context, accountIDs []types.AccountID, keyPrefixBase64 string, block block.BlockCharacteristic) (res jsonrpc.Response, err error)
TODO: decode response https://docs.near.org/docs/api/rpc#view-contract-state-changes
func (*Client) GasPriceView ¶
func (*Client) GenesisConfig ¶
func (*Client) LightClientProof ¶
func (c *Client) LightClientProof(ctx context.Context, tor TransactionOrReceiptId) (resp RpcLightClientExecutionProofResponse, err error)
LightClientProof doc: https://nomicon.io/ChainSpec/LightClient#light-client-proof
func (*Client) NetworkAddr ¶
func (*Client) NetworkInfo ¶
func (c *Client) NetworkInfo(ctx context.Context) (res NetworkInfo, err error)
func (*Client) NetworkStatusValidators ¶
func (c *Client) NetworkStatusValidators(ctx context.Context) (res StatusResponse, err error)
func (*Client) NetworkStatusValidatorsDetailed ¶
func (c *Client) NetworkStatusValidatorsDetailed(ctx context.Context, block block.BlockCharacteristic) (res ValidatorsResponse, err error)
https://docs.near.org/docs/api/rpc#detailed-validator-status
func (*Client) NextLightClientBlock ¶
func (c *Client) NextLightClientBlock(ctx context.Context, lastHash hash.CryptoHash) (resp LightClientBlockView, err error)
NextLightClientBlock doc: https://nomicon.io/ChainSpec/LightClient#light-client-block
func (*Client) RPCTransactionSend ¶
func (*Client) RPCTransactionSendAwait ¶
func (*Client) TransactionSend ¶
func (*Client) TransactionSendAwait ¶
func (c *Client) TransactionSendAwait(ctx context.Context, from, to types.AccountID, actions []action.Action, txnOpts ...TransactionOpt) (res FinalExecutionOutcomeView, err error)
func (*Client) TransactionStatus ¶
func (c *Client) TransactionStatus(ctx context.Context, tx hash.CryptoHash, sender types.AccountID) (resp FinalExecutionOutcomeView, err error)
func (*Client) TransactionStatusWithReceipts ¶
func (c *Client) TransactionStatusWithReceipts(ctx context.Context, tx hash.CryptoHash, sender types.AccountID) (resp FinalExecutionOutcomeWithReceiptView, err error)
https://docs.near.org/docs/api/rpc#transaction-status-with-receipts
type CurrentEpochValidatorInfo ¶
type CurrentEpochValidatorInfo struct { ValidatorInfo PublicKey key.Base58PublicKey `json:"public_key"` Stake types.Balance `json:"stake"` Shards []types.ShardID `json:"shards"` NumProducedBlocks types.NumBlocks `json:"num_produced_blocks"` NumExpectedBlocks types.NumBlocks `json:"num_expected_blocks"` }
type EdgeInfo ¶
type EdgeInfo struct { Nonce types.Nonce `json:"nonce"` Signature signature.Signature `json:"signature"` }
EdgeInfo contains information that will be ultimately used to create a new edge. It contains nonce proposed for the edge with signature from peer.
type ExecutionOutcomeView ¶
type ExecutionOutcomeView struct { Logs []string `json:"logs"` ReceiptIDs []hash.CryptoHash `json:"receipt_ids"` GasBurnt types.Gas `json:"gas_burnt"` TokensBurnt types.Balance `json:"tokens_burnt"` ExecutorID types.AccountID `json:"executor_id"` Status TransactionStatus `json:"status"` }
type ExecutionOutcomeWithIdView ¶
type ExecutionOutcomeWithIdView struct { Proof MerklePath `json:"proof"` BlockHash hash.CryptoHash `json:"block_hash"` ID hash.CryptoHash `json:"id"` Outcome ExecutionOutcomeView `json:"outcome"` }
type FinalExecutionOutcomeView ¶
type FinalExecutionOutcomeView struct { Status TransactionStatus `json:"status"` Transaction SignedTransactionView `json:"transaction"` TransactionOutcome ExecutionOutcomeWithIdView `json:"transaction_outcome"` ReceiptsOutcome []ExecutionOutcomeWithIdView `json:"receipts_outcome"` }
type FinalExecutionOutcomeWithReceiptView ¶
type FinalExecutionOutcomeWithReceiptView struct { FinalExecutionOutcomeView Receipts []ReceiptView `json:"receipts"` }
type FullPeerInfo ¶
type FullPeerInfo struct { PeerInfo PeerInfo `json:"peer_info"` ChainInfo PeerChainInfo `json:"chain_info"` EdgeInfo EdgeInfo `json:"edge_info"` }
type FunctionCallPermission ¶
type FunctionCallPermission struct { // Allowance for this function call (default 0.25 NEAR). Can be absent. Allowance *types.Balance `json:"allowance"` // ReceiverID holds the contract the key is allowed to call methods on ReceiverID types.AccountID `json:"receiver_id"` // MethodNames hold which functions are allowed to call. Can be empty (all methods are allowed) MethodNames []string `json:"method_names"` }
FunctionCallPermission represents a function call permission
type GenesisID ¶
type GenesisID struct { // Chain Id ChainID string `json:"chain_id"` // Hash of genesis block Hash hash.CryptoHash `json:"hash"` }
type KnownProducer ¶
type KnownProducer struct { AccountID types.AccountID `json:"account_id"` Addr *string `json:"addr"` PeerID key.PeerID `json:"peer_id"` }
KnownProducer is basically PeerInfo, but AccountID is known
type LightClientBlockLiteView ¶
type LightClientBlockLiteView struct { PrevBlockHash hash.CryptoHash `json:"prev_block_hash"` InnerRestHash hash.CryptoHash `json:"inner_rest_hash"` InnerLite BlockHeaderInnerLiteView `json:"inner_lite"` }
type LightClientBlockView ¶
type LightClientBlockView struct { PrevBlockHash hash.CryptoHash `json:"prev_block_hash"` NextBlockInnerHash hash.CryptoHash `json:"next_block_inner_hash"` InnerLite BlockHeaderInnerLiteView `json:"inner_lite"` InnerRestHash hash.CryptoHash `json:"inner_rest_hash"` NextBps []ValidatorStakeWithVersion `json:"next_bps"` ApprovalsAfterNext []*signature.Base58Signature `json:"approvals_after_next"` }
type MerklePath ¶
type MerklePath = []MerklePathItem
type MerklePathItem ¶
type MerklePathItem struct { Hash hash.CryptoHash `json:"hash"` Direction string `json:"direction"` // TODO: enum type, either 'Left' or 'Right' }
type NetworkInfo ¶
type NetworkInfo struct { ActivePeers []FullPeerInfo `json:"active_peers"` NumActivePeers uint `json:"num_active_peers"` PeerMaxCount uint32 `json:"peer_max_count"` HighestHeightPeers []FullPeerInfo `json:"highest_height_peers"` SentBytesPerSec uint64 `json:"sent_bytes_per_sec"` ReceivedBytesPerSec uint64 `json:"received_bytes_per_sec"` KnownProducers []KnownProducer `json:"known_producers"` MetricRecorder MetricRecorder `json:"metric_recorder"` PeerCounter uint `json:"peer_counter"` }
NetworkInfo holds network information
type NodeVersion ¶
type PeerChainInfo ¶
type PeerChainInfo struct { // Chain Id and hash of genesis block. GenesisID GenesisID `json:"genesis_id"` // Last known chain height of the peer. Height types.BlockHeight `json:"height"` // Shards that the peer is tracking. TrackedShards []types.ShardID `json:"tracked_shards"` // Denote if a node is running in archival mode or not. Archival bool `json:"archival"` }
PeerChainInfo contains peer chain information. This is derived from PeerCHainInfoV2 in nearcore
type PeerInfo ¶
type PeerInfo struct { ID key.PeerID `json:"id"` Addr *string `json:"addr"` AccountID *types.AccountID `json:"account_id"` }
PeerInfo holds peer information
type QueryResponse ¶
type QueryResponse struct { BlockHeight types.BlockHeight `json:"block_height"` BlockHash hash.CryptoHash `json:"block_hash"` Error *string `json:"error"` Logs []interface{} `json:"logs"` // TODO: use correct type }
type Receipt ¶
type Receipt struct { ReceiptID hash.CryptoHash `json:"receipt_id"` ReceiverID types.AccountID `json:"receiver_id"` LightClientHead hash.CryptoHash }
func (Receipt) Hash ¶
func (r Receipt) Hash() hash.CryptoHash
func (Receipt) LightClientHeadHash ¶
func (r Receipt) LightClientHeadHash() hash.CryptoHash
type ReceiptView ¶
type ReceiptView struct { PredecessorID types.AccountID `json:"predecessor_id"` ReceiverID types.AccountID `json:"receiver_id"` ReceiptID hash.CryptoHash `json:"receipt_id"` Receipt json.RawMessage `json:"receipt"` // TODO: needs a type! }
type RpcLightClientExecutionProofResponse ¶
type RpcLightClientExecutionProofResponse struct { OutcomeProof ExecutionOutcomeWithIdView `json:"outcome_proof"` OutcomeRootProof MerklePath `json:"outcome_root_proof"` BlockHeaderLite LightClientBlockLiteView `json:"block_header_lite"` BlockProof MerklePath `json:"block_proof"` }
type SignedTransactionView ¶
type SignedTransactionView struct { SignerID types.AccountID `json:"signer_id"` PublicKey key.Base58PublicKey `json:"public_key"` Nonce types.Nonce `json:"nonce"` ReceiverID types.AccountID `json:"receiver_id"` Actions []action.Action `json:"actions"` Signature signature.Base58Signature `json:"signature"` Hash hash.CryptoHash `json:"hash"` }
type SlashedValidator ¶
type StateItem ¶
type StateItem struct { Key string `json:"key"` Value string `json:"value"` Proof TrieProofPath `json:"proof"` }
type StatusResponse ¶
type StatusResponse struct { // Binary version Version NodeVersion `json:"version"` // Unique chain id. ChainID string `json:"chain_id"` // Currently active protocol version. ProtocolVersion uint32 `json:"protocol_version"` // Latest protocol version that this client supports. LatestProtocolVersion uint32 `json:"latest_protocol_version"` // Address for RPC server. RPCAddr string `json:"rpc_addr"` // Current epoch validators. Validators []ValidatorInfo `json:"validators"` // Sync status of the node. SyncInfo StatusSyncInfo `json:"sync_info"` // Validator id of the node ValidatorAccountID *types.AccountID `json:"validator_account_id"` }
type StatusSyncInfo ¶
type StatusSyncInfo struct { LatestBlockHash hash.CryptoHash `json:"latest_block_hash"` LatestBlockHeight types.BlockHeight `json:"latest_block_height"` LatestBlockTime time.Time `json:"latest_block_time"` Syncing bool `json:"syncing"` }
type Transaction ¶
type Transaction struct { TransactionHash hash.CryptoHash `json:"transaction_hash"` SenderID types.AccountID `json:"sender_id"` LightClientHead hash.CryptoHash `json:"light_client_head"` }
func (Transaction) Hash ¶
func (t Transaction) Hash() hash.CryptoHash
func (Transaction) ID ¶
func (t Transaction) ID() types.AccountID
func (Transaction) LightClientHeadHash ¶
func (t Transaction) LightClientHeadHash() hash.CryptoHash
func (Transaction) Type ¶
func (t Transaction) Type() string
type TransactionOpt ¶
func WithBlockCharacteristic ¶
func WithBlockCharacteristic(block block.BlockCharacteristic) TransactionOpt
func WithBlockHash ¶
func WithBlockHash(hash hash.CryptoHash) TransactionOpt
WithBlockHash sets block hash to attach this transaction to
func WithKeyNonce ¶
func WithKeyNonce(nonce types.Nonce) TransactionOpt
WithKeyNonce sets key nonce to use with this transaction. If not set via this function, a RPC query will be done to query current nonce and (nonce+1) will be used
func WithKeyPair ¶
func WithKeyPair(keyPair key.KeyPair) TransactionOpt
WithKeyPair sets key pair to use sign this transaction with
func WithLatestBlock ¶
func WithLatestBlock() TransactionOpt
WithLatestBlock is alias to `WithBlockCharacteristic(block.FinalityFinal())`
type TransactionOrReceiptId ¶
type TransactionOrReceiptId interface { Type() string ID() types.AccountID Hash() hash.CryptoHash LightClientHeadHash() hash.CryptoHash }
type TransactionStatus ¶
type TransactionStatus struct { SuccessValue string `json:"SuccessValue"` SuccessReceiptID string `json:"SuccessReceiptId"` Failure json.RawMessage `json:"Failure"` // TODO }
type TrieProofPath ¶
type TrieProofPath = []string
TrieProofPath is a set of serialized TrieNodes that are encoded in base64. Represent proof of inclusion of some TrieNode in the MerkleTrie.
type ValidatorInfo ¶
type ValidatorStakeView ¶
type ValidatorStakeView struct { AccountID types.AccountID `json:"account_id"` PublicKey key.Base58PublicKey `json:"public_key"` Stake types.Balance `json:"stake"` }
ValidatorStakeView is based on ValidatorStakeV1 struct in nearcore
type ValidatorsResponse ¶
type ValidatorsResponse struct {
CurrentValidators []CurrentEpochValidatorInfo `json:"current_validator"`
}
type ViewStateResult ¶
type ViewStateResult struct { Values []StateItem `json:"values"` Proof TrieProofPath `json:"proof"` QueryResponse }
Source Files ¶
- access_key.go
- access_key_structs.go
- account.go
- account_structs.go
- block.go
- block_structs.go
- chunk.go
- chunk_structs.go
- client.go
- common.go
- context.go
- contract.go
- contract_structs.go
- gas.go
- gas_structs.go
- genesis.go
- light.go
- light_structs.go
- network.go
- network_structs.go
- transaction.go
- transaction_structs.go
- transaction_wrapper.go
- utils.go