/* 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 TickBitmapTestContractJson } from "../TickBitmapTest.ral.json"; import { getContractByCodeHash, registerContract } from "./contracts"; import * as types from "./types"; // Custom types for the contract export namespace TickBitmapTestTypes { export type Fields = { wordTemplate: HexString; tickSpacing: bigint; }; export type State = ContractState; export interface CallMethodTable { 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; }; deploy: { params: CallContractParams<{ payer: Address; word: HexString; ts: bigint; }>; result: CallContractResult; }; flipTick_: { params: CallContractParams<{ tick: bigint }>; 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 { 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; }; deploy: { params: SignExecuteContractMethodParams<{ payer: Address; word: HexString; ts: bigint; }>; result: SignExecuteScriptTxResult; }; flipTick_: { params: SignExecuteContractMethodParams<{ tick: bigint }>; result: SignExecuteScriptTxResult; }; } export type SignExecuteMethodParams = SignExecuteMethodTable[T]["params"]; export type SignExecuteMethodResult = SignExecuteMethodTable[T]["result"]; } class Factory extends ContractFactory< TickBitmapTestInstance, TickBitmapTestTypes.Fields > { encodeFields(fields: TickBitmapTestTypes.Fields) { return encodeContractFields( addStdIdToFields(this.contract, fields), this.contract.fieldsSig, types.AllStructs ); } consts = { TickBitmapError: { TickNotAligned: BigInt("301") }, PathPrefixes: { Tick: BigInt("0"), Position: BigInt("1"), Word: BigInt("2"), }, }; at(address: string): TickBitmapTestInstance { return new TickBitmapTestInstance(address); } tests = { wordPath: async ( params: TestContractParamsWithoutMaps< TickBitmapTestTypes.Fields, { compressed: bigint } > ): Promise> => { return testMethod(this, "wordPath", params, getContractByCodeHash); }, getWord: async ( params: TestContractParamsWithoutMaps< TickBitmapTestTypes.Fields, { compressed: bigint } > ): Promise> => { return testMethod(this, "getWord", params, getContractByCodeHash); }, getWordOrTemplate: async ( params: TestContractParamsWithoutMaps< TickBitmapTestTypes.Fields, { compressed: bigint } > ): Promise> => { return testMethod( this, "getWordOrTemplate", params, getContractByCodeHash ); }, flipTick: async ( params: TestContractParamsWithoutMaps< TickBitmapTestTypes.Fields, { tick: bigint } > ): Promise> => { return testMethod(this, "flipTick", params, getContractByCodeHash); }, nextInitializedTickWithinOneWord: async ( params: TestContractParamsWithoutMaps< TickBitmapTestTypes.Fields, { tick: bigint; zeroForOne: boolean } > ): Promise> => { return testMethod( this, "nextInitializedTickWithinOneWord", params, getContractByCodeHash ); }, positionPath: async ( params: TestContractParamsWithoutMaps< TickBitmapTestTypes.Fields, { o: Address; tickLower: bigint; tickUpper: bigint } > ): Promise> => { return testMethod(this, "positionPath", params, getContractByCodeHash); }, positionContractId: async ( params: TestContractParamsWithoutMaps< TickBitmapTestTypes.Fields, { pool: HexString; o: Address; tickLower: bigint; tickUpper: bigint } > ): Promise> => { return testMethod( this, "positionContractId", params, getContractByCodeHash ); }, deploy: async ( params: TestContractParamsWithoutMaps< TickBitmapTestTypes.Fields, { payer: Address; word: HexString; ts: bigint } > ): Promise> => { return testMethod(this, "deploy", params, getContractByCodeHash); }, flipTick_: async ( params: TestContractParamsWithoutMaps< TickBitmapTestTypes.Fields, { tick: bigint } > ): Promise> => { return testMethod(this, "flipTick_", params, getContractByCodeHash); }, }; stateForTest( initFields: TickBitmapTestTypes.Fields, asset?: Asset, address?: string ) { return this.stateForTest_(initFields, asset, address, undefined); } } // Use this object to test and deploy the contract export const TickBitmapTest = new Factory( Contract.fromJson( TickBitmapTestContractJson, "", "5cb6cce5c5b8adb88a18a993227d51465e3e54b5a34936cafc51100725724b54", types.AllStructs ) ); registerContract(TickBitmapTest); // Use this class to interact with the blockchain export class TickBitmapTestInstance extends ContractInstance { constructor(address: Address) { super(address); } async fetchState(): Promise { return fetchContractState(TickBitmapTest, this); } view = { wordPath: async ( params: TickBitmapTestTypes.CallMethodParams<"wordPath"> ): Promise> => { return callMethod( TickBitmapTest, this, "wordPath", params, getContractByCodeHash ); }, getWord: async ( params: TickBitmapTestTypes.CallMethodParams<"getWord"> ): Promise> => { return callMethod( TickBitmapTest, this, "getWord", params, getContractByCodeHash ); }, getWordOrTemplate: async ( params: TickBitmapTestTypes.CallMethodParams<"getWordOrTemplate"> ): Promise> => { return callMethod( TickBitmapTest, this, "getWordOrTemplate", params, getContractByCodeHash ); }, flipTick: async ( params: TickBitmapTestTypes.CallMethodParams<"flipTick"> ): Promise> => { return callMethod( TickBitmapTest, this, "flipTick", params, getContractByCodeHash ); }, nextInitializedTickWithinOneWord: async ( params: TickBitmapTestTypes.CallMethodParams<"nextInitializedTickWithinOneWord"> ): Promise< TickBitmapTestTypes.CallMethodResult<"nextInitializedTickWithinOneWord"> > => { return callMethod( TickBitmapTest, this, "nextInitializedTickWithinOneWord", params, getContractByCodeHash ); }, positionPath: async ( params: TickBitmapTestTypes.CallMethodParams<"positionPath"> ): Promise> => { return callMethod( TickBitmapTest, this, "positionPath", params, getContractByCodeHash ); }, positionContractId: async ( params: TickBitmapTestTypes.CallMethodParams<"positionContractId"> ): Promise> => { return callMethod( TickBitmapTest, this, "positionContractId", params, getContractByCodeHash ); }, deploy: async ( params: TickBitmapTestTypes.CallMethodParams<"deploy"> ): Promise> => { return callMethod( TickBitmapTest, this, "deploy", params, getContractByCodeHash ); }, flipTick_: async ( params: TickBitmapTestTypes.CallMethodParams<"flipTick_"> ): Promise> => { return callMethod( TickBitmapTest, this, "flipTick_", params, getContractByCodeHash ); }, }; transact = { wordPath: async ( params: TickBitmapTestTypes.SignExecuteMethodParams<"wordPath"> ): Promise> => { return signExecuteMethod(TickBitmapTest, this, "wordPath", params); }, getWord: async ( params: TickBitmapTestTypes.SignExecuteMethodParams<"getWord"> ): Promise> => { return signExecuteMethod(TickBitmapTest, this, "getWord", params); }, getWordOrTemplate: async ( params: TickBitmapTestTypes.SignExecuteMethodParams<"getWordOrTemplate"> ): Promise< TickBitmapTestTypes.SignExecuteMethodResult<"getWordOrTemplate"> > => { return signExecuteMethod( TickBitmapTest, this, "getWordOrTemplate", params ); }, flipTick: async ( params: TickBitmapTestTypes.SignExecuteMethodParams<"flipTick"> ): Promise> => { return signExecuteMethod(TickBitmapTest, this, "flipTick", params); }, nextInitializedTickWithinOneWord: async ( params: TickBitmapTestTypes.SignExecuteMethodParams<"nextInitializedTickWithinOneWord"> ): Promise< TickBitmapTestTypes.SignExecuteMethodResult<"nextInitializedTickWithinOneWord"> > => { return signExecuteMethod( TickBitmapTest, this, "nextInitializedTickWithinOneWord", params ); }, positionPath: async ( params: TickBitmapTestTypes.SignExecuteMethodParams<"positionPath"> ): Promise> => { return signExecuteMethod(TickBitmapTest, this, "positionPath", params); }, positionContractId: async ( params: TickBitmapTestTypes.SignExecuteMethodParams<"positionContractId"> ): Promise< TickBitmapTestTypes.SignExecuteMethodResult<"positionContractId"> > => { return signExecuteMethod( TickBitmapTest, this, "positionContractId", params ); }, deploy: async ( params: TickBitmapTestTypes.SignExecuteMethodParams<"deploy"> ): Promise> => { return signExecuteMethod(TickBitmapTest, this, "deploy", params); }, flipTick_: async ( params: TickBitmapTestTypes.SignExecuteMethodParams<"flipTick_"> ): Promise> => { return signExecuteMethod(TickBitmapTest, this, "flipTick_", params); }, }; async multicall( calls: Calls ): Promise>; async multicall( callss: Narrow ): Promise>; async multicall< Callss extends | TickBitmapTestTypes.MultiCallParams | TickBitmapTestTypes.MultiCallParams[] >(callss: Callss): Promise { return await multicallMethods( TickBitmapTest, this, callss, getContractByCodeHash ); } }