@skalenetwork/ima-js
Version:
Simple TS/JS library to interact with SKALE IMA
53 lines (52 loc) • 3.44 kB
TypeScript
/**
* @license
* SKALE ima-js
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* @file index.ts
* @copyright SKALE Labs 2021-Present
*/
import { type Contract, type Provider, type TransactionResponse } from 'ethers';
import MainnetChain from './MainnetChain';
import SChain from './SChain';
import type TxOpts from './TxOpts';
export { default as MainnetChain } from './MainnetChain';
export { default as SChain } from './SChain';
export * as helper from './helper';
export { default as TimeoutException } from './exceptions/TimeoutException';
export { ERC_ABIS } from './contracts/tokens';
export declare class IMA {
mainnet: MainnetChain;
schain: SChain;
constructor(mainnetProvider: Provider, sChainProvider: Provider, mainnetAbi: any, sChainAbi: any);
addERC20Token(tokenName: string, mainnetContract: Contract, sChainContact: Contract): void;
addERC721Token(tokenName: string, mainnetContract: Contract, sChainContact: Contract): void;
addERC721WithMetadataToken(tokenName: string, mainnetContract: Contract, sChainContact: Contract): void;
addERC1155Token(tokenName: string, mainnetContract: Contract, sChainContact: Contract): void;
depositERC20(chainName: string, tokenName: string, amount: bigint, opts: TxOpts): Promise<TransactionResponse>;
withdrawERC20(tokenName: string, amount: bigint, opts: TxOpts): Promise<TransactionResponse>;
depositERC721(chainName: string, tokenName: string, tokenId: number, opts: TxOpts): Promise<TransactionResponse>;
withdrawERC721(tokenName: string, tokenId: number, opts: TxOpts): Promise<TransactionResponse>;
depositERC721WithMetadata(chainName: string, tokenName: string, tokenId: number, opts: TxOpts): Promise<TransactionResponse>;
withdrawERC721Meta(tokenName: string, tokenId: number, opts: TxOpts): Promise<TransactionResponse>;
depositERC1155(chainName: string, tokenName: string, tokenIds: number | number[], amounts: bigint | bigint[], opts: TxOpts): Promise<TransactionResponse>;
withdrawERC1155(tokenName: string, tokenIds: number | number[], amounts: bigint | bigint[], opts: TxOpts): Promise<TransactionResponse>;
linkERC20Token(chainName: string, originChainName: string, erc20OnMainnet: string, erc20OnSchain: string, opts: TxOpts): Promise<void>;
linkERC721Token(chainName: string, originChainName: string, erc721OnMainnet: string, erc721OnSchain: string, opts: TxOpts): Promise<void>;
linkERC721TokenWithMetadata(chainName: string, originChainName: string, erc721OnMainnet: string, erc721OnSchain: string, opts: TxOpts): Promise<void>;
linkERC1155Token(chainName: string, originChainName: string, erc1155OnMainnet: string, erc1155OnSchain: string, opts: TxOpts): Promise<void>;
connectSchain(chainName: string, opts: TxOpts): Promise<TransactionResponse>;
}