Documentation
¶
Index ¶
- Constants
- Variables
- type APIClient
- type APIKey
- type APIResponse
- type AccountAPIService
- type AccountBalanceRequest
- type AccountBalanceResponse
- type AccountIdentifier
- type Amount
- type Balance
- type BasicAuth
- type Block
- type BlockAPIService
- type BlockIdentifier
- type BlockRequest
- type BlockResponse
- type BlockTransactionRequest
- type BlockTransactionResponse
- type Configuration
- type ConstructionAPIService
- func (a *ConstructionAPIService) TransactionConstruction(ctx _context.Context, ...) (*TransactionConstructionResponse, *_nethttp.Response, error)
- func (a *ConstructionAPIService) TransactionSubmit(ctx _context.Context, transactionSubmitRequest TransactionSubmitRequest) (*TransactionSubmitResponse, *_nethttp.Response, error)
- type Currency
- type Error
- type GenericOpenAPIError
- type MempoolAPIService
- func (a *MempoolAPIService) Mempool(ctx _context.Context, mempoolRequest MempoolRequest) (*MempoolResponse, *_nethttp.Response, error)
- func (a *MempoolAPIService) MempoolTransaction(ctx _context.Context, mempoolTransactionRequest MempoolTransactionRequest) (*MempoolTransactionResponse, *_nethttp.Response, error)
- type MempoolRequest
- type MempoolResponse
- type MempoolTransactionRequest
- type MempoolTransactionResponse
- type NetworkAPIService
- type NetworkIdentifier
- type NetworkInformation
- type NetworkStatus
- type NetworkStatusRequest
- type NetworkStatusResponse
- type Operation
- type OperationIdentifier
- type OperationStatus
- type Options
- type PartialBlockIdentifier
- type PartialNetworkIdentifier
- type Peer
- type ServerConfiguration
- type ServerVariable
- type SubAccountIdentifier
- type SubNetworkIdentifier
- type SubNetworkStatus
- type SubmissionStatus
- type Transaction
- type TransactionConstructionRequest
- type TransactionConstructionResponse
- type TransactionIdentifier
- type TransactionSubmitRequest
- type TransactionSubmitResponse
- type Version
Constants ¶
const ( // APIVersion is the version of the Rosetta API Spec // used to generate this code. APIVersion = "1.2.4" )
Variables ¶
var ( // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct { AccountAPI *AccountAPIService BlockAPI *BlockAPIService ConstructionAPI *ConstructionAPIService MempoolAPI *MempoolAPIService NetworkAPI *NetworkAPIService // contains filtered or unexported fields }
APIClient manages communication with the Rosetta API v1.2.4 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
ChangeBasePath changes base path to allow switching to mocks
func (*APIClient) GetConfig ¶
func (c *APIClient) GetConfig() *Configuration
GetConfig allows for modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the OpenAPI operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
APIResponse stores the API response returned by the server.
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
NewAPIResponse returns a new APIResonse object.
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
type AccountAPIService ¶
type AccountAPIService service
AccountAPIService AccountAPI service
func (*AccountAPIService) AccountBalance ¶
func (a *AccountAPIService) AccountBalance(ctx _context.Context, accountBalanceRequest AccountBalanceRequest) (*AccountBalanceResponse, *_nethttp.Response, error)
AccountBalance Get an Account Balance Get an array of all Account Balances for an Account Identifier and the Block Identifier at which the balance lookup was performed. Some consumers of account balance data need to know at which block the balance was calculated to reconcile account balance changes. To get all balances associated with an account, it may be necessary to perform multiple balance requests with unique Account Identifiers. If the client supports it, passing nil AccountIdentifier metadata to the request should fetch all balances.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param accountBalanceRequest
@return AccountBalanceResponse
type AccountBalanceRequest ¶
type AccountBalanceRequest struct { NetworkIdentifier *NetworkIdentifier `json:"network_identifier"` AccountIdentifier *AccountIdentifier `json:"account_identifier"` }
AccountBalanceRequest struct for AccountBalanceRequest
type AccountBalanceResponse ¶
type AccountBalanceResponse struct { BlockIdentifier *BlockIdentifier `json:"block_identifier"` // A GetAccountBalanceResponse may include multiple uniquely-identified balances. For example, the balance of an account on each shard could be returned or the balance of an account on each ERC-20 contract. Balances []*Balance `json:"balances"` }
AccountBalanceResponse struct for AccountBalanceResponse
type AccountIdentifier ¶
type AccountIdentifier struct { // The `address` may be a cryptographic public key (or some encoding of it) or a provided username. Address string `json:"address"` SubAccount *SubAccountIdentifier `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]interface{} `json:"metadata,omitempty"` }
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).
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 `json:"value"` Currency *Currency `json:"currency"` Metadata *map[string]interface{} `json:"metadata,omitempty"` }
Amount Amount is some Value of a Currency. It is considered invalid to specify a Value without a Currency.
type Balance ¶
type Balance struct { AccountIdentifier *AccountIdentifier `json:"account_identifier"` // A single account may have a balance in multiple currencies. Amounts []*Amount `json:"amounts"` // Account-based blockchains that utilize a nonce or sequence number should include that number in the metadata. This number could be unique to the identifier or global across the account address. Metadata *map[string]interface{} `json:"metadata,omitempty"` }
Balance Balance is the array of Amount controlled by an AccountIdentifier. An underspecified AccountIdentifier may result in many amounts (ex: all ERC-20 balances for a single address).
type BasicAuth ¶
type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type Block ¶
type Block struct { BlockIdentifier *BlockIdentifier `json:"block_identifier"` ParentBlockIdentifier *BlockIdentifier `json:"parent_block_identifier"` // The timestamp of the block in milliseconds since the Unix Epoch. The timestamp is stored in milliseconds because some blockchains produce blocks more often than once a second. Timestamp int64 `json:"timestamp"` Transactions []*Transaction `json:"transactions"` Metadata *map[string]interface{} `json:"metadata,omitempty"` }
Block Blocks contain an array of Transactions that occured at a particular BlockIdentifier.
type BlockAPIService ¶
type BlockAPIService service
BlockAPIService BlockAPI service
func (*BlockAPIService) Block ¶
func (a *BlockAPIService) Block(ctx _context.Context, blockRequest BlockRequest) (*BlockResponse, *_nethttp.Response, error)
Block Get a Block Get a block by its Block Identifier If transactions are returned in the same call to the node as fetching the block, the response should include these transactions in the Block object. If not, an array of Transaction Identifiers should be returned so /block/transaction fetches can be done to get all transaction information.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param blockRequest
@return BlockResponse
func (*BlockAPIService) BlockTransaction ¶
func (a *BlockAPIService) BlockTransaction(ctx _context.Context, blockTransactionRequest BlockTransactionRequest) (*BlockTransactionResponse, *_nethttp.Response, error)
BlockTransaction Get a Block Transaction Get a transaction in a block by its Transaction Identifier This method should only be used when querying a node for a block does not return all transactions contained within it. All transactions returned by this method must be appended to any transactions returned by the /block method by consumers of this data. Fetching a transaction by hash is considered an \Explorer Method\ (which is classified under the \Future Work\ section). Calling this method requires reference to a BlockIdentifier because transaction parsing can change depending on which block contains the transaction. For example, in Bitcoin it is necessary to know which block contains a transaction to determine the destination of fee payments. Without specifying a block identifier, the node would have to infer which block to use (which could change during a re-org). Implementations that require fetching previous transactions to populate the response (ex: Previous UTXOs in Bitcoin) may find it useful to run a cache within the Rosetta server in the /data directory (on a path that does not conflict with the node).
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param blockTransactionRequest
@return BlockTransactionResponse
type BlockIdentifier ¶
type BlockIdentifier struct { // This is also known as the block height. Index int64 `json:"index"` Hash string `json:"hash"` }
BlockIdentifier The `block_identifier` uniquely identifies a block in a particular network.
type BlockRequest ¶
type BlockRequest struct { NetworkIdentifier *NetworkIdentifier `json:"network_identifier"` BlockIdentifier *PartialBlockIdentifier `json:"block_identifier"` }
BlockRequest struct for BlockRequest
type BlockResponse ¶
type BlockResponse struct { Block *Block `json:"block"` // Some blockchains may require additional transactions to be fetched that weren't returned in the block response (ex: block only returns transaction hashes). For blockchains with a lot of transactions in each block, this can be very useful as consumers can concurrently fetch all transactions returned. OtherTransactions []*TransactionIdentifier `json:"other_transactions,omitempty"` }
BlockResponse struct for BlockResponse
type BlockTransactionRequest ¶
type BlockTransactionRequest struct { NetworkIdentifier *NetworkIdentifier `json:"network_identifier"` BlockIdentifier *BlockIdentifier `json:"block_identifier"` TransactionIdentifier *TransactionIdentifier `json:"transaction_identifier"` }
BlockTransactionRequest struct for BlockTransactionRequest
type BlockTransactionResponse ¶
type BlockTransactionResponse struct {
Transaction *Transaction `json:"transaction"`
}
BlockTransactionResponse struct for BlockTransactionResponse
type Configuration ¶
type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` Debug bool `json:"debug,omitempty"` Servers []ServerConfiguration HTTPClient *http.Client }
Configuration stores the configuration of the API client
func NewConfiguration ¶
func NewConfiguration(basePath string, userAgent string, httpClient *http.Client) *Configuration
NewConfiguration returns a new Configuration object
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
AddDefaultHeader adds a new HTTP header to the default header in the request
type ConstructionAPIService ¶
type ConstructionAPIService service
ConstructionAPIService ConstructionAPI service
func (*ConstructionAPIService) TransactionConstruction ¶
func (a *ConstructionAPIService) TransactionConstruction(ctx _context.Context, transactionConstructionRequest TransactionConstructionRequest) (*TransactionConstructionResponse, *_nethttp.Response, error)
TransactionConstruction Get Transaction Construction Metadata Get any information required to construct a transaction for a specific account. Metadata returned here could be a recent hash to use or an account sequence number. It is important to clarify that this endpoint should not pre-construct any transactions for the client. All \account-specific\ metadata must be returned as a key-value mapping so that transaction construction can be audited and performed entirely offline. Any \account-agnostic\ metadata does not need to be broken out into a key-value mapping and can be returned as a blob.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param transactionConstructionRequest
@return TransactionConstructionResponse
func (*ConstructionAPIService) TransactionSubmit ¶
func (a *ConstructionAPIService) TransactionSubmit(ctx _context.Context, transactionSubmitRequest TransactionSubmitRequest) (*TransactionSubmitResponse, *_nethttp.Response, error)
TransactionSubmit Submit a Signed Transaction Submit a signed transaction in network-specific format
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param transactionSubmitRequest
@return TransactionSubmitResponse
type Currency ¶
type Currency struct { // Cannonical symbol associated with a currency. Symbol string `json:"symbol"` // 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 `json:"decimals"` // 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]interface{} `json:"metadata,omitempty"` }
Currency Currency is composed of a cannonical Symbol and Decimals. This Decimals value is used to convert an Amount.Value from atomic units (Satoshis) to standard units (Bitcoins).
type GenericOpenAPIError ¶
type GenericOpenAPIError struct {
// contains filtered or unexported fields
}
GenericOpenAPIError Provides access to the body, error and model on returned errors.
func (GenericOpenAPIError) Body ¶
func (e GenericOpenAPIError) Body() []byte
Body returns the raw bytes of the response
func (GenericOpenAPIError) Error ¶
func (e GenericOpenAPIError) Error() string
Error returns non-empty string if there was an error.
func (GenericOpenAPIError) Model ¶
func (e GenericOpenAPIError) Model() interface{}
Model returns the unpacked model of the error
type MempoolAPIService ¶
type MempoolAPIService service
MempoolAPIService MempoolAPI service
func (*MempoolAPIService) Mempool ¶
func (a *MempoolAPIService) Mempool(ctx _context.Context, mempoolRequest MempoolRequest) (*MempoolResponse, *_nethttp.Response, error)
Mempool Get All Mempool Transactions Get all Transaction Identifiers in the mempool
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param mempoolRequest
@return MempoolResponse
func (*MempoolAPIService) MempoolTransaction ¶
func (a *MempoolAPIService) MempoolTransaction(ctx _context.Context, mempoolTransactionRequest MempoolTransactionRequest) (*MempoolTransactionResponse, *_nethttp.Response, error)
MempoolTransaction Get a Mempool Transaction Get a transaction in the mempool by its Transaction Identifier. This is a separate request than fetching a block transaction (/block/transaction) because some blockchain nodes need to know that a transaction query is for something in the mempool instead of a transaction in a block. Transactions may not be fully parsable until they are in a block (ex: may not be possible to determine the fee to pay before a transaction is executed). On this endpoint, it is ok that returned transactions are only estimates of what may actually be included in a block.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param mempoolTransactionRequest
@return MempoolTransactionResponse
type MempoolRequest ¶
type MempoolRequest struct {
NetworkIdentifier *NetworkIdentifier `json:"network_identifier"`
}
MempoolRequest struct for MempoolRequest
type MempoolResponse ¶
type MempoolResponse struct {
TransactionIdentifiers []*TransactionIdentifier `json:"transaction_identifiers"`
}
MempoolResponse struct for MempoolResponse
type MempoolTransactionRequest ¶
type MempoolTransactionRequest struct { NetworkIdentifier *NetworkIdentifier `json:"network_identifier"` TransactionIdentifier *TransactionIdentifier `json:"transaction_identifier"` }
MempoolTransactionRequest struct for MempoolTransactionRequest
type MempoolTransactionResponse ¶
type MempoolTransactionResponse struct { Transaction *Transaction `json:"transaction"` Metadata *map[string]interface{} `json:"metadata,omitempty"` }
MempoolTransactionResponse struct for MempoolTransactionResponse
type NetworkAPIService ¶
type NetworkAPIService service
NetworkAPIService NetworkAPI service
func (*NetworkAPIService) NetworkStatus ¶
func (a *NetworkAPIService) NetworkStatus(ctx _context.Context, networkStatusRequest NetworkStatusRequest) (*NetworkStatusResponse, *_nethttp.Response, error)
NetworkStatus Get Network Status This method returns the current status of the network the node knows about. This method also returns the methods, operation types, and operation statuses the node supports.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param networkStatusRequest There are not any required fields in this request, yet. It is still specified as a `POST` request to ensure required fields can be added without requiring clients to change from a `GET`(which is currently more ideal) to a `POST` request.
@return NetworkStatusResponse
type NetworkIdentifier ¶
type NetworkIdentifier struct { Blockchain string `json:"blockchain"` // 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 `json:"network"` SubNetworkIdentifier *SubNetworkIdentifier `json:"sub_network_identifier,omitempty"` }
NetworkIdentifier The `network_identifier` specifies which network a particular object is associated with.
type NetworkInformation ¶
type NetworkInformation struct { CurrentBlockIdentifier *BlockIdentifier `json:"current_block_identifier"` // The timestamp of the block in milliseconds since the Unix Epoch. The timestamp is stored in milliseconds because some blockchains produce blocks more often than once a second. CurrentBlockTimestamp int64 `json:"current_block_timestamp"` GenesisBlockIdentifier *BlockIdentifier `json:"genesis_block_identifier"` Peers []*Peer `json:"peers"` }
NetworkInformation struct for NetworkInformation
type NetworkStatus ¶
type NetworkStatus struct { NetworkIdentifier *PartialNetworkIdentifier `json:"network_identifier"` NetworkInformation *NetworkInformation `json:"network_information"` }
NetworkStatus struct for NetworkStatus
type NetworkStatusRequest ¶
type NetworkStatusRequest struct {
Metadata *map[string]interface{} `json:"metadata,omitempty"`
}
NetworkStatusRequest struct for NetworkStatusRequest
type NetworkStatusResponse ¶
type NetworkStatusResponse struct { NetworkStatus *NetworkStatus `json:"network_status"` // If a node supports multiple sub-networks, their statuses should be returned in this array. SubNetworkStatus []*SubNetworkStatus `json:"sub_network_status,omitempty"` Version *Version `json:"version"` Options *Options `json:"options"` Metadata *map[string]interface{} `json:"metadata,omitempty"` }
NetworkStatusResponse struct for NetworkStatusResponse
type Operation ¶
type Operation struct { OperationIdentifier *OperationIdentifier `json:"operation_identifier"` // Restrict referenced `related_operations` to identifier indexes `<` 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 `json:"related_operations,omitempty"` // The network-specific type of the operation. Ensure that any type that can be returned here is also specified in the `NetowrkStatus`. This can be very useful to downstream consumers that parse all block data. Type string `json:"type"` // 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. Blockchains with atomic transactions (all operations succeed or all operations fail) will have the same `status` for each operation. Status string `json:"status"` Account *AccountIdentifier `json:"account,omitempty"` Amount *Amount `json:"amount,omitempty"` Metadata *map[string]interface{} `json:"metadata,omitempty"` }
Operation 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.
type OperationIdentifier ¶
type OperationIdentifier struct { // The operation `index` is used to ensure each operation has a unique identifier within a transaction. To clarify, there may not be any notion of an operation index in the blockchain being described. Index int64 `json:"index"` // 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). NetworkIndex *int64 `json:"network_index,omitempty"` }
OperationIdentifier The `operation_identifier` uniquely identifies an operation within a transaction.
type OperationStatus ¶
type OperationStatus struct { // The `status` is the network-specific status of the operation. Status string `json:"status"` // An `Operation` is considered `successful` if the `Operation.Amount` should affect the `Operation.Account`. Some blockchains (like Bitcoin) only include `successful` operations in blocks but other blockchains (like Ethereum) include unsuccessful operations that incur a fee. To reconcile the computed balance from the stream of `Operations`, it is critical to understand which `Operation.Status` indicate an `Operation` is `successful` and should affect an `Account`. Successful bool `json:"successful"` }
OperationStatus struct for OperationStatus
type Options ¶
type Options struct { // All methods that this implementation supports. Methods []string `json:"methods"` // All `Operation.Status` this implementation supports. Any status that is returned during parsing that is not listed here will cause client validation to error. OperationStatuses []*OperationStatus `json:"operation_statuses"` // All `Operation.Type` this implementation supports. Any type that is returned during parsing that is not listed here will cause client validation to error. OperationTypes []string `json:"operation_types"` // All `status` that can be returned when submitting a transaction using the `/construction/submit` endpoint. SubmissionStatuses []*SubmissionStatus `json:"submission_statuses"` }
Options Options specify supported methods, Operation.Status, Operation.Type, and all possible transaction submission statuses. This Options object is used by clients to validate the correctness of a Rosetta Server implementation. It is expected that these clients will error if they receive some response that contains any of the above information that is not specified here.
type PartialBlockIdentifier ¶
type PartialBlockIdentifier struct { Index *int64 `json:"index,omitempty"` Hash *string `json:"hash,omitempty"` }
PartialBlockIdentifier When fetching data by `BlockIdentifier`, it may be possible to only specify the `index` or `hash`. If neither property is specified, it is assumed that the client is making a request at the current block.
type PartialNetworkIdentifier ¶
type PartialNetworkIdentifier struct { Blockchain string `json:"blockchain"` Network string `json:"network"` }
PartialNetworkIdentifier The `partial_network_identifier` specifies which network a particular object is associated with (exculding the `sub_network_identifier`). This identifier is used exclusively in `/network/status`.
type Peer ¶
type Peer struct { PeerID string `json:"peer_id"` Metadata *map[string]interface{} `json:"metadata,omitempty"` }
Peer struct for Peer
type ServerConfiguration ¶
type ServerConfiguration struct { URL string Description string Variables map[string]ServerVariable }
ServerConfiguration stores the information about a server
type ServerVariable ¶
ServerVariable stores the information about a server variable
type SubAccountIdentifier ¶
type SubAccountIdentifier struct { SubAccount string `json:"sub_account"` Metadata *map[string]interface{} `json:"metadata,omitempty"` }
SubAccountIdentifier 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.
type SubNetworkIdentifier ¶
type SubNetworkIdentifier struct { SubNetwork string `json:"sub_network"` Metadata *map[string]interface{} `json:"metadata,omitempty"` }
SubNetworkIdentifier 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.
type SubNetworkStatus ¶
type SubNetworkStatus struct { SubNetworkIdentifier *SubNetworkIdentifier `json:"sub_network_identifier"` NetworkInformation *NetworkInformation `json:"network_information"` }
SubNetworkStatus struct for SubNetworkStatus
type SubmissionStatus ¶
type SubmissionStatus struct { // The `status` is the network-specific status of transaction submission. Status string `json:"status"` // A transaction submission is considered `successful` if there is any way that the transaction could be included in a block. For example, a transaction submission status that indicates a transaction is in the mempool would be `successful` and a status that indicates signature validation failed would not be `successful`. Successful bool `json:"successful"` }
SubmissionStatus struct for SubmissionStatus
type Transaction ¶
type Transaction struct { TransactionIdentifier *TransactionIdentifier `json:"transaction_identifier"` Operations []*Operation `json:"operations"` // Transactions that are related to other transactions (like a cross-shard transactioin) should include the `tranaction_identifier` of these transactions in the metadata. Metadata *map[string]interface{} `json:"metadata,omitempty"` }
Transaction Transactions contain an array of Operations that are attributable to the same TransactionIdentifier.
type TransactionConstructionRequest ¶
type TransactionConstructionRequest struct { NetworkIdentifier *NetworkIdentifier `json:"network_identifier"` AccountIdentifier *AccountIdentifier `json:"account_identifier"` // Some blockchains require different metadata for different types of transaction construction (ex: delegation versus a transfer). Instead of requiring a blockchain node to return all possible types of metadata for construction (which may require multiple node fetches), the client can specify a `method` to limit the metadata returned to only the subset required. Method *string `json:"method,omitempty"` }
TransactionConstructionRequest struct for TransactionConstructionRequest
type TransactionConstructionResponse ¶
type TransactionConstructionResponse struct { SuggestedFee *Amount `json:"suggested_fee"` Metadata *map[string]interface{} `json:"metadata,omitempty"` }
TransactionConstructionResponse struct for TransactionConstructionResponse
type TransactionIdentifier ¶
type TransactionIdentifier struct {
Hash string `json:"hash"`
}
TransactionIdentifier The `transaction_identifier` uniquely identifies a transaction in a particular network and block or in the mempool.
type TransactionSubmitRequest ¶
type TransactionSubmitRequest struct {
SignedTransaction string `json:"signed_transaction"`
}
TransactionSubmitRequest struct for TransactionSubmitRequest
type TransactionSubmitResponse ¶
type TransactionSubmitResponse struct { TransactionIdentifier *TransactionIdentifier `json:"transaction_identifier"` // Network-specific transaction submission status Status string `json:"status"` Metadata *map[string]interface{} `json:"metadata,omitempty"` }
TransactionSubmitResponse struct for TransactionSubmitResponse
type Version ¶
type Version struct { // The `rosetta_version` is the version of the Rosetta interface the implementation adheres to. This can be useful for clients looking to reliably parse responses. RosettaVersion string `json:"rosetta_version"` // The `node_version` is the cannonical version of the node runtime. This can help clients manage deployments. NodeVersion string `json:"node_version"` // When a middleware server is used to adhere to the Rosetta interface, it should return its version here. This can help clients manage deployments. MiddlewareVersion *string `json:"middleware_version,omitempty"` // Any other information that may be useful about versioning of dependent services should be returned here. Metadata *map[string]interface{} `json:"metadata,omitempty"` }
Version struct for Version
Source Files
¶
- api_account.go
- api_block.go
- api_construction.go
- api_mempool.go
- api_network.go
- client.go
- configuration.go
- model_account_balance_request.go
- model_account_balance_response.go
- model_account_identifier.go
- model_amount.go
- model_balance.go
- model_block.go
- model_block_identifier.go
- model_block_request.go
- model_block_response.go
- model_block_transaction_request.go
- model_block_transaction_response.go
- model_currency.go
- model_error.go
- model_mempool_request.go
- model_mempool_response.go
- model_mempool_transaction_request.go
- model_mempool_transaction_response.go
- model_network_identifier.go
- model_network_information.go
- model_network_status.go
- model_network_status_request.go
- model_network_status_response.go
- model_operation.go
- model_operation_identifier.go
- model_operation_status.go
- model_options.go
- model_partial_block_identifier.go
- model_partial_network_identifier.go
- model_peer.go
- model_sub_account_identifier.go
- model_sub_network_identifier.go
- model_sub_network_status.go
- model_submission_status.go
- model_transaction.go
- model_transaction_construction_request.go
- model_transaction_construction_response.go
- model_transaction_identifier.go
- model_transaction_submit_request.go
- model_transaction_submit_response.go
- model_version.go
- response.go