/* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ import { Address, Contract, ContractState, TestContractResult, HexString, ContractFactory, EventSubscribeOptions, EventSubscription, CallContractParams, CallContractResult, TestContractParams, ContractEvent, subscribeContractEvent, subscribeContractEvents, testMethod, callMethod, multicallMethods, fetchContractState, Asset, ContractInstance, getContractEventsCurrentCount, TestContractParamsWithoutMaps, TestContractResultWithoutMaps, SignExecuteContractMethodParams, SignExecuteScriptTxResult, signExecuteMethod, addStdIdToFields, encodeContractFields, Narrow, } from "@alephium/web3"; import { default as PoolUserContractJson } from "../PoolUser.ral.json"; import { getContractByCodeHash, registerContract } from "./contracts"; import * as types from "./types"; // Custom types for the contract export namespace PoolUserTypes { export type Fields = { token0: HexString; token1: HexString; token2: HexString; pool0: HexString; pool1: HexString; pool2: HexString; pool3: HexString; factory: HexString; }; export type State = ContractState; export interface CallMethodTable { deploy: { params: CallContractParams<{ counter: bigint; payer: Address; pool_: HexString; position_: HexString; tick_: HexString; word_: HexString; factory_: HexString; config_: HexString; dexAccount_: HexString; }>; result: CallContractResult< [ HexString, HexString, HexString, HexString, HexString, HexString, HexString, HexString ] >; }; } export type CallMethodParams = CallMethodTable[T]["params"]; export type CallMethodResult = CallMethodTable[T]["result"]; export type MultiCallParams = Partial<{ [Name in keyof CallMethodTable]: CallMethodTable[Name]["params"]; }>; export type MultiCallResults = { [MaybeName in keyof T]: MaybeName extends keyof CallMethodTable ? CallMethodTable[MaybeName]["result"] : undefined; }; export type MulticallReturnType = { [index in keyof Callss]: MultiCallResults; }; export interface SignExecuteMethodTable { deploy: { params: SignExecuteContractMethodParams<{ counter: bigint; payer: Address; pool_: HexString; position_: HexString; tick_: HexString; word_: HexString; factory_: HexString; config_: HexString; dexAccount_: HexString; }>; result: SignExecuteScriptTxResult; }; } export type SignExecuteMethodParams = SignExecuteMethodTable[T]["params"]; export type SignExecuteMethodResult = SignExecuteMethodTable[T]["result"]; } class Factory extends ContractFactory { encodeFields(fields: PoolUserTypes.Fields) { return encodeContractFields( addStdIdToFields(this.contract, fields), this.contract.fieldsSig, types.AllStructs ); } at(address: string): PoolUserInstance { return new PoolUserInstance(address); } tests = { deploy: async ( params: TestContractParamsWithoutMaps< PoolUserTypes.Fields, { counter: bigint; payer: Address; pool_: HexString; position_: HexString; tick_: HexString; word_: HexString; factory_: HexString; config_: HexString; dexAccount_: HexString; } > ): Promise< TestContractResultWithoutMaps< [ HexString, HexString, HexString, HexString, HexString, HexString, HexString, HexString ] > > => { return testMethod(this, "deploy", params, getContractByCodeHash); }, }; stateForTest( initFields: PoolUserTypes.Fields, asset?: Asset, address?: string ) { return this.stateForTest_(initFields, asset, address, undefined); } } // Use this object to test and deploy the contract export const PoolUser = new Factory( Contract.fromJson( PoolUserContractJson, "", "9e1114eb366a5aaf1730e3b16068a672c09da46c4e5111267129c5a0bceeaa97", types.AllStructs ) ); registerContract(PoolUser); // Use this class to interact with the blockchain export class PoolUserInstance extends ContractInstance { constructor(address: Address) { super(address); } async fetchState(): Promise { return fetchContractState(PoolUser, this); } view = { deploy: async ( params: PoolUserTypes.CallMethodParams<"deploy"> ): Promise> => { return callMethod( PoolUser, this, "deploy", params, getContractByCodeHash ); }, }; transact = { deploy: async ( params: PoolUserTypes.SignExecuteMethodParams<"deploy"> ): Promise> => { return signExecuteMethod(PoolUser, this, "deploy", params); }, }; async multicall( calls: Calls ): Promise>; async multicall( callss: Narrow ): Promise>; async multicall< Callss extends | PoolUserTypes.MultiCallParams | PoolUserTypes.MultiCallParams[] >(callss: Callss): Promise { return await multicallMethods( PoolUser, this, callss, getContractByCodeHash ); } }