ICRC1/Types
type Value = {#Nat : Nat; #Int : Int; #Blob : Blob; #Text : Text}
type StableBuffer<T> = StableBuffer.StableBuffer<T>
type StableTrieMap<K, V> = STMap.StableTrieMap<K, V>
type Account = { owner : Principal; subaccount : ?Subaccount }
type EncodedAccount = Blob
type SupportedStandard = { name : Text; url : Text }
type TxKind = {#mint; #burn; #transfer}
type Mint = { to : Account; amount : Balance; memo : ?Blob; created_at_time : ?Nat64 }
type BurnArgs = { from_subaccount : ?Subaccount; amount : Balance; memo : ?Blob; created_at_time : ?Nat64 }
type Burn = { from : Account; amount : Balance; memo : ?Blob; created_at_time : ?Nat64 }
type TransferArgs = { from_subaccount : ?Subaccount; to : Account; amount : Balance; fee : ?Balance; memo : ?Blob; created_at_time : ?Nat64 }
Arguments for a transfer operation
type TimeError = {#TooOld; #CreatedInFuture : { ledger_time : Timestamp }}
type TransferError = TimeError or {#BadFee : { expected_fee : Balance }; #BadBurn : { min_burn_amount : Balance }; #InsufficientFunds : { balance : Balance }; #Duplicate : { duplicate_of : TxIndex }; #TemporarilyUnavailable; #GenericError : { error_code : Nat; message : Text }}
type TokenInterface = actor { icrc1_name : shared query () -> async Text; icrc1_symbol : shared query () -> async Text; icrc1_decimals : shared query () -> async Nat8; icrc1_fee : shared query () -> async Balance; icrc1_metadata : shared query () -> async MetaData; icrc1_total_supply : shared query () -> async Balance; icrc1_minting_account : shared query () -> async ?Account; icrc1_balance_of : shared query (Account) -> async Balance; icrc1_transfer : shared (TransferArgs) -> async TransferResult; icrc1_supported_standards : shared query () -> async [SupportedStandard] }
Interface for the ICRC token canister
type ArchiveInterface = actor { append_transactions : shared ([Transaction]) -> async Result.Result<(), Text>; total_transactions : shared query () -> async Nat; get_transaction : shared query (TxIndex) -> async ?Transaction; get_transactions : shared query (GetTransactionsRequest) -> async TransactionRange; remaining_capacity : shared query () -> async Nat }
The Interface for the Archive canister
type InitArgs = { name : Text; symbol : Text; decimals : Nat8; fee : Balance; minting_account : Account; max_supply : Balance; initial_balances : [(Account, Balance)]; min_burn_amount : Balance; advanced_settings : ?AdvancedSettings }
Initial arguments for the setting up the icrc1 token canister
type AdvancedSettings = { burned_tokens : Balance; transaction_window : Timestamp; permitted_drift : Timestamp }
Additional settings for the InitArgs type during initialization of an icrc1 token canister
type ArchiveData = { var canister : ArchiveInterface; var stored_txs : Nat }
The details of the archive canister
type GetTransactionsRequest = { start : TxIndex; length : Nat }
The type to request a range of transactions from the ledger canister
type TransactionRange = { transactions : [Transaction] }
Functions supported by the rosetta
Interface of the ICRC token and Rosetta canister