/// declare module "@ijstech/eth-wallet/web3.ts" { import { BigNumber } from 'bignumber.js'; export type Hex = string | number; export type Unit = 'noether' | 'wei' | 'kwei' | 'Kwei' | 'babbage' | 'femtoether' | 'mwei' | 'Mwei' | 'lovelace' | 'picoether' | 'gwei' | 'Gwei' | 'shannon' | 'nanoether' | 'nano' | 'szabo' | 'microether' | 'micro' | 'finney' | 'milliether' | 'milli' | 'ether' | 'kether' | 'grand' | 'mether' | 'gether' | 'tether'; export type Mixed = string | number | BigNumber | { type: string; value: string; } | { t: string; v: string | BigNumber | number; } | boolean; export interface Units { noether: string; wei: string; kwei: string; Kwei: string; babbage: string; femtoether: string; mwei: string; Mwei: string; lovelace: string; picoether: string; gwei: string; Gwei: string; shannon: string; nanoether: string; nano: string; szabo: string; microether: string; micro: string; finney: string; milliether: string; milli: string; ether: string; kether: string; grand: string; mether: string; gether: string; tether: string; } export interface Utils { isBN(value: string | number): boolean; isBigNumber(value: BigNumber): boolean; toBN(value: number | string): BigNumber; toTwosComplement(value: number | string | BigNumber): string; isAddress(address: string, chainId?: number): boolean; isHex(hex: Hex): boolean; isHexStrict(hex: Hex): boolean; asciiToHex(string: string, length?: number): string; hexToAscii(string: string): string; toAscii(string: string): string; bytesToHex(bytes: number[]): string; numberToHex(value: number | string | BigNumber): string; checkAddressChecksum(address: string, chainId?: number): boolean; fromAscii(string: string): string; fromDecimal(value: string | number): string; fromUtf8(string: string): string; fromWei(value: string | BigNumber, unit?: Unit): string; hexToBytes(hex: Hex): number[]; hexToNumber(hex: Hex, bigIntOnOverflow?: boolean): number | string; hexToNumberString(hex: Hex): string; hexToString(hex: Hex): string; hexToUtf8(string: string): string; keccak256(value: string | BigNumber): string; padLeft(value: string | number, characterAmount: number, sign?: string): string; padRight(string: string | number, characterAmount: number, sign?: string): string; leftPad(string: string | number, characterAmount: number, sign?: string): string; rightPad(string: string | number, characterAmount: number, sign?: string): string; sha3(value: string | BigNumber): string | null; randomHex(bytesSize: number): string; utf8ToHex(string: string): string; stringToHex(string: string): string; toChecksumAddress(address: string, chainId?: number): string; toDecimal(hex: Hex): number; toHex(value: number | string | BigNumber): string; toUtf8(string: string): string; toWei(val: BigNumber, unit?: Unit): BigNumber; toWei(val: string, unit?: Unit): string; isBloom(bloom: string): boolean; isInBloom(bloom: string, value: string | Uint8Array): boolean; isUserEthereumAddressInBloom(bloom: string, ethereumAddress: string): boolean; isContractAddressInBloom(bloom: string, contractAddress: string): boolean; isTopicInBloom(bloom: string, topic: string): boolean; isTopic(topic: string): boolean; _jsonInterfaceMethodToString(abiItem: AbiItem): string; soliditySha3(...val: Mixed[]): string | null; soliditySha3Raw(...val: Mixed[]): string; encodePacked(...val: Mixed[]): string | null; getUnitValue(unit: Unit): string; unitMap(): Units; testAddress(bloom: string, address: string): boolean; testTopic(bloom: string, topic: string): boolean; getSignatureParameters(signature: string): { r: string; s: string; v: number; }; stripHexPrefix(str: string): string; toNumber(value: number | string | BigNumber, bigIntOnOverflow?: boolean): number | string; } export interface HttpHeader { name: string; value: string; } export interface HttpProviderOptions { keepAlive?: boolean; timeout?: number; headers?: HttpHeader[]; withCredentials?: boolean; agent?: HttpAgent; } export interface HttpAgent { http?: string; https?: string; baseUrl?: string; } export interface HttpProvider { constructor(host: string, options?: HttpProviderOptions): any; host: string; connected: boolean; supportsSubscriptions(): boolean; send(payload: any, callback: (error: Error | null, result?: any) => void): void; disconnect(): boolean; } export interface ReconnectOptions { auto?: boolean; delay?: number; maxAttempts?: number; onTimeout?: boolean; } export interface WebsocketProviderOptions { host?: string; timeout?: number; reconnectDelay?: number; headers?: any; protocol?: string; clientConfig?: object; requestOptions?: any; origin?: string; reconnect?: ReconnectOptions; } export interface JsonRpcPayload { jsonrpc: string; method: string; params?: any[]; id?: string | number; } export interface RequestItem { payload: JsonRpcPayload; callback: (error: any, result: any) => void; } export interface JsonRpcResponse { jsonrpc: string; id: string | number; result?: any; error?: { readonly code?: number; readonly data?: unknown; readonly message: string; }; } export interface WebsocketProvider { constructor(host: string, options?: WebsocketProviderOptions): any; isConnecting(): boolean; requestQueue: Map; responseQueue: Map; connected: boolean; connection: any; supportsSubscriptions(): boolean; send(payload: JsonRpcPayload, callback: (error: Error | null, result?: JsonRpcResponse) => void): void; on(type: string, callback: () => void): void; once(type: string, callback: () => void): void; removeListener(type: string, callback: () => void): void; removeAllListeners(type: string): void; reset(): void; disconnect(code?: number, reason?: string): void; connect(): void; reconnect(): void; } export interface RequestArguments { method: string; params?: any; [key: string]: any; } export interface AbstractProvider { sendAsync(payload: JsonRpcPayload, callback?: (error: Error | null, result?: JsonRpcResponse) => Promise | void): void; send?(payload: JsonRpcPayload, callback: (error: Error | null, result?: JsonRpcResponse) => unknown): void; request?(args: RequestArguments): Promise; connected?: boolean; } export type provider = HttpProvider | WebsocketProvider | AbstractProvider | string | null; export interface AbiInput { name: string; type: string; indexed?: boolean; components?: AbiInput[]; internalType?: string; } export interface AbiOutput { name: string; type: string; components?: AbiOutput[]; internalType?: string; } export type AbiType = 'function' | 'constructor' | 'event' | 'fallback' | 'receive'; export type StateMutabilityType = 'pure' | 'view' | 'nonpayable' | 'payable'; export interface AbiItem { anonymous?: boolean; constant?: boolean; inputs?: AbiInput[]; name?: string; outputs?: AbiOutput[]; payable?: boolean; stateMutability?: StateMutabilityType; type: AbiType; gas?: number; } export interface ContractOptions { from?: string; gasPrice?: string; gas?: number; data?: string; } export type chain = 'mainnet' | 'goerli' | 'kovan' | 'rinkeby' | 'ropsten'; export type hardfork = 'chainstart' | 'homestead' | 'dao' | 'tangerineWhistle' | 'spuriousDragon' | 'byzantium' | 'constantinople' | 'petersburg' | 'istanbul'; export interface CustomChainParams { name?: string; networkId: number; chainId: number; } export interface Common { customChain: CustomChainParams; baseChain?: chain; hardfork?: hardfork; } export interface TransactionConfig { from?: string | number; to?: string; value?: number | string | BigNumber; gas?: number | string; gasPrice?: number | string | BigNumber; maxPriorityFeePerGas?: number | string | BigNumber; maxFeePerGas?: number | string | BigNumber; data?: string; nonce?: number; chainId?: number; common?: Common; chain?: string; hardfork?: string; } export interface SignedTransaction { messageHash?: string; r: string; s: string; v: string; rawTransaction?: string; transactionHash?: string; } export interface Sign extends SignedTransaction { message: string; signature: string; } export interface EncryptedKeystoreV3Json { version: number; id: string; address: string; crypto: { ciphertext: string; cipherparams: { iv: string; }; cipher: string; kdf: string; kdfparams: { dklen: number; salt: string; n: number; r: number; p: number; }; mac: string; }; } export interface Account { address: string; privateKey: string; signTransaction: (transactionConfig: TransactionConfig) => Promise; sign: (data: string) => Sign; encrypt: (password: string) => EncryptedKeystoreV3Json; } export interface SignatureObject { messageHash: string; r: string; s: string; v: string; } export interface AddedAccount extends Account { index: number; } export interface AddAccount { address: string; privateKey: string; } export interface WalletBase { constructor(accounts: Accounts): any; length: number; defaultKeyName: string; [key: number]: Account; create(numberOfAccounts: number, entropy?: string): WalletBase; add(account: string | AddAccount): AddedAccount; remove(account: string | number): boolean; clear(): WalletBase; encrypt(password: string): EncryptedKeystoreV3Json[]; decrypt(keystoreArray: EncryptedKeystoreV3Json[], password: string): WalletBase; save(password: string, keyName?: string): boolean; load(password: string, keyName?: string): WalletBase; } export interface Accounts { constructor(provider?: provider): any; readonly givenProvider: any; readonly currentProvider: provider; setProvider(provider: provider): boolean; create(entropy?: string): Account; privateKeyToAccount(privateKey: string, ignoreLength?: boolean): Account; signTransaction(transactionConfig: TransactionConfig, privateKey: string): Promise; recoverTransaction(signature: string): string; hashMessage(message: string): string; sign(data: string, privateKey: string): Sign; recover(signatureObject: SignatureObject): string; recover(message: string, signature: string, preFixed?: boolean): string; recover(message: string, v: string, r: string, s: string, preFixed?: boolean): string; encrypt(privateKey: string, password: string): EncryptedKeystoreV3Json; decrypt(keystoreJsonV3: EncryptedKeystoreV3Json, password: string): Account; wallet: WalletBase; } export type BlockNumber = bigint | string | number | BigNumber | 'latest' | 'pending' | 'earliest' | 'genesis' | 'finalized' | 'safe'; export interface Options extends ContractOptions { address: string; jsonInterface: AbiItem[]; } export interface DeployOptions { data: string; arguments?: any[]; } export interface SendOptions { from: string; gasPrice?: string; gas?: number; value?: number | string | BigNumber; nonce?: number; } export interface EventLog { event: string; address: string; returnValues: any; logIndex: bigint; transactionIndex: bigint; transactionHash: string; blockHash: string; blockNumber: bigint; raw?: { data: string; topics: any[]; }; } export interface Log { address: string; data: string; topics: string[]; logIndex: bigint; transactionIndex: bigint; transactionHash: string; blockHash: string; blockNumber: bigint; removed: boolean; } export interface TransactionReceipt { status: bigint; transactionHash: string; transactionIndex: bigint; blockHash: string; blockNumber: bigint; from: string; to: string; contractAddress?: string; cumulativeGasUsed: bigint; gasUsed: bigint; effectiveGasPrice: bigint; logs: Log[]; logsBloom: string; events?: { [eventName: string]: EventLog; }; } export interface ConfirmationObject { confirmationNumber: bigint; receipt: TransactionReceipt; latestBlockHash: string; } export interface PromiEvent extends Promise { once(type: 'sending', handler: (payload: object) => void): PromiEvent; once(type: 'sent', handler: (payload: object) => void): PromiEvent; once(type: 'transactionHash', handler: (transactionHash: string) => void): PromiEvent; once(type: 'receipt', handler: (receipt: TransactionReceipt) => void): PromiEvent; once(type: 'confirmation', handler: (confirmationObject: ConfirmationObject) => void): PromiEvent; once(type: 'error', handler: (error: Error) => void): PromiEvent; once(type: 'error' | 'confirmation' | 'receipt' | 'transactionHash' | 'sent' | 'sending', handler: (error: Error | TransactionReceipt | string | object) => void): PromiEvent; on(type: 'sending', handler: (payload: object) => void): PromiEvent; on(type: 'sent', handler: (payload: object) => void): PromiEvent; on(type: 'transactionHash', handler: (receipt: string) => void): PromiEvent; on(type: 'receipt', handler: (receipt: TransactionReceipt) => void): PromiEvent; on(type: 'confirmation', handler: (confirmationObject: ConfirmationObject) => void): PromiEvent; on(type: 'error', handler: (error: Error) => void): PromiEvent; on(type: 'error' | 'confirmation' | 'receipt' | 'transactionHash' | 'sent' | 'sending', handler: (error: Error | TransactionReceipt | string | object) => void): PromiEvent; } export interface CallOptions { from?: string; gasPrice?: string; gas?: bigint; } export interface EstimateGasOptions { from?: string; gas?: bigint; value?: number | string | BigNumber; } export interface ContractSendMethod { send(options: SendOptions): PromiEvent; call(options?: CallOptions): Promise; estimateGas(options: EstimateGasOptions): Promise; estimateGas(): Promise; estimateGas(options: EstimateGasOptions): Promise; estimateGas(options: EstimateGasOptions): Promise; estimateGas(): Promise; encodeABI(): string; } export interface EventData { returnValues: { [key: string]: any; }; raw: { data: string; topics: string[]; }; event: string; signature: string; logIndex: bigint; transactionIndex: bigint; transactionHash: string; blockHash: string; blockNumber: bigint; address: string; } export interface Filter { [key: string]: number | string | string[] | number[]; } export interface LogsOptions { fromBlock?: BlockNumber; address?: string | string[]; topics?: Array; } export interface EventOptions extends LogsOptions { filter?: Filter; } export interface PastLogsOptions extends LogsOptions { toBlock?: BlockNumber; } export interface PastEventOptions extends PastLogsOptions { filter?: Filter; } export interface Contract { constructor(jsonInterface: AbiItem[], address?: string, options?: ContractOptions): any; setProvider(provider: provider, accounts?: Accounts): void; defaultAccount: string | null; defaultBlock: BlockNumber; defaultCommon: Common; defaultHardfork: hardfork; defaultChain: chain; transactionPollingTimeout: number; transactionConfirmationBlocks: number; transactionBlockTimeout: number; handleRevert: boolean; options: Options; clone(): Contract; deploy(options: DeployOptions): ContractSendMethod; methods: any; once(event: string, callback: (error: Error, event: EventData) => void): void; once(event: string, options: EventOptions, callback: (error: Error, event: EventData) => void): void; events: any; getPastEvents(event: string): Promise; getPastEvents(event: string, options: PastEventOptions): Promise; getPastEvents(event: string, options: PastEventOptions): Promise; getPastEvents(event: string): Promise; } export interface IndirectOptions { institution: string; identifier: string; } export interface Iban { constructor(iban: string): any; toAddress(iban: string): string; toIban(address: string): string; fromAddress(address: string): Iban; fromBban(bban: string): Iban; createIndirect(options: IndirectOptions): Iban; isValid(iban: string): boolean; isValid(): boolean; isDirect(): boolean; isIndirect(): boolean; checksum(): string; institution(): string; client(): string; toAddress(): string; toString(): string; } export interface Method { name: string; call: string; params?: number; inputFormatter?: Array<(() => void) | null>; outputFormatter?: () => void; transformPayload?: () => void; extraFormatters?: any; defaultBlock?: string; defaultAccount?: string | null; abiCoder?: any; handleRevert?: boolean; } export interface BatchRequest { constructor(): any; add(method: Method): void; execute(): void; } export interface Extension { property?: string; methods: Method[]; } export interface RLPEncodedTransaction { raw: string; tx: { nonce: string; gasPrice: string; gas: string; to: string; value: string; input: string; r: string; s: string; v: string; hash: string; }; } export interface Personal { constructor(provider?: provider): any; readonly givenProvider: any; readonly currentProvider: provider; defaultAccount: string | null; defaultBlock: string | number; BatchRequest: new () => BatchRequest; setProvider(provider: provider): boolean; extend(extension: Extension): any; newAccount(password: string): Promise; sign(dataToSign: string, address: string, password: string): Promise; ecRecover(dataThatWasSigned: string, signature: string): Promise; signTransaction(transactionConfig: TransactionConfig, password: string): Promise; sendTransaction(transactionConfig: TransactionConfig, password: string): Promise; unlockAccount(address: string, password: string, unlockDuration: number): Promise; lockAccount(address: string): Promise; getAccounts(): Promise; importRawKey(privateKey: string, password: string): Promise; } export interface AbiCoder { encodeFunctionSignature(functionName: string | AbiItem): string; encodeEventSignature(functionName: string | AbiItem): string; encodeParameter(type: any, parameter: any): string; encodeParameters(types: any[], paramaters: any[]): string; encodeFunctionCall(abiItem: AbiItem, params: string[]): string; decodeParameter(type: any, hex: string): { [key: string]: any; }; decodeParameters(types: any[], hex: string): { [key: string]: any; }; decodeLog(inputs: AbiInput[], hex: string, topics: string[]): { [key: string]: string; }; } export interface Providers { HttpProvider: new (host: string, options?: HttpProviderOptions) => HttpProvider; WebsocketProvider: new (host: string, options?: WebsocketProviderOptions) => WebsocketProvider; IpcProvider: new (path: string, net: any) => any; } export interface Network { constructor(provider?: provider): any; readonly givenProvider: any; readonly currentProvider: provider; readonly providers: Providers; BatchRequest: new () => BatchRequest; setProvider(provider: provider): boolean; extend(extension: Extension): any; getNetworkType(): Promise; } export interface SubscriptionOptions { subscription: string; type: string; requestManager: any; } export interface Subscription { constructor(options: SubscriptionOptions): any; id: string; options: SubscriptionOptions; callback: () => void; arguments: any; lastBlock: number; subscribe(callback?: (error: Error, result: T) => void): Subscription; unsubscribe(callback?: (error: Error, result: boolean) => void): Promise; on(type: 'data', handler: (data: T) => void): Subscription; on(type: 'changed', handler: (data: T) => void): Subscription; on(type: 'connected', handler: (subscriptionId: string) => void): Subscription; on(type: 'error', handler: (data: Error) => void): Subscription; } export interface Syncing { StartingBlock: number; CurrentBlock: number; HighestBlock: number; KnownStates: number; PulledStates: number; } export interface BlockHeader { number: bigint; hash: string; parentHash: string; nonce: string; sha3Uncles: string; logsBloom: string; transactionsRoot: string; stateRoot: string; receiptsRoot: string; miner: string; extraData: string; gasLimit: bigint; gasUsed: bigint; timestamp: bigint; baseFeePerGas?: bigint; } export interface FeeHistoryResult { baseFeePerGas: string[]; gasUsedRatio: number[]; oldestBlock: bigint; reward: string[][]; } export interface BlockTransactionBase extends BlockHeader { size: bigint; difficulty: bigint; totalDifficulty: bigint; uncles: string[]; } export interface BlockTransactionString extends BlockTransactionBase { transactions: string[]; } export interface AccessTuple { address: string; storageKeys: string[]; } export type AccessList = AccessTuple[]; export interface Transaction { hash: string; nonce: bigint; blockHash: string | null; blockNumber: bigint | null; transactionIndex: bigint | null; from: string; to: string | null; value: string; gasPrice: string; maxPriorityFeePerGas?: bigint | string | BigNumber; maxFeePerGas?: bigint | string | BigNumber; gas: bigint; input: string; chainId?: string; accessList?: AccessList; v?: string; r?: string; s?: string; } export interface BlockTransactionObject extends BlockTransactionBase { transactions: Transaction[]; } export interface CreateAccessList { accessList: AccessTuple[]; error?: string; gasUsed: string; } export interface Eth { constructor(provider?: provider): any; Contract: new (jsonInterface: AbiItem[] | AbiItem, address?: string, options?: ContractOptions) => Contract; Iban: new (iban: string) => Iban; personal: Personal; accounts: Accounts; ens: any; abi: AbiCoder; net: Network; readonly givenProvider: any; defaultAccount: string | null; defaultBlock: BlockNumber; defaultCommon: Common; defaultHardfork: hardfork; defaultChain: chain; transactionPollingTimeout: number; transactionConfirmationBlocks: number; transactionBlockTimeout: number; handleRevert: boolean; readonly currentProvider: provider; setProvider(provider: provider): boolean; BatchRequest: new () => BatchRequest; readonly providers: Providers; extend(extension: Extension): any; clearSubscriptions(callback: (error: Error, result: boolean) => void): void; subscribe(type: 'logs', options: LogsOptions): Subscription; subscribe(type: 'syncing'): Subscription; subscribe(type: 'newBlockHeaders'): Subscription; subscribe(type: 'pendingTransactions'): Subscription; getProtocolVersion(): Promise; isSyncing(): Promise; getCoinbase(): Promise; isMining(): Promise; getHashRate(): Promise; getNodeInfo(): Promise; getChainId(): Promise; getGasPrice(): Promise; getFeeHistory(blockCount: number | BigNumber | BigNumber | string, lastBlock: number | BigNumber | BigNumber | string, rewardPercentiles: number[]): Promise; getAccounts(): Promise; getBlockNumber(): Promise; getBalance(address: string): Promise; getBalance(address: string, defaultBlock: BlockNumber): Promise; getBalance(address: string): Promise; getBalance(address: string, defaultBlock: BlockNumber): Promise; getStorageAt(address: string, position: number | BigNumber | string): Promise; getStorageAt(address: string, position: number | BigNumber | string, defaultBlock: BlockNumber): Promise; getStorageAt(address: string, position: number | BigNumber | string): Promise; getStorageAt(address: string, position: number | BigNumber | string, defaultBlock: BlockNumber): Promise; getCode(address: string): Promise; getCode(address: string, defaultBlock: BlockNumber): Promise; getCode(address: string): Promise; getCode(address: string, defaultBlock: BlockNumber): Promise; getBlock(blockHashOrBlockNumber: BlockNumber | string): Promise; getBlock(blockHashOrBlockNumber: BlockNumber | string, returnTransactionObjects: false): Promise; getBlock(blockHashOrBlockNumber: BlockNumber | string, returnTransactionObjects: true): Promise; getBlock(blockHashOrBlockNumber: BlockNumber | string): Promise; getBlock(blockHashOrBlockNumber: BlockNumber | string, returnTransactionObjects: false): Promise; getBlock(blockHashOrBlockNumber: BlockNumber | string, returnTransactionObjects: true): Promise; getBlockTransactionCount(blockHashOrBlockNumber: BlockNumber | string): Promise; getBlockUncleCount(blockHashOrBlockNumber: BlockNumber | string): Promise; getUncle(blockHashOrBlockNumber: BlockNumber | string, uncleIndex: number | string | BigNumber): Promise; getUncle(blockHashOrBlockNumber: BlockNumber | string, uncleIndex: number | string | BigNumber, returnTransactionObjects: boolean): Promise; getUncle(blockHashOrBlockNumber: BlockNumber | string, uncleIndex: number | string | BigNumber): Promise; getUncle(blockHashOrBlockNumber: BlockNumber | string, uncleIndex: number | string | BigNumber, returnTransactionObjects: boolean): Promise; getTransaction(transactionHash: string): Promise; getPendingTransactions(): Promise; getTransactionFromBlock(blockHashOrBlockNumber: BlockNumber | string, indexNumber: number | string | BigNumber): Promise; getTransactionReceipt(hash: string): Promise; getTransactionCount(address: string): Promise; getTransactionCount(address: string, defaultBlock: BlockNumber): Promise; getTransactionCount(address: string): Promise; getTransactionCount(address: string, defaultBlock: BlockNumber): Promise; sendTransaction(transactionConfig: TransactionConfig): PromiEvent; sendSignedTransaction(signedTransactionData: string): PromiEvent; sign(dataToSign: string, address: string | number): Promise; signTransaction(transactionConfig: TransactionConfig): Promise; signTransaction(transactionConfig: TransactionConfig, address: string): Promise; signTransaction(transactionConfig: TransactionConfig, address: string): Promise; call(transactionConfig: TransactionConfig): Promise; call(transactionConfig: TransactionConfig, defaultBlock?: BlockNumber): Promise; call(transactionConfig: TransactionConfig): Promise; call(transactionConfig: TransactionConfig, defaultBlock: BlockNumber): Promise; estimateGas(transactionConfig: TransactionConfig): Promise; createAccessList(transactionConfig: TransactionConfig): Promise; createAccessList(transactionConfig: TransactionConfig, defaultBlock: BlockNumber): Promise; getPastLogs(options: PastLogsOptions): Promise; } export interface IWeb3 { eth: Eth; utils: Utils; currentProvider(): any; setProvider(provider: any): any; } export class Web3 implements IWeb3 { readonly eth: Eth; readonly utils: Utils; static utils: Utils; constructor(provider?: any); get currentProvider(): any; setProvider(provider: any): boolean; } } declare module "contracts/ERC1155/ERC1155.json" { const _default: { abi: ({ inputs: { internalType: string; name: string; type: string; }[]; stateMutability: string; type: string; anonymous?: undefined; name?: undefined; outputs?: undefined; } | { anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string; }[]; name: string; type: string; stateMutability?: undefined; outputs?: undefined; } | { inputs: { internalType: string; name: string; type: string; }[]; name: string; outputs: { internalType: string; name: string; type: string; }[]; stateMutability: string; type: string; anonymous?: undefined; })[]; bytecode: string; }; export default _default; } declare module "contracts/ERC1155/ERC1155" { import { IWallet, Contract as _Contract, TransactionReceipt, BigNumber, Event, TransactionOptions } from "@ijstech/eth-contract"; export interface IBalanceOfParams { account: string; id: number | BigNumber; } export interface IBalanceOfBatchParams { accounts: string[]; ids: (number | BigNumber)[]; } export interface IIsApprovedForAllParams { account: string; operator: string; } export interface ISafeBatchTransferFromParams { from: string; to: string; ids: (number | BigNumber)[]; amounts: (number | BigNumber)[]; data: string; } export interface ISafeTransferFromParams { from: string; to: string; id: number | BigNumber; amount: number | BigNumber; data: string; } export interface ISetApprovalForAllParams { operator: string; approved: boolean; } export class ERC1155 extends _Contract { static _abi: any; constructor(wallet: IWallet, address?: string); deploy(uri: string, options?: TransactionOptions): Promise; parseApprovalForAllEvent(receipt: TransactionReceipt): ERC1155.ApprovalForAllEvent[]; decodeApprovalForAllEvent(event: Event): ERC1155.ApprovalForAllEvent; parseTransferBatchEvent(receipt: TransactionReceipt): ERC1155.TransferBatchEvent[]; decodeTransferBatchEvent(event: Event): ERC1155.TransferBatchEvent; parseTransferSingleEvent(receipt: TransactionReceipt): ERC1155.TransferSingleEvent[]; decodeTransferSingleEvent(event: Event): ERC1155.TransferSingleEvent; parseURIEvent(receipt: TransactionReceipt): ERC1155.URIEvent[]; decodeURIEvent(event: Event): ERC1155.URIEvent; balanceOf: { (params: IBalanceOfParams, options?: TransactionOptions): Promise; }; balanceOfBatch: { (params: IBalanceOfBatchParams, options?: TransactionOptions): Promise; }; isApprovedForAll: { (params: IIsApprovedForAllParams, options?: TransactionOptions): Promise; }; safeBatchTransferFrom: { (params: ISafeBatchTransferFromParams, options?: TransactionOptions): Promise; call: (params: ISafeBatchTransferFromParams, options?: TransactionOptions) => Promise; txData: (params: ISafeBatchTransferFromParams, options?: TransactionOptions) => Promise; }; safeTransferFrom: { (params: ISafeTransferFromParams, options?: TransactionOptions): Promise; call: (params: ISafeTransferFromParams, options?: TransactionOptions) => Promise; txData: (params: ISafeTransferFromParams, options?: TransactionOptions) => Promise; }; setApprovalForAll: { (params: ISetApprovalForAllParams, options?: TransactionOptions): Promise; call: (params: ISetApprovalForAllParams, options?: TransactionOptions) => Promise; txData: (params: ISetApprovalForAllParams, options?: TransactionOptions) => Promise; }; supportsInterface: { (interfaceId: string, options?: TransactionOptions): Promise; }; uri: { (param1: number | BigNumber, options?: TransactionOptions): Promise; }; private assign; } export module ERC1155 { interface ApprovalForAllEvent { account: string; operator: string; approved: boolean; _event: Event; } interface TransferBatchEvent { operator: string; from: string; to: string; ids: BigNumber[]; values: BigNumber[]; _event: Event; } interface TransferSingleEvent { operator: string; from: string; to: string; id: BigNumber; value: BigNumber; _event: Event; } interface URIEvent { value: string; id: BigNumber; _event: Event; } } } declare module "contracts/ERC20/ERC20.json" { const _default_1: { abi: ({ inputs: { internalType: string; name: string; type: string; }[]; stateMutability: string; type: string; anonymous?: undefined; name?: undefined; outputs?: undefined; } | { anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string; }[]; name: string; type: string; stateMutability?: undefined; outputs?: undefined; } | { inputs: { internalType: string; name: string; type: string; }[]; name: string; outputs: { internalType: string; name: string; type: string; }[]; stateMutability: string; type: string; anonymous?: undefined; })[]; bytecode: string; }; export default _default_1; } declare module "contracts/ERC20/ERC20" { import { IWallet, Contract as _Contract, TransactionReceipt, BigNumber, Event, TransactionOptions } from "@ijstech/eth-contract"; export interface IDeployParams { name: string; symbol: string; } export interface IAllowanceParams { owner: string; spender: string; } export interface IApproveParams { spender: string; amount: number | BigNumber; } export interface IDecreaseAllowanceParams { spender: string; subtractedValue: number | BigNumber; } export interface IIncreaseAllowanceParams { spender: string; addedValue: number | BigNumber; } export interface ITransferParams { to: string; amount: number | BigNumber; } export interface ITransferFromParams { from: string; to: string; amount: number | BigNumber; } export class ERC20 extends _Contract { static _abi: any; constructor(wallet: IWallet, address?: string); deploy(params: IDeployParams, options?: TransactionOptions): Promise; parseApprovalEvent(receipt: TransactionReceipt): ERC20.ApprovalEvent[]; decodeApprovalEvent(event: Event): ERC20.ApprovalEvent; parseTransferEvent(receipt: TransactionReceipt): ERC20.TransferEvent[]; decodeTransferEvent(event: Event): ERC20.TransferEvent; allowance: { (params: IAllowanceParams, options?: TransactionOptions): Promise; }; approve: { (params: IApproveParams, options?: TransactionOptions): Promise; call: (params: IApproveParams, options?: TransactionOptions) => Promise; txData: (params: IApproveParams, options?: TransactionOptions) => Promise; }; balanceOf: { (account: string, options?: TransactionOptions): Promise; }; decimals: { (options?: TransactionOptions): Promise; }; decreaseAllowance: { (params: IDecreaseAllowanceParams, options?: TransactionOptions): Promise; call: (params: IDecreaseAllowanceParams, options?: TransactionOptions) => Promise; txData: (params: IDecreaseAllowanceParams, options?: TransactionOptions) => Promise; }; increaseAllowance: { (params: IIncreaseAllowanceParams, options?: TransactionOptions): Promise; call: (params: IIncreaseAllowanceParams, options?: TransactionOptions) => Promise; txData: (params: IIncreaseAllowanceParams, options?: TransactionOptions) => Promise; }; name: { (options?: TransactionOptions): Promise; }; symbol: { (options?: TransactionOptions): Promise; }; totalSupply: { (options?: TransactionOptions): Promise; }; transfer: { (params: ITransferParams, options?: TransactionOptions): Promise; call: (params: ITransferParams, options?: TransactionOptions) => Promise; txData: (params: ITransferParams, options?: TransactionOptions) => Promise; }; transferFrom: { (params: ITransferFromParams, options?: TransactionOptions): Promise; call: (params: ITransferFromParams, options?: TransactionOptions) => Promise; txData: (params: ITransferFromParams, options?: TransactionOptions) => Promise; }; private assign; } export module ERC20 { interface ApprovalEvent { owner: string; spender: string; value: BigNumber; _event: Event; } interface TransferEvent { from: string; to: string; value: BigNumber; _event: Event; } } } declare module "contracts/ERC721/ERC721.json" { const _default_2: { abi: ({ inputs: { internalType: string; name: string; type: string; }[]; stateMutability: string; type: string; anonymous?: undefined; name?: undefined; outputs?: undefined; } | { anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string; }[]; name: string; type: string; stateMutability?: undefined; outputs?: undefined; } | { inputs: { internalType: string; name: string; type: string; }[]; name: string; outputs: { internalType: string; name: string; type: string; }[]; stateMutability: string; type: string; anonymous?: undefined; })[]; bytecode: string; }; export default _default_2; } declare module "contracts/ERC721/ERC721" { import { IWallet, Contract as _Contract, TransactionReceipt, BigNumber, Event, TransactionOptions } from "@ijstech/eth-contract"; export interface IDeployParams { name: string; symbol: string; } export interface IApproveParams { to: string; tokenId: number | BigNumber; } export interface IIsApprovedForAllParams { owner: string; operator: string; } export interface ISafeTransferFromParams { from: string; to: string; tokenId: number | BigNumber; } export interface ISafeTransferFrom_1Params { from: string; to: string; tokenId: number | BigNumber; data: string; } export interface ISetApprovalForAllParams { operator: string; approved: boolean; } export interface ITransferFromParams { from: string; to: string; tokenId: number | BigNumber; } export class ERC721 extends _Contract { static _abi: any; constructor(wallet: IWallet, address?: string); deploy(params: IDeployParams, options?: TransactionOptions): Promise; parseApprovalEvent(receipt: TransactionReceipt): ERC721.ApprovalEvent[]; decodeApprovalEvent(event: Event): ERC721.ApprovalEvent; parseApprovalForAllEvent(receipt: TransactionReceipt): ERC721.ApprovalForAllEvent[]; decodeApprovalForAllEvent(event: Event): ERC721.ApprovalForAllEvent; parseTransferEvent(receipt: TransactionReceipt): ERC721.TransferEvent[]; decodeTransferEvent(event: Event): ERC721.TransferEvent; approve: { (params: IApproveParams, options?: TransactionOptions): Promise; call: (params: IApproveParams, options?: TransactionOptions) => Promise; txData: (params: IApproveParams, options?: TransactionOptions) => Promise; }; balanceOf: { (owner: string, options?: TransactionOptions): Promise; }; getApproved: { (tokenId: number | BigNumber, options?: TransactionOptions): Promise; }; isApprovedForAll: { (params: IIsApprovedForAllParams, options?: TransactionOptions): Promise; }; name: { (options?: TransactionOptions): Promise; }; ownerOf: { (tokenId: number | BigNumber, options?: TransactionOptions): Promise; }; safeTransferFrom: { (params: ISafeTransferFromParams, options?: TransactionOptions): Promise; call: (params: ISafeTransferFromParams, options?: TransactionOptions) => Promise; txData: (params: ISafeTransferFromParams, options?: TransactionOptions) => Promise; }; safeTransferFrom_1: { (params: ISafeTransferFrom_1Params, options?: TransactionOptions): Promise; call: (params: ISafeTransferFrom_1Params, options?: TransactionOptions) => Promise; txData: (params: ISafeTransferFrom_1Params, options?: TransactionOptions) => Promise; }; setApprovalForAll: { (params: ISetApprovalForAllParams, options?: TransactionOptions): Promise; call: (params: ISetApprovalForAllParams, options?: TransactionOptions) => Promise; txData: (params: ISetApprovalForAllParams, options?: TransactionOptions) => Promise; }; supportsInterface: { (interfaceId: string, options?: TransactionOptions): Promise; }; symbol: { (options?: TransactionOptions): Promise; }; tokenURI: { (tokenId: number | BigNumber, options?: TransactionOptions): Promise; }; transferFrom: { (params: ITransferFromParams, options?: TransactionOptions): Promise; call: (params: ITransferFromParams, options?: TransactionOptions) => Promise; txData: (params: ITransferFromParams, options?: TransactionOptions) => Promise; }; private assign; } export module ERC721 { interface ApprovalEvent { owner: string; approved: string; tokenId: BigNumber; _event: Event; } interface ApprovalForAllEvent { owner: string; operator: string; approved: boolean; _event: Event; } interface TransferEvent { from: string; to: string; tokenId: BigNumber; _event: Event; } } } declare module "contracts/MultiCall/MultiCall.json" { const _default_3: { abi: { inputs: ({ components: { internalType: string; name: string; type: string; }[]; internalType: string; name: string; type: string; } | { internalType: string; name: string; type: string; components?: undefined; })[]; name: string; outputs: { internalType: string; name: string; type: string; }[]; stateMutability: string; type: string; }[]; bytecode: string; }; export default _default_3; } declare module "contracts/MultiCall/MultiCall" { import { IWallet, Contract as _Contract, TransactionReceipt, BigNumber, TransactionOptions } from "@ijstech/eth-contract"; export interface IMulticallWithGasLimitationParams { calls: { to: string; data: string; }[]; gasBuffer: number | BigNumber; } export class MultiCall extends _Contract { static _abi: any; constructor(wallet: IWallet, address?: string); deploy(options?: TransactionOptions): Promise; gasLeft: { (options?: TransactionOptions): Promise; }; gaslimit: { (options?: TransactionOptions): Promise; }; multicall: { (calls: { to: string; data: string; }[], options?: TransactionOptions): Promise; call: (calls: { to: string; data: string; }[], options?: TransactionOptions) => Promise; txData: (calls: { to: string; data: string; }[], options?: TransactionOptions) => Promise; }; multicallWithGas: { (calls: { to: string; data: string; }[], options?: TransactionOptions): Promise; call: (calls: { to: string; data: string; }[], options?: TransactionOptions) => Promise<{ results: string[]; gasUsed: BigNumber[]; }>; txData: (calls: { to: string; data: string; }[], options?: TransactionOptions) => Promise; }; multicallWithGasLimitation: { (params: IMulticallWithGasLimitationParams, options?: TransactionOptions): Promise; call: (params: IMulticallWithGasLimitationParams, options?: TransactionOptions) => Promise<{ results: string[]; lastSuccessIndex: BigNumber; }>; txData: (params: IMulticallWithGasLimitationParams, options?: TransactionOptions) => Promise; }; private assign; } } /// declare module "@ijstech/eth-wallet/contracts/index.ts" { export { ERC1155 } from "contracts/ERC1155/ERC1155"; export { ERC20 } from "contracts/ERC20/ERC20"; export { ERC721 } from "contracts/ERC721/ERC721"; export { MultiCall } from "contracts/MultiCall/MultiCall"; } /// declare module "@ijstech/eth-wallet/contract.ts" { /*!----------------------------------------------------------- * Copyright (c) IJS Technologies. All rights reserved. * Released under dual AGPLv3/commercial license * https://ijs.network *-----------------------------------------------------------*/ import { IWallet, TransactionReceipt, Event, IBatchRequestObj } from "@ijstech/eth-wallet/wallet.ts"; import { BigNumber } from 'bignumber.js'; module Contract { export interface EventType { name: string; } export interface TransactionOptions { from?: string; to?: string; nonce?: number; gas?: number; gasLimit?: number; gasPrice?: BigNumber | number; data?: string; value?: BigNumber | number; } export interface DeployOptions extends TransactionOptions { libraries?: { [file: string]: { [contract: string]: string; }; }; } interface LinkReferences { [file: string]: { [contract: string]: { length: number; start: number; }[]; }; } export class Contract { wallet: IWallet; _abi: any; _bytecode: string; _linkReferences: LinkReferences; _address: string; private _events; privateKey: string; private abiHash; constructor(wallet: IWallet, address?: string, abi?: any, bytecode?: string, linkReferences?: LinkReferences); at(address: string): Contract; set address(value: string); get address(): string; protected decodeEvents(receipt: TransactionReceipt): any[]; protected parseEvents(receipt: TransactionReceipt, eventName: string): Event[]; get events(): EventType[]; getAbiEvents(): any; getAbiTopics(eventNames?: string[]): any[]; scanEvents(fromBlock: number, toBlock: number | string, eventNames?: string[]): Promise; batchCall(batchObj: IBatchRequestObj, key: string, methodName: string, params?: any[], options?: number | BigNumber | TransactionOptions): Promise; protected txData(methodName: string, params?: any[], options?: number | BigNumber | TransactionOptions): Promise; protected call(methodName: string, params?: any[], options?: number | BigNumber | TransactionOptions): Promise; private _send; getDeployBytecode(options?: number | BigNumber | DeployOptions): string; protected __deploy(params?: any[], options?: number | BigNumber | DeployOptions): Promise; protected send(methodName: string, params?: any[], options?: number | BigNumber | TransactionOptions): Promise; protected _deploy(...params: any[]): Promise; protected methods(methodName: string, ...params: any[]): Promise; } export {}; } export = Contract; } /// declare module "@ijstech/eth-wallet/types.ts" { /*!----------------------------------------------------------- * Copyright (c) IJS Technologies. All rights reserved. * Released under dual AGPLv3/commercial license * https://ijs.network *-----------------------------------------------------------*/ export interface MessageTypeProperty { name: string; type: string; } export type EIP712TypeMap = { [type: string]: MessageTypeProperty[]; }; export interface IEIP712Domain { name: string; version: string; chainId: number; verifyingContract: string; } export enum SignTypedDataVersion { V1 = "V1", V3 = "V3", V4 = "V4" } export interface MessageTypes { EIP712Domain: MessageTypeProperty[]; [additionalProperties: string]: MessageTypeProperty[]; } export interface TypedMessage { types: T; primaryType: keyof T; domain: { name?: string; version?: string; chainId?: number; verifyingContract?: string; salt?: ArrayBuffer; }; message: Record; } export interface IAbiDefinition { _abi: any; [key: string]: any; } export interface ITokenObject { address?: string; name: string; decimals: number; symbol: string; } namespace nacl { interface BoxKeyPair { publicKey: Uint8Array; secretKey: Uint8Array; } interface SignKeyPair { publicKey: Uint8Array; secretKey: Uint8Array; } interface secretbox { (msg: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array; open(box: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array | null; readonly keyLength: number; readonly nonceLength: number; readonly overheadLength: number; } interface scalarMult { (n: Uint8Array, p: Uint8Array): Uint8Array; base(n: Uint8Array): Uint8Array; readonly scalarLength: number; readonly groupElementLength: number; } namespace boxProps { interface open { (msg: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array): Uint8Array | null; after(box: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array | null; } interface keyPair { (): BoxKeyPair; fromSecretKey(secretKey: Uint8Array): BoxKeyPair; } } interface box { (msg: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array): Uint8Array; before(publicKey: Uint8Array, secretKey: Uint8Array): Uint8Array; after(msg: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array; open: boxProps.open; keyPair: boxProps.keyPair; readonly publicKeyLength: number; readonly secretKeyLength: number; readonly sharedKeyLength: number; readonly nonceLength: number; readonly overheadLength: number; } namespace signProps { interface detached { (msg: Uint8Array, secretKey: Uint8Array): Uint8Array; verify(msg: Uint8Array, sig: Uint8Array, publicKey: Uint8Array): boolean; } interface keyPair { (): SignKeyPair; fromSecretKey(secretKey: Uint8Array): SignKeyPair; fromSeed(secretKey: Uint8Array): SignKeyPair; } } interface sign { (msg: Uint8Array, secretKey: Uint8Array): Uint8Array; open(signedMsg: Uint8Array, publicKey: Uint8Array): Uint8Array | null; detached: signProps.detached; keyPair: signProps.keyPair; readonly publicKeyLength: number; readonly secretKeyLength: number; readonly seedLength: number; readonly signatureLength: number; } interface hash { (msg: Uint8Array): Uint8Array; readonly hashLength: number; } } export interface INacl { randomBytes(n: number): Uint8Array; secretbox: nacl.secretbox; scalarMult: nacl.scalarMult; box: nacl.box; sign: nacl.sign; hash: nacl.hash; verify(x: Uint8Array, y: Uint8Array): boolean; setPRNG(fn: (x: Uint8Array, n: number) => void): void; } } /// declare module "@ijstech/eth-wallet/constants.ts" { export const EIP712DomainAbi: { name: string; type: string; }[]; export const TYPED_MESSAGE_SCHEMA: { type: string; properties: { types: { type: string; additionalProperties: { type: string; items: { type: string; properties: { name: { type: string; }; type: { type: string; }; }; required: string[]; }; }; }; primaryType: { type: string; }; domain: { type: string; }; message: { type: string; }; }; required: string[]; }; export enum ClientWalletEvent { AccountsChanged = "accountsChanged", ChainChanged = "chainChanged", Connect = "connect", Disconnect = "disconnect" } export enum RpcWalletEvent { Connected = "connected", Disconnected = "disconnected", ChainChanged = "chainChanged" } } /// declare module "@ijstech/eth-wallet/utils.ts" { /*!----------------------------------------------------------- * Copyright (c) IJS Technologies. All rights reserved. * Released under dual AGPLv3/commercial license * https://ijs.network *-----------------------------------------------------------*/ import { BigNumber } from "bignumber.js"; import { EIP712TypeMap, IEIP712Domain, MessageTypes, TypedMessage } from "@ijstech/eth-wallet/types.ts"; import { ISendTxEventsOptions } from "@ijstech/eth-wallet/wallet.ts"; export function sleep(millisecond: number): Promise; export function numberToBytes32(value: number | BigNumber, prefix?: boolean): string; export function padLeft(string: string, chars: number, sign?: string): string; export function padRight(string: string, chars: number, sign?: string): string; type stringArray = string | _stringArray; interface _stringArray extends Array { } export function stringToBytes32(value: string | stringArray): string | string[]; export function stringToBytes(value: string | stringArray, nByte?: number): string | string[]; export function addressToBytes32(value: string, prefix?: boolean): string; export function bytes32ToAddress(value: string): string; export function bytes32ToString(value: string): string; export function addressToBytes32Right(value: string, prefix?: boolean): string; export function toNumber(value: string | number | BigNumber | bigint): number; export function toDecimals(value: BigNumber | number | string, decimals?: number): BigNumber; export function fromDecimals(value: BigNumber | number | string, decimals?: number): BigNumber; export function toString(value: any): any; export const nullAddress = "0x0000000000000000000000000000000000000000"; export function constructTypedMessageData(domain: IEIP712Domain, customTypes: EIP712TypeMap, primaryType: string, message: Record): TypedMessage; export function soliditySha3(...val: any[]): any; export function toChecksumAddress(address: string): any; export function registerSendTxEvents(sendTxEventHandlers: ISendTxEventsOptions): void; export function uint8ArrayToHex(byteArray: Uint8Array): string; export function stringToUnicodeHex(str: string): string; export function hexToString(hex: string): string; } /// declare module "@ijstech/eth-wallet/contracts/erc20.ts" { /*!----------------------------------------------------------- * Copyright (c) IJS Technologies. All rights reserved. * Released under dual AGPLv3/commercial license * https://ijs.network *-----------------------------------------------------------*/ import { IWallet, TransactionReceipt, Event } from "@ijstech/eth-wallet/wallet.ts"; import { Contract } from "@ijstech/eth-wallet/contract.ts"; import { BigNumber } from 'bignumber.js'; export class Erc20 extends Contract { private _decimals; constructor(wallet: IWallet, address?: string, decimals?: number); deploy(params: { name: string; symbol: string; minter?: string; cap?: number | BigNumber; }): Promise; parseApprovalEvent(receipt: TransactionReceipt): Erc20.ApprovalEvent[]; decodeApprovalEvent(event: Event): Erc20.ApprovalEvent; parseTransferEvent(receipt: TransactionReceipt): Erc20.TransferEvent[]; decodeTransferEvent(event: Event): Erc20.TransferEvent; allowance(params: { owner: string; spender: string; }): Promise; approve(params: { spender: string; amount: number | BigNumber; }): Promise; get balance(): Promise; balanceOf(address: string): Promise; get cap(): Promise; get decimals(): Promise; mint(params: { address: string; amount: number | BigNumber; }): Promise; minter(): Promise; get name(): Promise; get symbol(): Promise; get totalSupply(): Promise; transfer(params: { address: string; amount: number | BigNumber; }): Promise; } export module Erc20 { interface ApprovalEvent { owner: string; spender: string; value: BigNumber; _event: Event; } interface TransferEvent { from: string; to: string; value: BigNumber; _event: Event; } } } /// declare module "@ijstech/eth-wallet/eventBus.ts" { export interface IEventBusRegistry { id: number; event: string; unregister: () => void; } export interface ICallable { [key: string]: Function; } export interface ISubscriber { [key: string]: ICallable; } export interface IEventBus { dispatch(event: string, arg?: T): void; register(sender: any, event: string, callback: Function): IEventBusRegistry; } export class EventBus implements IEventBus { private subscribers; private static nextId; private static instance?; private idEventMap; private constructor(); static getInstance(): EventBus; dispatch(event: string, arg?: T): void; register(sender: any, event: string, callback: Function): IEventBusRegistry; unregister(id: number): void; private getNextId; } } /// declare module "@ijstech/eth-wallet/providers.json.ts" { const _default_4: { MetaMask: { displayName: string; image: string; homepage: string; }; Web3Modal: { displayName: string; image: string; }; }; export default _default_4; } declare module "ethers" { export interface IEthers { keccak256(data: Uint8Array): string; toUtf8Bytes(data: string): Uint8Array; toUtf8String(data: string): string; isHexString(value: string): boolean; getAddress(address: string): string; isAddress(address: string): boolean; hexlify(data: Uint8Array): string; verifyMessage(message: string, signature: string): string; verifyTypedData(domain: any, types: any, value: any, signature: string): string; formatUnits(value: string, unit: string): string; formatEther(value: string): string; parseUnits(value: string, unit?: string): string; solidityPackedKeccak256(types: string[], values: any[]): string; JsonRpcProvider: new (url: string) => IEthersProvider; BrowserProvider: new (provider: any) => IEthersProvider; Wallet: { new (privateKey: string, provider?: IEthersProvider): IEthersWallet; createRandom(): IEthersWallet; }; Interface: new (abi: any[]) => IEthersInterface; Contract: new (address: string, abi: any[], provider: IEthersProvider) => IEthersContract; ContractFactory: new (abi: any[], bytecode: string, signer: IEthersWallet) => IEthersContractFactory; AbiCoder: { defaultAbiCoder(): IEthersAbiCoder; }; } export interface IEthersProvider { getBlock(blockHashOrBlockNumber: string | number, includeTransactions?: boolean): Promise; getBlockNumber(): Promise; getFeeData(): Promise<{ gasPrice: string; }>; getLogs(filter: any): Promise; getTransaction(transactionHash: string): Promise; getTransactionReceipt(transactionHash: string): Promise; estimateGas(transaction: any): Promise; call(transaction: any): Promise; send(method: string, params: any[]): Promise; broadcastTransaction(signedTransaction: string): Promise; listAccounts(): Promise; getBalance(address: string): Promise; } export interface IEthersWallet { address: string; privateKey: string; signMessage(message: string): Promise; signTransaction(transaction: any): Promise; sendTransaction(transaction: any): Promise; } export interface IEthersInterface { encodeFunctionData(functionName: string, params: any[]): string; decodeFunctionData(functionName: string, data: string): any; decodeEventLog(eventFragment: any, data: string, topics: string[]): any; getEvent(eventName: string): any; } export interface IEthersContract { [methodName: string]: any; staticCall(...params: any[]): Promise; populateTransaction(...params: any[]): Promise; } export interface IEthersContractFactory { deploy(...params: any[]): Promise; } export interface IEthersAbiCoder { encode(types: string[], values: any[]): string; decode(types: string[], data: string): any; } export interface IEthersLib { ethers: IEthers; Wallet: { new (privateKey: string, provider?: IEthersProvider): IEthersWallet; createRandom(): IEthersWallet; }; } } /// declare module "@ijstech/eth-wallet/wallet.ts" { import { ConfirmationObject, TransactionReceipt } from "@ijstech/eth-wallet/web3.ts"; import { BigNumber } from 'bignumber.js'; import { Erc20 } from "@ijstech/eth-wallet/contracts/erc20.ts"; import { IAbiDefinition, MessageTypes, TypedMessage } from "@ijstech/eth-wallet/types.ts"; import { IEventBusRegistry } from "@ijstech/eth-wallet/eventBus.ts"; export { TransactionReceipt, ConfirmationObject }; export function toString(value: any): any; export type stringArray = string | _stringArray; export interface _stringArray extends Array { } export interface IWalletUtils { fromDecimals(value: BigNumber | number | string, decimals?: number): BigNumber; fromWei(value: any, unit?: string): string; hexToUtf8(value: string): string; sha3(value: string): string; stringToBytes(value: string | stringArray, nByte?: number): string | string[]; stringToBytes32(value: string | stringArray): string | string[]; toDecimals(value: BigNumber | number | string, decimals?: number): BigNumber; toString(value: any): string; toUtf8(value: any): string; toWei(value: string, unit?: string): string; } export interface IWalletTransaction { hash: string; nonce: bigint; blockHash: string | null; blockNumber: bigint | null; transactionIndex: bigint | null; from: string; to: string | null; value: BigNumber; gasPrice: BigNumber; maxPriorityFeePerGas?: bigint | string | BigNumber; maxFeePerGas?: bigint | string | BigNumber; gas: bigint; input: string; } export interface IWalletBlockTransactionObject { number: bigint; hash: string; parentHash: string; nonce: string; sha3Uncles: string; logsBloom: string; transactionRoot: string; stateRoot: string; receiptsRoot: string; miner: string; extraData: string; gasLimit: bigint; gasUsed: bigint; timestamp: bigint | string; baseFeePerGas?: bigint; size: bigint; difficulty: bigint; totalDifficulty: bigint; uncles: string[]; transactions: IWalletTransaction[]; } export interface ITokenInfo { name: string; symbol: string; totalSupply: BigNumber; decimals: number; } export interface IBatchRequestResult { key: string; result: any; } export interface IBatchRequestObj { batch: any; promises: Promise[]; execute: (batch: IBatchRequestObj, promises: Promise[]) => Promise; } export interface IConnectWalletEventPayload { userTriggeredConnect?: boolean; [key: string]: any; } export interface IWallet { account: IAccount; accounts: Promise; address: string; balance: Promise; balanceOf(address: string): Promise; _call(abiHash: string, address: string, methodName: string, params?: any[], options?: number | BigNumber | TransactionOptions): Promise; chainId: number; createAccount(): IAccount; decode(abi: any, event: Log | EventLog, raw?: { data: string; topics: string[]; }): Event; decodeErrorMessage(msg: string): any; decodeEventData(data: Log, events?: any): Promise; decodeLog(inputs: any, hexString: string, topics: any): any; decodeParameters(types: string[], hexString: string): any; encodeParameters(types: string[], values: any[]): string; defaultAccount: string; getAbiEvents(abi: any[]): any; getAbiTopics(abi: any[], eventNames: string[]): any[]; getBlock(blockHashOrBlockNumber?: number | string, returnTransactionObjects?: boolean): Promise; getBlockNumber(): Promise; getBlockTimestamp(blockHashOrBlockNumber?: number | string): Promise; getChainId(): Promise; getContractAbi(address: string): any; getContractAbiEvents(address: string): any; getTransaction(transactionHash: string): Promise; methods(...args: any): Promise; privateKey: string; recoverSigner(msg: string, signature: string): Promise; registerAbi(abi: any[] | string, address?: string | string[], handler?: any): string; registerAbiContracts(abiHash: string, address: string | string[], handler?: any): any; send(to: string, amount: number): Promise; _send(abiHash: string, address: string, methodName: string, params?: any[], options?: number | BigNumber | TransactionOptions): Promise; scanEvents(fromBlock: number, toBlock?: number | string, topics?: any, events?: any, address?: string | string[]): Promise; scanEvents(params: { fromBlock: number; toBlock?: number | string; topics?: any; events?: any; address?: string | string[]; }): Promise; signMessage(msg: string): Promise; signTransaction(tx: any, privateKey?: string): Promise; soliditySha3(...val: any[]): string; toChecksumAddress(address: string): string; isAddress(address: string): boolean; tokenInfo(address: string): Promise; _txData(abiHash: string, address: string, methodName: string, params?: any[], options?: number | BigNumber | TransactionOptions): Promise; _txObj(abiHash: string, address: string, methodName: string, params?: any[], options?: number | BigNumber | TransactionOptions): Promise; utils: IWalletUtils; verifyMessage(account: string, msg: string, signature: string): Promise; multiCall(calls: { to: string; data: string; }[], gasBuffer?: string): Promise<{ results: string[]; lastSuccessIndex: BigNumber; }>; doMulticall(contracts: IMulticallContractCall[], gasBuffer?: string): Promise; encodeFunctionCall>(contract: T, methodName: F, params: string[]): string; decodeAbiEncodedParameters>(contract: T, methodName: F, hexString: string): any; } export interface IClientWallet extends IWallet { init(): Promise; blockGasLimit(): Promise; clientSideProvider: IClientSideProvider; initClientWallet(config: IClientWalletConfig): void; connect(clientSideProvider: IClientSideProvider, eventPayload?: Record): Promise; disconnect(): Promise; getGasPrice(): Promise; getTransaction(transactionHash: string): Promise; getTransactionReceipt(transactionHash: string): Promise; isConnected: boolean; provider: any; registerEvent(abi: any, eventMap: { [topics: string]: any; }, address: string, handler: any): any; registerSendTxEvents(eventsOptions: ISendTxEventsOptions): void; sendSignedTransaction(signedTransaction: string): Promise; sendTransaction(transaction: Transaction): Promise; signTypedDataV4(data: TypedMessage): Promise; switchNetwork(chainId: number): Promise; transactionCount(): Promise; getNetworkInfo(chainId: number): INetwork; setNetworkInfo(network: INetwork): void; setMultipleNetworksInfo(networks: INetwork[]): void; registerWalletEvent(sender: any, event: string, callback: Function): IEventBusRegistry; unregisterWalletEvent(registry: IEventBusRegistry): void; unregisterAllWalletEvents(): void; destoryRpcWalletInstance(instanceId: string): void; initRpcWallet(config: IRpcWalletConfig): string; encrypt: (key: string) => Promise; decrypt: (data: string) => Promise; } export interface IRpcWallet extends IWallet { init(): Promise; instanceId: string; isConnected: boolean; switchNetwork(chainId: number): Promise; registerWalletEvent(sender: any, event: string, callback: Function): IEventBusRegistry; unregisterAllWalletEvents(): void; unregisterWalletEvent(registry: IEventBusRegistry): void; } export interface IContractMethod { call: any; estimateGas(...params: any[]): Promise; encodeABI(): string; } export interface IContract { deploy(params: { data: string; arguments?: any[]; }): IContractMethod; methods: { [methodName: string]: (...params: any[]) => IContractMethod; }; options: { address: string; }; } export interface Event { name: string; address: string; blockNumber: bigint; logIndex: bigint; topics: string[]; transactionHash: string; transactionIndex: bigint; data: any; rawData: any; } export interface Log { address: string; data: string; topics: Array; logIndex: bigint; transactionHash?: string; transactionIndex: bigint; blockHash?: string; type?: string; blockNumber: bigint; } export interface EventLog { event: string; address: string; returnValues: any; logIndex: bigint; transactionIndex: bigint; transactionHash: string; blockHash: string; blockNumber: bigint; raw?: { data: string; topics: string[]; }; } export interface Transaction { from?: string; to?: string; nonce?: number; gas?: number; gasLimit?: number; gasPrice?: BigNumber | number; data?: string; value?: BigNumber | number; } export interface TransactionOptions { from?: string; to?: string; nonce?: number; gas?: number; gasLimit?: number; gasPrice?: string | BigNumber | number; data?: string; value?: BigNumber | number | string; } export interface IKMS { } export interface IAccount { address: string; privateKey?: string; kms?: IKMS; sign?(): Promise; signTransaction?(): Promise; } export interface ITokenOption { address: string; symbol: string; decimals: number; image?: string; } export interface INetwork { image?: string; networkCode?: string; networkType?: string; chainId?: number; chainName: string; nativeCurrency: { name: string; symbol: string; decimals: number; }; rpcUrls: string[]; blockExplorerUrls?: string[]; iconUrls?: string[]; } export interface IClientSideProviderEvents { onAccountChanged?: (account: string) => void; onChainChanged?: (chainId: string) => void; onConnect?: (connectInfo: any) => void; onDisconnect?: (error: any) => void; } export interface IMulticallInfo { chainId: number; contractAddress: string; gasBuffer: string; } export type NetworksMapType = { [chainId: number]: INetwork; }; export type MulticallInfoMapType = { [chainId: number]: IMulticallInfo; }; export interface IMulticallContractCall { to: string; contract: IAbiDefinition; methodName: string; params: any[]; } export interface IRpcWalletConfig { networks: INetwork[]; defaultChainId?: number; infuraId: string; multicalls?: IMulticallInfo[]; } export interface IClientWalletConfig { defaultChainId: number; networks: INetwork[]; infuraId: string; multicalls?: IMulticallInfo[]; } export interface IClientProviderOptions { name?: string; image?: string; infuraId?: string; useDefaultProvider?: boolean; [key: string]: any; } export interface IClientSideProvider { name: string; displayName: string; provider: any; selectedAddress: string; image: string; homepage?: string; events?: IClientSideProviderEvents; options?: IClientProviderOptions; installed(): boolean; isConnected(): boolean; connect: (eventPayload?: Record) => Promise; disconnect: () => Promise; switchNetwork?: (chainId: number, onChainChanged?: (chainId: string) => void) => Promise; encrypt: (key: string) => Promise; decrypt: (data: string) => Promise; } export class EthereumProvider implements IClientSideProvider { protected wallet: Wallet; protected _events?: IClientSideProviderEvents; protected _options?: IClientProviderOptions; protected _isConnected: boolean; protected _name: string; protected _image: string; protected _selectedAddress: string; onAccountChanged: (account: string) => void; onChainChanged: (chainId: string) => void; onConnect: (connectInfo: any) => void; onDisconnect: (error: any) => void; private handleAccountsChanged; private handleChainChanged; private handleConnect; private handleDisconnect; constructor(wallet: Wallet, events?: IClientSideProviderEvents, options?: IClientProviderOptions); get name(): string; get displayName(): string; get provider(): any; get image(): string; installed(): boolean; get events(): IClientSideProviderEvents; get options(): IClientProviderOptions; get selectedAddress(): string; protected toChecksumAddress(address: string): string; protected removeListeners(): void; private _handleAccountsChanged; protected initEvents(): void; connect(eventPayload?: IConnectWalletEventPayload): Promise; disconnect(): Promise; isConnected(): boolean; addToken(option: ITokenOption, type?: string): Promise; switchNetwork(chainId: number): Promise; encrypt(key: string): Promise; decrypt(data: string): Promise; } export class MetaMaskProvider extends EthereumProvider { get displayName(): string; get image(): string; get homepage(): string; installed(): boolean; encrypt(key: string): Promise; decrypt(data: string): Promise; } export class Web3ModalProvider extends EthereumProvider { private _provider; constructor(wallet: Wallet, events?: IClientSideProviderEvents, options?: IClientProviderOptions); get name(): string; get displayName(): string; get provider(): any; get image(): string; get homepage(): any; installed(): boolean; get options(): IClientProviderOptions; private initializeWeb3Modal; connect(eventPayload?: IConnectWalletEventPayload): Promise; disconnect(): Promise; } export interface ISendTxEventsOptions { transactionHash?: (error: Error, receipt?: string) => void; confirmation?: (receipt: any) => void; } export class Wallet implements IClientWallet { protected _ethersProvider: any; protected _ethersSigner: any; protected _defaultAccount: string; protected _account: IAccount; private _accounts; protected _provider: any; private _eventTopicAbi; private _eventHandler; protected _sendTxEventHandler: ISendTxEventsOptions; protected _contracts: {}; protected _blockGasLimit: number; private _networksMap; private _multicallInfoMap; chainId: number; clientSideProvider: IClientSideProvider; private _infuraId; protected _utils: IWalletUtils; private static _rpcWalletPoolMap; protected _walletEventIds: Set; constructor(provider?: any, account?: IAccount | IAccount[]); private static readonly instance; static getInstance(): IWallet; static getClientInstance(): IClientWallet; static getRpcWalletInstance(instanceId: string): IRpcWallet; private fromWei; private toWei; private hexToUtf8; private toUtf8; init(): Promise; protected privateKeyToAccount(privateKey: string): IAccount; get isConnected(): boolean; switchNetwork(chainId: number): Promise; initClientWallet(config: IClientWalletConfig): void; registerWalletEvent(sender: any, event: string, callback: Function): IEventBusRegistry; unregisterWalletEvent(registry: IEventBusRegistry): void; unregisterAllWalletEvents(): void; destoryRpcWalletInstance(instanceId: string): void; private generateUUID; initRpcWallet(config: IRpcWalletConfig): string; setDefaultProvider(): void; connect(clientSideProvider: IClientSideProvider, eventPayload?: IConnectWalletEventPayload): Promise; disconnect(): Promise; encrypt(key: string): Promise; decrypt(data: string): Promise; get accounts(): Promise; get address(): string; get account(): IAccount; set account(value: IAccount); get infuraId(): string; set infuraId(value: string); get networksMap(): NetworksMapType; get multicallInfoMap(): MulticallInfoMapType; set multicallInfoMap(value: MulticallInfoMapType); getNetworkInfo(chainId: number): INetwork; setNetworkInfo(network: INetwork): void; setMultipleNetworksInfo(networks: INetwork[]): void; createAccount(): IAccount; decodeLog(inputs: any, hexString: string, topics: any): any; get defaultAccount(): string; set defaultAccount(address: string); getChainId(): Promise; get provider(): any; set provider(value: any); sendSignedTransaction(tx: string): Promise; signTransaction(tx: any, privateKey?: string): Promise; registerSendTxEvents(eventsOptions: ISendTxEventsOptions): void; _call(abiHash: string, address: string, methodName: string, params?: any[], options?: number | BigNumber | TransactionOptions): Promise; protected _createTxData(signer: any, abiHash: string, address: string, methodName: string, params?: any[]): Promise; protected _createTxObj(address: string, txData: any, options?: number | BigNumber | TransactionOptions): Promise; _txObj(abiHash: string, address: string, methodName: string, params?: any[], options?: number | BigNumber | TransactionOptions): Promise; protected getSigner(): Promise; protected extractEthersErrorInfo(errorString: string): { action: string; reason: string; errorCode: number; message: string; }; _send(abiHash: string, address: string, methodName: string, params?: any[], options?: number | BigNumber | TransactionOptions): Promise; _txData(abiHash: string, address: string, methodName: string, params?: any[], options?: number | BigNumber | TransactionOptions): Promise; methods(...args: any): Promise; get balance(): Promise; balanceOf(address: string): Promise; recoverSigner(msg: string, signature: string): Promise; getBlock(blockHashOrBlockNumber?: number | string, returnTransactionObjects?: boolean): Promise; getBlockNumber(): Promise; getBlockTimestamp(blockHashOrBlockNumber?: number | string): Promise; set privateKey(value: string); private sha3; registerEvent(abi: any, eventMap: { [topics: string]: any; }, address: string, handler: any): Promise; private _abiHashDict; private _abiContractDict; private _abiAddressDict; private _abiEventDict; getAbiEvents(abi: any[]): any; getAbiTopics(abi: any[], eventNames?: string[]): any[]; getContractAbi(address: string): any; getContractAbiEvents(address: string): any; registerAbi(abi: any[] | string, address?: string | string[], handler?: any): string; registerAbiContracts(abiHash: string, address: string | string[], handler?: any): void; decode(abi: any, event: Log | EventLog, raw?: { data: string; topics: string[]; }): Event; decodeEventData(data: Log, events?: any): Promise; encodeParameters(types: string[], values: any[]): string; decodeParameters(types: string[], hexString: string): any; scanEvents(params: { fromBlock: number; toBlock?: number | string; topics?: any; events?: any; address?: string | string[]; }): Promise; scanEvents(fromBlock: number, toBlock?: number | string, topics?: any, events?: any, address?: string | string[]): Promise; send(to: string, amount: number | BigNumber): Promise; estimateGas(tx: TransactionOptions): Promise; setBlockTime(time: number): Promise; increaseBlockTime(value: number): Promise; signMessage(msg: string): Promise; signTypedDataV4(data: TypedMessage): Promise; recoverTypedSignatureV4(data: TypedMessage, signature: string): Promise; token(tokenAddress: string, decimals?: number): Erc20; tokenInfo(tokenAddress: string): Promise; get utils(): IWalletUtils; verifyMessage(account: string, msg: string, signature: string): Promise; private _gasLimit; blockGasLimit(): Promise; getGasPrice(): Promise; transactionCount(): Promise; private monitorTransactionEvents; protected convertEthersTransactionReceipt(ethersReceipt: any): TransactionReceipt; sendTransaction(transaction: TransactionOptions): Promise; getTransaction(transactionHash: string): Promise; getTransactionReceipt(transactionHash: string): Promise; call(transaction: Transaction): Promise; decodeErrorMessage(msg: string): string; protected inferSolidityType(value: any): string; soliditySha3(...val: any[]): string; toChecksumAddress(address: string): string; isAddress(address: string): boolean; multiCall(calls: { to: string; data: string; }[], gasBuffer?: string): Promise<{ results: string[]; lastSuccessIndex: BigNumber; }>; doMulticall(contracts: IMulticallContractCall[], gasBuffer?: string): Promise; encodeFunctionCall>(contract: T, methodName: F, params: string[]): string; decodeAbiEncodedParameters>(contract: T, methodName: F, hexString: string): any; } export class RpcWallet extends Wallet implements IRpcWallet { static rpcWalletRegistry: Record; instanceId: string; private _address; get address(): string; set address(value: string); setProvider(provider: any): void; get isConnected(): boolean; static getRpcWallet(chainId: number): IRpcWallet; switchNetwork(chainId: number): Promise; initWalletEvents(): void; registerWalletEvent(sender: any, event: string, callback: Function): IEventBusRegistry; } } /// declare module "@ijstech/eth-wallet/approvalModel/ERC20ApprovalModel.ts" { import { BigNumber } from 'bignumber.js'; import { IRpcWallet, TransactionReceipt } from "@ijstech/eth-wallet/wallet.ts"; import { ITokenObject } from "@ijstech/eth-wallet/types.ts"; export const getERC20Allowance: (wallet: IRpcWallet, token: ITokenObject, spenderAddress: string) => Promise; export interface IERC20ApprovalEventOptions { sender: any; payAction: () => Promise; onToBeApproved: (token: ITokenObject, data?: any) => Promise; onToBePaid: (token: ITokenObject, data?: any) => Promise; onApproving: (token: ITokenObject, receipt?: string, data?: any) => Promise; onApproved: (token: ITokenObject, data?: any, receipt?: TransactionReceipt) => Promise; onPaying: (receipt?: string, data?: any) => Promise; onPaid: (data?: any, receipt?: TransactionReceipt) => Promise; onApprovingError: (token: ITokenObject, err: Error) => Promise; onPayingError: (err: Error) => Promise; } export interface IERC20ApprovalOptions extends IERC20ApprovalEventOptions { spenderAddress: string; } export interface IERC20ApprovalAction { doApproveAction: (token: ITokenObject, inputAmount: string, data?: any) => Promise; doPayAction: (data?: any) => Promise; checkAllowance: (token: ITokenObject, inputAmount: string, data?: any) => Promise; } export class ERC20ApprovalModel { private wallet; private options; constructor(wallet: IRpcWallet, options: IERC20ApprovalOptions); set spenderAddress(value: string); private checkAllowance; private doApproveAction; private doPayAction; getAction: () => IERC20ApprovalAction; } } /// declare module "@ijstech/eth-wallet/approvalModel/index.ts" { export { getERC20Allowance, IERC20ApprovalEventOptions, IERC20ApprovalOptions, IERC20ApprovalAction, ERC20ApprovalModel } from "@ijstech/eth-wallet/approvalModel/ERC20ApprovalModel.ts"; } /// declare module "@ijstech/eth-wallet" { /*!----------------------------------------------------------- * Copyright (c) IJS Technologies. All rights reserved. * Released under dual AGPLv3/commercial license * https://ijs.network *-----------------------------------------------------------*/ export { IWallet, IWalletUtils, IAccount, Wallet, Transaction, Event, TransactionReceipt, ISendTxEventsOptions, IClientProviderOptions, IBatchRequestObj, INetwork, EthereumProvider, MetaMaskProvider, Web3ModalProvider, IClientSideProviderEvents, IClientSideProvider, IClientWalletConfig, IClientWallet, IMulticallInfo, RpcWallet, IRpcWalletConfig, IRpcWallet, IConnectWalletEventPayload, IMulticallContractCall } from "@ijstech/eth-wallet/wallet.ts"; export { Contract } from "@ijstech/eth-wallet/contract.ts"; export { BigNumber } from "bignumber.js"; export { Erc20 } from "@ijstech/eth-wallet/contracts/erc20.ts"; export * as Utils from "@ijstech/eth-wallet/utils.ts"; export * as Contracts from "@ijstech/eth-wallet/contracts/index.ts"; export * as Types from "@ijstech/eth-wallet/types.ts"; export * as Constants from "@ijstech/eth-wallet/constants.ts"; export { IEventBusRegistry, EventBus } from "@ijstech/eth-wallet/eventBus.ts"; export { getERC20Allowance, IERC20ApprovalEventOptions, IERC20ApprovalOptions, IERC20ApprovalAction, ERC20ApprovalModel } from "@ijstech/eth-wallet/approvalModel/index.ts"; }