/* 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 PoolContractJson } from "../Pool.ral.json"; import { getContractByCodeHash, registerContract } from "./contracts"; import * as types from "./types"; // Custom types for the contract export namespace PoolTypes { export type Fields = { parent: HexString; positionTemplate: HexString; dexAccountTemplate: HexString; tickTemplate: HexString; wordTemplate: HexString; configIndex: bigint; token0: HexString; token1: HexString; token2: HexString; fee: bigint; tickSpacing: bigint; maxLiquidityPerTick: bigint; nextNftIndex: bigint; slot0: types.Slot0; liquidity: bigint; rewardInfos: [types.Reward, types.Reward, types.Reward]; feeGrowths: [bigint, bigint, bigint]; protocolFees: types.ProtocolFees; }; export type State = ContractState; export type InitializeEvent = ContractEvent<{ sqrtPriceX96: bigint; tick: bigint; }>; export type SwapStartEvent = ContractEvent<{ sqrtPriceX96: bigint }>; export type SwapStepEvent = ContractEvent<{ sqrtPriceX96: bigint; liquidity: bigint; }>; export type SwapEvent = ContractEvent<{ sender: Address; recipient: Address; amount0: bigint; amount1: bigint; sqrtPriceX96: bigint; liquidity: bigint; tick: bigint; }>; export type MintEvent = ContractEvent<{ sender: Address; owner: Address; tickLower: bigint; tickUpper: bigint; liquidity: bigint; amount0: bigint; amount1: bigint; timestamp: bigint; }>; export type BurnEvent = ContractEvent<{ operator: Address; owner: Address; tickLower: bigint; tickUpper: bigint; liquidity: bigint; amount0: bigint; amount1: bigint; }>; export type CollectEvent = ContractEvent<{ operator: Address; recipient: Address; owner: Address; tickLower: bigint; tickUpper: bigint; amount0: bigint; amount1: bigint; amount2: bigint; }>; export type FeesEvent = ContractEvent<{ owner: Address; tickLower: bigint; tickUpper: bigint; amount0: bigint; amount1: bigint; amount2: bigint; timestamp: bigint; }>; export type CollectProtocolEvent = ContractEvent<{ sender: Address; recipient: Address; amount0: bigint; amount1: bigint; }>; export interface CallMethodTable { getCollectionUri: { params: Omit, "args">; result: CallContractResult; }; totalSupply: { params: Omit, "args">; result: CallContractResult; }; nftByIndex: { params: CallContractParams<{ index: bigint }>; result: CallContractResult; }; validateNFT: { params: CallContractParams<{ nftId: HexString; nftIndex: bigint }>; result: CallContractResult; }; getSqrtRatioAtTick: { params: CallContractParams<{ tick: bigint }>; result: CallContractResult; }; getTickAtSqrtRatio: { params: CallContractParams<{ sqrtPriceX96: bigint }>; result: CallContractResult; }; computeSwapStep: { params: CallContractParams<{ sqrtRatioCurrentX96: bigint; sqrtRatioTargetX96: bigint; liquidity_: bigint; amountRemaining: bigint; feePips: bigint; }>; result: CallContractResult<[bigint, bigint, bigint, bigint]>; }; divRoundingUp: { params: CallContractParams<{ x: bigint; y: bigint }>; result: CallContractResult; }; getNextSqrtPriceFromAmount0RoundingUp: { params: CallContractParams<{ sqrtPX96: bigint; liquidity_: bigint; amount: bigint; add: boolean; }>; result: CallContractResult; }; getNextSqrtPriceFromAmount1RoundingDown: { params: CallContractParams<{ sqrtPX96: bigint; liquidity_: bigint; amount: bigint; add: boolean; }>; result: CallContractResult; }; getNextSqrtPriceFromInput: { params: CallContractParams<{ sqrtPX96: bigint; liquidity_: bigint; amountIn: bigint; zeroForOne: boolean; }>; result: CallContractResult; }; getNextSqrtPriceFromOutput: { params: CallContractParams<{ sqrtPX96: bigint; liquidity_: bigint; amountOut: bigint; zeroForOne: boolean; }>; result: CallContractResult; }; getAmount0DeltaEx: { params: CallContractParams<{ sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint; roundUp: boolean; }>; result: CallContractResult; }; getAmount0Delta: { params: CallContractParams<{ sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint; }>; result: CallContractResult; }; getAmount1DeltaEx: { params: CallContractParams<{ sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint; roundUp: boolean; }>; result: CallContractResult; }; getAmount1Delta: { params: CallContractParams<{ sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint; }>; result: CallContractResult; }; mulDiv: { params: CallContractParams<{ a: bigint; b: bigint; denominator: bigint }>; result: CallContractResult; }; mulDivRoundingUp: { params: CallContractParams<{ a: bigint; b: bigint; denominator: bigint }>; result: CallContractResult; }; wordPath: { params: CallContractParams<{ compressed: bigint }>; result: CallContractResult; }; getWord: { params: CallContractParams<{ compressed: bigint }>; result: CallContractResult; }; getWordOrTemplate: { params: CallContractParams<{ compressed: bigint }>; result: CallContractResult; }; flipTick: { params: CallContractParams<{ tick: bigint }>; result: CallContractResult; }; nextInitializedTickWithinOneWord: { params: CallContractParams<{ tick: bigint; zeroForOne: boolean }>; result: CallContractResult<[bigint, boolean]>; }; positionPath: { params: CallContractParams<{ o: Address; tickLower: bigint; tickUpper: bigint; }>; result: CallContractResult; }; positionContractId: { params: CallContractParams<{ pool: HexString; o: Address; tickLower: bigint; tickUpper: bigint; }>; result: CallContractResult; }; configPath: { params: CallContractParams<{ configIndex_: bigint }>; result: CallContractResult; }; poolPath: { params: CallContractParams<{ factory: HexString; tokens: HexString; configIndex_: bigint; }>; result: CallContractResult; }; poolContractId: { params: CallContractParams<{ factory: HexString; tokens: HexString; configIndex_: bigint; }>; result: CallContractResult; }; checkTicks: { params: CallContractParams<{ tickLower: bigint; tickUpper: bigint }>; result: CallContractResult; }; tickPath: { params: CallContractParams<{ tick: bigint }>; result: CallContractResult; }; toTick: { params: CallContractParams<{ tick: bigint }>; result: CallContractResult; }; getTick: { params: CallContractParams<{ tick: bigint }>; result: CallContractResult<[HexString, boolean]>; }; toPosition: { params: CallContractParams<{ owner: Address; tickLower: bigint; tickUpper: bigint; }>; result: CallContractResult; }; getPosition: { params: CallContractParams<{ owner: Address; tickLower: bigint; tickUpper: bigint; }>; result: CallContractResult<[HexString, boolean]>; }; getFeeGrowthInside: { params: CallContractParams<{ tickLower: HexString; tickUpper: HexString; }>; result: CallContractResult<[bigint, bigint, bigint]>; }; updatePosition: { params: CallContractParams<{ position: HexString; owner: Address; tickLower: bigint; tickUpper: bigint; liquidityDelta: bigint; }>; result: CallContractResult<[bigint, bigint, bigint]>; }; modifyPosition: { params: CallContractParams<{ position: HexString; params: types.ModifyPositionParams; }>; result: CallContractResult<[bigint, bigint, [bigint, bigint, bigint]]>; }; mint: { params: CallContractParams<{ payer: Address; owner: Address; tickLower: bigint; tickUpper: bigint; amount: bigint; }>; result: CallContractResult<[bigint, bigint]>; }; burn: { params: CallContractParams<{ operator: Address; owner: Address; tickLower: bigint; tickUpper: bigint; amount: bigint; }>; result: CallContractResult<[bigint, bigint]>; }; collect: { params: CallContractParams<{ operator: Address; recipient: Address; owner: Address; tickLower: bigint; tickUpper: bigint; maxAmounts: [bigint, bigint, bigint]; }>; result: CallContractResult<[bigint, bigint, bigint]>; }; withdraw: { params: CallContractParams<{ recipient: Address; amounts: [bigint, bigint, bigint]; }>; result: CallContractResult; }; simulateSwap: { params: CallContractParams<{ zeroForOne: boolean; amountSpecified: bigint; data: HexString; maxSteps: bigint; }>; result: CallContractResult; }; swap: { params: CallContractParams<{ payer: Address; recipient: Address; token: HexString; zeroForOne: boolean; amountSpecified: bigint; sqrtPriceLimitX96: bigint; data: HexString; }>; result: CallContractResult<[bigint, bigint]>; }; pop: { params: CallContractParams<{ data: HexString; t: HexString; exactInput: boolean; }>; result: CallContractResult<[boolean, bigint, HexString, HexString]>; }; swapExactOut: { params: CallContractParams<{ p: types.SwapParams; refRewards: bigint }>; result: CallContractResult; }; swapExactIn: { params: CallContractParams<{ p: types.SwapParams; refRewards: bigint }>; result: CallContractResult; }; getSqrtPricesX96: { params: CallContractParams<{ tickLower: bigint; tickUpper: bigint }>; result: CallContractResult<[bigint, bigint, bigint]>; }; updateReward: { params: CallContractParams<{ index: bigint; blockTime: bigint }>; result: CallContractResult; }; updateRewards: { params: CallContractParams<{ blockTime: bigint }>; result: CallContractResult; }; extendRewards: { params: CallContractParams<{ payer: Address; index: bigint; amount: bigint; }>; result: CallContractResult; }; setRewardParams: { params: CallContractParams<{ payer: Address; index: bigint; openTime: bigint; endTime: bigint; amount: bigint; }>; result: CallContractResult; }; collectProtocolFees: { params: CallContractParams<{ recipient: Address }>; result: CallContractResult; }; positionInfo: { params: CallContractParams<{ owner: Address; tickLower: bigint; tickUpper: bigint; acc: bigint; iacc0: bigint; iacc1: bigint; t0: bigint; acct0: bigint; }>; result: CallContractResult; }; getTokenUri: { params: Omit, "args">; result: CallContractResult; }; } 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 { getCollectionUri: { params: Omit, "args">; result: SignExecuteScriptTxResult; }; totalSupply: { params: Omit, "args">; result: SignExecuteScriptTxResult; }; nftByIndex: { params: SignExecuteContractMethodParams<{ index: bigint }>; result: SignExecuteScriptTxResult; }; validateNFT: { params: SignExecuteContractMethodParams<{ nftId: HexString; nftIndex: bigint; }>; result: SignExecuteScriptTxResult; }; getSqrtRatioAtTick: { params: SignExecuteContractMethodParams<{ tick: bigint }>; result: SignExecuteScriptTxResult; }; getTickAtSqrtRatio: { params: SignExecuteContractMethodParams<{ sqrtPriceX96: bigint }>; result: SignExecuteScriptTxResult; }; computeSwapStep: { params: SignExecuteContractMethodParams<{ sqrtRatioCurrentX96: bigint; sqrtRatioTargetX96: bigint; liquidity_: bigint; amountRemaining: bigint; feePips: bigint; }>; result: SignExecuteScriptTxResult; }; divRoundingUp: { params: SignExecuteContractMethodParams<{ x: bigint; y: bigint }>; result: SignExecuteScriptTxResult; }; getNextSqrtPriceFromAmount0RoundingUp: { params: SignExecuteContractMethodParams<{ sqrtPX96: bigint; liquidity_: bigint; amount: bigint; add: boolean; }>; result: SignExecuteScriptTxResult; }; getNextSqrtPriceFromAmount1RoundingDown: { params: SignExecuteContractMethodParams<{ sqrtPX96: bigint; liquidity_: bigint; amount: bigint; add: boolean; }>; result: SignExecuteScriptTxResult; }; getNextSqrtPriceFromInput: { params: SignExecuteContractMethodParams<{ sqrtPX96: bigint; liquidity_: bigint; amountIn: bigint; zeroForOne: boolean; }>; result: SignExecuteScriptTxResult; }; getNextSqrtPriceFromOutput: { params: SignExecuteContractMethodParams<{ sqrtPX96: bigint; liquidity_: bigint; amountOut: bigint; zeroForOne: boolean; }>; result: SignExecuteScriptTxResult; }; getAmount0DeltaEx: { params: SignExecuteContractMethodParams<{ sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint; roundUp: boolean; }>; result: SignExecuteScriptTxResult; }; getAmount0Delta: { params: SignExecuteContractMethodParams<{ sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint; }>; result: SignExecuteScriptTxResult; }; getAmount1DeltaEx: { params: SignExecuteContractMethodParams<{ sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint; roundUp: boolean; }>; result: SignExecuteScriptTxResult; }; getAmount1Delta: { params: SignExecuteContractMethodParams<{ sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint; }>; result: SignExecuteScriptTxResult; }; mulDiv: { params: SignExecuteContractMethodParams<{ a: bigint; b: bigint; denominator: bigint; }>; result: SignExecuteScriptTxResult; }; mulDivRoundingUp: { params: SignExecuteContractMethodParams<{ a: bigint; b: bigint; denominator: bigint; }>; result: SignExecuteScriptTxResult; }; wordPath: { params: SignExecuteContractMethodParams<{ compressed: bigint }>; result: SignExecuteScriptTxResult; }; getWord: { params: SignExecuteContractMethodParams<{ compressed: bigint }>; result: SignExecuteScriptTxResult; }; getWordOrTemplate: { params: SignExecuteContractMethodParams<{ compressed: bigint }>; result: SignExecuteScriptTxResult; }; flipTick: { params: SignExecuteContractMethodParams<{ tick: bigint }>; result: SignExecuteScriptTxResult; }; nextInitializedTickWithinOneWord: { params: SignExecuteContractMethodParams<{ tick: bigint; zeroForOne: boolean; }>; result: SignExecuteScriptTxResult; }; positionPath: { params: SignExecuteContractMethodParams<{ o: Address; tickLower: bigint; tickUpper: bigint; }>; result: SignExecuteScriptTxResult; }; positionContractId: { params: SignExecuteContractMethodParams<{ pool: HexString; o: Address; tickLower: bigint; tickUpper: bigint; }>; result: SignExecuteScriptTxResult; }; configPath: { params: SignExecuteContractMethodParams<{ configIndex_: bigint }>; result: SignExecuteScriptTxResult; }; poolPath: { params: SignExecuteContractMethodParams<{ factory: HexString; tokens: HexString; configIndex_: bigint; }>; result: SignExecuteScriptTxResult; }; poolContractId: { params: SignExecuteContractMethodParams<{ factory: HexString; tokens: HexString; configIndex_: bigint; }>; result: SignExecuteScriptTxResult; }; checkTicks: { params: SignExecuteContractMethodParams<{ tickLower: bigint; tickUpper: bigint; }>; result: SignExecuteScriptTxResult; }; tickPath: { params: SignExecuteContractMethodParams<{ tick: bigint }>; result: SignExecuteScriptTxResult; }; toTick: { params: SignExecuteContractMethodParams<{ tick: bigint }>; result: SignExecuteScriptTxResult; }; getTick: { params: SignExecuteContractMethodParams<{ tick: bigint }>; result: SignExecuteScriptTxResult; }; toPosition: { params: SignExecuteContractMethodParams<{ owner: Address; tickLower: bigint; tickUpper: bigint; }>; result: SignExecuteScriptTxResult; }; getPosition: { params: SignExecuteContractMethodParams<{ owner: Address; tickLower: bigint; tickUpper: bigint; }>; result: SignExecuteScriptTxResult; }; getFeeGrowthInside: { params: SignExecuteContractMethodParams<{ tickLower: HexString; tickUpper: HexString; }>; result: SignExecuteScriptTxResult; }; updatePosition: { params: SignExecuteContractMethodParams<{ position: HexString; owner: Address; tickLower: bigint; tickUpper: bigint; liquidityDelta: bigint; }>; result: SignExecuteScriptTxResult; }; modifyPosition: { params: SignExecuteContractMethodParams<{ position: HexString; params: types.ModifyPositionParams; }>; result: SignExecuteScriptTxResult; }; mint: { params: SignExecuteContractMethodParams<{ payer: Address; owner: Address; tickLower: bigint; tickUpper: bigint; amount: bigint; }>; result: SignExecuteScriptTxResult; }; burn: { params: SignExecuteContractMethodParams<{ operator: Address; owner: Address; tickLower: bigint; tickUpper: bigint; amount: bigint; }>; result: SignExecuteScriptTxResult; }; collect: { params: SignExecuteContractMethodParams<{ operator: Address; recipient: Address; owner: Address; tickLower: bigint; tickUpper: bigint; maxAmounts: [bigint, bigint, bigint]; }>; result: SignExecuteScriptTxResult; }; withdraw: { params: SignExecuteContractMethodParams<{ recipient: Address; amounts: [bigint, bigint, bigint]; }>; result: SignExecuteScriptTxResult; }; simulateSwap: { params: SignExecuteContractMethodParams<{ zeroForOne: boolean; amountSpecified: bigint; data: HexString; maxSteps: bigint; }>; result: SignExecuteScriptTxResult; }; swap: { params: SignExecuteContractMethodParams<{ payer: Address; recipient: Address; token: HexString; zeroForOne: boolean; amountSpecified: bigint; sqrtPriceLimitX96: bigint; data: HexString; }>; result: SignExecuteScriptTxResult; }; pop: { params: SignExecuteContractMethodParams<{ data: HexString; t: HexString; exactInput: boolean; }>; result: SignExecuteScriptTxResult; }; swapExactOut: { params: SignExecuteContractMethodParams<{ p: types.SwapParams; refRewards: bigint; }>; result: SignExecuteScriptTxResult; }; swapExactIn: { params: SignExecuteContractMethodParams<{ p: types.SwapParams; refRewards: bigint; }>; result: SignExecuteScriptTxResult; }; getSqrtPricesX96: { params: SignExecuteContractMethodParams<{ tickLower: bigint; tickUpper: bigint; }>; result: SignExecuteScriptTxResult; }; updateReward: { params: SignExecuteContractMethodParams<{ index: bigint; blockTime: bigint; }>; result: SignExecuteScriptTxResult; }; updateRewards: { params: SignExecuteContractMethodParams<{ blockTime: bigint }>; result: SignExecuteScriptTxResult; }; extendRewards: { params: SignExecuteContractMethodParams<{ payer: Address; index: bigint; amount: bigint; }>; result: SignExecuteScriptTxResult; }; setRewardParams: { params: SignExecuteContractMethodParams<{ payer: Address; index: bigint; openTime: bigint; endTime: bigint; amount: bigint; }>; result: SignExecuteScriptTxResult; }; collectProtocolFees: { params: SignExecuteContractMethodParams<{ recipient: Address }>; result: SignExecuteScriptTxResult; }; positionInfo: { params: SignExecuteContractMethodParams<{ owner: Address; tickLower: bigint; tickUpper: bigint; acc: bigint; iacc0: bigint; iacc1: bigint; t0: bigint; acct0: bigint; }>; result: SignExecuteScriptTxResult; }; getTokenUri: { params: Omit, "args">; result: SignExecuteScriptTxResult; }; } export type SignExecuteMethodParams = SignExecuteMethodTable[T]["params"]; export type SignExecuteMethodResult = SignExecuteMethodTable[T]["result"]; } class Factory extends ContractFactory { encodeFields(fields: PoolTypes.Fields) { return encodeContractFields( addStdIdToFields(this.contract, fields), this.contract.fieldsSig, types.AllStructs ); } eventIndex = { Initialize: 0, SwapStart: 1, SwapStep: 2, Swap: 3, Mint: 4, Burn: 5, Collect: 6, Fees: 7, CollectProtocol: 8, }; consts = { MAX_PIPS: BigInt("1000000"), TickMathError: { SqrtPriceX96OutOfBounds: BigInt("201"), TickOutOfBounds: BigInt("202"), }, SqrtPriceMathError: { SqrtFromAmountOverflow: BigInt("221"), QuotientTooHigh: BigInt("222"), PriceZero: BigInt("223"), NoLiquidity: BigInt("224"), PriceNotFitIn160: BigInt("225"), }, FullMathError: { MulDivOverflow: BigInt("351") }, TickBitmapError: { TickNotAligned: BigInt("301") }, PathPrefixes: { Tick: BigInt("0"), Position: BigInt("1"), Word: BigInt("2"), }, PoolError: { TLU: BigInt("102"), TLM: BigInt("103"), TUM: BigInt("104"), AS: BigInt("105"), SPL: BigInt("106"), NP: BigInt("107"), UnauthorizedMint: BigInt("108"), NFTNotPartOfCollection: BigInt("109"), NFTByIndexNotSupported: BigInt("110"), UnauthorizedRewardSender: BigInt("111"), InvalidRewardParams: BigInt("112"), DexAccountNotFound: BigInt("113"), InvalidRewardIndex: BigInt("114"), RewardPeriodEnded: BigInt("115"), ZeroRewardAmount: BigInt("116"), }, }; at(address: string): PoolInstance { return new PoolInstance(address); } tests = { getCollectionUri: async ( params: Omit< TestContractParamsWithoutMaps, "args" > ): Promise> => { return testMethod( this, "getCollectionUri", params, getContractByCodeHash ); }, totalSupply: async ( params: Omit< TestContractParamsWithoutMaps, "args" > ): Promise> => { return testMethod(this, "totalSupply", params, getContractByCodeHash); }, nftByIndex: async ( params: TestContractParamsWithoutMaps ): Promise> => { return testMethod(this, "nftByIndex", params, getContractByCodeHash); }, validateNFT: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { nftId: HexString; nftIndex: bigint } > ): Promise> => { return testMethod(this, "validateNFT", params, getContractByCodeHash); }, getSqrtRatioAtTick: async ( params: TestContractParamsWithoutMaps ): Promise> => { return testMethod( this, "getSqrtRatioAtTick", params, getContractByCodeHash ); }, getTickAtSqrtRatio: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { sqrtPriceX96: bigint } > ): Promise> => { return testMethod( this, "getTickAtSqrtRatio", params, getContractByCodeHash ); }, computeSwapStep: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { sqrtRatioCurrentX96: bigint; sqrtRatioTargetX96: bigint; liquidity_: bigint; amountRemaining: bigint; feePips: bigint; } > ): Promise< TestContractResultWithoutMaps<[bigint, bigint, bigint, bigint]> > => { return testMethod(this, "computeSwapStep", params, getContractByCodeHash); }, divRoundingUp: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { x: bigint; y: bigint } > ): Promise> => { return testMethod(this, "divRoundingUp", params, getContractByCodeHash); }, getNextSqrtPriceFromAmount0RoundingUp: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { sqrtPX96: bigint; liquidity_: bigint; amount: bigint; add: boolean } > ): Promise> => { return testMethod( this, "getNextSqrtPriceFromAmount0RoundingUp", params, getContractByCodeHash ); }, getNextSqrtPriceFromAmount1RoundingDown: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { sqrtPX96: bigint; liquidity_: bigint; amount: bigint; add: boolean } > ): Promise> => { return testMethod( this, "getNextSqrtPriceFromAmount1RoundingDown", params, getContractByCodeHash ); }, getNextSqrtPriceFromInput: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { sqrtPX96: bigint; liquidity_: bigint; amountIn: bigint; zeroForOne: boolean; } > ): Promise> => { return testMethod( this, "getNextSqrtPriceFromInput", params, getContractByCodeHash ); }, getNextSqrtPriceFromOutput: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { sqrtPX96: bigint; liquidity_: bigint; amountOut: bigint; zeroForOne: boolean; } > ): Promise> => { return testMethod( this, "getNextSqrtPriceFromOutput", params, getContractByCodeHash ); }, getAmount0DeltaEx: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint; roundUp: boolean; } > ): Promise> => { return testMethod( this, "getAmount0DeltaEx", params, getContractByCodeHash ); }, getAmount0Delta: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint } > ): Promise> => { return testMethod(this, "getAmount0Delta", params, getContractByCodeHash); }, getAmount1DeltaEx: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint; roundUp: boolean; } > ): Promise> => { return testMethod( this, "getAmount1DeltaEx", params, getContractByCodeHash ); }, getAmount1Delta: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint } > ): Promise> => { return testMethod(this, "getAmount1Delta", params, getContractByCodeHash); }, mulDiv: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { a: bigint; b: bigint; denominator: bigint } > ): Promise> => { return testMethod(this, "mulDiv", params, getContractByCodeHash); }, mulDivRoundingUp: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { a: bigint; b: bigint; denominator: bigint } > ): Promise> => { return testMethod( this, "mulDivRoundingUp", params, getContractByCodeHash ); }, wordPath: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { compressed: bigint } > ): Promise> => { return testMethod(this, "wordPath", params, getContractByCodeHash); }, getWord: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { compressed: bigint } > ): Promise> => { return testMethod(this, "getWord", params, getContractByCodeHash); }, getWordOrTemplate: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { compressed: bigint } > ): Promise> => { return testMethod( this, "getWordOrTemplate", params, getContractByCodeHash ); }, flipTick: async ( params: TestContractParamsWithoutMaps ): Promise> => { return testMethod(this, "flipTick", params, getContractByCodeHash); }, nextInitializedTickWithinOneWord: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { tick: bigint; zeroForOne: boolean } > ): Promise> => { return testMethod( this, "nextInitializedTickWithinOneWord", params, getContractByCodeHash ); }, positionPath: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { o: Address; tickLower: bigint; tickUpper: bigint } > ): Promise> => { return testMethod(this, "positionPath", params, getContractByCodeHash); }, positionContractId: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { pool: HexString; o: Address; tickLower: bigint; tickUpper: bigint } > ): Promise> => { return testMethod( this, "positionContractId", params, getContractByCodeHash ); }, configPath: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { configIndex_: bigint } > ): Promise> => { return testMethod(this, "configPath", params, getContractByCodeHash); }, poolPath: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { factory: HexString; tokens: HexString; configIndex_: bigint } > ): Promise> => { return testMethod(this, "poolPath", params, getContractByCodeHash); }, poolContractId: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { factory: HexString; tokens: HexString; configIndex_: bigint } > ): Promise> => { return testMethod(this, "poolContractId", params, getContractByCodeHash); }, checkTicks: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { tickLower: bigint; tickUpper: bigint } > ): Promise> => { return testMethod(this, "checkTicks", params, getContractByCodeHash); }, tickPath: async ( params: TestContractParamsWithoutMaps ): Promise> => { return testMethod(this, "tickPath", params, getContractByCodeHash); }, toTick: async ( params: TestContractParamsWithoutMaps ): Promise> => { return testMethod(this, "toTick", params, getContractByCodeHash); }, getTick: async ( params: TestContractParamsWithoutMaps ): Promise> => { return testMethod(this, "getTick", params, getContractByCodeHash); }, toPosition: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { owner: Address; tickLower: bigint; tickUpper: bigint } > ): Promise> => { return testMethod(this, "toPosition", params, getContractByCodeHash); }, getPosition: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { owner: Address; tickLower: bigint; tickUpper: bigint } > ): Promise> => { return testMethod(this, "getPosition", params, getContractByCodeHash); }, getFeeGrowthInside: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { tickLower: HexString; tickUpper: HexString } > ): Promise> => { return testMethod( this, "getFeeGrowthInside", params, getContractByCodeHash ); }, updatePosition: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { position: HexString; owner: Address; tickLower: bigint; tickUpper: bigint; liquidityDelta: bigint; } > ): Promise> => { return testMethod(this, "updatePosition", params, getContractByCodeHash); }, modifyPosition: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { position: HexString; params: types.ModifyPositionParams } > ): Promise< TestContractResultWithoutMaps<[bigint, bigint, [bigint, bigint, bigint]]> > => { return testMethod(this, "modifyPosition", params, getContractByCodeHash); }, mint: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { payer: Address; owner: Address; tickLower: bigint; tickUpper: bigint; amount: bigint; } > ): Promise> => { return testMethod(this, "mint", params, getContractByCodeHash); }, burn: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { operator: Address; owner: Address; tickLower: bigint; tickUpper: bigint; amount: bigint; } > ): Promise> => { return testMethod(this, "burn", params, getContractByCodeHash); }, collect: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { operator: Address; recipient: Address; owner: Address; tickLower: bigint; tickUpper: bigint; maxAmounts: [bigint, bigint, bigint]; } > ): Promise> => { return testMethod(this, "collect", params, getContractByCodeHash); }, withdraw: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { recipient: Address; amounts: [bigint, bigint, bigint] } > ): Promise> => { return testMethod(this, "withdraw", params, getContractByCodeHash); }, simulateSwap: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { zeroForOne: boolean; amountSpecified: bigint; data: HexString; maxSteps: bigint; } > ): Promise> => { return testMethod(this, "simulateSwap", params, getContractByCodeHash); }, swap: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { payer: Address; recipient: Address; token: HexString; zeroForOne: boolean; amountSpecified: bigint; sqrtPriceLimitX96: bigint; data: HexString; } > ): Promise> => { return testMethod(this, "swap", params, getContractByCodeHash); }, pop: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { data: HexString; t: HexString; exactInput: boolean } > ): Promise< TestContractResultWithoutMaps<[boolean, bigint, HexString, HexString]> > => { return testMethod(this, "pop", params, getContractByCodeHash); }, swapExactOut: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { p: types.SwapParams; refRewards: bigint } > ): Promise> => { return testMethod(this, "swapExactOut", params, getContractByCodeHash); }, swapExactIn: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { p: types.SwapParams; refRewards: bigint } > ): Promise> => { return testMethod(this, "swapExactIn", params, getContractByCodeHash); }, getSqrtPricesX96: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { tickLower: bigint; tickUpper: bigint } > ): Promise> => { return testMethod( this, "getSqrtPricesX96", params, getContractByCodeHash ); }, updateReward: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { index: bigint; blockTime: bigint } > ): Promise> => { return testMethod(this, "updateReward", params, getContractByCodeHash); }, updateRewards: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { blockTime: bigint } > ): Promise> => { return testMethod(this, "updateRewards", params, getContractByCodeHash); }, extendRewards: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { payer: Address; index: bigint; amount: bigint } > ): Promise> => { return testMethod(this, "extendRewards", params, getContractByCodeHash); }, setRewardParams: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { payer: Address; index: bigint; openTime: bigint; endTime: bigint; amount: bigint; } > ): Promise> => { return testMethod(this, "setRewardParams", params, getContractByCodeHash); }, collectProtocolFees: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { recipient: Address } > ): Promise> => { return testMethod( this, "collectProtocolFees", params, getContractByCodeHash ); }, positionInfo: async ( params: TestContractParamsWithoutMaps< PoolTypes.Fields, { owner: Address; tickLower: bigint; tickUpper: bigint; acc: bigint; iacc0: bigint; iacc1: bigint; t0: bigint; acct0: bigint; } > ): Promise> => { return testMethod(this, "positionInfo", params, getContractByCodeHash); }, getTokenUri: async ( params: Omit< TestContractParamsWithoutMaps, "args" > ): Promise> => { return testMethod(this, "getTokenUri", params, getContractByCodeHash); }, }; stateForTest(initFields: PoolTypes.Fields, asset?: Asset, address?: string) { return this.stateForTest_(initFields, asset, address, undefined); } } // Use this object to test and deploy the contract export const Pool = new Factory( Contract.fromJson( PoolContractJson, "", "cdb37fb2772ba9c976a4dc34db15994ecaeef82d8690b9a94c600a81c67f98c4", types.AllStructs ) ); registerContract(Pool); // Use this class to interact with the blockchain export class PoolInstance extends ContractInstance { constructor(address: Address) { super(address); } async fetchState(): Promise { return fetchContractState(Pool, this); } async getContractEventsCurrentCount(): Promise { return getContractEventsCurrentCount(this.address); } subscribeInitializeEvent( options: EventSubscribeOptions, fromCount?: number ): EventSubscription { return subscribeContractEvent( Pool.contract, this, options, "Initialize", fromCount ); } subscribeSwapStartEvent( options: EventSubscribeOptions, fromCount?: number ): EventSubscription { return subscribeContractEvent( Pool.contract, this, options, "SwapStart", fromCount ); } subscribeSwapStepEvent( options: EventSubscribeOptions, fromCount?: number ): EventSubscription { return subscribeContractEvent( Pool.contract, this, options, "SwapStep", fromCount ); } subscribeSwapEvent( options: EventSubscribeOptions, fromCount?: number ): EventSubscription { return subscribeContractEvent( Pool.contract, this, options, "Swap", fromCount ); } subscribeMintEvent( options: EventSubscribeOptions, fromCount?: number ): EventSubscription { return subscribeContractEvent( Pool.contract, this, options, "Mint", fromCount ); } subscribeBurnEvent( options: EventSubscribeOptions, fromCount?: number ): EventSubscription { return subscribeContractEvent( Pool.contract, this, options, "Burn", fromCount ); } subscribeCollectEvent( options: EventSubscribeOptions, fromCount?: number ): EventSubscription { return subscribeContractEvent( Pool.contract, this, options, "Collect", fromCount ); } subscribeFeesEvent( options: EventSubscribeOptions, fromCount?: number ): EventSubscription { return subscribeContractEvent( Pool.contract, this, options, "Fees", fromCount ); } subscribeCollectProtocolEvent( options: EventSubscribeOptions, fromCount?: number ): EventSubscription { return subscribeContractEvent( Pool.contract, this, options, "CollectProtocol", fromCount ); } subscribeAllEvents( options: EventSubscribeOptions< | PoolTypes.InitializeEvent | PoolTypes.SwapStartEvent | PoolTypes.SwapStepEvent | PoolTypes.SwapEvent | PoolTypes.MintEvent | PoolTypes.BurnEvent | PoolTypes.CollectEvent | PoolTypes.FeesEvent | PoolTypes.CollectProtocolEvent >, fromCount?: number ): EventSubscription { return subscribeContractEvents(Pool.contract, this, options, fromCount); } view = { getCollectionUri: async ( params?: PoolTypes.CallMethodParams<"getCollectionUri"> ): Promise> => { return callMethod( Pool, this, "getCollectionUri", params === undefined ? {} : params, getContractByCodeHash ); }, totalSupply: async ( params?: PoolTypes.CallMethodParams<"totalSupply"> ): Promise> => { return callMethod( Pool, this, "totalSupply", params === undefined ? {} : params, getContractByCodeHash ); }, nftByIndex: async ( params: PoolTypes.CallMethodParams<"nftByIndex"> ): Promise> => { return callMethod( Pool, this, "nftByIndex", params, getContractByCodeHash ); }, validateNFT: async ( params: PoolTypes.CallMethodParams<"validateNFT"> ): Promise> => { return callMethod( Pool, this, "validateNFT", params, getContractByCodeHash ); }, getSqrtRatioAtTick: async ( params: PoolTypes.CallMethodParams<"getSqrtRatioAtTick"> ): Promise> => { return callMethod( Pool, this, "getSqrtRatioAtTick", params, getContractByCodeHash ); }, getTickAtSqrtRatio: async ( params: PoolTypes.CallMethodParams<"getTickAtSqrtRatio"> ): Promise> => { return callMethod( Pool, this, "getTickAtSqrtRatio", params, getContractByCodeHash ); }, computeSwapStep: async ( params: PoolTypes.CallMethodParams<"computeSwapStep"> ): Promise> => { return callMethod( Pool, this, "computeSwapStep", params, getContractByCodeHash ); }, divRoundingUp: async ( params: PoolTypes.CallMethodParams<"divRoundingUp"> ): Promise> => { return callMethod( Pool, this, "divRoundingUp", params, getContractByCodeHash ); }, getNextSqrtPriceFromAmount0RoundingUp: async ( params: PoolTypes.CallMethodParams<"getNextSqrtPriceFromAmount0RoundingUp"> ): Promise< PoolTypes.CallMethodResult<"getNextSqrtPriceFromAmount0RoundingUp"> > => { return callMethod( Pool, this, "getNextSqrtPriceFromAmount0RoundingUp", params, getContractByCodeHash ); }, getNextSqrtPriceFromAmount1RoundingDown: async ( params: PoolTypes.CallMethodParams<"getNextSqrtPriceFromAmount1RoundingDown"> ): Promise< PoolTypes.CallMethodResult<"getNextSqrtPriceFromAmount1RoundingDown"> > => { return callMethod( Pool, this, "getNextSqrtPriceFromAmount1RoundingDown", params, getContractByCodeHash ); }, getNextSqrtPriceFromInput: async ( params: PoolTypes.CallMethodParams<"getNextSqrtPriceFromInput"> ): Promise> => { return callMethod( Pool, this, "getNextSqrtPriceFromInput", params, getContractByCodeHash ); }, getNextSqrtPriceFromOutput: async ( params: PoolTypes.CallMethodParams<"getNextSqrtPriceFromOutput"> ): Promise> => { return callMethod( Pool, this, "getNextSqrtPriceFromOutput", params, getContractByCodeHash ); }, getAmount0DeltaEx: async ( params: PoolTypes.CallMethodParams<"getAmount0DeltaEx"> ): Promise> => { return callMethod( Pool, this, "getAmount0DeltaEx", params, getContractByCodeHash ); }, getAmount0Delta: async ( params: PoolTypes.CallMethodParams<"getAmount0Delta"> ): Promise> => { return callMethod( Pool, this, "getAmount0Delta", params, getContractByCodeHash ); }, getAmount1DeltaEx: async ( params: PoolTypes.CallMethodParams<"getAmount1DeltaEx"> ): Promise> => { return callMethod( Pool, this, "getAmount1DeltaEx", params, getContractByCodeHash ); }, getAmount1Delta: async ( params: PoolTypes.CallMethodParams<"getAmount1Delta"> ): Promise> => { return callMethod( Pool, this, "getAmount1Delta", params, getContractByCodeHash ); }, mulDiv: async ( params: PoolTypes.CallMethodParams<"mulDiv"> ): Promise> => { return callMethod(Pool, this, "mulDiv", params, getContractByCodeHash); }, mulDivRoundingUp: async ( params: PoolTypes.CallMethodParams<"mulDivRoundingUp"> ): Promise> => { return callMethod( Pool, this, "mulDivRoundingUp", params, getContractByCodeHash ); }, wordPath: async ( params: PoolTypes.CallMethodParams<"wordPath"> ): Promise> => { return callMethod(Pool, this, "wordPath", params, getContractByCodeHash); }, getWord: async ( params: PoolTypes.CallMethodParams<"getWord"> ): Promise> => { return callMethod(Pool, this, "getWord", params, getContractByCodeHash); }, getWordOrTemplate: async ( params: PoolTypes.CallMethodParams<"getWordOrTemplate"> ): Promise> => { return callMethod( Pool, this, "getWordOrTemplate", params, getContractByCodeHash ); }, flipTick: async ( params: PoolTypes.CallMethodParams<"flipTick"> ): Promise> => { return callMethod(Pool, this, "flipTick", params, getContractByCodeHash); }, nextInitializedTickWithinOneWord: async ( params: PoolTypes.CallMethodParams<"nextInitializedTickWithinOneWord"> ): Promise< PoolTypes.CallMethodResult<"nextInitializedTickWithinOneWord"> > => { return callMethod( Pool, this, "nextInitializedTickWithinOneWord", params, getContractByCodeHash ); }, positionPath: async ( params: PoolTypes.CallMethodParams<"positionPath"> ): Promise> => { return callMethod( Pool, this, "positionPath", params, getContractByCodeHash ); }, positionContractId: async ( params: PoolTypes.CallMethodParams<"positionContractId"> ): Promise> => { return callMethod( Pool, this, "positionContractId", params, getContractByCodeHash ); }, configPath: async ( params: PoolTypes.CallMethodParams<"configPath"> ): Promise> => { return callMethod( Pool, this, "configPath", params, getContractByCodeHash ); }, poolPath: async ( params: PoolTypes.CallMethodParams<"poolPath"> ): Promise> => { return callMethod(Pool, this, "poolPath", params, getContractByCodeHash); }, poolContractId: async ( params: PoolTypes.CallMethodParams<"poolContractId"> ): Promise> => { return callMethod( Pool, this, "poolContractId", params, getContractByCodeHash ); }, checkTicks: async ( params: PoolTypes.CallMethodParams<"checkTicks"> ): Promise> => { return callMethod( Pool, this, "checkTicks", params, getContractByCodeHash ); }, tickPath: async ( params: PoolTypes.CallMethodParams<"tickPath"> ): Promise> => { return callMethod(Pool, this, "tickPath", params, getContractByCodeHash); }, toTick: async ( params: PoolTypes.CallMethodParams<"toTick"> ): Promise> => { return callMethod(Pool, this, "toTick", params, getContractByCodeHash); }, getTick: async ( params: PoolTypes.CallMethodParams<"getTick"> ): Promise> => { return callMethod(Pool, this, "getTick", params, getContractByCodeHash); }, toPosition: async ( params: PoolTypes.CallMethodParams<"toPosition"> ): Promise> => { return callMethod( Pool, this, "toPosition", params, getContractByCodeHash ); }, getPosition: async ( params: PoolTypes.CallMethodParams<"getPosition"> ): Promise> => { return callMethod( Pool, this, "getPosition", params, getContractByCodeHash ); }, getFeeGrowthInside: async ( params: PoolTypes.CallMethodParams<"getFeeGrowthInside"> ): Promise> => { return callMethod( Pool, this, "getFeeGrowthInside", params, getContractByCodeHash ); }, updatePosition: async ( params: PoolTypes.CallMethodParams<"updatePosition"> ): Promise> => { return callMethod( Pool, this, "updatePosition", params, getContractByCodeHash ); }, modifyPosition: async ( params: PoolTypes.CallMethodParams<"modifyPosition"> ): Promise> => { return callMethod( Pool, this, "modifyPosition", params, getContractByCodeHash ); }, mint: async ( params: PoolTypes.CallMethodParams<"mint"> ): Promise> => { return callMethod(Pool, this, "mint", params, getContractByCodeHash); }, burn: async ( params: PoolTypes.CallMethodParams<"burn"> ): Promise> => { return callMethod(Pool, this, "burn", params, getContractByCodeHash); }, collect: async ( params: PoolTypes.CallMethodParams<"collect"> ): Promise> => { return callMethod(Pool, this, "collect", params, getContractByCodeHash); }, withdraw: async ( params: PoolTypes.CallMethodParams<"withdraw"> ): Promise> => { return callMethod(Pool, this, "withdraw", params, getContractByCodeHash); }, simulateSwap: async ( params: PoolTypes.CallMethodParams<"simulateSwap"> ): Promise> => { return callMethod( Pool, this, "simulateSwap", params, getContractByCodeHash ); }, swap: async ( params: PoolTypes.CallMethodParams<"swap"> ): Promise> => { return callMethod(Pool, this, "swap", params, getContractByCodeHash); }, pop: async ( params: PoolTypes.CallMethodParams<"pop"> ): Promise> => { return callMethod(Pool, this, "pop", params, getContractByCodeHash); }, swapExactOut: async ( params: PoolTypes.CallMethodParams<"swapExactOut"> ): Promise> => { return callMethod( Pool, this, "swapExactOut", params, getContractByCodeHash ); }, swapExactIn: async ( params: PoolTypes.CallMethodParams<"swapExactIn"> ): Promise> => { return callMethod( Pool, this, "swapExactIn", params, getContractByCodeHash ); }, getSqrtPricesX96: async ( params: PoolTypes.CallMethodParams<"getSqrtPricesX96"> ): Promise> => { return callMethod( Pool, this, "getSqrtPricesX96", params, getContractByCodeHash ); }, updateReward: async ( params: PoolTypes.CallMethodParams<"updateReward"> ): Promise> => { return callMethod( Pool, this, "updateReward", params, getContractByCodeHash ); }, updateRewards: async ( params: PoolTypes.CallMethodParams<"updateRewards"> ): Promise> => { return callMethod( Pool, this, "updateRewards", params, getContractByCodeHash ); }, extendRewards: async ( params: PoolTypes.CallMethodParams<"extendRewards"> ): Promise> => { return callMethod( Pool, this, "extendRewards", params, getContractByCodeHash ); }, setRewardParams: async ( params: PoolTypes.CallMethodParams<"setRewardParams"> ): Promise> => { return callMethod( Pool, this, "setRewardParams", params, getContractByCodeHash ); }, collectProtocolFees: async ( params: PoolTypes.CallMethodParams<"collectProtocolFees"> ): Promise> => { return callMethod( Pool, this, "collectProtocolFees", params, getContractByCodeHash ); }, positionInfo: async ( params: PoolTypes.CallMethodParams<"positionInfo"> ): Promise> => { return callMethod( Pool, this, "positionInfo", params, getContractByCodeHash ); }, getTokenUri: async ( params?: PoolTypes.CallMethodParams<"getTokenUri"> ): Promise> => { return callMethod( Pool, this, "getTokenUri", params === undefined ? {} : params, getContractByCodeHash ); }, }; transact = { getCollectionUri: async ( params: PoolTypes.SignExecuteMethodParams<"getCollectionUri"> ): Promise> => { return signExecuteMethod(Pool, this, "getCollectionUri", params); }, totalSupply: async ( params: PoolTypes.SignExecuteMethodParams<"totalSupply"> ): Promise> => { return signExecuteMethod(Pool, this, "totalSupply", params); }, nftByIndex: async ( params: PoolTypes.SignExecuteMethodParams<"nftByIndex"> ): Promise> => { return signExecuteMethod(Pool, this, "nftByIndex", params); }, validateNFT: async ( params: PoolTypes.SignExecuteMethodParams<"validateNFT"> ): Promise> => { return signExecuteMethod(Pool, this, "validateNFT", params); }, getSqrtRatioAtTick: async ( params: PoolTypes.SignExecuteMethodParams<"getSqrtRatioAtTick"> ): Promise> => { return signExecuteMethod(Pool, this, "getSqrtRatioAtTick", params); }, getTickAtSqrtRatio: async ( params: PoolTypes.SignExecuteMethodParams<"getTickAtSqrtRatio"> ): Promise> => { return signExecuteMethod(Pool, this, "getTickAtSqrtRatio", params); }, computeSwapStep: async ( params: PoolTypes.SignExecuteMethodParams<"computeSwapStep"> ): Promise> => { return signExecuteMethod(Pool, this, "computeSwapStep", params); }, divRoundingUp: async ( params: PoolTypes.SignExecuteMethodParams<"divRoundingUp"> ): Promise> => { return signExecuteMethod(Pool, this, "divRoundingUp", params); }, getNextSqrtPriceFromAmount0RoundingUp: async ( params: PoolTypes.SignExecuteMethodParams<"getNextSqrtPriceFromAmount0RoundingUp"> ): Promise< PoolTypes.SignExecuteMethodResult<"getNextSqrtPriceFromAmount0RoundingUp"> > => { return signExecuteMethod( Pool, this, "getNextSqrtPriceFromAmount0RoundingUp", params ); }, getNextSqrtPriceFromAmount1RoundingDown: async ( params: PoolTypes.SignExecuteMethodParams<"getNextSqrtPriceFromAmount1RoundingDown"> ): Promise< PoolTypes.SignExecuteMethodResult<"getNextSqrtPriceFromAmount1RoundingDown"> > => { return signExecuteMethod( Pool, this, "getNextSqrtPriceFromAmount1RoundingDown", params ); }, getNextSqrtPriceFromInput: async ( params: PoolTypes.SignExecuteMethodParams<"getNextSqrtPriceFromInput"> ): Promise< PoolTypes.SignExecuteMethodResult<"getNextSqrtPriceFromInput"> > => { return signExecuteMethod(Pool, this, "getNextSqrtPriceFromInput", params); }, getNextSqrtPriceFromOutput: async ( params: PoolTypes.SignExecuteMethodParams<"getNextSqrtPriceFromOutput"> ): Promise< PoolTypes.SignExecuteMethodResult<"getNextSqrtPriceFromOutput"> > => { return signExecuteMethod( Pool, this, "getNextSqrtPriceFromOutput", params ); }, getAmount0DeltaEx: async ( params: PoolTypes.SignExecuteMethodParams<"getAmount0DeltaEx"> ): Promise> => { return signExecuteMethod(Pool, this, "getAmount0DeltaEx", params); }, getAmount0Delta: async ( params: PoolTypes.SignExecuteMethodParams<"getAmount0Delta"> ): Promise> => { return signExecuteMethod(Pool, this, "getAmount0Delta", params); }, getAmount1DeltaEx: async ( params: PoolTypes.SignExecuteMethodParams<"getAmount1DeltaEx"> ): Promise> => { return signExecuteMethod(Pool, this, "getAmount1DeltaEx", params); }, getAmount1Delta: async ( params: PoolTypes.SignExecuteMethodParams<"getAmount1Delta"> ): Promise> => { return signExecuteMethod(Pool, this, "getAmount1Delta", params); }, mulDiv: async ( params: PoolTypes.SignExecuteMethodParams<"mulDiv"> ): Promise> => { return signExecuteMethod(Pool, this, "mulDiv", params); }, mulDivRoundingUp: async ( params: PoolTypes.SignExecuteMethodParams<"mulDivRoundingUp"> ): Promise> => { return signExecuteMethod(Pool, this, "mulDivRoundingUp", params); }, wordPath: async ( params: PoolTypes.SignExecuteMethodParams<"wordPath"> ): Promise> => { return signExecuteMethod(Pool, this, "wordPath", params); }, getWord: async ( params: PoolTypes.SignExecuteMethodParams<"getWord"> ): Promise> => { return signExecuteMethod(Pool, this, "getWord", params); }, getWordOrTemplate: async ( params: PoolTypes.SignExecuteMethodParams<"getWordOrTemplate"> ): Promise> => { return signExecuteMethod(Pool, this, "getWordOrTemplate", params); }, flipTick: async ( params: PoolTypes.SignExecuteMethodParams<"flipTick"> ): Promise> => { return signExecuteMethod(Pool, this, "flipTick", params); }, nextInitializedTickWithinOneWord: async ( params: PoolTypes.SignExecuteMethodParams<"nextInitializedTickWithinOneWord"> ): Promise< PoolTypes.SignExecuteMethodResult<"nextInitializedTickWithinOneWord"> > => { return signExecuteMethod( Pool, this, "nextInitializedTickWithinOneWord", params ); }, positionPath: async ( params: PoolTypes.SignExecuteMethodParams<"positionPath"> ): Promise> => { return signExecuteMethod(Pool, this, "positionPath", params); }, positionContractId: async ( params: PoolTypes.SignExecuteMethodParams<"positionContractId"> ): Promise> => { return signExecuteMethod(Pool, this, "positionContractId", params); }, configPath: async ( params: PoolTypes.SignExecuteMethodParams<"configPath"> ): Promise> => { return signExecuteMethod(Pool, this, "configPath", params); }, poolPath: async ( params: PoolTypes.SignExecuteMethodParams<"poolPath"> ): Promise> => { return signExecuteMethod(Pool, this, "poolPath", params); }, poolContractId: async ( params: PoolTypes.SignExecuteMethodParams<"poolContractId"> ): Promise> => { return signExecuteMethod(Pool, this, "poolContractId", params); }, checkTicks: async ( params: PoolTypes.SignExecuteMethodParams<"checkTicks"> ): Promise> => { return signExecuteMethod(Pool, this, "checkTicks", params); }, tickPath: async ( params: PoolTypes.SignExecuteMethodParams<"tickPath"> ): Promise> => { return signExecuteMethod(Pool, this, "tickPath", params); }, toTick: async ( params: PoolTypes.SignExecuteMethodParams<"toTick"> ): Promise> => { return signExecuteMethod(Pool, this, "toTick", params); }, getTick: async ( params: PoolTypes.SignExecuteMethodParams<"getTick"> ): Promise> => { return signExecuteMethod(Pool, this, "getTick", params); }, toPosition: async ( params: PoolTypes.SignExecuteMethodParams<"toPosition"> ): Promise> => { return signExecuteMethod(Pool, this, "toPosition", params); }, getPosition: async ( params: PoolTypes.SignExecuteMethodParams<"getPosition"> ): Promise> => { return signExecuteMethod(Pool, this, "getPosition", params); }, getFeeGrowthInside: async ( params: PoolTypes.SignExecuteMethodParams<"getFeeGrowthInside"> ): Promise> => { return signExecuteMethod(Pool, this, "getFeeGrowthInside", params); }, updatePosition: async ( params: PoolTypes.SignExecuteMethodParams<"updatePosition"> ): Promise> => { return signExecuteMethod(Pool, this, "updatePosition", params); }, modifyPosition: async ( params: PoolTypes.SignExecuteMethodParams<"modifyPosition"> ): Promise> => { return signExecuteMethod(Pool, this, "modifyPosition", params); }, mint: async ( params: PoolTypes.SignExecuteMethodParams<"mint"> ): Promise> => { return signExecuteMethod(Pool, this, "mint", params); }, burn: async ( params: PoolTypes.SignExecuteMethodParams<"burn"> ): Promise> => { return signExecuteMethod(Pool, this, "burn", params); }, collect: async ( params: PoolTypes.SignExecuteMethodParams<"collect"> ): Promise> => { return signExecuteMethod(Pool, this, "collect", params); }, withdraw: async ( params: PoolTypes.SignExecuteMethodParams<"withdraw"> ): Promise> => { return signExecuteMethod(Pool, this, "withdraw", params); }, simulateSwap: async ( params: PoolTypes.SignExecuteMethodParams<"simulateSwap"> ): Promise> => { return signExecuteMethod(Pool, this, "simulateSwap", params); }, swap: async ( params: PoolTypes.SignExecuteMethodParams<"swap"> ): Promise> => { return signExecuteMethod(Pool, this, "swap", params); }, pop: async ( params: PoolTypes.SignExecuteMethodParams<"pop"> ): Promise> => { return signExecuteMethod(Pool, this, "pop", params); }, swapExactOut: async ( params: PoolTypes.SignExecuteMethodParams<"swapExactOut"> ): Promise> => { return signExecuteMethod(Pool, this, "swapExactOut", params); }, swapExactIn: async ( params: PoolTypes.SignExecuteMethodParams<"swapExactIn"> ): Promise> => { return signExecuteMethod(Pool, this, "swapExactIn", params); }, getSqrtPricesX96: async ( params: PoolTypes.SignExecuteMethodParams<"getSqrtPricesX96"> ): Promise> => { return signExecuteMethod(Pool, this, "getSqrtPricesX96", params); }, updateReward: async ( params: PoolTypes.SignExecuteMethodParams<"updateReward"> ): Promise> => { return signExecuteMethod(Pool, this, "updateReward", params); }, updateRewards: async ( params: PoolTypes.SignExecuteMethodParams<"updateRewards"> ): Promise> => { return signExecuteMethod(Pool, this, "updateRewards", params); }, extendRewards: async ( params: PoolTypes.SignExecuteMethodParams<"extendRewards"> ): Promise> => { return signExecuteMethod(Pool, this, "extendRewards", params); }, setRewardParams: async ( params: PoolTypes.SignExecuteMethodParams<"setRewardParams"> ): Promise> => { return signExecuteMethod(Pool, this, "setRewardParams", params); }, collectProtocolFees: async ( params: PoolTypes.SignExecuteMethodParams<"collectProtocolFees"> ): Promise> => { return signExecuteMethod(Pool, this, "collectProtocolFees", params); }, positionInfo: async ( params: PoolTypes.SignExecuteMethodParams<"positionInfo"> ): Promise> => { return signExecuteMethod(Pool, this, "positionInfo", params); }, getTokenUri: async ( params: PoolTypes.SignExecuteMethodParams<"getTokenUri"> ): Promise> => { return signExecuteMethod(Pool, this, "getTokenUri", params); }, }; async multicall( calls: Calls ): Promise>; async multicall( callss: Narrow ): Promise>; async multicall< Callss extends PoolTypes.MultiCallParams | PoolTypes.MultiCallParams[] >(callss: Callss): Promise { return await multicallMethods(Pool, this, callss, getContractByCodeHash); } }