Expand description
A library of types to communicate with the ICP ledger canister.
Structs§
- Account
Balance Args - Arguments for the
account_balancecall. - Account
Identifier AccountIdentifieris 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_blocksandquery_archived_blocksfunction. - Checksum
Error - An error for reporting invalid checksums.
- GetBlocks
Args - Arguments for the
get_blocksfunction. - Memo
- An arbitrary number associated with a transaction.
The caller can set it in a
transfercall as a correlation identifier. - Query
Archive Fn - Function type used by
query_blocksfor fetching blocks from the archive. Has the signature(GetBlocksArgs) -> (GetBlocksResult). - Query
Blocks Response - Return type for the
query_blocksfunction. - 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_symbolfunction. - 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
transfercall.
Enums§
- Account
IdParse Error - An error for reporting invalid Account Identifiers.
- GetBlocks
Error - An error indicating that the arguments passed to
get_blocksorquery_archived_blockswere invalid. - Operation
- The content of a ledger transaction.
- Transfer
Error - Error of the
transfercall.
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_balancemethod on the specified canister. - query_
archived_ blocks - Continues a query started in
query_blocksby calling its returned archive function. - query_
blocks - Calls the
query_blockmethod on the specified canister. - token_
symbol - Calls the
token_symbolmethod 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
transfercall.