@towns-protocol/generated
Version:
## How to generate contract types
462 lines (458 loc) • 9.52 kB
text/typescript
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from "ethers";
import type { Provider } from "@ethersproject/providers";
import type { ISwapFacet, ISwapFacetInterface } from "../ISwapFacet";
const _abi = [
{
type: "function",
name: "executeSwap",
inputs: [
{
name: "params",
type: "tuple",
internalType: "struct ISwapRouterBase.ExactInputParams",
components: [
{
name: "tokenIn",
type: "address",
internalType: "address",
},
{
name: "tokenOut",
type: "address",
internalType: "address",
},
{
name: "amountIn",
type: "uint256",
internalType: "uint256",
},
{
name: "minAmountOut",
type: "uint256",
internalType: "uint256",
},
{
name: "recipient",
type: "address",
internalType: "address",
},
],
},
{
name: "routerParams",
type: "tuple",
internalType: "struct ISwapRouterBase.RouterParams",
components: [
{
name: "router",
type: "address",
internalType: "address",
},
{
name: "approveTarget",
type: "address",
internalType: "address",
},
{
name: "swapData",
type: "bytes",
internalType: "bytes",
},
],
},
{
name: "poster",
type: "address",
internalType: "address",
},
],
outputs: [
{
name: "amountOut",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "payable",
},
{
type: "function",
name: "executeSwapWithPermit",
inputs: [
{
name: "params",
type: "tuple",
internalType: "struct ISwapRouterBase.ExactInputParams",
components: [
{
name: "tokenIn",
type: "address",
internalType: "address",
},
{
name: "tokenOut",
type: "address",
internalType: "address",
},
{
name: "amountIn",
type: "uint256",
internalType: "uint256",
},
{
name: "minAmountOut",
type: "uint256",
internalType: "uint256",
},
{
name: "recipient",
type: "address",
internalType: "address",
},
],
},
{
name: "routerParams",
type: "tuple",
internalType: "struct ISwapRouterBase.RouterParams",
components: [
{
name: "router",
type: "address",
internalType: "address",
},
{
name: "approveTarget",
type: "address",
internalType: "address",
},
{
name: "swapData",
type: "bytes",
internalType: "bytes",
},
],
},
{
name: "permit",
type: "tuple",
internalType: "struct ISwapRouterBase.Permit2Params",
components: [
{
name: "owner",
type: "address",
internalType: "address",
},
{
name: "nonce",
type: "uint256",
internalType: "uint256",
},
{
name: "deadline",
type: "uint256",
internalType: "uint256",
},
{
name: "signature",
type: "bytes",
internalType: "bytes",
},
],
},
{
name: "poster",
type: "address",
internalType: "address",
},
],
outputs: [
{
name: "amountOut",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "payable",
},
{
type: "function",
name: "getSwapFees",
inputs: [],
outputs: [
{
name: "protocolBps",
type: "uint16",
internalType: "uint16",
},
{
name: "posterBps",
type: "uint16",
internalType: "uint16",
},
{
name: "forwardPosterFee",
type: "bool",
internalType: "bool",
},
],
stateMutability: "view",
},
{
type: "function",
name: "getSwapRouter",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "address",
},
],
stateMutability: "view",
},
{
type: "function",
name: "setSwapFeeConfig",
inputs: [
{
name: "posterFeeBps",
type: "uint16",
internalType: "uint16",
},
{
name: "forwardPosterFee",
type: "bool",
internalType: "bool",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "event",
name: "FeeDistribution",
inputs: [
{
name: "token",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "protocol",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "poster",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "protocolAmount",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "posterAmount",
type: "uint256",
indexed: false,
internalType: "uint256",
},
],
anonymous: false,
},
{
type: "event",
name: "Swap",
inputs: [
{
name: "router",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "caller",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "tokenIn",
type: "address",
indexed: false,
internalType: "address",
},
{
name: "tokenOut",
type: "address",
indexed: false,
internalType: "address",
},
{
name: "amountIn",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "amountOut",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "recipient",
type: "address",
indexed: false,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "SwapExecuted",
inputs: [
{
name: "recipient",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "tokenIn",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "tokenOut",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "amountIn",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "amountOut",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "poster",
type: "address",
indexed: false,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "SwapFeeConfigUpdated",
inputs: [
{
name: "posterFeeBps",
type: "uint16",
indexed: false,
internalType: "uint16",
},
{
name: "forwardPosterFee",
type: "bool",
indexed: false,
internalType: "bool",
},
],
anonymous: false,
},
{
type: "event",
name: "SwapRouterInitialized",
inputs: [
{
name: "spaceFactory",
type: "address",
indexed: false,
internalType: "address",
},
],
anonymous: false,
},
{
type: "error",
name: "SwapFacet__SwapRouterNotSet",
inputs: [],
},
{
type: "error",
name: "SwapFacet__TotalFeeTooHigh",
inputs: [],
},
{
type: "error",
name: "SwapFacet__UnexpectedETH",
inputs: [],
},
{
type: "error",
name: "SwapRouter__InsufficientOutput",
inputs: [],
},
{
type: "error",
name: "SwapRouter__InvalidAmount",
inputs: [],
},
{
type: "error",
name: "SwapRouter__InvalidBps",
inputs: [],
},
{
type: "error",
name: "SwapRouter__InvalidRouter",
inputs: [],
},
{
type: "error",
name: "SwapRouter__NativeTokenNotSupportedWithPermit",
inputs: [],
},
{
type: "error",
name: "SwapRouter__RecipientRequired",
inputs: [],
},
{
type: "error",
name: "SwapRouter__UnexpectedETH",
inputs: [],
},
] as const;
export class ISwapFacet__factory {
static readonly abi = _abi;
static createInterface(): ISwapFacetInterface {
return new utils.Interface(_abi) as ISwapFacetInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): ISwapFacet {
return new Contract(address, _abi, signerOrProvider) as ISwapFacet;
}
}