Documentation ¶
Index ¶
- Constants
- func CombineHash(hash1 []byte, hash2 []byte) []byte
- type AccessKey
- type AccessKeyPermission
- type AccessKeyResponse
- type Account
- type AccountDoesNotExist
- type AccountId
- type Action
- type ActionError
- type ActionView
- type AddKey
- type ApprovalMessage
- type BigInt
- type Block
- func (b *Block) ComputeHash(PreviousBlockHash []byte, innerLite HeaderInnerLite, innerRest HeaderInnerRest) ([]byte, error)
- func (b *Block) ComputeInnerHash(innerLite HeaderInnerLite, innerRest HeaderInnerRest) ([]byte, error)
- func (b *Block) Hash() *CryptoHash
- func (b *Block) Height() int64
- func (b *Block) InnerLite() HeaderInnerLite
- func (b *Block) InnerRest() HeaderInnerRest
- func (b *Block) RlpSerialize() ([]byte, error)
- func (b *Block) SerializableHeader() SerializableHeader
- type BlockNotification
- type BlockProducer
- type BmcStatus
- type BmvStatus
- type CallFunction
- type CallFunctionResponse
- type Cause
- type ChainStatus
- type ChainSyncInfo
- type Change
- type ChangeData
- type Chunk
- type ChunkHeader
- type ContractStateChange
- type CryptoHash
- type DeleteAccount
- type DeleteKey
- type DeployContract
- type ExecutionOutcomeView
- type ExecutionOutcomeWithIdView
- type ExecutionStatus
- type Failure
- type FunctionCall
- type FunctionCallError
- type FunctionCallPermission
- type FunctionCallView
- type Header
- type HeaderInnerLite
- type HeaderInnerRest
- type Kind
- type MerklePath
- type MerklePathItem
- type NextBlockProducers
- type PublicKey
- type ReceiptProof
- type SerializableHeader
- type Signature
- type Stake
- type Timestamp
- type Transaction
- type TransactionResult
- type TransactionView
- type Transfer
- type ValidatorStakeStructVersion
Constants ¶
View Source
const ( ED25519 = 0 SECP256K1 = 1 )
Variables ¶
This section is empty.
Functions ¶
func CombineHash ¶
Types ¶
type AccessKey ¶
type AccessKey struct { Nonce uint64 Permission AccessKeyPermission }
type AccessKeyPermission ¶
type AccessKeyPermission struct { Enum borsh.Enum `borsh_enum:"true"` FunctionCall FunctionCallPermission FullAccess borsh.Enum }
type AccessKeyResponse ¶
type Account ¶
type Account struct { Amount BigInt `json:"amount"` Locked BigInt `json:"locked"` CodeHash CryptoHash `json:"code_hash"` StorageUsage int64 `json:"storage_usage"` StoragePaidAt int64 `json:"storage_paid_at"` Height int64 `json:"block_height"` BlockHash CryptoHash `json:"block_hash"` }
type AccountDoesNotExist ¶
type AccountDoesNotExist struct {
AccountId AccountId `json:"account_id"`
}
type Action ¶
type Action struct { Enum borsh.Enum `borsh_enum:"true"` // treat struct as complex enum when serializing/deserializing CreateAccount borsh.Enum DeployContract DeployContract FunctionCall FunctionCall Transfer Transfer Stake Stake AddKey AddKey DeleteKey DeleteKey DeleteAccount DeleteAccount }
type ActionError ¶
type ActionView ¶
type ActionView struct { Enum borsh.Enum `borsh_enum:"true"` // treat struct as complex enum when serializing/deserializing CreateAccount borsh.Enum DeployContract DeployContract FunctionCall FunctionCallView Transfer Transfer Stake Stake AddKey AddKey DeleteKey DeleteKey DeleteAccount DeleteAccount }
type ApprovalMessage ¶
type ApprovalMessage struct { Type []byte PreviousBlockHash CryptoHash PreviousBlockHeight int64 TargetHeight int64 }
type BigInt ¶
func (*BigInt) UnmarshalJSON ¶
type Block ¶
type Block struct { Author string `json:"author"` Header Header `json:"header"` Chunks []Chunk `json:"chunks"` }
func (*Block) ComputeHash ¶
func (b *Block) ComputeHash(PreviousBlockHash []byte, innerLite HeaderInnerLite, innerRest HeaderInnerRest) ([]byte, error)
func (*Block) ComputeInnerHash ¶
func (b *Block) ComputeInnerHash(innerLite HeaderInnerLite, innerRest HeaderInnerRest) ([]byte, error)
func (*Block) Hash ¶
func (b *Block) Hash() *CryptoHash
func (*Block) InnerLite ¶
func (b *Block) InnerLite() HeaderInnerLite
func (*Block) InnerRest ¶
func (b *Block) InnerRest() HeaderInnerRest
func (*Block) RlpSerialize ¶
func (*Block) SerializableHeader ¶
func (b *Block) SerializableHeader() SerializableHeader
type BlockNotification ¶
type BlockNotification struct {
// contains filtered or unexported fields
}
func NewBlockNotification ¶
func NewBlockNotification(offset int64) *BlockNotification
func (*BlockNotification) Block ¶
func (bn *BlockNotification) Block() *Block
func (*BlockNotification) Offset ¶
func (bn *BlockNotification) Offset() int64
func (*BlockNotification) Receipts ¶
func (bn *BlockNotification) Receipts() []*chain.Receipt
func (*BlockNotification) SetBlock ¶
func (bn *BlockNotification) SetBlock(block Block)
func (*BlockNotification) SetReceipts ¶
func (bn *BlockNotification) SetReceipts(receipts []*chain.Receipt)
type BlockProducer ¶
type BlockProducer struct { ValidatorStakeStructVersion ValidatorStakeStructVersion `json:"validator_stake_struct_version"` AccountId AccountId `json:"account_id"` PublicKey PublicKey `json:"public_key"` Stake BigInt `json:"stake"` }
type BmcStatus ¶
type BmcStatus struct { TxSeq uint64 `json:"tx_seq"` RxSeq uint64 `json:"rx_seq"` Verifier AccountId `json:"verifier"` BMRIndex uint `json:"relay_index"` RotateHeight uint64 `json:"rotate_height"` RotateTerm uint `json:"rotate_term"` DelayLimit uint `json:"delay_limit"` MaxAggregation uint `json:"max_aggregation"` CurrentHeight uint64 `json:"current_height"` RxHeight uint64 `json:"rx_height"` RxHeightSrc uint64 `json:"rx_height_src"` BlockIntervalSrc uint `json:"block_interval_src"` BlockIntervalDst uint `json:"block_interval_dst"` }
type CallFunction ¶
type CallFunctionResponse ¶
type Cause ¶
type Cause struct { Type string `json:"type"` ReceiptHash CryptoHash `json:"receipt_hash"` }
type ChainStatus ¶
type ChainStatus struct { ChainId string `json:"chain_id"` SyncInfo ChainSyncInfo `json:"sync_info"` }
type ChainSyncInfo ¶
type ChainSyncInfo struct { LatestBlockHash CryptoHash `json:"latest_block_hash"` LatestBlockHeight int64 `json:"latest_block_height"` LatestBlockTime string `json:"latest_block_time"` Syncing bool `json:"syncing"` }
type Change ¶
type Change struct { Cause Cause `json:"cause"` Type string `json:"type"` Data ChangeData `json:"change"` }
type ChangeData ¶
type Chunk ¶
type Chunk struct { ChunkHash CryptoHash `json:"chunk_hash"` PreviousBlockHash CryptoHash `json:"prev_block_hash"` OutcomeRoot CryptoHash `json:"outcome_root"` PrevStateRoot CryptoHash `json:"prev_state_root"` EncodedMerkleRoot CryptoHash `json:"encoded_merkle_root"` EncodedLength uint `json:"encoded_length"` HeightCreated uint `json:"height_created"` HeightIncluded uint `json:"height_included"` ShardId uint `json:"shard_id"` OutgoingReceiptsRoot CryptoHash `json:"outgoing_receipts_root"` TxRoot CryptoHash `json:"tx_root"` Signature Signature `json:"signature"` }
type ChunkHeader ¶
type ChunkHeader struct { Header Chunk `json:"header"` Transactions []Transaction `json:"transactions"` }
type ContractStateChange ¶
type ContractStateChange struct { BlockHash CryptoHash `json:"block_hash"` Changes []Change `json:"changes"` }
type CryptoHash ¶
type CryptoHash [32]byte
func NewCryptoHash ¶
func NewCryptoHash(hash string) CryptoHash
func (*CryptoHash) Base58Encode ¶
func (c *CryptoHash) Base58Encode() string
func (*CryptoHash) UnmarshalJSON ¶
func (c *CryptoHash) UnmarshalJSON(p []byte) error
type DeleteAccount ¶
type DeleteAccount struct {
BeneficiaryID string
}
type DeployContract ¶
type DeployContract struct {
Code []byte
}
type ExecutionOutcomeView ¶
type ExecutionOutcomeView struct { Logs []string `json:"logs"` ReceiptIds []CryptoHash `json:"receipt_ids"` GasBurnt uint64 `json:"gas_burnt"` TokensBurnt string `json:"tokens_burnt"` ExecutorId string `json:"executor_id"` Status ExecutionStatus `json:"status"` }
type ExecutionOutcomeWithIdView ¶
type ExecutionOutcomeWithIdView struct { Proofs MerklePath `json:"proof"` BlockHash CryptoHash `json:"block_hash"` ReceiptId CryptoHash `json:"id"` Outcome ExecutionOutcomeView `json:"outcome"` }
type ExecutionStatus ¶
type ExecutionStatus struct { SuccessValue string `json:"SuccessValue"` SuccessReceiptId CryptoHash `json:"SuccessReceiptId"` Failure Failure `json:"Failure"` Unknown string `json:"Unknown"` }
type Failure ¶
type Failure struct {
ActionError ActionError `json:"ActionError"`
}
TODO: Add More Errors
type FunctionCall ¶
type FunctionCallError ¶
type FunctionCallError struct {
ExecutionError string `json:"ExecutionError"`
}
type FunctionCallPermission ¶
type FunctionCallView ¶
type Header ¶
type Header struct { Height int64 `json:"height"` PreviousHeight int64 `json:"prev_height"` EpochId CryptoHash `json:"epoch_id"` NextEpochId CryptoHash `json:"next_epoch_id"` Hash CryptoHash `json:"hash"` PreviousBlockHash CryptoHash `json:"prev_hash"` PreviousStateRoot CryptoHash `json:"prev_state_root"` ChunkReceiptsRoot CryptoHash `json:"chunk_receipts_root"` ChunkHeadersRoot CryptoHash `json:"chunk_headers_root"` ChunkTransactionRoot CryptoHash `json:"chunk_tx_root"` OutcomeRoot CryptoHash `json:"outcome_root"` ChunksIncluded uint8 `json:"chunks_included"` ChallengesRoot []byte `json:"challenges_root"` Timestamp Timestamp `json:"timestamp_nanosec"` RandomValue CryptoHash `json:"random_value"` ValidatorProposals []BlockProducer `json:"validator_proposals"` ChunkMask []bool `json:"chunk_mask"` GasPrice BigInt `json:"gas_price"` BlockOrdinal uint64 `json:"block_ordinal"` TotalSupply BigInt `json:"total_supply"` ChallengesResult []string `json:"challenges_result"` LastFinalBlock CryptoHash `json:"last_final_block"` LastDSFinalBlock CryptoHash `json:"last_ds_final_block"` NextBlockProducerHash CryptoHash `json:"next_bp_hash"` BlockMerkleRoot CryptoHash `json:"block_merkle_root"` EpochSyncDataHash CryptoHash `json:"epoch_sync_data_hash"` Approvals []Signature `json:"approvals"` Signature Signature `json:"signature"` LatestProtocolVersion uint32 `json:"latest_protocol_version"` }
type HeaderInnerLite ¶
type HeaderInnerLite struct { Height uint64 EpochId [32]byte NextEpochId [32]byte PreviousStateRoot [32]byte OutcomeRoot [32]byte Timestamp uint64 NextBlockProducerHash [32]byte BlockMerkleRoot [32]byte }
func (HeaderInnerLite) BorshSerialize ¶
func (h HeaderInnerLite) BorshSerialize() ([]byte, error)
type HeaderInnerRest ¶
type HeaderInnerRest struct { ChunkReceiptsRoot [32]byte ChunkHeadersRoot [32]byte ChunkTransactionRoot [32]byte ChallengesRoot []byte RandomValue [32]byte ValidatorProposals []BlockProducer ChunkMask []bool GasPrice BigInt TotalSupply BigInt ChallengesResult []string LastFinalBlock [32]byte LastDSFinalBlock [32]byte BlockOrdinal uint64 PreviousHeight uint64 EpochSyncDataHash [32]byte Approvals []Signature LatestProtocolVersion uint32 }
func (HeaderInnerRest) BorshSerialize ¶
func (h HeaderInnerRest) BorshSerialize() ([]byte, error)
type Kind ¶
type Kind struct { FunctionCallError FunctionCallError `json:"FunctionCallError"` AccountDoesNotExist AccountDoesNotExist `json:"AccountDoesNotExist"` }
type MerklePath ¶
type MerklePath []MerklePathItem
type MerklePathItem ¶
type MerklePathItem struct { Hash CryptoHash `json:"hash"` Direction string `json:"direction"` }
type NextBlockProducers ¶
type NextBlockProducers []BlockProducer
func (*NextBlockProducers) UnmarshalJSON ¶
func (nbps *NextBlockProducers) UnmarshalJSON(p []byte) error
type PublicKey ¶
func NewPublicKeyFromED25519 ¶
func (*PublicKey) Base58Encode ¶
func (*PublicKey) UnmarshalJSON ¶
type ReceiptProof ¶
type ReceiptProof struct { OutComeProof ExecutionOutcomeWithIdView `json:"outcome_proof"` OutComeRootProof MerklePath `json:"outcome_root_proof"` BlockProof MerklePath `json:"block_proof"` }
type SerializableHeader ¶
type SerializableHeader struct { PreviousBlockHash [32]byte InnerLite HeaderInnerLite InnerRest HeaderInnerRest Signature Signature }
type Transaction ¶
type Transaction struct { SignerId AccountId `json:"signer_id"` PublicKey PublicKey `json:"public_key"` Nonce int `json:"nonce"` ReceiverId AccountId `json:"receiver_id"` BlockHash CryptoHash Actions []Action `json:"actions"` // TODO: ActionView Signature Signature `json:"signature"` Txid CryptoHash `json:"hash"` }
func (*Transaction) Payload ¶
func (t *Transaction) Payload(wallet *wallet.NearWallet) (string, error)
type TransactionResult ¶
type TransactionResult struct { Status ExecutionStatus `json:"status"` Transaction TransactionView `json:"transaction"` TransactionOutcome ExecutionOutcomeWithIdView `json:"transaction_outcome"` ReceiptsOutcome []ExecutionOutcomeWithIdView `json:"receipts_outcome"` }
type TransactionView ¶
type TransactionView struct { SignerId AccountId `json:"signer_id"` PublicKey PublicKey `json:"public_key"` Nonce int `json:"nonce"` ReceiverId AccountId `json:"receiver_id"` Actions []ActionView `json:"actions"` // TODO: ActionView Signature Signature `json:"signature"` Txid CryptoHash `json:"hash"` }
type ValidatorStakeStructVersion ¶
type ValidatorStakeStructVersion []byte
func (*ValidatorStakeStructVersion) UnmarshalJSON ¶
func (vs *ValidatorStakeStructVersion) UnmarshalJSON(p []byte) error
Click to show internal directories.
Click to hide internal directories.