@subwallet/invariant-vara-sdk
Version:
<div align="center"> <h1>⚡Invariant protocol⚡</h1> <p> <a href="https://invariant.app/math-spec-vara.pdf">MATH SPEC 📄</a> | <a href="https://discord.gg/VzS3C9wR">DISCORD 🌐</a> | </p> </div>
57 lines (56 loc) • 3.44 kB
TypeScript
import { GearApi, HexString } from '@gear-js/api';
import { TypeRegistry } from '@polkadot/types';
import { TransactionBuilder, ActorId } from 'sails-js';
export declare class Erc20Token {
api: GearApi;
private _programId?;
readonly registry: TypeRegistry;
readonly vft: Vft;
constructor(api: GearApi, _programId?: `0x${string}` | undefined);
get programId(): `0x${string}`;
newCtorFromCode(code: Uint8Array | Buffer | HexString, name: string, symbol: string, decimals: number): TransactionBuilder<null>;
newCtorFromCodeId(codeId: `0x${string}`, name: string, symbol: string, decimals: number): TransactionBuilder<null>;
}
export declare class Vft {
private _program;
constructor(_program: Erc20Token);
burn(from: ActorId, value: number | string | bigint): TransactionBuilder<boolean>;
grantAdminRole(to: ActorId): TransactionBuilder<null>;
grantBurnerRole(to: ActorId): TransactionBuilder<null>;
grantMinterRole(to: ActorId): TransactionBuilder<null>;
mint(to: ActorId, value: number | string | bigint): TransactionBuilder<boolean>;
revokeAdminRole(from: ActorId): TransactionBuilder<null>;
revokeBurnerRole(from: ActorId): TransactionBuilder<null>;
revokeMinterRole(from: ActorId): TransactionBuilder<null>;
setTransferFail(flag: boolean): TransactionBuilder<null>;
transfer(to: ActorId, value: number | string | bigint): TransactionBuilder<boolean>;
transferFrom(from: ActorId, to: ActorId, value: number | string | bigint): TransactionBuilder<boolean>;
approve(spender: ActorId, value: number | string | bigint): TransactionBuilder<boolean>;
admins(originAddress?: string, value?: number | string | bigint, atBlock?: `0x${string}`): Promise<Array<ActorId>>;
burners(originAddress?: string, value?: number | string | bigint, atBlock?: `0x${string}`): Promise<Array<ActorId>>;
minters(originAddress?: string, value?: number | string | bigint, atBlock?: `0x${string}`): Promise<Array<ActorId>>;
allowance(owner: ActorId, spender: ActorId, originAddress?: string, value?: number | string | bigint, atBlock?: `0x${string}`): Promise<bigint>;
balanceOf(account: ActorId, originAddress?: string, value?: number | string | bigint, atBlock?: `0x${string}`): Promise<bigint>;
decimals(originAddress?: string, value?: number | string | bigint, atBlock?: `0x${string}`): Promise<number>;
name(originAddress?: string, value?: number | string | bigint, atBlock?: `0x${string}`): Promise<string>;
symbol(originAddress?: string, value?: number | string | bigint, atBlock?: `0x${string}`): Promise<string>;
totalSupply(originAddress?: string, value?: number | string | bigint, atBlock?: `0x${string}`): Promise<bigint>;
subscribeToMintedEvent(callback: (data: {
to: ActorId;
value: number | string | bigint;
}) => void | Promise<void>): Promise<() => void>;
subscribeToBurnedEvent(callback: (data: {
from: ActorId;
value: number | string | bigint;
}) => void | Promise<void>): Promise<() => void>;
subscribeToApprovalEvent(callback: (data: {
owner: ActorId;
spender: ActorId;
value: number | string | bigint;
}) => void | Promise<void>): Promise<() => void>;
subscribeToTransferEvent(callback: (data: {
from: ActorId;
to: ActorId;
value: number | string | bigint;
}) => void | Promise<void>): Promise<() => void>;
}