@safik/fk-plug-controller
Version:
Internet Computer Plug wallet's controller
71 lines (70 loc) • 1.71 kB
TypeScript
import type { Principal } from '@dfinity/principal';
export interface NotifyArgs {
'canister_id': Principal;
'method_name': string;
}
export interface TokenMetaData {
'features': Array<string>;
'name': string;
'decimal': number;
'symbol': string;
}
export interface StandardToken extends TokenMetaData {
canisterId: string;
}
export interface TokenBalance {
name: string;
symbol: string;
amount: bigint;
canisterId: string | null;
}
export declare type TransactionId = bigint;
export declare type BurnError = {
'InsufficientBalance': null;
} | {
'InvalidTokenContract': null;
} | {
'NotSufficientLiquidity': null;
};
export declare type BurnResult = {
'Ok': TransactionId;
} | {
'Err': BurnError;
};
export declare type TransferError = {
'CallFailed': null;
} | {
'InsufficientBalance': null;
} | {
'Unknown': null;
} | {
'AmountTooLarge': null;
};
export declare type TransferResult = {
'Ok': TransactionId;
} | {
'Err': TransferError;
};
export declare type TxReceipt = {
'Ok': bigint;
} | {
'Err': {
'InsufficientAllowance': null;
'InsufficientBalance': null;
};
};
export default interface _SERVICE {
'meta': () => Promise<TokenMetaData>;
'meta_certified': () => Promise<TokenMetaData>;
'balance': (arg_0: [] | [Principal]) => Promise<bigint>;
'burn': (arg_0: {
canister_id: Principal;
amount: bigint;
}) => Promise<BurnResult>;
'transfer': (arg_0: {
'to': Principal;
'from': [] | [Principal];
'amount': bigint;
}) => Promise<TransferResult>;
'transferErc20': (to: Principal, amount: bigint) => Promise<TxReceipt>;
}