Expand description
A library of types to communicate with the ICP ledger canister.
Structs§
- Account
Balance Args - Arguments for the
account_balance
call. - Account
Identifier - AccountIdentifier is a 32-byte array. The first 4 bytes is a big-endian encoding of a CRC32 checksum of the last 28 bytes.
- Archived
Block Range - A function that can be called to retrieve a range of archived blocks.
- Block
- A single record in the ledger.
- Block
Range - A prefix of the block range specified in the
get_blocks
andquery_archived_blocks
function. - Checksum
Error - An error for reporting invalid checksums.
- GetBlocks
Args - 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. - Query
Archive Fn - Function type used by
query_blocks
for fetching blocks from the archive. Has the signature(
GetBlocksArgs
) -> (
GetBlocksResult
)
. - Query
Blocks Response - 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.
- Transfer
Args - Arguments for the
transfer
call.
Enums§
- Account
IdParse Error - An error for reporting invalid Account Identifiers.
- GetBlocks
Error - An error indicating that the arguments passed to
get_blocks
orquery_archived_blocks
were invalid. - Operation
- The content of a ledger transaction.
- Transfer
Error - 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§
- Block
Index - The sequence number of a block in the Tokens ledger blockchain.
- GetBlocks
Result - The return type of
get_blocks
. - Transfer
Result - Result of the
transfer
call.