Crate ic_ledger_types

Source
Expand description

A library of types to communicate with the ICP ledger canister.

Structs§

AccountBalanceArgs
Arguments for the account_balance call.
AccountIdentifier
AccountIdentifier is a 32-byte array. The first 4 bytes is a big-endian encoding of a CRC32 checksum of the last 28 bytes.
ArchivedBlockRange
A function that can be called to retrieve a range of archived blocks.
Block
A single record in the ledger.
BlockRange
A prefix of the block range specified in the get_blocks and query_archived_blocks function.
ChecksumError
An error for reporting invalid checksums.
GetBlocksArgs
Arguments for the get_blocks function.
Memo
An arbitrary number associated with a transaction. The caller can set it in a transfer call as a correlation identifier.
QueryArchiveFn
Function type used by query_blocks for fetching blocks from the archive. Has the signature (GetBlocksArgs) -> (GetBlocksResult).
QueryBlocksResponse
Return type for the query_blocks function.
Subaccount
Subaccount is an arbitrary 32-byte byte array. Ledger uses subaccounts to compute account address, which enables one principal to control multiple ledger accounts.
Symbol
Return type of the token_symbol function.
Timestamp
Number of nanoseconds from the UNIX epoch in UTC timezone.
Tokens
A type for representing amounts of Tokens.
Transaction
A recorded ledger transaction.
TransferArgs
Arguments for the transfer call.

Enums§

AccountIdParseError
An error for reporting invalid Account Identifiers.
GetBlocksError
An error indicating that the arguments passed to get_blocks or query_archived_blocks were invalid.
Operation
The content of a ledger transaction.
TransferError
Error of the transfer call.

Constants§

DEFAULT_FEE
The default fee for ledger transactions.
DEFAULT_SUBACCOUNT
The subaccount that is used by default.
MAINNET_CYCLES_MINTING_CANISTER_ID
Id of the cycles minting canister on the IC.
MAINNET_GOVERNANCE_CANISTER_ID
Id of the governance canister on the IC.
MAINNET_LEDGER_CANISTER_ID
Id of the ledger canister on the IC.

Functions§

account_balance
Calls the “account_balance” method on the specified canister.
query_archived_blocks
Continues a query started in query_blocks by calling its returned archive function.
query_blocks
Calls the “query_block” method on the specified canister.
token_symbol
Calls the “token_symbol” method on the specified canister.
transfer
Calls the “transfer” method on the specified canister.

Type Aliases§

BlockIndex
The sequence number of a block in the Tokens ledger blockchain.
GetBlocksResult
The return type of get_blocks.
TransferResult
Result of the transfer call.