UNPKG

@volare.finance/utils.js

Version:
48 lines (47 loc) 2.38 kB
/** * @file erc1155.ts * @author astra <astra@volare.finance> * @date 2022 */ import { TransactionResponse } from '@ethersproject/providers'; import { ContractInterface, Wallet } from 'ethers'; import { Provider } from '../provider'; import { Address, BigNumber, Sym } from '../type'; export interface IERC1155 { address: Address; name: string; symbol: Sym; } export interface IERC1155Metadata { name: string; description: string; image: string; external_url: string; attributes: Array<{ trait_type: string; value: any; display_type?: string; }>; } export declare class ERC1155 extends Provider { static TransferSingle_t0: string; static TransferBatch_t0: string; static ApprovalForAll_t0: string; static URI_t0: string; static ABI(): ContractInterface; static SafeTransferFrom(contract: Address, wallet: Wallet, from: Address, to: Address, id: number, value: BigNumber, data: string): Promise<TransactionResponse>; static SafeBatchTransferFrom(contract: Address, wallet: Wallet, from: Address, to: Address, ids: number[], values: BigNumber[], data: string): Promise<TransactionResponse>; static BalanceOf(contract: Address, owner: Address, id: number): Promise<BigNumber>; static BalanceOfBatch(contract: Address, owners: Address[], ids: number[]): Promise<BigNumber[]>; static SetApprovalForAll(contract: Address, wallet: Wallet, operator: Address, approved: boolean): Promise<TransactionResponse>; static IsApprovedForAll(contract: Address, owner: Address, operator: Address): Promise<boolean>; static URI(contract: Address, id: number): Promise<string>; constructor(contract: Address, endpoint: string); safeTransferFrom(wallet: Wallet, from: Address, to: Address, id: number, value: BigNumber, data: string): Promise<TransactionResponse>; safeBatchTransferFrom(wallet: Wallet, from: Address, to: Address, ids: number[], values: BigNumber[], data: string): Promise<TransactionResponse>; balanceOf(owner: Address, id: number): Promise<BigNumber>; balanceOfBatch(owners: Address[], ids: number[]): Promise<BigNumber[]>; setApprovalForAll(wallet: Wallet, operator: Address, approved: boolean): Promise<TransactionResponse>; isApprovedForAll(owner: Address, operator: Address): Promise<boolean>; uri(id: number): Promise<string>; }