@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>
32 lines (31 loc) • 2.28 kB
TypeScript
import { GearApi, HexString } from '@gear-js/api';
import { KeyringPair } from '@polkadot/keyring/types';
import { ActorId, Signer } from './utils.js';
import { TransactionWrapper } from './utils.js';
export declare class FungibleToken {
private readonly gasLimit;
private readonly erc20;
private admin?;
private constructor();
static deploy(api: GearApi, deployer: KeyringPair, name?: string, symbol?: string, decimals?: bigint, gasLimit?: bigint): Promise<`0x${string}`>;
static load(api: GearApi, gasLimit?: bigint): Promise<FungibleToken>;
programId(): HexString;
setAdmin(admin: KeyringPair): void;
allowance(owner: ActorId, spender: ActorId, tokenAddress: HexString): Promise<bigint>;
balanceOf(owner: ActorId, tokenAddress: HexString): Promise<bigint>;
decimals(tokenAddress: HexString): Promise<bigint>;
name(tokenAddress: HexString): Promise<string>;
symbol(tokenAddress: HexString): Promise<string>;
totalSupply(tokenAddress: HexString): Promise<bigint>;
approveTx(spender: ActorId, amount: bigint, tokenAddress: HexString, gasLimit?: bigint): Promise<TransactionWrapper<boolean>>;
approve(owner: Signer, spender: ActorId, amount: bigint, tokenAddress: HexString): Promise<boolean>;
burnTx(account: ActorId, amount: bigint, tokenAddress: HexString, gasLimit?: bigint): Promise<TransactionWrapper<boolean>>;
burn(account: ActorId, amount: bigint, tokenAddress: HexString): Promise<boolean>;
mintTx(account: ActorId, amount: bigint, tokenAddress: HexString, gasLimit?: bigint): Promise<TransactionWrapper<boolean>>;
mint(account: ActorId, amount: bigint, tokenAddress: HexString): Promise<boolean>;
setTransferFail(flag: boolean, tokenAddress: HexString, gasLimit?: bigint): Promise<null>;
transferTx(to: ActorId, amount: bigint, tokenAddress: HexString, gasLimit?: bigint): Promise<TransactionWrapper<boolean>>;
transfer(signer: Signer, to: ActorId, amount: bigint, tokenAddress: HexString): Promise<boolean>;
transferFromTx(from: ActorId, to: ActorId, amount: bigint, tokenAddress: HexString, gasLimit?: bigint): Promise<TransactionWrapper<boolean>>;
transferFrom(signer: Signer, from: ActorId, to: ActorId, amount: bigint, tokenAddress: HexString): Promise<boolean>;
}