@hashflow/contracts-evm
Version:
EVM Smart Contracts for Solidity
192 lines (191 loc) • 11.3 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 "../../common";
export declare namespace IHashflowXChainMessenger {
type XChainQuoteStruct = {
srcChainId: BigNumberish;
dstChainId: BigNumberish;
srcPool: AddressLike;
dstPool: BytesLike;
srcExternalAccount: AddressLike;
dstExternalAccount: BytesLike;
trader: AddressLike;
dstTrader: BytesLike;
baseToken: AddressLike;
quoteToken: BytesLike;
baseTokenAmount: BigNumberish;
quoteTokenAmount: BigNumberish;
txid: BytesLike;
};
type XChainQuoteStructOutput = [
srcChainId: bigint,
dstChainId: bigint,
srcPool: string,
dstPool: string,
srcExternalAccount: string,
dstExternalAccount: string,
trader: string,
dstTrader: string,
baseToken: string,
quoteToken: string,
baseTokenAmount: bigint,
quoteTokenAmount: bigint,
txid: string
] & {
srcChainId: bigint;
dstChainId: bigint;
srcPool: string;
dstPool: string;
srcExternalAccount: string;
dstExternalAccount: string;
trader: string;
dstTrader: string;
baseToken: string;
quoteToken: string;
baseTokenAmount: bigint;
quoteTokenAmount: bigint;
txid: string;
};
}
export interface HashflowXChainMessengerBaseInterface extends Interface {
getFunction(nameOrSignature: "acceptOwnership" | "hChainId" | "owner" | "pendingOwner" | "renounceOwnership" | "router" | "tradeXChain" | "transferOwnership" | "updateXChainRemoteAddress" | "withdrawFunds" | "xChainRemotes"): FunctionFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferStarted" | "OwnershipTransferred" | "UpdateXChainRemoteAddress"): EventFragment;
encodeFunctionData(functionFragment: "acceptOwnership", values?: undefined): string;
encodeFunctionData(functionFragment: "hChainId", values?: undefined): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(functionFragment: "pendingOwner", values?: undefined): string;
encodeFunctionData(functionFragment: "renounceOwnership", values?: undefined): string;
encodeFunctionData(functionFragment: "router", values?: undefined): string;
encodeFunctionData(functionFragment: "tradeXChain", values: [
IHashflowXChainMessenger.XChainQuoteStruct,
AddressLike,
BytesLike,
BytesLike
]): string;
encodeFunctionData(functionFragment: "transferOwnership", values: [AddressLike]): string;
encodeFunctionData(functionFragment: "updateXChainRemoteAddress", values: [BigNumberish, BytesLike]): string;
encodeFunctionData(functionFragment: "withdrawFunds", values?: undefined): string;
encodeFunctionData(functionFragment: "xChainRemotes", values: [BigNumberish]): string;
decodeFunctionResult(functionFragment: "acceptOwnership", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "hChainId", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "pendingOwner", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "renounceOwnership", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "router", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "tradeXChain", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "transferOwnership", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "updateXChainRemoteAddress", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "withdrawFunds", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "xChainRemotes", data: BytesLike): Result;
}
export declare namespace OwnershipTransferStartedEvent {
type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike];
type OutputTuple = [previousOwner: string, newOwner: string];
interface OutputObject {
previousOwner: string;
newOwner: string;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace OwnershipTransferredEvent {
type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike];
type OutputTuple = [previousOwner: string, newOwner: string];
interface OutputObject {
previousOwner: string;
newOwner: string;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace UpdateXChainRemoteAddressEvent {
type InputTuple = [chainId: BigNumberish, remoteAddress: BytesLike];
type OutputTuple = [chainId: bigint, remoteAddress: string];
interface OutputObject {
chainId: bigint;
remoteAddress: string;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export interface HashflowXChainMessengerBase extends BaseContract {
connect(runner?: ContractRunner | null): HashflowXChainMessengerBase;
waitForDeployment(): Promise<this>;
interface: HashflowXChainMessengerBaseInterface;
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>;
acceptOwnership: TypedContractMethod<[], [void], "nonpayable">;
hChainId: TypedContractMethod<[], [bigint], "view">;
owner: TypedContractMethod<[], [string], "view">;
pendingOwner: TypedContractMethod<[], [string], "view">;
renounceOwnership: TypedContractMethod<[], [void], "nonpayable">;
router: TypedContractMethod<[], [string], "view">;
tradeXChain: TypedContractMethod<[
xChainQuote: IHashflowXChainMessenger.XChainQuoteStruct,
caller: AddressLike,
dstContract: BytesLike,
dstCalldata: BytesLike
], [
void
], "payable">;
transferOwnership: TypedContractMethod<[
newOwner: AddressLike
], [
void
], "nonpayable">;
updateXChainRemoteAddress: TypedContractMethod<[
_hChainId: BigNumberish,
remoteAddress: BytesLike
], [
void
], "nonpayable">;
withdrawFunds: TypedContractMethod<[], [void], "nonpayable">;
xChainRemotes: TypedContractMethod<[arg0: BigNumberish], [string], "view">;
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
getFunction(nameOrSignature: "acceptOwnership"): TypedContractMethod<[], [void], "nonpayable">;
getFunction(nameOrSignature: "hChainId"): TypedContractMethod<[], [bigint], "view">;
getFunction(nameOrSignature: "owner"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "pendingOwner"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "renounceOwnership"): TypedContractMethod<[], [void], "nonpayable">;
getFunction(nameOrSignature: "router"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "tradeXChain"): TypedContractMethod<[
xChainQuote: IHashflowXChainMessenger.XChainQuoteStruct,
caller: AddressLike,
dstContract: BytesLike,
dstCalldata: BytesLike
], [
void
], "payable">;
getFunction(nameOrSignature: "transferOwnership"): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">;
getFunction(nameOrSignature: "updateXChainRemoteAddress"): TypedContractMethod<[
_hChainId: BigNumberish,
remoteAddress: BytesLike
], [
void
], "nonpayable">;
getFunction(nameOrSignature: "withdrawFunds"): TypedContractMethod<[], [void], "nonpayable">;
getFunction(nameOrSignature: "xChainRemotes"): TypedContractMethod<[arg0: BigNumberish], [string], "view">;
getEvent(key: "OwnershipTransferStarted"): TypedContractEvent<OwnershipTransferStartedEvent.InputTuple, OwnershipTransferStartedEvent.OutputTuple, OwnershipTransferStartedEvent.OutputObject>;
getEvent(key: "OwnershipTransferred"): TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
getEvent(key: "UpdateXChainRemoteAddress"): TypedContractEvent<UpdateXChainRemoteAddressEvent.InputTuple, UpdateXChainRemoteAddressEvent.OutputTuple, UpdateXChainRemoteAddressEvent.OutputObject>;
filters: {
"OwnershipTransferStarted(address,address)": TypedContractEvent<OwnershipTransferStartedEvent.InputTuple, OwnershipTransferStartedEvent.OutputTuple, OwnershipTransferStartedEvent.OutputObject>;
OwnershipTransferStarted: TypedContractEvent<OwnershipTransferStartedEvent.InputTuple, OwnershipTransferStartedEvent.OutputTuple, OwnershipTransferStartedEvent.OutputObject>;
"OwnershipTransferred(address,address)": TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
OwnershipTransferred: TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
"UpdateXChainRemoteAddress(uint16,bytes)": TypedContractEvent<UpdateXChainRemoteAddressEvent.InputTuple, UpdateXChainRemoteAddressEvent.OutputTuple, UpdateXChainRemoteAddressEvent.OutputObject>;
UpdateXChainRemoteAddress: TypedContractEvent<UpdateXChainRemoteAddressEvent.InputTuple, UpdateXChainRemoteAddressEvent.OutputTuple, UpdateXChainRemoteAddressEvent.OutputObject>;
};
}