object

package
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount struct {
	Value    string              `json:"value"`
	Currency identifier.Currency `json:"currency"`
}

Amount is some value of a currency. An amount must have both a value and a currency.

type Block

type Block struct {
	ID           identifier.Block `json:"block_identifier"`
	ParentID     identifier.Block `json:"parent_block_identifier"`
	Timestamp    int64            `json:"timestamp"`
	Transactions []*Transaction   `json:"transactions"`
}

Block contains an array of transactions that occurred at a particular block identifier. A hard requirement for blocks returned by Rosetta implementations is that they must be unalterable: once a client has requested and received a block identified by a specific block identifier, all future calls for that same block identifier must return the same block contents.

Examples given of metadata in the Rosetta API documentation are `transaction_root` and `difficulty`.

type Metadata added in v1.2.0

type Metadata struct {
	CurrentBlockID identifier.Block `json:"current_block"`
	SequenceNumber uint64           `json:"sequence_number"`
}

Metadata is the information required to construct a transaction for a specific network.

type Operation

type Operation struct {
	ID        identifier.Operation `json:"operation_identifier"`
	Type      string               `json:"type"`
	Status    string               `json:"status,omitempty"`
	AccountID identifier.Account   `json:"account"`
	Amount    Amount               `json:"amount"`
}

Operation contains all balance-changing information within a transaction. It is always one-sided (only affects one account identifier) and can succeed or fail independently of a transaction. Operations are used both to represent on-chain data in the Data API and to construct new transaction in the Construction API, creating a standard interface for reading and writing to blockchains.

Examples of metadata given in the Rosetta API documentation are "asm" and "hex".

The `coin_change` field is omitted, as the Flow blockchain is an account-based blockchain without utxo set.

type Options added in v1.2.0

type Options struct {
	AccountID identifier.Account `json:"account_identifier"`
}

Options object is used in the Rosetta Construction API requests. This object is returned in the `/construction/preprocess` response, and is forwarded to the `/construction/metadata` endpoint unmodified.

Specifically for Flow DPS, this object contains the account identifier that is the proposer of the transaction (by default, this is the sender). Account identifier is required so that we can return the sequence number of the proposer's key, required for the Flow transaction.

type PublicKey added in v1.2.0

type PublicKey struct {
	HexBytes  string `json:"hex_bytes"`
	CurveType string `json:"curve_type"`
}

PublicKey represents a public key used in a transaction signature.

type Signature added in v1.2.0

type Signature struct {
	SigningPayload SigningPayload `json:"signing_payload"`
	SignatureType  string         `json:"signature_type"`
	HexBytes       string         `json:"hex_bytes"`
	PublicKey      PublicKey      `json:"public_key"`
}

Signature contains the information about a transaction signature.

type SigningPayload added in v1.2.0

type SigningPayload struct {
	AccountID     identifier.Account `json:"account_identifier"`
	HexBytes      string             `json:"hex_bytes"`
	SignatureType string             `json:"signature_type"`
}

SigningPayload is the payload of an account's signature.

type Transaction

type Transaction struct {
	ID         identifier.Transaction `json:"transaction_identifier"`
	Operations []*Operation           `json:"operations"`
}

Transaction contains an array of operations that are attributable to the same transaction identifier.

Examples of metadata given in the Rosetta API documentation are "size" and "lockTime".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL