@catalabs/catalyst-sdk
Version:
Catalyst AMM SDK
536 lines • 23.8 kB
TypeScript
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from 'ethers';
import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from '../../../contracts/common';
export declare namespace IAllowanceTransfer {
type TokenSpenderPairStruct = {
token: AddressLike;
spender: AddressLike;
};
type TokenSpenderPairStructOutput = [
token: string,
spender: string
] & {
token: string;
spender: string;
};
type PermitDetailsStruct = {
token: AddressLike;
amount: BigNumberish;
expiration: BigNumberish;
nonce: BigNumberish;
};
type PermitDetailsStructOutput = [
token: string,
amount: bigint,
expiration: bigint,
nonce: bigint
] & {
token: string;
amount: bigint;
expiration: bigint;
nonce: bigint;
};
type PermitBatchStruct = {
details: IAllowanceTransfer.PermitDetailsStruct[];
spender: AddressLike;
sigDeadline: BigNumberish;
};
type PermitBatchStructOutput = [
details: IAllowanceTransfer.PermitDetailsStructOutput[],
spender: string,
sigDeadline: bigint
] & {
details: IAllowanceTransfer.PermitDetailsStructOutput[];
spender: string;
sigDeadline: bigint;
};
type PermitSingleStruct = {
details: IAllowanceTransfer.PermitDetailsStruct;
spender: AddressLike;
sigDeadline: BigNumberish;
};
type PermitSingleStructOutput = [
details: IAllowanceTransfer.PermitDetailsStructOutput,
spender: string,
sigDeadline: bigint
] & {
details: IAllowanceTransfer.PermitDetailsStructOutput;
spender: string;
sigDeadline: bigint;
};
type AllowanceTransferDetailsStruct = {
token: AddressLike;
amount: BigNumberish;
to: AddressLike;
};
type AllowanceTransferDetailsStructOutput = [
token: string,
amount: bigint,
to: string
] & {
token: string;
amount: bigint;
to: string;
};
}
export declare namespace ISignatureTransfer {
type TokenPermissionsStruct = {
token: AddressLike;
amount: BigNumberish;
};
type TokenPermissionsStructOutput = [token: string, amount: bigint] & {
token: string;
amount: bigint;
};
type PermitBatchTransferFromStruct = {
permitted: ISignatureTransfer.TokenPermissionsStruct[];
nonce: BigNumberish;
deadline: BigNumberish;
};
type PermitBatchTransferFromStructOutput = [
permitted: ISignatureTransfer.TokenPermissionsStructOutput[],
nonce: bigint,
deadline: bigint
] & {
permitted: ISignatureTransfer.TokenPermissionsStructOutput[];
nonce: bigint;
deadline: bigint;
};
type SignatureTransferDetailsStruct = {
to: AddressLike;
requestedAmount: BigNumberish;
};
type SignatureTransferDetailsStructOutput = [
to: string,
requestedAmount: bigint
] & {
to: string;
requestedAmount: bigint;
};
type PermitTransferFromStruct = {
permitted: ISignatureTransfer.TokenPermissionsStruct;
nonce: BigNumberish;
deadline: BigNumberish;
};
type PermitTransferFromStructOutput = [
permitted: ISignatureTransfer.TokenPermissionsStructOutput,
nonce: bigint,
deadline: bigint
] & {
permitted: ISignatureTransfer.TokenPermissionsStructOutput;
nonce: bigint;
deadline: bigint;
};
}
export interface Permit2Interface extends Interface {
getFunction(nameOrSignature: 'DOMAIN_SEPARATOR' | 'allowance' | 'approve' | 'invalidateNonces' | 'invalidateUnorderedNonces' | 'lockdown' | 'nonceBitmap' | 'permit(address,((address,uint160,uint48,uint48)[],address,uint256),bytes)' | 'permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)' | 'permitTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes)' | 'permitTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes)' | 'permitWitnessTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes32,string,string,bytes)' | 'permitWitnessTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes32,string,string,bytes)' | 'transferFrom(address,address,address,uint160)' | 'transferFrom(address,(address,uint160,address)[])'): FunctionFragment;
getEvent(nameOrSignatureOrTopic: 'Approval' | 'Lockdown' | 'NonceInvalidation' | 'UnorderedNonceInvalidation'): EventFragment;
encodeFunctionData(functionFragment: 'DOMAIN_SEPARATOR', values?: undefined): string;
encodeFunctionData(functionFragment: 'allowance', values: [AddressLike, AddressLike, AddressLike]): string;
encodeFunctionData(functionFragment: 'approve', values: [AddressLike, AddressLike, BigNumberish, BigNumberish]): string;
encodeFunctionData(functionFragment: 'invalidateNonces', values: [AddressLike, AddressLike, BigNumberish]): string;
encodeFunctionData(functionFragment: 'invalidateUnorderedNonces', values: [BigNumberish, BigNumberish]): string;
encodeFunctionData(functionFragment: 'lockdown', values: [IAllowanceTransfer.TokenSpenderPairStruct[]]): string;
encodeFunctionData(functionFragment: 'nonceBitmap', values: [AddressLike, BigNumberish]): string;
encodeFunctionData(functionFragment: 'permit(address,((address,uint160,uint48,uint48)[],address,uint256),bytes)', values: [AddressLike, IAllowanceTransfer.PermitBatchStruct, BytesLike]): string;
encodeFunctionData(functionFragment: 'permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)', values: [AddressLike, IAllowanceTransfer.PermitSingleStruct, BytesLike]): string;
encodeFunctionData(functionFragment: 'permitTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes)', values: [
ISignatureTransfer.PermitBatchTransferFromStruct,
AddressLike,
ISignatureTransfer.SignatureTransferDetailsStruct[],
BytesLike
]): string;
encodeFunctionData(functionFragment: 'permitTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes)', values: [
ISignatureTransfer.PermitTransferFromStruct,
AddressLike,
AddressLike,
BigNumberish,
BytesLike
]): string;
encodeFunctionData(functionFragment: 'permitWitnessTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes32,string,string,bytes)', values: [
ISignatureTransfer.PermitTransferFromStruct,
AddressLike,
AddressLike,
BigNumberish,
BytesLike,
string,
string,
BytesLike
]): string;
encodeFunctionData(functionFragment: 'permitWitnessTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes32,string,string,bytes)', values: [
ISignatureTransfer.PermitBatchTransferFromStruct,
AddressLike,
ISignatureTransfer.SignatureTransferDetailsStruct[],
BytesLike,
string,
string,
BytesLike
]): string;
encodeFunctionData(functionFragment: 'transferFrom(address,address,address,uint160)', values: [AddressLike, AddressLike, AddressLike, BigNumberish]): string;
encodeFunctionData(functionFragment: 'transferFrom(address,(address,uint160,address)[])', values: [AddressLike, IAllowanceTransfer.AllowanceTransferDetailsStruct[]]): string;
decodeFunctionResult(functionFragment: 'DOMAIN_SEPARATOR', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'invalidateNonces', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'invalidateUnorderedNonces', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'lockdown', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'nonceBitmap', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'permit(address,((address,uint160,uint48,uint48)[],address,uint256),bytes)', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'permitTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes)', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'permitTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes)', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'permitWitnessTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes32,string,string,bytes)', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'permitWitnessTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes32,string,string,bytes)', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'transferFrom(address,address,address,uint160)', data: BytesLike): Result;
decodeFunctionResult(functionFragment: 'transferFrom(address,(address,uint160,address)[])', data: BytesLike): Result;
}
declare namespace ApprovalEvent {
type InputTuple = [
owner: AddressLike,
token: AddressLike,
spender: AddressLike,
amount: BigNumberish,
expiration: BigNumberish
];
type OutputTuple = [
owner: string,
token: string,
spender: string,
amount: bigint,
expiration: bigint
];
interface OutputObject {
owner: string;
token: string;
spender: string;
amount: bigint;
expiration: bigint;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace LockdownEvent {
type InputTuple = [
owner: AddressLike,
token: AddressLike,
spender: AddressLike
];
type OutputTuple = [owner: string, token: string, spender: string];
interface OutputObject {
owner: string;
token: string;
spender: string;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace NonceInvalidationEvent {
type InputTuple = [
owner: AddressLike,
token: AddressLike,
spender: AddressLike,
newNonce: BigNumberish,
oldNonce: BigNumberish
];
type OutputTuple = [
owner: string,
token: string,
spender: string,
newNonce: bigint,
oldNonce: bigint
];
interface OutputObject {
owner: string;
token: string;
spender: string;
newNonce: bigint;
oldNonce: bigint;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace UnorderedNonceInvalidationEvent {
type InputTuple = [
owner: AddressLike,
word: BigNumberish,
mask: BigNumberish
];
type OutputTuple = [owner: string, word: bigint, mask: bigint];
interface OutputObject {
owner: string;
word: bigint;
mask: bigint;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export interface Permit2 extends BaseContract {
connect(runner?: ContractRunner | null): Permit2;
waitForDeployment(): Promise<this>;
interface: Permit2Interface;
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>;
DOMAIN_SEPARATOR: TypedContractMethod<[], [string], 'view'>;
allowance: TypedContractMethod<[
arg0: AddressLike,
arg1: AddressLike,
arg2: AddressLike
], [
[
bigint,
bigint,
bigint
] & {
amount: bigint;
expiration: bigint;
nonce: bigint;
}
], 'view'>;
approve: TypedContractMethod<[
token: AddressLike,
spender: AddressLike,
amount: BigNumberish,
expiration: BigNumberish
], [
void
], 'nonpayable'>;
invalidateNonces: TypedContractMethod<[
token: AddressLike,
spender: AddressLike,
newNonce: BigNumberish
], [
void
], 'nonpayable'>;
invalidateUnorderedNonces: TypedContractMethod<[
wordPos: BigNumberish,
mask: BigNumberish
], [
void
], 'nonpayable'>;
lockdown: TypedContractMethod<[
approvals: IAllowanceTransfer.TokenSpenderPairStruct[]
], [
void
], 'nonpayable'>;
nonceBitmap: TypedContractMethod<[
arg0: AddressLike,
arg1: BigNumberish
], [
bigint
], 'view'>;
'permit(address,((address,uint160,uint48,uint48)[],address,uint256),bytes)': TypedContractMethod<[
owner: AddressLike,
permitBatch: IAllowanceTransfer.PermitBatchStruct,
signature: BytesLike
], [
void
], 'nonpayable'>;
'permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)': TypedContractMethod<[
owner: AddressLike,
permitSingle: IAllowanceTransfer.PermitSingleStruct,
signature: BytesLike
], [
void
], 'nonpayable'>;
'permitTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes)': TypedContractMethod<[
permit: ISignatureTransfer.PermitBatchTransferFromStruct,
owner: AddressLike,
transferDetails: ISignatureTransfer.SignatureTransferDetailsStruct[],
signature: BytesLike
], [
void
], 'nonpayable'>;
'permitTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes)': TypedContractMethod<[
permit: ISignatureTransfer.PermitTransferFromStruct,
owner: AddressLike,
to: AddressLike,
requestedAmount: BigNumberish,
signature: BytesLike
], [
void
], 'nonpayable'>;
'permitWitnessTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes32,string,string,bytes)': TypedContractMethod<[
permit: ISignatureTransfer.PermitTransferFromStruct,
owner: AddressLike,
to: AddressLike,
requestedAmount: BigNumberish,
witness: BytesLike,
witnessTypeName: string,
witnessType: string,
signature: BytesLike
], [
void
], 'nonpayable'>;
'permitWitnessTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes32,string,string,bytes)': TypedContractMethod<[
permit: ISignatureTransfer.PermitBatchTransferFromStruct,
owner: AddressLike,
transferDetails: ISignatureTransfer.SignatureTransferDetailsStruct[],
witness: BytesLike,
witnessTypeName: string,
witnessType: string,
signature: BytesLike
], [
void
], 'nonpayable'>;
'transferFrom(address,address,address,uint160)': TypedContractMethod<[
token: AddressLike,
from: AddressLike,
to: AddressLike,
amount: BigNumberish
], [
void
], 'nonpayable'>;
'transferFrom(address,(address,uint160,address)[])': TypedContractMethod<[
from: AddressLike,
transferDetails: IAllowanceTransfer.AllowanceTransferDetailsStruct[]
], [
void
], 'nonpayable'>;
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
getFunction(nameOrSignature: 'DOMAIN_SEPARATOR'): TypedContractMethod<[], [string], 'view'>;
getFunction(nameOrSignature: 'allowance'): TypedContractMethod<[
arg0: AddressLike,
arg1: AddressLike,
arg2: AddressLike
], [
[
bigint,
bigint,
bigint
] & {
amount: bigint;
expiration: bigint;
nonce: bigint;
}
], 'view'>;
getFunction(nameOrSignature: 'approve'): TypedContractMethod<[
token: AddressLike,
spender: AddressLike,
amount: BigNumberish,
expiration: BigNumberish
], [
void
], 'nonpayable'>;
getFunction(nameOrSignature: 'invalidateNonces'): TypedContractMethod<[
token: AddressLike,
spender: AddressLike,
newNonce: BigNumberish
], [
void
], 'nonpayable'>;
getFunction(nameOrSignature: 'invalidateUnorderedNonces'): TypedContractMethod<[
wordPos: BigNumberish,
mask: BigNumberish
], [
void
], 'nonpayable'>;
getFunction(nameOrSignature: 'lockdown'): TypedContractMethod<[
approvals: IAllowanceTransfer.TokenSpenderPairStruct[]
], [
void
], 'nonpayable'>;
getFunction(nameOrSignature: 'nonceBitmap'): TypedContractMethod<[
arg0: AddressLike,
arg1: BigNumberish
], [
bigint
], 'view'>;
getFunction(nameOrSignature: 'permit(address,((address,uint160,uint48,uint48)[],address,uint256),bytes)'): TypedContractMethod<[
owner: AddressLike,
permitBatch: IAllowanceTransfer.PermitBatchStruct,
signature: BytesLike
], [
void
], 'nonpayable'>;
getFunction(nameOrSignature: 'permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)'): TypedContractMethod<[
owner: AddressLike,
permitSingle: IAllowanceTransfer.PermitSingleStruct,
signature: BytesLike
], [
void
], 'nonpayable'>;
getFunction(nameOrSignature: 'permitTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes)'): TypedContractMethod<[
permit: ISignatureTransfer.PermitBatchTransferFromStruct,
owner: AddressLike,
transferDetails: ISignatureTransfer.SignatureTransferDetailsStruct[],
signature: BytesLike
], [
void
], 'nonpayable'>;
getFunction(nameOrSignature: 'permitTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes)'): TypedContractMethod<[
permit: ISignatureTransfer.PermitTransferFromStruct,
owner: AddressLike,
to: AddressLike,
requestedAmount: BigNumberish,
signature: BytesLike
], [
void
], 'nonpayable'>;
getFunction(nameOrSignature: 'permitWitnessTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes32,string,string,bytes)'): TypedContractMethod<[
permit: ISignatureTransfer.PermitTransferFromStruct,
owner: AddressLike,
to: AddressLike,
requestedAmount: BigNumberish,
witness: BytesLike,
witnessTypeName: string,
witnessType: string,
signature: BytesLike
], [
void
], 'nonpayable'>;
getFunction(nameOrSignature: 'permitWitnessTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes32,string,string,bytes)'): TypedContractMethod<[
permit: ISignatureTransfer.PermitBatchTransferFromStruct,
owner: AddressLike,
transferDetails: ISignatureTransfer.SignatureTransferDetailsStruct[],
witness: BytesLike,
witnessTypeName: string,
witnessType: string,
signature: BytesLike
], [
void
], 'nonpayable'>;
getFunction(nameOrSignature: 'transferFrom(address,address,address,uint160)'): TypedContractMethod<[
token: AddressLike,
from: AddressLike,
to: AddressLike,
amount: BigNumberish
], [
void
], 'nonpayable'>;
getFunction(nameOrSignature: 'transferFrom(address,(address,uint160,address)[])'): TypedContractMethod<[
from: AddressLike,
transferDetails: IAllowanceTransfer.AllowanceTransferDetailsStruct[]
], [
void
], 'nonpayable'>;
getEvent(key: 'Approval'): TypedContractEvent<ApprovalEvent.InputTuple, ApprovalEvent.OutputTuple, ApprovalEvent.OutputObject>;
getEvent(key: 'Lockdown'): TypedContractEvent<LockdownEvent.InputTuple, LockdownEvent.OutputTuple, LockdownEvent.OutputObject>;
getEvent(key: 'NonceInvalidation'): TypedContractEvent<NonceInvalidationEvent.InputTuple, NonceInvalidationEvent.OutputTuple, NonceInvalidationEvent.OutputObject>;
getEvent(key: 'UnorderedNonceInvalidation'): TypedContractEvent<UnorderedNonceInvalidationEvent.InputTuple, UnorderedNonceInvalidationEvent.OutputTuple, UnorderedNonceInvalidationEvent.OutputObject>;
filters: {
'Approval(address,address,address,uint160,uint48)': TypedContractEvent<ApprovalEvent.InputTuple, ApprovalEvent.OutputTuple, ApprovalEvent.OutputObject>;
Approval: TypedContractEvent<ApprovalEvent.InputTuple, ApprovalEvent.OutputTuple, ApprovalEvent.OutputObject>;
'Lockdown(address,address,address)': TypedContractEvent<LockdownEvent.InputTuple, LockdownEvent.OutputTuple, LockdownEvent.OutputObject>;
Lockdown: TypedContractEvent<LockdownEvent.InputTuple, LockdownEvent.OutputTuple, LockdownEvent.OutputObject>;
'NonceInvalidation(address,address,address,uint48,uint48)': TypedContractEvent<NonceInvalidationEvent.InputTuple, NonceInvalidationEvent.OutputTuple, NonceInvalidationEvent.OutputObject>;
NonceInvalidation: TypedContractEvent<NonceInvalidationEvent.InputTuple, NonceInvalidationEvent.OutputTuple, NonceInvalidationEvent.OutputObject>;
'UnorderedNonceInvalidation(address,uint256,uint256)': TypedContractEvent<UnorderedNonceInvalidationEvent.InputTuple, UnorderedNonceInvalidationEvent.OutputTuple, UnorderedNonceInvalidationEvent.OutputObject>;
UnorderedNonceInvalidation: TypedContractEvent<UnorderedNonceInvalidationEvent.InputTuple, UnorderedNonceInvalidationEvent.OutputTuple, UnorderedNonceInvalidationEvent.OutputObject>;
};
}
export {};
//# sourceMappingURL=Permit2.d.ts.map