Documentation
¶
Index ¶
- func DecodeBase64(data string) ([]byte, error)
- type AccessKey
- type Action
- type AddKeyAction
- type Block
- type BlockChunk
- type BlockHeader
- type BlockNumberResponse
- type Chunk
- type ChunkHeader
- type ChunkReceipt
- type Client
- type CongestionInfo
- type CreateAccountAction
- type DelegateAction
- type DeleteAccountAction
- type DeleteKeyAction
- type DeployContractAction
- type FunctionCallAction
- type NonDelegateAction
- type Outcome
- type ReceiptAction
- type ReceiptActionDetails
- type ReceiptOutcome
- type SignedDelegateAction
- type StakeAction
- type Transaction
- type TransactionDetails
- type TransactionOutcome
- type TransactionOutcomeMetadata
- type TransactionOutcomeProof
- type TransactionOutcomeStatus
- type TransactionStatus
- type TransferAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBase64 ¶
DecodeBase64 decodes a base64 string.
Types ¶
type Action ¶
type Action struct {
CreateAccount *CreateAccountAction `json:"CreateAccount,omitempty"`
DeployContract *DeployContractAction `json:"DeployContract,omitempty"`
FunctionCall *FunctionCallAction `json:"FunctionCall,omitempty"`
Transfer *TransferAction `json:"Transfer,omitempty"`
Stake *StakeAction `json:"Stake,omitempty"`
AddKey *AddKeyAction `json:"AddKey,omitempty"`
DeleteKey *DeleteKeyAction `json:"DeleteKey,omitempty"`
DeleteAccount *DeleteAccountAction `json:"DeleteAccount,omitempty"`
DelegateActions *SignedDelegateAction `json:"Delegate,omitempty"`
}
type AddKeyAction ¶
type Block ¶
type Block struct {
Author string `json:"author"`
Chunks []BlockChunk `json:"chunks"`
Header BlockHeader `json:"header"`
}
type BlockChunk ¶
type BlockChunk struct {
ChunkHash string `json:"chunk_hash"`
PrevBlockHash string `json:"prev_block_hash"`
OutcomeRoot string `json:"outcome_root"`
PrevStateRoot string `json:"prev_state_root"`
EncodedMerkleRoot string `json:"encoded_merkle_root"`
EncodedLength int `json:"encoded_length"`
HeightCreated int `json:"height_created"`
HeightIncluded int `json:"height_included"`
ShardID int `json:"shard_id"`
GasUsed int64 `json:"gas_used"`
GasLimit int64 `json:"gas_limit"`
RentPaid string `json:"rent_paid"`
ValidatorReward string `json:"validator_reward"`
BalanceBurnt string `json:"balance_burnt"`
OutgoingReceiptsRoot string `json:"outgoing_receipts_root"`
TxRoot string `json:"tx_root"`
ValidatorProposals []interface{} `json:"validator_proposals"`
Signature string `json:"signature"`
CongestionInfo CongestionInfo `json:"congestion_info"`
}
type BlockHeader ¶
type BlockHeader struct {
Approvals []string `json:"approvals"`
BlockBodyHash string `json:"block_body_hash"`
BlockMerkleRoot string `json:"block_merkle_root"`
BlockOrdinal int `json:"block_ordinal"`
ChallengesResult []interface{} `json:"challenges_result"`
ChallengesRoot string `json:"challenges_root"`
ChunkHeadersRoot string `json:"chunk_headers_root"`
ChunkMask []bool `json:"chunk_mask"`
ChunkReceiptsRoot string `json:"chunk_receipts_root"`
ChunkTxRoot string `json:"chunk_tx_root"`
ChunksIncluded int `json:"chunks_included"`
EpochID string `json:"epoch_id"`
EpochSyncDataHash interface{} `json:"epoch_sync_data_hash"`
GasPrice string `json:"gas_price"`
Hash string `json:"hash"`
Height int `json:"height"`
LastDsFinalBlock string `json:"last_ds_final_block"`
LastFinalBlock string `json:"last_final_block"`
LatestProtocolVersion int `json:"latest_protocol_version"`
NextBpHash string `json:"next_bp_hash"`
NextEpochID string `json:"next_epoch_id"`
OutcomeRoot string `json:"outcome_root"`
PrevHash string `json:"prev_hash"`
PrevHeight int `json:"prev_height"`
PrevStateRoot string `json:"prev_state_root"`
RandomValue string `json:"random_value"`
RentPaid string `json:"rent_paid"`
Signature string `json:"signature"`
Timestamp int64 `json:"timestamp"`
TimestampNanosec string `json:"timestamp_nanosec"`
TotalSupply string `json:"total_supply"`
ValidatorProposals []interface{} `json:"validator_proposals"`
ValidatorReward string `json:"validator_reward"`
}
type BlockNumberResponse ¶
type Chunk ¶
type Chunk struct {
Author string `json:"author"`
Header ChunkHeader `json:"header"`
Transactions []TransactionDetails `json:"transactions"`
Receipts []ChunkReceipt `json:"receipts"`
}
type ChunkHeader ¶
type ChunkHeader struct {
ChunkHash string `json:"chunk_hash"`
PrevBlockHash string `json:"prev_block_hash"`
OutcomeRoot string `json:"outcome_root"`
PrevStateRoot string `json:"prev_state_root"`
EncodedMerkleRoot string `json:"encoded_merkle_root"`
EncodedLength int `json:"encoded_length"`
HeightCreated int `json:"height_created"`
HeightIncluded int `json:"height_included"`
ShardID int `json:"shard_id"`
GasUsed int64 `json:"gas_used"`
GasLimit int64 `json:"gas_limit"`
RentPaid string `json:"rent_paid"`
ValidatorReward string `json:"validator_reward"`
BalanceBurnt string `json:"balance_burnt"`
OutgoingReceiptsRoot string `json:"outgoing_receipts_root"`
TxRoot string `json:"tx_root"`
ValidatorProposals []interface{} `json:"validator_proposals"`
Signature string `json:"signature"`
CongestionInfo CongestionInfo `json:"congestion_info"`
}
type ChunkReceipt ¶
type ChunkReceipt struct {
PredecessorID string `json:"predecessor_id"`
ReceiverID string `json:"receiver_id"`
ReceiptID string `json:"receipt_id"`
Receipt ReceiptAction `json:"receipt"`
Priority int `json:"priority"`
}
type Client ¶
type Client interface {
BlockByHeight(ctx context.Context, blockHeight *big.Int) (*Block, error)
ChunkByHash(ctx context.Context, hash string) (*Chunk, error)
ChunkByHeight(ctx context.Context, blockHeight *big.Int, shardID int) (*Chunk, error)
TransactionByHash(ctx context.Context, txHash string, senderAccountID string) (*Transaction, error)
GetBlockHeight(ctx context.Context) (int64, error)
}
Client provides basic RPC methods for NEAR Protocol.
type CongestionInfo ¶
type CreateAccountAction ¶
type CreateAccountAction struct{}
type DelegateAction ¶
type DeleteAccountAction ¶
type DeleteAccountAction struct {
BeneficiaryID string `json:"beneficiary_id"`
}
type DeleteKeyAction ¶
type DeleteKeyAction struct {
PublicKey string `json:"public_key"`
}
type DeployContractAction ¶
type DeployContractAction struct {
Code []byte `json:"code"`
}
type FunctionCallAction ¶
type NonDelegateAction ¶
type NonDelegateAction struct{}
type Outcome ¶
type Outcome struct {
Logs []string `json:"logs"`
ReceiptIDs []string `json:"receipt_ids"`
GasBurnt int64 `json:"gas_burnt"`
TokensBurnt string `json:"tokens_burnt"`
ExecutorID string `json:"executor_id"`
Status TransactionOutcomeStatus `json:"status"`
Metadata TransactionOutcomeMetadata `json:"metadata"`
}
type ReceiptAction ¶
type ReceiptAction struct {
Action ReceiptActionDetails `json:"Action"`
}
type ReceiptActionDetails ¶
type ReceiptActionDetails struct {
SignerID string `json:"signer_id"`
SignerPublicKey string `json:"signer_public_key"`
GasPrice string `json:"gas_price"`
OutputDataReceivers []interface{} `json:"output_data_receivers"`
InputDataIDs []interface{} `json:"input_data_ids"`
Actions []interface{} `json:"actions"` // Change to interface{} to accept any action type
IsPromiseYield bool `json:"is_promise_yield"`
}
type ReceiptOutcome ¶
type ReceiptOutcome struct {
Proof []TransactionOutcomeProof `json:"proof"`
BlockHash string `json:"block_hash"`
ID string `json:"id"`
Outcome Outcome `json:"outcome"`
}
type SignedDelegateAction ¶
type SignedDelegateAction struct {
DelegateAction DelegateAction `json:"delegate_action"`
Signature string `json:"signature"`
}
type StakeAction ¶
type Transaction ¶
type Transaction struct {
Status TransactionStatus `json:"status"`
Transaction TransactionDetails `json:"transaction"`
TransactionOutcome TransactionOutcome `json:"transaction_outcome"`
ReceiptsOutcome []ReceiptOutcome `json:"receipts_outcome"`
FinalExecutionStatus string `json:"final_execution_status"`
}
type TransactionDetails ¶
type TransactionDetails struct {
SignerID string `json:"signer_id"`
PublicKey string `json:"public_key"`
Nonce uint64 `json:"nonce"`
ReceiverID string `json:"receiver_id"`
Actions []Action `json:"actions"`
Signature string `json:"signature"`
Hash string `json:"hash"`
PriorityFee uint64 `json:"priority_fee"`
}
type TransactionOutcome ¶
type TransactionOutcome struct {
Proof []TransactionOutcomeProof `json:"proof"`
BlockHash string `json:"block_hash"`
ID string `json:"id"`
Outcome Outcome `json:"outcome"`
}
type TransactionOutcomeMetadata ¶
type TransactionOutcomeMetadata struct {
Version int `json:"version"`
GasProfile interface{} `json:"gas_profile"`
}
type TransactionOutcomeProof ¶
type TransactionOutcomeStatus ¶
type TransactionOutcomeStatus struct {
SuccessReceiptID string `json:"SuccessReceiptId"`
}
type TransactionStatus ¶
type TransactionStatus struct {
SuccessValue string `json:"SuccessValue"`
}
type TransferAction ¶
type TransferAction struct {
Deposit string `json:"deposit"`
}
Click to show internal directories.
Click to hide internal directories.