@catalabs/catalyst-sdk
Version:
Catalyst AMM SDK
272 lines • 12.8 kB
TypeScript
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, AddressLike, ContractRunner, ContractMethod, Listener } from 'ethers';
import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedListener, TypedContractMethod } from './common';
export declare namespace Multicall2 {
type CallStruct = {
target: AddressLike;
callData: BytesLike;
};
type CallStructOutput = [target: string, callData: string] & {
target: string;
callData: string;
};
type ResultStruct = {
success: boolean;
returnData: BytesLike;
};
type ResultStructOutput = [success: boolean, returnData: string] & {
success: boolean;
returnData: string;
};
}
export declare namespace TokenLens {
type TokenBalanceStruct = {
token: AddressLike;
amount: BigNumberish;
};
type TokenBalanceStructOutput = [token: string, amount: bigint] & {
token: string;
amount: bigint;
};
type AccountBalanceStruct = {
balance: BigNumberish;
tokenBalances: TokenLens.TokenBalanceStruct[];
};
type AccountBalanceStructOutput = [
balance: bigint,
tokenBalances: TokenLens.TokenBalanceStructOutput[]
] & {
balance: bigint;
tokenBalances: TokenLens.TokenBalanceStructOutput[];
};
type TokenInformationStruct = {
token: AddressLike;
name: string;
symbol: string;
decimals: BigNumberish;
};
type TokenInformationStructOutput = [
token: string,
name: string,
symbol: string,
decimals: bigint
] & {
token: string;
name: string;
symbol: string;
decimals: bigint;
};
}
export interface CatalystLensInterface extends Interface {
getFunction(nameOrSignature: 'aggregate' | 'blockAndAggregate' | 'fetchAccountBalances' | 'fetchTokenAllowances' | 'fetchTokenBalances' | 'fetchTokenInformation' | 'fetchTokenInformations' | 'getBlockHash' | 'getBlockNumber' | 'getCurrentBlockCoinbase' | 'getCurrentBlockDifficulty' | 'getCurrentBlockGasLimit' | 'getCurrentBlockTimestamp' | 'getEthBalance' | 'getLastBlockHash' | 'tryAggregate' | 'tryBlockAndAggregate'): FunctionFragment;
encodeFunctionData(functionFragment: 'aggregate', values: [Multicall2.CallStruct[]]): string;
encodeFunctionData(functionFragment: 'blockAndAggregate', values: [Multicall2.CallStruct[]]): string;
encodeFunctionData(functionFragment: 'fetchAccountBalances', values: [AddressLike, AddressLike[]]): string;
encodeFunctionData(functionFragment: 'fetchTokenAllowances', values: [AddressLike, AddressLike, AddressLike[]]): string;
encodeFunctionData(functionFragment: 'fetchTokenBalances', values: [AddressLike, AddressLike[]]): string;
encodeFunctionData(functionFragment: 'fetchTokenInformation', values: [AddressLike]): string;
encodeFunctionData(functionFragment: 'fetchTokenInformations', values: [AddressLike[]]): string;
encodeFunctionData(functionFragment: 'getBlockHash', values: [BigNumberish]): string;
encodeFunctionData(functionFragment: 'getBlockNumber', values?: undefined): string;
encodeFunctionData(functionFragment: 'getCurrentBlockCoinbase', values?: undefined): string;
encodeFunctionData(functionFragment: 'getCurrentBlockDifficulty', values?: undefined): string;
encodeFunctionData(functionFragment: 'getCurrentBlockGasLimit', values?: undefined): string;
encodeFunctionData(functionFragment: 'getCurrentBlockTimestamp', values?: undefined): string;
encodeFunctionData(functionFragment: 'getEthBalance', values: [AddressLike]): string;
encodeFunctionData(functionFragment: 'getLastBlockHash', values?: undefined): string;
encodeFunctionData(functionFragment: 'tryAggregate', values: [boolean, Multicall2.CallStruct[]]): string;
encodeFunctionData(functionFragment: 'tryBlockAndAggregate', values: [boolean, Multicall2.CallStruct[]]): string;
decodeFunctionResult(functionFragment: 'aggregate', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'blockAndAggregate', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'fetchAccountBalances', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'fetchTokenAllowances', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'fetchTokenBalances', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'fetchTokenInformation', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'fetchTokenInformations', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'getBlockHash', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'getBlockNumber', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'getCurrentBlockCoinbase', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'getCurrentBlockDifficulty', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'getCurrentBlockGasLimit', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'getCurrentBlockTimestamp', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'getEthBalance', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'getLastBlockHash', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'tryAggregate', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'tryBlockAndAggregate', data: BytesLike): Result;
}
export interface CatalystLens extends BaseContract {
connect(runner?: ContractRunner | null): CatalystLens;
waitForDeployment(): Promise<this>;
interface: CatalystLensInterface;
queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
on<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
once<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
listeners(eventName?: string): Promise<Array<Listener>>;
removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
aggregate: TypedContractMethod<[
calls: Multicall2.CallStruct[]
], [
[bigint, string[]] & {
blockNumber: bigint;
returnData: string[];
}
], 'nonpayable'>;
blockAndAggregate: TypedContractMethod<[
calls: Multicall2.CallStruct[]
], [
[
bigint,
string,
Multicall2.ResultStructOutput[]
] & {
blockNumber: bigint;
blockHash: string;
returnData: Multicall2.ResultStructOutput[];
}
], 'nonpayable'>;
fetchAccountBalances: TypedContractMethod<[
owner: AddressLike,
tokens: AddressLike[]
], [
TokenLens.AccountBalanceStructOutput
], 'view'>;
fetchTokenAllowances: TypedContractMethod<[
owner: AddressLike,
spender: AddressLike,
tokens: AddressLike[]
], [
TokenLens.TokenBalanceStructOutput[]
], 'view'>;
fetchTokenBalances: TypedContractMethod<[
owner: AddressLike,
tokens: AddressLike[]
], [
TokenLens.TokenBalanceStructOutput[]
], 'view'>;
fetchTokenInformation: TypedContractMethod<[
token: AddressLike
], [
TokenLens.TokenInformationStructOutput
], 'view'>;
fetchTokenInformations: TypedContractMethod<[
tokens: AddressLike[]
], [
TokenLens.TokenInformationStructOutput[]
], 'view'>;
getBlockHash: TypedContractMethod<[
blockNumber: BigNumberish
], [
string
], 'view'>;
getBlockNumber: TypedContractMethod<[], [bigint], 'view'>;
getCurrentBlockCoinbase: TypedContractMethod<[], [string], 'view'>;
getCurrentBlockDifficulty: TypedContractMethod<[], [bigint], 'view'>;
getCurrentBlockGasLimit: TypedContractMethod<[], [bigint], 'view'>;
getCurrentBlockTimestamp: TypedContractMethod<[], [bigint], 'view'>;
getEthBalance: TypedContractMethod<[addr: AddressLike], [bigint], 'view'>;
getLastBlockHash: TypedContractMethod<[], [string], 'view'>;
tryAggregate: TypedContractMethod<[
requireSuccess: boolean,
calls: Multicall2.CallStruct[]
], [
Multicall2.ResultStructOutput[]
], 'nonpayable'>;
tryBlockAndAggregate: TypedContractMethod<[
requireSuccess: boolean,
calls: Multicall2.CallStruct[]
], [
[
bigint,
string,
Multicall2.ResultStructOutput[]
] & {
blockNumber: bigint;
blockHash: string;
returnData: Multicall2.ResultStructOutput[];
}
], 'nonpayable'>;
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
getFunction(nameOrSignature: 'aggregate'): TypedContractMethod<[
calls: Multicall2.CallStruct[]
], [
[bigint, string[]] & {
blockNumber: bigint;
returnData: string[];
}
], 'nonpayable'>;
getFunction(nameOrSignature: 'blockAndAggregate'): TypedContractMethod<[
calls: Multicall2.CallStruct[]
], [
[
bigint,
string,
Multicall2.ResultStructOutput[]
] & {
blockNumber: bigint;
blockHash: string;
returnData: Multicall2.ResultStructOutput[];
}
], 'nonpayable'>;
getFunction(nameOrSignature: 'fetchAccountBalances'): TypedContractMethod<[
owner: AddressLike,
tokens: AddressLike[]
], [
TokenLens.AccountBalanceStructOutput
], 'view'>;
getFunction(nameOrSignature: 'fetchTokenAllowances'): TypedContractMethod<[
owner: AddressLike,
spender: AddressLike,
tokens: AddressLike[]
], [
TokenLens.TokenBalanceStructOutput[]
], 'view'>;
getFunction(nameOrSignature: 'fetchTokenBalances'): TypedContractMethod<[
owner: AddressLike,
tokens: AddressLike[]
], [
TokenLens.TokenBalanceStructOutput[]
], 'view'>;
getFunction(nameOrSignature: 'fetchTokenInformation'): TypedContractMethod<[
token: AddressLike
], [
TokenLens.TokenInformationStructOutput
], 'view'>;
getFunction(nameOrSignature: 'fetchTokenInformations'): TypedContractMethod<[
tokens: AddressLike[]
], [
TokenLens.TokenInformationStructOutput[]
], 'view'>;
getFunction(nameOrSignature: 'getBlockHash'): TypedContractMethod<[blockNumber: BigNumberish], [string], 'view'>;
getFunction(nameOrSignature: 'getBlockNumber'): TypedContractMethod<[], [bigint], 'view'>;
getFunction(nameOrSignature: 'getCurrentBlockCoinbase'): TypedContractMethod<[], [string], 'view'>;
getFunction(nameOrSignature: 'getCurrentBlockDifficulty'): TypedContractMethod<[], [bigint], 'view'>;
getFunction(nameOrSignature: 'getCurrentBlockGasLimit'): TypedContractMethod<[], [bigint], 'view'>;
getFunction(nameOrSignature: 'getCurrentBlockTimestamp'): TypedContractMethod<[], [bigint], 'view'>;
getFunction(nameOrSignature: 'getEthBalance'): TypedContractMethod<[addr: AddressLike], [bigint], 'view'>;
getFunction(nameOrSignature: 'getLastBlockHash'): TypedContractMethod<[], [string], 'view'>;
getFunction(nameOrSignature: 'tryAggregate'): TypedContractMethod<[
requireSuccess: boolean,
calls: Multicall2.CallStruct[]
], [
Multicall2.ResultStructOutput[]
], 'nonpayable'>;
getFunction(nameOrSignature: 'tryBlockAndAggregate'): TypedContractMethod<[
requireSuccess: boolean,
calls: Multicall2.CallStruct[]
], [
[
bigint,
string,
Multicall2.ResultStructOutput[]
] & {
blockNumber: bigint;
blockHash: string;
returnData: Multicall2.ResultStructOutput[];
}
], 'nonpayable'>;
filters: {};
}
//# sourceMappingURL=CatalystLens.d.ts.map