Documentation ¶
Index ¶
- Variables
- func ConvertMillisecondsToTimestamp(milliseconds int64) *timestamppb.Timestamp
- func FromSDKMetadata(metadata map[string]interface{}) (map[string]*anypb.Any, error)
- func Int64Deref(p *int64) int64
- func Int64Ref(v int64) *int64
- func MarshalToAny(v interface{}) (*anypb.Any, error)
- func StringDeref(p *string) string
- func StringRef(v string) *string
- func ToSDKAccountIdentifier(account *AccountIdentifier) (*sdk.AccountIdentifier, error)
- func ToSDKAmount(amount *Amount) (*sdk.Amount, error)
- func ToSDKCoinChange(coinChange *CoinChange) *sdk.CoinChange
- func ToSDKMetadata(metadata map[string]*anypb.Any) (map[string]interface{}, error)
- func ToSDKNetworkIdentifier(networkIdentifier *NetworkIdentifier) (*sdk.NetworkIdentifier, error)
- func ToSDKOperation(rosettaOp *Operation) (*sdk.Operation, error)
- func ToSDKOperationIdentifiers(ops []*OperationIdentifier) []*sdk.OperationIdentifier
- func ToSDKOperations(operations []*Operation) ([]*sdk.Operation, error)
- func ToSDKRelatedTransaction(relatedTransaction *RelatedTransaction) (*sdk.RelatedTransaction, error)
- func ToSDKRelatedTransactions(relatedTransactions []*RelatedTransaction) ([]*sdk.RelatedTransaction, error)
- func ToSDKSubNetworkIdentifier(subNetworkIdentifier *SubNetworkIdentifier) (*sdk.SubNetworkIdentifier, error)
- func ToSDKTransaction(transaction *Transaction) (*sdk.Transaction, error)
- func UnmarshalToInterface(v *anypb.Any) (interface{}, error)
- type AccountIdentifier
- func (*AccountIdentifier) Descriptor() ([]byte, []int)deprecated
- func (x *AccountIdentifier) GetAddress() string
- func (x *AccountIdentifier) GetMetadata() map[string]*anypb.Any
- func (x *AccountIdentifier) GetSubAccount() *SubAccountIdentifier
- func (*AccountIdentifier) ProtoMessage()
- func (x *AccountIdentifier) ProtoReflect() protoreflect.Message
- func (x *AccountIdentifier) Reset()
- func (x *AccountIdentifier) String() string
- type Amount
- func (*Amount) Descriptor() ([]byte, []int)deprecated
- func (x *Amount) GetCurrency() *Currency
- func (x *Amount) GetMetadata() map[string]*anypb.Any
- func (x *Amount) GetValue() string
- func (*Amount) ProtoMessage()
- func (x *Amount) ProtoReflect() protoreflect.Message
- func (x *Amount) Reset()
- func (x *Amount) String() string
- type Block
- func (*Block) Descriptor() ([]byte, []int)deprecated
- func (x *Block) GetBlockIdentifier() *BlockIdentifier
- func (x *Block) GetMetadata() map[string]*anypb.Any
- func (x *Block) GetParentBlockIdentifier() *BlockIdentifier
- func (x *Block) GetTimestamp() *timestamppb.Timestamp
- func (x *Block) GetTransactions() []*Transaction
- func (*Block) ProtoMessage()
- func (x *Block) ProtoReflect() protoreflect.Message
- func (x *Block) Reset()
- func (x *Block) String() string
- type BlockIdentifier
- func (*BlockIdentifier) Descriptor() ([]byte, []int)deprecated
- func (x *BlockIdentifier) GetHash() string
- func (x *BlockIdentifier) GetIndex() int64
- func (*BlockIdentifier) ProtoMessage()
- func (x *BlockIdentifier) ProtoReflect() protoreflect.Message
- func (x *BlockIdentifier) Reset()
- func (x *BlockIdentifier) String() string
- type CoinChange
- func (*CoinChange) Descriptor() ([]byte, []int)deprecated
- func (x *CoinChange) GetCoinAction() CoinChange_CoinAction
- func (x *CoinChange) GetCoinIdentifier() *CoinIdentifier
- func (*CoinChange) ProtoMessage()
- func (x *CoinChange) ProtoReflect() protoreflect.Message
- func (x *CoinChange) Reset()
- func (x *CoinChange) String() string
- type CoinChange_CoinAction
- func (CoinChange_CoinAction) Descriptor() protoreflect.EnumDescriptor
- func (x CoinChange_CoinAction) Enum() *CoinChange_CoinAction
- func (CoinChange_CoinAction) EnumDescriptor() ([]byte, []int)deprecated
- func (x CoinChange_CoinAction) Number() protoreflect.EnumNumber
- func (x CoinChange_CoinAction) String() string
- func (CoinChange_CoinAction) Type() protoreflect.EnumType
- type CoinIdentifier
- type Currency
- func (*Currency) Descriptor() ([]byte, []int)deprecated
- func (x *Currency) GetDecimals() int32
- func (x *Currency) GetMetadata() map[string]*anypb.Any
- func (x *Currency) GetSymbol() string
- func (*Currency) ProtoMessage()
- func (x *Currency) ProtoReflect() protoreflect.Message
- func (x *Currency) Reset()
- func (x *Currency) String() string
- type NetworkIdentifier
- func (*NetworkIdentifier) Descriptor() ([]byte, []int)deprecated
- func (x *NetworkIdentifier) GetBlockchain() string
- func (x *NetworkIdentifier) GetNetwork() string
- func (x *NetworkIdentifier) GetSubNetworkIdentifier() *SubNetworkIdentifier
- func (*NetworkIdentifier) ProtoMessage()
- func (x *NetworkIdentifier) ProtoReflect() protoreflect.Message
- func (x *NetworkIdentifier) Reset()
- func (x *NetworkIdentifier) String() string
- type Operation
- func (*Operation) Descriptor() ([]byte, []int)deprecated
- func (x *Operation) GetAccount() *AccountIdentifier
- func (x *Operation) GetAmount() *Amount
- func (x *Operation) GetCoinChange() *CoinChange
- func (x *Operation) GetMetadata() map[string]*anypb.Any
- func (x *Operation) GetOperationIdentifier() *OperationIdentifier
- func (x *Operation) GetRelatedOperations() []*OperationIdentifier
- func (x *Operation) GetStatus() string
- func (x *Operation) GetType() string
- func (*Operation) ProtoMessage()
- func (x *Operation) ProtoReflect() protoreflect.Message
- func (x *Operation) Reset()
- func (x *Operation) String() string
- type OperationIdentifier
- func (*OperationIdentifier) Descriptor() ([]byte, []int)deprecated
- func (x *OperationIdentifier) GetIndex() int64
- func (x *OperationIdentifier) GetNetworkIndex() int64
- func (*OperationIdentifier) ProtoMessage()
- func (x *OperationIdentifier) ProtoReflect() protoreflect.Message
- func (x *OperationIdentifier) Reset()
- func (x *OperationIdentifier) String() string
- type RelatedTransaction
- func (*RelatedTransaction) Descriptor() ([]byte, []int)deprecated
- func (x *RelatedTransaction) GetDirection() RelatedTransaction_Direction
- func (x *RelatedTransaction) GetNetworkIdentifier() *NetworkIdentifier
- func (x *RelatedTransaction) GetTransactionIdentifier() *TransactionIdentifier
- func (*RelatedTransaction) ProtoMessage()
- func (x *RelatedTransaction) ProtoReflect() protoreflect.Message
- func (x *RelatedTransaction) Reset()
- func (x *RelatedTransaction) String() string
- type RelatedTransaction_Direction
- func (RelatedTransaction_Direction) Descriptor() protoreflect.EnumDescriptor
- func (x RelatedTransaction_Direction) Enum() *RelatedTransaction_Direction
- func (RelatedTransaction_Direction) EnumDescriptor() ([]byte, []int)deprecated
- func (x RelatedTransaction_Direction) Number() protoreflect.EnumNumber
- func (x RelatedTransaction_Direction) String() string
- func (RelatedTransaction_Direction) Type() protoreflect.EnumType
- type SubAccountIdentifier
- func (*SubAccountIdentifier) Descriptor() ([]byte, []int)deprecated
- func (x *SubAccountIdentifier) GetAddress() string
- func (x *SubAccountIdentifier) GetMetadata() map[string]*anypb.Any
- func (*SubAccountIdentifier) ProtoMessage()
- func (x *SubAccountIdentifier) ProtoReflect() protoreflect.Message
- func (x *SubAccountIdentifier) Reset()
- func (x *SubAccountIdentifier) String() string
- type SubNetworkIdentifier
- func (*SubNetworkIdentifier) Descriptor() ([]byte, []int)deprecated
- func (x *SubNetworkIdentifier) GetMetadata() map[string]*anypb.Any
- func (x *SubNetworkIdentifier) GetNetwork() string
- func (*SubNetworkIdentifier) ProtoMessage()
- func (x *SubNetworkIdentifier) ProtoReflect() protoreflect.Message
- func (x *SubNetworkIdentifier) Reset()
- func (x *SubNetworkIdentifier) String() string
- type Transaction
- func (*Transaction) Descriptor() ([]byte, []int)deprecated
- func (x *Transaction) GetMetadata() map[string]*anypb.Any
- func (x *Transaction) GetOperations() []*Operation
- func (x *Transaction) GetRelatedTransactions() []*RelatedTransaction
- func (x *Transaction) GetTransactionIdentifier() *TransactionIdentifier
- func (*Transaction) ProtoMessage()
- func (x *Transaction) ProtoReflect() protoreflect.Message
- func (x *Transaction) Reset()
- func (x *Transaction) String() string
- type TransactionIdentifier
- func (*TransactionIdentifier) Descriptor() ([]byte, []int)deprecated
- func (x *TransactionIdentifier) GetHash() string
- func (*TransactionIdentifier) ProtoMessage()
- func (x *TransactionIdentifier) ProtoReflect() protoreflect.Message
- func (x *TransactionIdentifier) Reset()
- func (x *TransactionIdentifier) String() string
Constants ¶
This section is empty.
Variables ¶
var ( CoinChange_CoinAction_name = map[int32]string{ 0: "COIN_ACTION_UNSPECIFIED", 1: "COIN_CREATED", 2: "COIN_SPENT", } CoinChange_CoinAction_value = map[string]int32{ "COIN_ACTION_UNSPECIFIED": 0, "COIN_CREATED": 1, "COIN_SPENT": 2, } )
Enum value maps for CoinChange_CoinAction.
var ( // FromSDKDirectionMap maps from rosetta sdk Direction to proto RelatedTransaction_Direction FromSDKDirectionMap = map[sdk.Direction]RelatedTransaction_Direction{ sdk.Backward: RelatedTransaction_BACKWARD, sdk.Forward: RelatedTransaction_FORWARD, } // FromSDKCoinActionMap maps from rosetta sdk CoinAction to proto CoinChange_CoinAction FromSDKCoinActionMap = map[sdk.CoinAction]CoinChange_CoinAction{ sdk.CoinCreated: CoinChange_COIN_CREATED, sdk.CoinSpent: CoinChange_COIN_SPENT, } // ToSDKCoinActionMap maps from proto CoinChange_CoinAction to rosetta sdk CoinAction ToSDKCoinActionMap = map[CoinChange_CoinAction]sdk.CoinAction{ CoinChange_COIN_CREATED: sdk.CoinCreated, CoinChange_COIN_SPENT: sdk.CoinSpent, } // ToSDKDirectionMap maps from proto RelatedTransaction_Direction to rosetta sdk Direction ToSDKDirectionMap = map[RelatedTransaction_Direction]sdk.Direction{ RelatedTransaction_BACKWARD: sdk.Backward, RelatedTransaction_FORWARD: sdk.Forward, } )
var ( RelatedTransaction_Direction_name = map[int32]string{ 0: "DIRECTION_UNSPECIFIED", 1: "FORWARD", 2: "BACKWARD", } RelatedTransaction_Direction_value = map[string]int32{ "DIRECTION_UNSPECIFIED": 0, "FORWARD": 1, "BACKWARD": 2, } )
Enum value maps for RelatedTransaction_Direction.
var File_coinbase_crypto_rosetta_types_account_identifer_proto protoreflect.FileDescriptor
var File_coinbase_crypto_rosetta_types_amount_proto protoreflect.FileDescriptor
var File_coinbase_crypto_rosetta_types_block_proto protoreflect.FileDescriptor
var File_coinbase_crypto_rosetta_types_coin_change_proto protoreflect.FileDescriptor
var File_coinbase_crypto_rosetta_types_network_identifier_proto protoreflect.FileDescriptor
var File_coinbase_crypto_rosetta_types_operation_proto protoreflect.FileDescriptor
var File_coinbase_crypto_rosetta_types_transaction_proto protoreflect.FileDescriptor
Functions ¶
func ConvertMillisecondsToTimestamp ¶
func ConvertMillisecondsToTimestamp(milliseconds int64) *timestamppb.Timestamp
ConvertMillisecondsToTimestamp converts milliseconds to timestamp
func FromSDKMetadata ¶
FromSDKMetadata converts metadata from rosetta sdk type to proto type
func MarshalToAny ¶
MarshalToAny converts interface to anypb.Any
func ToSDKAccountIdentifier ¶
func ToSDKAccountIdentifier(account *AccountIdentifier) (*sdk.AccountIdentifier, error)
ToSDKAccountIdentifier converts AccountIdentifier from proto type to sdk type
func ToSDKAmount ¶
ToSDKAmount converts Amount from proto type to rosetta sdk type
func ToSDKCoinChange ¶
func ToSDKCoinChange(coinChange *CoinChange) *sdk.CoinChange
ToSDKCoinChange converts CoinChange from proto type to sdk type
func ToSDKMetadata ¶
ToSDKMetadata converts metadata from proto type to rosetta sdk type
func ToSDKNetworkIdentifier ¶
func ToSDKNetworkIdentifier(networkIdentifier *NetworkIdentifier) (*sdk.NetworkIdentifier, error)
ToSDKNetworkIdentifier converts NetworkIdentifier from proto type to sdk type
func ToSDKOperation ¶
ToSDKOperation converts Operation from proto type to sdk type
func ToSDKOperationIdentifiers ¶
func ToSDKOperationIdentifiers(ops []*OperationIdentifier) []*sdk.OperationIdentifier
ToSDKOperationIdentifiers converts OperationIdentifier list from proto type to sdk type
func ToSDKOperations ¶
ToSDKOperations converts Operation from proto type to sdk type
func ToSDKRelatedTransaction ¶
func ToSDKRelatedTransaction(relatedTransaction *RelatedTransaction) (*sdk.RelatedTransaction, error)
ToSDKRelatedTransaction converts RelatedTransaction from proto type to sdk type
func ToSDKRelatedTransactions ¶
func ToSDKRelatedTransactions(relatedTransactions []*RelatedTransaction) ([]*sdk.RelatedTransaction, error)
ToSDKRelatedTransactions converts list of RelatedTransaction from proto type to sdk type
func ToSDKSubNetworkIdentifier ¶
func ToSDKSubNetworkIdentifier(subNetworkIdentifier *SubNetworkIdentifier) (*sdk.SubNetworkIdentifier, error)
ToSDKSubNetworkIdentifier converts SubNetworkIdentifier from proto type to sdk type
func ToSDKTransaction ¶
func ToSDKTransaction(transaction *Transaction) (*sdk.Transaction, error)
ToSDKTransaction converts Transaction from proto type to sdk type
func UnmarshalToInterface ¶
UnmarshalToInterface converts anypb.Any to interface
Types ¶
type AccountIdentifier ¶
type AccountIdentifier struct { // The address may be a cryptographic public key (or some encoding of it) or a provided // username. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The sub account identifier SubAccount *SubAccountIdentifier `protobuf:"bytes,2,opt,name=sub_account,json=subAccount,proto3" json:"sub_account,omitempty"` // Blockchains that utilize a username model (where the address is not a derivative of a // cryptographic public key) should specify the public key(s) owned by the address in metadata. Metadata map[string]*anypb.Any `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
AccountIdentifier The account_identifier uniquely identifies an account within a network. All fields in the account_identifier are utilized to determine this uniqueness (including the metadata field, if populated).
func FromSDKAccountIdentifier ¶
func FromSDKAccountIdentifier(accountIdentifier *sdk.AccountIdentifier) (*AccountIdentifier, error)
FromSDKAccountIdentifier converts AccountIdentifier from rosetta sdk type to proto type
func (*AccountIdentifier) Descriptor
deprecated
func (*AccountIdentifier) Descriptor() ([]byte, []int)
Deprecated: Use AccountIdentifier.ProtoReflect.Descriptor instead.
func (*AccountIdentifier) GetAddress ¶
func (x *AccountIdentifier) GetAddress() string
func (*AccountIdentifier) GetMetadata ¶
func (x *AccountIdentifier) GetMetadata() map[string]*anypb.Any
func (*AccountIdentifier) GetSubAccount ¶
func (x *AccountIdentifier) GetSubAccount() *SubAccountIdentifier
func (*AccountIdentifier) ProtoMessage ¶
func (*AccountIdentifier) ProtoMessage()
func (*AccountIdentifier) ProtoReflect ¶
func (x *AccountIdentifier) ProtoReflect() protoreflect.Message
func (*AccountIdentifier) Reset ¶
func (x *AccountIdentifier) Reset()
func (*AccountIdentifier) String ¶
func (x *AccountIdentifier) String() string
type Amount ¶
type Amount struct { // Value of the transaction in atomic units represented as an arbitrary-sized signed integer. // For example, 1 BTC would be represented by a value of 100000000. Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // Currency is composed of a canonical Symbol and Decimals. This Decimals value is used to // convert an Amount.Value from atomic units (Satoshis) to standard units (Bitcoins). Currency *Currency `protobuf:"bytes,2,opt,name=currency,proto3" json:"currency,omitempty"` // The metadata is protocol specific metadata Metadata map[string]*anypb.Any `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
Amount is some Value of a Currency. It is considered invalid to specify a Value without a Currency.
func FromSDKAmount ¶
FromSDKAmount converts Amount from rosetta sdk type to proto type
func (*Amount) Descriptor
deprecated
func (*Amount) GetCurrency ¶
func (*Amount) ProtoMessage ¶
func (*Amount) ProtoMessage()
func (*Amount) ProtoReflect ¶
func (x *Amount) ProtoReflect() protoreflect.Message
type Block ¶
type Block struct { // BlockIdentifier uniquely identifies a block in a particular network. BlockIdentifier *BlockIdentifier `protobuf:"bytes,2,opt,name=block_identifier,json=blockIdentifier,proto3" json:"block_identifier,omitempty"` // BlockIdentifier uniquely identifies a block in a particular network. ParentBlockIdentifier *BlockIdentifier `` /* 126-byte string literal not displayed */ // The timestamp of the block since the Unix Epoch. The rosetta spec only // support timestamp in milliseconds granularity. // (-- api-linter: core::0142::time-field-names=disabled // // go/aip/not-precedent: This field was called timestamp in rosetta spec. --) Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Transactions within the block. Transactions []*Transaction `protobuf:"bytes,5,rep,name=transactions,proto3" json:"transactions,omitempty"` // Metadata for the block. Metadata map[string]*anypb.Any `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
Blocks contain an array of Transactions that occurred at a particular BlockIdentifier. A hard requirement for blocks returned by Rosetta implementations is that they MUST be immutable: once a client has requested and received a block identified by a specific BlockIndentifier, all future calls for that same BlockIdentifier must return the same block contents.
func FromSDKBlock ¶
FromSDKBlock converts Block from rosetta sdk type to proto type
func FromSDKBlocks ¶
FromSDKBlocks converts blocks from Rosetta sdk type to proto type
func (*Block) Descriptor
deprecated
func (*Block) GetBlockIdentifier ¶
func (x *Block) GetBlockIdentifier() *BlockIdentifier
func (*Block) GetParentBlockIdentifier ¶
func (x *Block) GetParentBlockIdentifier() *BlockIdentifier
func (*Block) GetTimestamp ¶
func (x *Block) GetTimestamp() *timestamppb.Timestamp
func (*Block) GetTransactions ¶
func (x *Block) GetTransactions() []*Transaction
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) ProtoReflect ¶
func (x *Block) ProtoReflect() protoreflect.Message
type BlockIdentifier ¶
type BlockIdentifier struct { // The block height. Note that this this should be >= 0 Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` // The block hash. Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` // contains filtered or unexported fields }
The block identifier uniquely identifies a block in a particular network.
func FromSDKBlockIdentifier ¶
func FromSDKBlockIdentifier(blockIdentifier *sdk.BlockIdentifier) *BlockIdentifier
FromSDKBlockIdentifier converts BlockIdentifier from rosetta sdk type to proto type
func (*BlockIdentifier) Descriptor
deprecated
func (*BlockIdentifier) Descriptor() ([]byte, []int)
Deprecated: Use BlockIdentifier.ProtoReflect.Descriptor instead.
func (*BlockIdentifier) GetHash ¶
func (x *BlockIdentifier) GetHash() string
func (*BlockIdentifier) GetIndex ¶
func (x *BlockIdentifier) GetIndex() int64
func (*BlockIdentifier) ProtoMessage ¶
func (*BlockIdentifier) ProtoMessage()
func (*BlockIdentifier) ProtoReflect ¶
func (x *BlockIdentifier) ProtoReflect() protoreflect.Message
func (*BlockIdentifier) Reset ¶
func (x *BlockIdentifier) Reset()
func (*BlockIdentifier) String ¶
func (x *BlockIdentifier) String() string
type CoinChange ¶
type CoinChange struct { // CoinIdentifier uniquely identifies a Coin. CoinIdentifier *CoinIdentifier `protobuf:"bytes,1,opt,name=coin_identifier,json=coinIdentifier,proto3" json:"coin_identifier,omitempty"` // CoinActions are different state changes that a Coin can undergo CoinAction CoinChange_CoinAction `` /* 149-byte string literal not displayed */ // contains filtered or unexported fields }
CoinChange is used to represent a change in state of a coin identified by a coin_identifier. This object is part of the Operation model and must be populated for UTXO-based blockchains. Coincidentally, this abstraction of UTXOs allows for supporting both account-based transfers and UTXO-based transfers on the same blockchain (when a transfer is account-based, don't populate this model).
func FromSDKCoinChange ¶
func FromSDKCoinChange(coinChange *sdk.CoinChange) *CoinChange
FromSDKCoinChange converts CoinChange from rosetta sdk type to proto type
func (*CoinChange) Descriptor
deprecated
func (*CoinChange) Descriptor() ([]byte, []int)
Deprecated: Use CoinChange.ProtoReflect.Descriptor instead.
func (*CoinChange) GetCoinAction ¶
func (x *CoinChange) GetCoinAction() CoinChange_CoinAction
func (*CoinChange) GetCoinIdentifier ¶
func (x *CoinChange) GetCoinIdentifier() *CoinIdentifier
func (*CoinChange) ProtoMessage ¶
func (*CoinChange) ProtoMessage()
func (*CoinChange) ProtoReflect ¶
func (x *CoinChange) ProtoReflect() protoreflect.Message
func (*CoinChange) Reset ¶
func (x *CoinChange) Reset()
func (*CoinChange) String ¶
func (x *CoinChange) String() string
type CoinChange_CoinAction ¶
type CoinChange_CoinAction int32
CoinActions are different state changes that a Coin can undergo. It is assumed that a single Coin cannot be created or spent more than once.
const ( // COIN_ACTION_UNSPECIFIED indicating a CoinAction is not set CoinChange_COIN_ACTION_UNSPECIFIED CoinChange_CoinAction = 0 // COIN_CREATED indicating a Coin was created. CoinChange_COIN_CREATED CoinChange_CoinAction = 1 // COIN_SPENT indicating a Coin was spent. CoinChange_COIN_SPENT CoinChange_CoinAction = 2 )
func (CoinChange_CoinAction) Descriptor ¶
func (CoinChange_CoinAction) Descriptor() protoreflect.EnumDescriptor
func (CoinChange_CoinAction) Enum ¶
func (x CoinChange_CoinAction) Enum() *CoinChange_CoinAction
func (CoinChange_CoinAction) EnumDescriptor
deprecated
func (CoinChange_CoinAction) EnumDescriptor() ([]byte, []int)
Deprecated: Use CoinChange_CoinAction.Descriptor instead.
func (CoinChange_CoinAction) Number ¶
func (x CoinChange_CoinAction) Number() protoreflect.EnumNumber
func (CoinChange_CoinAction) String ¶
func (x CoinChange_CoinAction) String() string
func (CoinChange_CoinAction) Type ¶
func (CoinChange_CoinAction) Type() protoreflect.EnumType
type CoinIdentifier ¶
type CoinIdentifier struct { // Identifier should be populated with a globally unique identifier of a Coin. In Bitcoin, this // identifier would be transaction_hash:index. Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` // contains filtered or unexported fields }
CoinIdentifier uniquely identifies a Coin.
func FromSDKCoinIdentifier ¶
func FromSDKCoinIdentifier(coinIdentifier *sdk.CoinIdentifier) *CoinIdentifier
FromSDKCoinIdentifier converts CoinIdentifier from rosetta sdk type to proto type
func (*CoinIdentifier) Descriptor
deprecated
func (*CoinIdentifier) Descriptor() ([]byte, []int)
Deprecated: Use CoinIdentifier.ProtoReflect.Descriptor instead.
func (*CoinIdentifier) GetIdentifier ¶
func (x *CoinIdentifier) GetIdentifier() string
func (*CoinIdentifier) ProtoMessage ¶
func (*CoinIdentifier) ProtoMessage()
func (*CoinIdentifier) ProtoReflect ¶
func (x *CoinIdentifier) ProtoReflect() protoreflect.Message
func (*CoinIdentifier) Reset ¶
func (x *CoinIdentifier) Reset()
func (*CoinIdentifier) String ¶
func (x *CoinIdentifier) String() string
type Currency ¶
type Currency struct { // Canonical symbol associated with a currency. Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` // Number of decimal places in the standard unit representation of the amount. For example, BTC // has 8 decimals. Note that it is not possible to represent the value of some currency in atomic // units that is not base 10. Decimals int32 `protobuf:"varint,2,opt,name=decimals,proto3" json:"decimals,omitempty"` // Any additional information related to the currency itself. For example, it would be useful to // populate this object with the contract address of an ERC-20 token. Metadata map[string]*anypb.Any `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
Currency is composed of a canonical Symbol and Decimals. This Decimals value is used to convert an Amount.Value from atomic units (Satoshis) to standard units (Bitcoins).
func FromSDKCurrency ¶
FromSDKCurrency converts Currency from rosetta sdk type to proto type
func (*Currency) Descriptor
deprecated
func (*Currency) GetDecimals ¶
func (*Currency) ProtoMessage ¶
func (*Currency) ProtoMessage()
func (*Currency) ProtoReflect ¶
func (x *Currency) ProtoReflect() protoreflect.Message
type NetworkIdentifier ¶
type NetworkIdentifier struct { // Blockchain the network is associated with Blockchain string `protobuf:"bytes,1,opt,name=blockchain,proto3" json:"blockchain,omitempty"` // If a blockchain has a specific chain-id or network identifier, it should go in // this field. It is up to the client to determine which network-specific identifier // is mainnet or testnet. Network string `protobuf:"bytes,2,opt,name=network,proto3" json:"network,omitempty"` // In blockchains with sharded state, the SubNetworkIdentifier is required to query // some object on a specific shard. This identifier is optional for all non-sharded // blockchains. SubNetworkIdentifier *SubNetworkIdentifier `protobuf:"bytes,3,opt,name=sub_network_identifier,json=subNetworkIdentifier,proto3" json:"sub_network_identifier,omitempty"` // contains filtered or unexported fields }
NetworkIdentifier specifies which network a particular object is associated with.
func FromSDKNetworkIdentifier ¶
func FromSDKNetworkIdentifier(networkIdentifier *sdk.NetworkIdentifier) (*NetworkIdentifier, error)
FromSDKNetworkIdentifier converts NetworkIdentifier from rosetta sdk type to proto type
func (*NetworkIdentifier) Descriptor
deprecated
func (*NetworkIdentifier) Descriptor() ([]byte, []int)
Deprecated: Use NetworkIdentifier.ProtoReflect.Descriptor instead.
func (*NetworkIdentifier) GetBlockchain ¶
func (x *NetworkIdentifier) GetBlockchain() string
func (*NetworkIdentifier) GetNetwork ¶
func (x *NetworkIdentifier) GetNetwork() string
func (*NetworkIdentifier) GetSubNetworkIdentifier ¶
func (x *NetworkIdentifier) GetSubNetworkIdentifier() *SubNetworkIdentifier
func (*NetworkIdentifier) ProtoMessage ¶
func (*NetworkIdentifier) ProtoMessage()
func (*NetworkIdentifier) ProtoReflect ¶
func (x *NetworkIdentifier) ProtoReflect() protoreflect.Message
func (*NetworkIdentifier) Reset ¶
func (x *NetworkIdentifier) Reset()
func (*NetworkIdentifier) String ¶
func (x *NetworkIdentifier) String() string
type Operation ¶
type Operation struct { // The operation_identifier uniquely identifies an operation within a transaction. OperationIdentifier *OperationIdentifier `protobuf:"bytes,1,opt,name=operation_identifier,json=operationIdentifier,proto3" json:"operation_identifier,omitempty"` // Restrict referenced related_operations to identifier indices " the current // operation_identifier.index. This ensures there exists a clear DAG-structure of relations. // Since operations are one-sided, one could imagine relating operations in a single transfer // or linking operations in a call tree. RelatedOperations []*OperationIdentifier `protobuf:"bytes,2,rep,name=related_operations,json=relatedOperations,proto3" json:"related_operations,omitempty"` // Type is the network-specific type of the operation. Ensure that any type that can be returned // here is also specified in the NetworkOptionsResponse. This can be very useful to downstream // consumers that parse all block data. Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // Status is the network-specific status of the operation. Status is not defined on the transaction // object because blockchains with smart contracts may have transactions that partially apply (some // operations are successful and some are not). Blockchains with atomic transactions (all operations // succeed or all operations fail) will have the same status for each operation. On-chain operations // (operations retrieved in the /block and /block/transaction endpoints) MUST have a populated status // field (anything on-chain must have succeeded or failed). However, operations provided during // transaction construction (often times called "intent" in the documentation) MUST NOT have a // populated status field (operations yet to be included on-chain have not yet succeeded or failed). Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` // The account_identifier uniquely identifies an account within a network. All fields in the // account_identifier are utilized to determine this uniqueness (including the metadata field, // if populated). Account *AccountIdentifier `protobuf:"bytes,5,opt,name=account,proto3" json:"account,omitempty"` // Amount is some Value of a Currency. It is considered invalid to specify a Value without a Currency. Amount *Amount `protobuf:"bytes,6,opt,name=amount,proto3" json:"amount,omitempty"` // CoinChange is used to represent a change in state of a some coin identified by a coin_identifier. // This object is part of the Operation model and must be populated for UTXO-based blockchains. // Coincidentally, this abstraction of UTXOs allows for supporting both account-based transfers and // UTXO-based transfers on the same blockchain (when a transfer is account-based, don't populate // this model). CoinChange *CoinChange `protobuf:"bytes,7,opt,name=coin_change,json=coinChange,proto3" json:"coin_change,omitempty"` // Metadata stores any protocol specific information regarding the operation Metadata map[string]*anypb.Any `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
Operations contain all balance-changing information within a transaction. They are always one-sided (only affect 1 AccountIdentifier) and can succeed or fail independently from a Transaction. Operations are used both to represent on-chain data (Data API) and to construct new transactions (Construction API), creating a standard interface for reading and writing to blockchains.
func FromSDKOperation ¶
FromSDKOperation converts Operation from rosetta sdk type to proto type
func FromSDKOperations ¶
FromSDKOperations converts operations from rosetta sdk type to proto type
func (*Operation) Descriptor
deprecated
func (*Operation) GetAccount ¶
func (x *Operation) GetAccount() *AccountIdentifier
func (*Operation) GetCoinChange ¶
func (x *Operation) GetCoinChange() *CoinChange
func (*Operation) GetOperationIdentifier ¶
func (x *Operation) GetOperationIdentifier() *OperationIdentifier
func (*Operation) GetRelatedOperations ¶
func (x *Operation) GetRelatedOperations() []*OperationIdentifier
func (*Operation) ProtoMessage ¶
func (*Operation) ProtoMessage()
func (*Operation) ProtoReflect ¶
func (x *Operation) ProtoReflect() protoreflect.Message
type OperationIdentifier ¶
type OperationIdentifier struct { // The operation index is used to ensure each operation has a unique identifier within a transaction. // This index is only relative to the transaction and NOT GLOBAL. The operations in each transaction // should start from index 0. To clarify, there may not be any notion of an operation index in the // blockchain being described. Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` // Some blockchains specify an operation index that is essential for client use. For example, Bitcoin // uses a network_index to identify which UTXO was used in a transaction. network_index should not be // populated if there is no notion of an operation index in a blockchain (typically most // account-based blockchains). // Note that this this should be >= 0 NetworkIndex int64 `protobuf:"varint,2,opt,name=network_index,json=networkIndex,proto3" json:"network_index,omitempty"` // contains filtered or unexported fields }
OperationIdentifier uniquely identifies an operation within a transaction.
func FromSDKOperationIdentifier ¶
func FromSDKOperationIdentifier(oi *sdk.OperationIdentifier) *OperationIdentifier
FromSDKOperationIdentifier converts OperationIdentifier from rosetta sdk type to proto type
func FromSDKOperationIdentifiers ¶
func FromSDKOperationIdentifiers(ops []*sdk.OperationIdentifier) []*OperationIdentifier
FromSDKOperationIdentifiers converts operationIdentifiers from rosetta sdk type to proto type
func (*OperationIdentifier) Descriptor
deprecated
func (*OperationIdentifier) Descriptor() ([]byte, []int)
Deprecated: Use OperationIdentifier.ProtoReflect.Descriptor instead.
func (*OperationIdentifier) GetIndex ¶
func (x *OperationIdentifier) GetIndex() int64
func (*OperationIdentifier) GetNetworkIndex ¶
func (x *OperationIdentifier) GetNetworkIndex() int64
func (*OperationIdentifier) ProtoMessage ¶
func (*OperationIdentifier) ProtoMessage()
func (*OperationIdentifier) ProtoReflect ¶
func (x *OperationIdentifier) ProtoReflect() protoreflect.Message
func (*OperationIdentifier) Reset ¶
func (x *OperationIdentifier) Reset()
func (*OperationIdentifier) String ¶
func (x *OperationIdentifier) String() string
type RelatedTransaction ¶
type RelatedTransaction struct { // The network_identifier specifies which network a particular object is associated with. // An unpopulated network identifier indicates that the related transaction is on the same network. NetworkIdentifier *NetworkIdentifier `protobuf:"bytes,1,opt,name=network_identifier,json=networkIdentifier,proto3" json:"network_identifier,omitempty"` // The transaction_identifier uniquely identifies a transaction in a particular network and block // or in the mempool. TransactionIdentifier *TransactionIdentifier `protobuf:"bytes,2,opt,name=transaction_identifier,json=transactionIdentifier,proto3" json:"transaction_identifier,omitempty"` // Used by RelatedTransaction to indicate the direction of the relation. // Can be used to indicate if a transaction relation is from child to parent or the reverse. Direction RelatedTransaction_Direction `` /* 136-byte string literal not displayed */ // contains filtered or unexported fields }
RelatedTransaction allows implementations to link together multiple transactions.
func FromSDKRelatedTransaction ¶
func FromSDKRelatedTransaction(relatedTransaction *sdk.RelatedTransaction) (*RelatedTransaction, error)
FromSDKRelatedTransaction converts RelatedTransaction from rosetta sdk type to proto type
func FromSDKRelatedTransactions ¶
func FromSDKRelatedTransactions(relatedTransactions []*sdk.RelatedTransaction) ([]*RelatedTransaction, error)
FromSDKRelatedTransactions converts relatedTransactions from rosetta sdk type to proto type
func (*RelatedTransaction) Descriptor
deprecated
func (*RelatedTransaction) Descriptor() ([]byte, []int)
Deprecated: Use RelatedTransaction.ProtoReflect.Descriptor instead.
func (*RelatedTransaction) GetDirection ¶
func (x *RelatedTransaction) GetDirection() RelatedTransaction_Direction
func (*RelatedTransaction) GetNetworkIdentifier ¶
func (x *RelatedTransaction) GetNetworkIdentifier() *NetworkIdentifier
func (*RelatedTransaction) GetTransactionIdentifier ¶
func (x *RelatedTransaction) GetTransactionIdentifier() *TransactionIdentifier
func (*RelatedTransaction) ProtoMessage ¶
func (*RelatedTransaction) ProtoMessage()
func (*RelatedTransaction) ProtoReflect ¶
func (x *RelatedTransaction) ProtoReflect() protoreflect.Message
func (*RelatedTransaction) Reset ¶
func (x *RelatedTransaction) Reset()
func (*RelatedTransaction) String ¶
func (x *RelatedTransaction) String() string
type RelatedTransaction_Direction ¶
type RelatedTransaction_Direction int32
Used by RelatedTransaction to indicate the direction of the relation (i.e. cross-shard/cross-network sends may reference backward to an earlier transaction and async execution may reference forward). Can be used to indicate if a transaction relation is from child to parent or the reverse.
const ( // DIRECTION_UNSPECIFIED indicating the direction is not specified. RelatedTransaction_DIRECTION_UNSPECIFIED RelatedTransaction_Direction = 0 // FORWARD indicating a transaction relation is from parent to child. RelatedTransaction_FORWARD RelatedTransaction_Direction = 1 // BACKWARD indicating a transaction relation is from child to parent. RelatedTransaction_BACKWARD RelatedTransaction_Direction = 2 )
func (RelatedTransaction_Direction) Descriptor ¶
func (RelatedTransaction_Direction) Descriptor() protoreflect.EnumDescriptor
func (RelatedTransaction_Direction) Enum ¶
func (x RelatedTransaction_Direction) Enum() *RelatedTransaction_Direction
func (RelatedTransaction_Direction) EnumDescriptor
deprecated
func (RelatedTransaction_Direction) EnumDescriptor() ([]byte, []int)
Deprecated: Use RelatedTransaction_Direction.Descriptor instead.
func (RelatedTransaction_Direction) Number ¶
func (x RelatedTransaction_Direction) Number() protoreflect.EnumNumber
func (RelatedTransaction_Direction) String ¶
func (x RelatedTransaction_Direction) String() string
func (RelatedTransaction_Direction) Type ¶
func (RelatedTransaction_Direction) Type() protoreflect.EnumType
type SubAccountIdentifier ¶
type SubAccountIdentifier struct { // The SubAccount address may be a cryptographic value or some other identifier (ex: bonded) that uniquely // specifies a SubAccount. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // If the SubAccount address is not sufficient to uniquely specify a SubAccount, any other identifying // information can be stored here. It is important to note that two SubAccounts with identical addresses // but differing metadata will not be considered equal by clients. Metadata map[string]*anypb.Any `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
An account may have state specific to a contract address (ERC-20 token) and/or a stake (delegated balance). The sub_account_identifier should specify which state (if applicable) an account instantiation refers to.
func FromSDKSubAccountIdentifier ¶
func FromSDKSubAccountIdentifier(subAccountIdentifier *sdk.SubAccountIdentifier) (*SubAccountIdentifier, error)
FromSDKSubAccountIdentifier converts SubAccountIdentifier from rosetta sdk type to proto type
func (*SubAccountIdentifier) Descriptor
deprecated
func (*SubAccountIdentifier) Descriptor() ([]byte, []int)
Deprecated: Use SubAccountIdentifier.ProtoReflect.Descriptor instead.
func (*SubAccountIdentifier) GetAddress ¶
func (x *SubAccountIdentifier) GetAddress() string
func (*SubAccountIdentifier) GetMetadata ¶
func (x *SubAccountIdentifier) GetMetadata() map[string]*anypb.Any
func (*SubAccountIdentifier) ProtoMessage ¶
func (*SubAccountIdentifier) ProtoMessage()
func (*SubAccountIdentifier) ProtoReflect ¶
func (x *SubAccountIdentifier) ProtoReflect() protoreflect.Message
func (*SubAccountIdentifier) Reset ¶
func (x *SubAccountIdentifier) Reset()
func (*SubAccountIdentifier) String ¶
func (x *SubAccountIdentifier) String() string
type SubNetworkIdentifier ¶
type SubNetworkIdentifier struct { // The subnetwork identifier. Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // Metadata info for the subnetwork. Metadata map[string]*anypb.Any `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
In blockchains with sharded state, the SubNetworkIdentifier is required to query some object on a specific shard. This identifier is optional for all non-sharded blockchains.
func FromSDKSubNetworkIdentifier ¶
func FromSDKSubNetworkIdentifier(subNetworkIdentifier *sdk.SubNetworkIdentifier) (*SubNetworkIdentifier, error)
FromSDKSubNetworkIdentifier converts SubNetworkIdentifier from rosetta sdk type to proto type
func (*SubNetworkIdentifier) Descriptor
deprecated
func (*SubNetworkIdentifier) Descriptor() ([]byte, []int)
Deprecated: Use SubNetworkIdentifier.ProtoReflect.Descriptor instead.
func (*SubNetworkIdentifier) GetMetadata ¶
func (x *SubNetworkIdentifier) GetMetadata() map[string]*anypb.Any
func (*SubNetworkIdentifier) GetNetwork ¶
func (x *SubNetworkIdentifier) GetNetwork() string
func (*SubNetworkIdentifier) ProtoMessage ¶
func (*SubNetworkIdentifier) ProtoMessage()
func (*SubNetworkIdentifier) ProtoReflect ¶
func (x *SubNetworkIdentifier) ProtoReflect() protoreflect.Message
func (*SubNetworkIdentifier) Reset ¶
func (x *SubNetworkIdentifier) Reset()
func (*SubNetworkIdentifier) String ¶
func (x *SubNetworkIdentifier) String() string
type Transaction ¶
type Transaction struct { // The transaction_identifier uniquely identifies a transaction in a particular network and block // or in the mempool. TransactionIdentifier *TransactionIdentifier `protobuf:"bytes,1,opt,name=transaction_identifier,json=transactionIdentifier,proto3" json:"transaction_identifier,omitempty"` // The operations is an array of Operations that are associated with the transaction Operations []*Operation `protobuf:"bytes,2,rep,name=operations,proto3" json:"operations,omitempty"` // The related_transaction allows implementations to link together multiple transactions. // An unpopulated network identifier indicates that the related transaction is on the same network. RelatedTransactions []*RelatedTransaction `protobuf:"bytes,3,rep,name=related_transactions,json=relatedTransactions,proto3" json:"related_transactions,omitempty"` // Transactions that are related to other transactions (like a cross-shard transaction) should // include the tranaction_identifier of these transactions in the metadata. Metadata map[string]*anypb.Any `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
Transactions contain an array of Operations that are attributable to the same TransactionIdentifier.
func FromSDKTransaction ¶
func FromSDKTransaction(transaction *sdk.Transaction) (*Transaction, error)
FromSDKTransaction converts Transaction from rosetta sdk type to proto type
func FromSDKTransactions ¶
func FromSDKTransactions(transactions []*sdk.Transaction) ([]*Transaction, error)
FromSDKTransactions converts transactions from rosetta sdk type to proto type
func (*Transaction) Descriptor
deprecated
func (*Transaction) Descriptor() ([]byte, []int)
Deprecated: Use Transaction.ProtoReflect.Descriptor instead.
func (*Transaction) GetMetadata ¶
func (x *Transaction) GetMetadata() map[string]*anypb.Any
func (*Transaction) GetOperations ¶
func (x *Transaction) GetOperations() []*Operation
func (*Transaction) GetRelatedTransactions ¶
func (x *Transaction) GetRelatedTransactions() []*RelatedTransaction
func (*Transaction) GetTransactionIdentifier ¶
func (x *Transaction) GetTransactionIdentifier() *TransactionIdentifier
func (*Transaction) ProtoMessage ¶
func (*Transaction) ProtoMessage()
func (*Transaction) ProtoReflect ¶
func (x *Transaction) ProtoReflect() protoreflect.Message
func (*Transaction) Reset ¶
func (x *Transaction) Reset()
func (*Transaction) String ¶
func (x *Transaction) String() string
type TransactionIdentifier ¶
type TransactionIdentifier struct { // The hash of the transaction. Any transactions that are attributable only to a block (ex: a // block event) should use the hash of the block as the identifier. Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // contains filtered or unexported fields }
TransactionIdentifier uniquely identifies a transaction in a particular network and block or in the mempool.
func (*TransactionIdentifier) Descriptor
deprecated
func (*TransactionIdentifier) Descriptor() ([]byte, []int)
Deprecated: Use TransactionIdentifier.ProtoReflect.Descriptor instead.
func (*TransactionIdentifier) GetHash ¶
func (x *TransactionIdentifier) GetHash() string
func (*TransactionIdentifier) ProtoMessage ¶
func (*TransactionIdentifier) ProtoMessage()
func (*TransactionIdentifier) ProtoReflect ¶
func (x *TransactionIdentifier) ProtoReflect() protoreflect.Message
func (*TransactionIdentifier) Reset ¶
func (x *TransactionIdentifier) Reset()
func (*TransactionIdentifier) String ¶
func (x *TransactionIdentifier) String() string