diff --git a/packages/sdk-router/src/abi/FastBridge.json b/packages/sdk-router/src/abi/FastBridge.json new file mode 100644 index 0000000000..2b008da14e --- /dev/null +++ b/packages/sdk-router/src/abi/FastBridge.json @@ -0,0 +1,864 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "_owner", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "AccessControlBadConfirmation", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "bytes32", "name": "neededRole", "type": "bytes32" } + ], + "name": "AccessControlUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "target", "type": "address" } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "AddressInsufficientBalance", + "type": "error" + }, + { "inputs": [], "name": "AmountIncorrect", "type": "error" }, + { "inputs": [], "name": "ChainIncorrect", "type": "error" }, + { "inputs": [], "name": "DeadlineExceeded", "type": "error" }, + { "inputs": [], "name": "DeadlineNotExceeded", "type": "error" }, + { "inputs": [], "name": "DeadlineTooShort", "type": "error" }, + { "inputs": [], "name": "DisputePeriodNotPassed", "type": "error" }, + { "inputs": [], "name": "DisputePeriodPassed", "type": "error" }, + { "inputs": [], "name": "FailedInnerCall", "type": "error" }, + { "inputs": [], "name": "MsgValueIncorrect", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "token", "type": "address" } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { "inputs": [], "name": "SenderIncorrect", "type": "error" }, + { "inputs": [], "name": "StatusIncorrect", "type": "error" }, + { "inputs": [], "name": "TokenNotContract", "type": "error" }, + { "inputs": [], "name": "TransactionRelayed", "type": "error" }, + { "inputs": [], "name": "ZeroAddress", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "relayer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BridgeDepositClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BridgeDepositRefunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "relayer", + "type": "address" + } + ], + "name": "BridgeProofDisputed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "relayer", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "transactionHash", + "type": "bytes32" + } + ], + "name": "BridgeProofProvided", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "relayer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "chainGasAmount", + "type": "uint256" + } + ], + "name": "BridgeRelayed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "request", + "type": "bytes" + } + ], + "name": "BridgeRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldChainGasAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newChainGasAmount", + "type": "uint256" + } + ], + "name": "ChainGasAmountUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldFeeRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newFeeRate", + "type": "uint256" + } + ], + "name": "FeeRateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "FeesSwept", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "governor", + "type": "address" + } + ], + "name": "GovernorAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "governor", + "type": "address" + } + ], + "name": "GovernorRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "GuardAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "GuardRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "relayer", + "type": "address" + } + ], + "name": "RelayerAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "relayer", + "type": "address" + } + ], + "name": "RelayerRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DISPUTE_PERIOD", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FEE_BPS", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FEE_RATE_MAX", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "GOVERNOR_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "GUARD_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_DEADLINE_PERIOD", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RELAYER_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_governor", "type": "address" } + ], + "name": "addGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_guard", "type": "address" } + ], + "name": "addGuard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_relayer", "type": "address" } + ], + "name": "addRelayer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "uint32", "name": "dstChainId", "type": "uint32" }, + { "internalType": "address", "name": "to", "type": "address" }, + { + "internalType": "address", + "name": "originToken", + "type": "address" + }, + { "internalType": "address", "name": "destToken", "type": "address" }, + { + "internalType": "uint256", + "name": "originAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "destAmount", + "type": "uint256" + }, + { "internalType": "bool", "name": "sendChainGas", "type": "bool" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" } + ], + "internalType": "struct IFastBridge.BridgeParams", + "name": "params", + "type": "tuple" + } + ], + "name": "bridge", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "name": "bridgeProofs", + "outputs": [ + { "internalType": "uint96", "name": "timestamp", "type": "uint96" }, + { "internalType": "address", "name": "relayer", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "name": "bridgeRelays", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "name": "bridgeStatuses", + "outputs": [ + { + "internalType": "enum FastBridge.BridgeStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "transactionId", "type": "bytes32" }, + { "internalType": "address", "name": "relayer", "type": "address" } + ], + "name": "canClaim", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "chainGasAmount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes", "name": "request", "type": "bytes" }, + { "internalType": "address", "name": "to", "type": "address" } + ], + "name": "claim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "deployBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "transactionId", "type": "bytes32" } + ], + "name": "dispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes", "name": "request", "type": "bytes" }], + "name": "getBridgeTransaction", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "originChainId", + "type": "uint32" + }, + { "internalType": "uint32", "name": "destChainId", "type": "uint32" }, + { + "internalType": "address", + "name": "originSender", + "type": "address" + }, + { + "internalType": "address", + "name": "destRecipient", + "type": "address" + }, + { + "internalType": "address", + "name": "originToken", + "type": "address" + }, + { "internalType": "address", "name": "destToken", "type": "address" }, + { + "internalType": "uint256", + "name": "originAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "destAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "originFeeAmount", + "type": "uint256" + }, + { "internalType": "bool", "name": "sendChainGas", "type": "bool" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint256", "name": "nonce", "type": "uint256" } + ], + "internalType": "struct IFastBridge.BridgeTransaction", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" } + ], + "name": "getRoleAdmin", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "hasRole", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nonce", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolFeeRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "protocolFees", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes", "name": "request", "type": "bytes" }, + { "internalType": "bytes32", "name": "destTxHash", "type": "bytes32" } + ], + "name": "prove", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes", "name": "request", "type": "bytes" }, + { "internalType": "address", "name": "to", "type": "address" } + ], + "name": "refund", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes", "name": "request", "type": "bytes" }], + "name": "relay", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_governor", "type": "address" } + ], + "name": "removeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_guard", "type": "address" } + ], + "name": "removeGuard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_relayer", "type": "address" } + ], + "name": "removeRelayer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { + "internalType": "address", + "name": "callerConfirmation", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newChainGasAmount", + "type": "uint256" + } + ], + "name": "setChainGasAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "newFeeRate", "type": "uint256" } + ], + "name": "setProtocolFeeRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } + ], + "name": "supportsInterface", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "token", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" } + ], + "name": "sweepProtocolFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/packages/sdk-router/src/typechain/FastBridge.ts b/packages/sdk-router/src/typechain/FastBridge.ts new file mode 100644 index 0000000000..67ec5f621e --- /dev/null +++ b/packages/sdk-router/src/typechain/FastBridge.ts @@ -0,0 +1,1628 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers' +import type { + FunctionFragment, + Result, + EventFragment, +} from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/providers' +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from './common' + +export declare namespace IFastBridge { + export type BridgeParamsStruct = { + dstChainId: BigNumberish + to: string + originToken: string + destToken: string + originAmount: BigNumberish + destAmount: BigNumberish + sendChainGas: boolean + deadline: BigNumberish + } + + export type BridgeParamsStructOutput = [ + number, + string, + string, + string, + BigNumber, + BigNumber, + boolean, + BigNumber + ] & { + dstChainId: number + to: string + originToken: string + destToken: string + originAmount: BigNumber + destAmount: BigNumber + sendChainGas: boolean + deadline: BigNumber + } + + export type BridgeTransactionStruct = { + originChainId: BigNumberish + destChainId: BigNumberish + originSender: string + destRecipient: string + originToken: string + destToken: string + originAmount: BigNumberish + destAmount: BigNumberish + originFeeAmount: BigNumberish + sendChainGas: boolean + deadline: BigNumberish + nonce: BigNumberish + } + + export type BridgeTransactionStructOutput = [ + number, + number, + string, + string, + string, + string, + BigNumber, + BigNumber, + BigNumber, + boolean, + BigNumber, + BigNumber + ] & { + originChainId: number + destChainId: number + originSender: string + destRecipient: string + originToken: string + destToken: string + originAmount: BigNumber + destAmount: BigNumber + originFeeAmount: BigNumber + sendChainGas: boolean + deadline: BigNumber + nonce: BigNumber + } +} + +export interface FastBridgeInterface extends utils.Interface { + functions: { + 'DEFAULT_ADMIN_ROLE()': FunctionFragment + 'DISPUTE_PERIOD()': FunctionFragment + 'FEE_BPS()': FunctionFragment + 'FEE_RATE_MAX()': FunctionFragment + 'GOVERNOR_ROLE()': FunctionFragment + 'GUARD_ROLE()': FunctionFragment + 'MIN_DEADLINE_PERIOD()': FunctionFragment + 'RELAYER_ROLE()': FunctionFragment + 'addGovernor(address)': FunctionFragment + 'addGuard(address)': FunctionFragment + 'addRelayer(address)': FunctionFragment + 'bridge((uint32,address,address,address,uint256,uint256,bool,uint256))': FunctionFragment + 'bridgeProofs(bytes32)': FunctionFragment + 'bridgeRelays(bytes32)': FunctionFragment + 'bridgeStatuses(bytes32)': FunctionFragment + 'canClaim(bytes32,address)': FunctionFragment + 'chainGasAmount()': FunctionFragment + 'claim(bytes,address)': FunctionFragment + 'deployBlock()': FunctionFragment + 'dispute(bytes32)': FunctionFragment + 'getBridgeTransaction(bytes)': FunctionFragment + 'getRoleAdmin(bytes32)': FunctionFragment + 'grantRole(bytes32,address)': FunctionFragment + 'hasRole(bytes32,address)': FunctionFragment + 'nonce()': FunctionFragment + 'protocolFeeRate()': FunctionFragment + 'protocolFees(address)': FunctionFragment + 'prove(bytes,bytes32)': FunctionFragment + 'refund(bytes,address)': FunctionFragment + 'relay(bytes)': FunctionFragment + 'removeGovernor(address)': FunctionFragment + 'removeGuard(address)': FunctionFragment + 'removeRelayer(address)': FunctionFragment + 'renounceRole(bytes32,address)': FunctionFragment + 'revokeRole(bytes32,address)': FunctionFragment + 'setChainGasAmount(uint256)': FunctionFragment + 'setProtocolFeeRate(uint256)': FunctionFragment + 'supportsInterface(bytes4)': FunctionFragment + 'sweepProtocolFees(address,address)': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | 'DEFAULT_ADMIN_ROLE' + | 'DISPUTE_PERIOD' + | 'FEE_BPS' + | 'FEE_RATE_MAX' + | 'GOVERNOR_ROLE' + | 'GUARD_ROLE' + | 'MIN_DEADLINE_PERIOD' + | 'RELAYER_ROLE' + | 'addGovernor' + | 'addGuard' + | 'addRelayer' + | 'bridge' + | 'bridgeProofs' + | 'bridgeRelays' + | 'bridgeStatuses' + | 'canClaim' + | 'chainGasAmount' + | 'claim' + | 'deployBlock' + | 'dispute' + | 'getBridgeTransaction' + | 'getRoleAdmin' + | 'grantRole' + | 'hasRole' + | 'nonce' + | 'protocolFeeRate' + | 'protocolFees' + | 'prove' + | 'refund' + | 'relay' + | 'removeGovernor' + | 'removeGuard' + | 'removeRelayer' + | 'renounceRole' + | 'revokeRole' + | 'setChainGasAmount' + | 'setProtocolFeeRate' + | 'supportsInterface' + | 'sweepProtocolFees' + ): FunctionFragment + + encodeFunctionData( + functionFragment: 'DEFAULT_ADMIN_ROLE', + values?: undefined + ): string + encodeFunctionData( + functionFragment: 'DISPUTE_PERIOD', + values?: undefined + ): string + encodeFunctionData(functionFragment: 'FEE_BPS', values?: undefined): string + encodeFunctionData( + functionFragment: 'FEE_RATE_MAX', + values?: undefined + ): string + encodeFunctionData( + functionFragment: 'GOVERNOR_ROLE', + values?: undefined + ): string + encodeFunctionData(functionFragment: 'GUARD_ROLE', values?: undefined): string + encodeFunctionData( + functionFragment: 'MIN_DEADLINE_PERIOD', + values?: undefined + ): string + encodeFunctionData( + functionFragment: 'RELAYER_ROLE', + values?: undefined + ): string + encodeFunctionData(functionFragment: 'addGovernor', values: [string]): string + encodeFunctionData(functionFragment: 'addGuard', values: [string]): string + encodeFunctionData(functionFragment: 'addRelayer', values: [string]): string + encodeFunctionData( + functionFragment: 'bridge', + values: [IFastBridge.BridgeParamsStruct] + ): string + encodeFunctionData( + functionFragment: 'bridgeProofs', + values: [BytesLike] + ): string + encodeFunctionData( + functionFragment: 'bridgeRelays', + values: [BytesLike] + ): string + encodeFunctionData( + functionFragment: 'bridgeStatuses', + values: [BytesLike] + ): string + encodeFunctionData( + functionFragment: 'canClaim', + values: [BytesLike, string] + ): string + encodeFunctionData( + functionFragment: 'chainGasAmount', + values?: undefined + ): string + encodeFunctionData( + functionFragment: 'claim', + values: [BytesLike, string] + ): string + encodeFunctionData( + functionFragment: 'deployBlock', + values?: undefined + ): string + encodeFunctionData(functionFragment: 'dispute', values: [BytesLike]): string + encodeFunctionData( + functionFragment: 'getBridgeTransaction', + values: [BytesLike] + ): string + encodeFunctionData( + functionFragment: 'getRoleAdmin', + values: [BytesLike] + ): string + encodeFunctionData( + functionFragment: 'grantRole', + values: [BytesLike, string] + ): string + encodeFunctionData( + functionFragment: 'hasRole', + values: [BytesLike, string] + ): string + encodeFunctionData(functionFragment: 'nonce', values?: undefined): string + encodeFunctionData( + functionFragment: 'protocolFeeRate', + values?: undefined + ): string + encodeFunctionData(functionFragment: 'protocolFees', values: [string]): string + encodeFunctionData( + functionFragment: 'prove', + values: [BytesLike, BytesLike] + ): string + encodeFunctionData( + functionFragment: 'refund', + values: [BytesLike, string] + ): string + encodeFunctionData(functionFragment: 'relay', values: [BytesLike]): string + encodeFunctionData( + functionFragment: 'removeGovernor', + values: [string] + ): string + encodeFunctionData(functionFragment: 'removeGuard', values: [string]): string + encodeFunctionData( + functionFragment: 'removeRelayer', + values: [string] + ): string + encodeFunctionData( + functionFragment: 'renounceRole', + values: [BytesLike, string] + ): string + encodeFunctionData( + functionFragment: 'revokeRole', + values: [BytesLike, string] + ): string + encodeFunctionData( + functionFragment: 'setChainGasAmount', + values: [BigNumberish] + ): string + encodeFunctionData( + functionFragment: 'setProtocolFeeRate', + values: [BigNumberish] + ): string + encodeFunctionData( + functionFragment: 'supportsInterface', + values: [BytesLike] + ): string + encodeFunctionData( + functionFragment: 'sweepProtocolFees', + values: [string, string] + ): string + + decodeFunctionResult( + functionFragment: 'DEFAULT_ADMIN_ROLE', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'DISPUTE_PERIOD', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'FEE_BPS', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'FEE_RATE_MAX', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'GOVERNOR_ROLE', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'GUARD_ROLE', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'MIN_DEADLINE_PERIOD', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'RELAYER_ROLE', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'addGovernor', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'addGuard', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'addRelayer', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'bridge', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'bridgeProofs', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'bridgeRelays', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'bridgeStatuses', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'canClaim', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'chainGasAmount', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'claim', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'deployBlock', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'dispute', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'getBridgeTransaction', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'getRoleAdmin', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'grantRole', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'hasRole', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'nonce', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'protocolFeeRate', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'protocolFees', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'prove', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'refund', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'relay', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'removeGovernor', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'removeGuard', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'removeRelayer', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'renounceRole', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'revokeRole', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setChainGasAmount', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'setProtocolFeeRate', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'supportsInterface', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'sweepProtocolFees', + data: BytesLike + ): Result + + events: { + 'BridgeDepositClaimed(bytes32,address,address,address,uint256)': EventFragment + 'BridgeDepositRefunded(bytes32,address,address,uint256)': EventFragment + 'BridgeProofDisputed(bytes32,address)': EventFragment + 'BridgeProofProvided(bytes32,address,bytes32)': EventFragment + 'BridgeRelayed(bytes32,address,address,address,uint256,uint256)': EventFragment + 'BridgeRequested(bytes32,address,bytes)': EventFragment + 'ChainGasAmountUpdated(uint256,uint256)': EventFragment + 'FeeRateUpdated(uint256,uint256)': EventFragment + 'FeesSwept(address,address,uint256)': EventFragment + 'GovernorAdded(address)': EventFragment + 'GovernorRemoved(address)': EventFragment + 'GuardAdded(address)': EventFragment + 'GuardRemoved(address)': EventFragment + 'RelayerAdded(address)': EventFragment + 'RelayerRemoved(address)': EventFragment + 'RoleAdminChanged(bytes32,bytes32,bytes32)': EventFragment + 'RoleGranted(bytes32,address,address)': EventFragment + 'RoleRevoked(bytes32,address,address)': EventFragment + } + + getEvent(nameOrSignatureOrTopic: 'BridgeDepositClaimed'): EventFragment + getEvent(nameOrSignatureOrTopic: 'BridgeDepositRefunded'): EventFragment + getEvent(nameOrSignatureOrTopic: 'BridgeProofDisputed'): EventFragment + getEvent(nameOrSignatureOrTopic: 'BridgeProofProvided'): EventFragment + getEvent(nameOrSignatureOrTopic: 'BridgeRelayed'): EventFragment + getEvent(nameOrSignatureOrTopic: 'BridgeRequested'): EventFragment + getEvent(nameOrSignatureOrTopic: 'ChainGasAmountUpdated'): EventFragment + getEvent(nameOrSignatureOrTopic: 'FeeRateUpdated'): EventFragment + getEvent(nameOrSignatureOrTopic: 'FeesSwept'): EventFragment + getEvent(nameOrSignatureOrTopic: 'GovernorAdded'): EventFragment + getEvent(nameOrSignatureOrTopic: 'GovernorRemoved'): EventFragment + getEvent(nameOrSignatureOrTopic: 'GuardAdded'): EventFragment + getEvent(nameOrSignatureOrTopic: 'GuardRemoved'): EventFragment + getEvent(nameOrSignatureOrTopic: 'RelayerAdded'): EventFragment + getEvent(nameOrSignatureOrTopic: 'RelayerRemoved'): EventFragment + getEvent(nameOrSignatureOrTopic: 'RoleAdminChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'RoleGranted'): EventFragment + getEvent(nameOrSignatureOrTopic: 'RoleRevoked'): EventFragment +} + +export interface BridgeDepositClaimedEventObject { + transactionId: string + relayer: string + to: string + token: string + amount: BigNumber +} +export type BridgeDepositClaimedEvent = TypedEvent< + [string, string, string, string, BigNumber], + BridgeDepositClaimedEventObject +> + +export type BridgeDepositClaimedEventFilter = + TypedEventFilter + +export interface BridgeDepositRefundedEventObject { + transactionId: string + to: string + token: string + amount: BigNumber +} +export type BridgeDepositRefundedEvent = TypedEvent< + [string, string, string, BigNumber], + BridgeDepositRefundedEventObject +> + +export type BridgeDepositRefundedEventFilter = + TypedEventFilter + +export interface BridgeProofDisputedEventObject { + transactionId: string + relayer: string +} +export type BridgeProofDisputedEvent = TypedEvent< + [string, string], + BridgeProofDisputedEventObject +> + +export type BridgeProofDisputedEventFilter = + TypedEventFilter + +export interface BridgeProofProvidedEventObject { + transactionId: string + relayer: string + transactionHash: string +} +export type BridgeProofProvidedEvent = TypedEvent< + [string, string, string], + BridgeProofProvidedEventObject +> + +export type BridgeProofProvidedEventFilter = + TypedEventFilter + +export interface BridgeRelayedEventObject { + transactionId: string + relayer: string + to: string + token: string + amount: BigNumber + chainGasAmount: BigNumber +} +export type BridgeRelayedEvent = TypedEvent< + [string, string, string, string, BigNumber, BigNumber], + BridgeRelayedEventObject +> + +export type BridgeRelayedEventFilter = TypedEventFilter + +export interface BridgeRequestedEventObject { + transactionId: string + sender: string + request: string +} +export type BridgeRequestedEvent = TypedEvent< + [string, string, string], + BridgeRequestedEventObject +> + +export type BridgeRequestedEventFilter = TypedEventFilter + +export interface ChainGasAmountUpdatedEventObject { + oldChainGasAmount: BigNumber + newChainGasAmount: BigNumber +} +export type ChainGasAmountUpdatedEvent = TypedEvent< + [BigNumber, BigNumber], + ChainGasAmountUpdatedEventObject +> + +export type ChainGasAmountUpdatedEventFilter = + TypedEventFilter + +export interface FeeRateUpdatedEventObject { + oldFeeRate: BigNumber + newFeeRate: BigNumber +} +export type FeeRateUpdatedEvent = TypedEvent< + [BigNumber, BigNumber], + FeeRateUpdatedEventObject +> + +export type FeeRateUpdatedEventFilter = TypedEventFilter + +export interface FeesSweptEventObject { + token: string + recipient: string + amount: BigNumber +} +export type FeesSweptEvent = TypedEvent< + [string, string, BigNumber], + FeesSweptEventObject +> + +export type FeesSweptEventFilter = TypedEventFilter + +export interface GovernorAddedEventObject { + governor: string +} +export type GovernorAddedEvent = TypedEvent<[string], GovernorAddedEventObject> + +export type GovernorAddedEventFilter = TypedEventFilter + +export interface GovernorRemovedEventObject { + governor: string +} +export type GovernorRemovedEvent = TypedEvent< + [string], + GovernorRemovedEventObject +> + +export type GovernorRemovedEventFilter = TypedEventFilter + +export interface GuardAddedEventObject { + guard: string +} +export type GuardAddedEvent = TypedEvent<[string], GuardAddedEventObject> + +export type GuardAddedEventFilter = TypedEventFilter + +export interface GuardRemovedEventObject { + guard: string +} +export type GuardRemovedEvent = TypedEvent<[string], GuardRemovedEventObject> + +export type GuardRemovedEventFilter = TypedEventFilter + +export interface RelayerAddedEventObject { + relayer: string +} +export type RelayerAddedEvent = TypedEvent<[string], RelayerAddedEventObject> + +export type RelayerAddedEventFilter = TypedEventFilter + +export interface RelayerRemovedEventObject { + relayer: string +} +export type RelayerRemovedEvent = TypedEvent< + [string], + RelayerRemovedEventObject +> + +export type RelayerRemovedEventFilter = TypedEventFilter + +export interface RoleAdminChangedEventObject { + role: string + previousAdminRole: string + newAdminRole: string +} +export type RoleAdminChangedEvent = TypedEvent< + [string, string, string], + RoleAdminChangedEventObject +> + +export type RoleAdminChangedEventFilter = + TypedEventFilter + +export interface RoleGrantedEventObject { + role: string + account: string + sender: string +} +export type RoleGrantedEvent = TypedEvent< + [string, string, string], + RoleGrantedEventObject +> + +export type RoleGrantedEventFilter = TypedEventFilter + +export interface RoleRevokedEventObject { + role: string + account: string + sender: string +} +export type RoleRevokedEvent = TypedEvent< + [string, string, string], + RoleRevokedEventObject +> + +export type RoleRevokedEventFilter = TypedEventFilter + +export interface FastBridge extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: FastBridgeInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise> + + listeners( + eventFilter?: TypedEventFilter + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise<[string]> + + DISPUTE_PERIOD(overrides?: CallOverrides): Promise<[BigNumber]> + + FEE_BPS(overrides?: CallOverrides): Promise<[BigNumber]> + + FEE_RATE_MAX(overrides?: CallOverrides): Promise<[BigNumber]> + + GOVERNOR_ROLE(overrides?: CallOverrides): Promise<[string]> + + GUARD_ROLE(overrides?: CallOverrides): Promise<[string]> + + MIN_DEADLINE_PERIOD(overrides?: CallOverrides): Promise<[BigNumber]> + + RELAYER_ROLE(overrides?: CallOverrides): Promise<[string]> + + addGovernor( + _governor: string, + overrides?: Overrides & { from?: string } + ): Promise + + addGuard( + _guard: string, + overrides?: Overrides & { from?: string } + ): Promise + + addRelayer( + _relayer: string, + overrides?: Overrides & { from?: string } + ): Promise + + bridge( + params: IFastBridge.BridgeParamsStruct, + overrides?: PayableOverrides & { from?: string } + ): Promise + + bridgeProofs( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber, string] & { timestamp: BigNumber; relayer: string }> + + bridgeRelays(arg0: BytesLike, overrides?: CallOverrides): Promise<[boolean]> + + bridgeStatuses( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise<[number]> + + canClaim( + transactionId: BytesLike, + relayer: string, + overrides?: CallOverrides + ): Promise<[boolean]> + + chainGasAmount(overrides?: CallOverrides): Promise<[BigNumber]> + + claim( + request: BytesLike, + to: string, + overrides?: Overrides & { from?: string } + ): Promise + + deployBlock(overrides?: CallOverrides): Promise<[BigNumber]> + + dispute( + transactionId: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + getBridgeTransaction( + request: BytesLike, + overrides?: CallOverrides + ): Promise<[IFastBridge.BridgeTransactionStructOutput]> + + getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise<[string]> + + grantRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + hasRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise<[boolean]> + + nonce(overrides?: CallOverrides): Promise<[BigNumber]> + + protocolFeeRate(overrides?: CallOverrides): Promise<[BigNumber]> + + protocolFees(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]> + + prove( + request: BytesLike, + destTxHash: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + refund( + request: BytesLike, + to: string, + overrides?: Overrides & { from?: string } + ): Promise + + relay( + request: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise + + removeGovernor( + _governor: string, + overrides?: Overrides & { from?: string } + ): Promise + + removeGuard( + _guard: string, + overrides?: Overrides & { from?: string } + ): Promise + + removeRelayer( + _relayer: string, + overrides?: Overrides & { from?: string } + ): Promise + + renounceRole( + role: BytesLike, + callerConfirmation: string, + overrides?: Overrides & { from?: string } + ): Promise + + revokeRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + setChainGasAmount( + newChainGasAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + setProtocolFeeRate( + newFeeRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]> + + sweepProtocolFees( + token: string, + recipient: string, + overrides?: Overrides & { from?: string } + ): Promise + } + + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise + + DISPUTE_PERIOD(overrides?: CallOverrides): Promise + + FEE_BPS(overrides?: CallOverrides): Promise + + FEE_RATE_MAX(overrides?: CallOverrides): Promise + + GOVERNOR_ROLE(overrides?: CallOverrides): Promise + + GUARD_ROLE(overrides?: CallOverrides): Promise + + MIN_DEADLINE_PERIOD(overrides?: CallOverrides): Promise + + RELAYER_ROLE(overrides?: CallOverrides): Promise + + addGovernor( + _governor: string, + overrides?: Overrides & { from?: string } + ): Promise + + addGuard( + _guard: string, + overrides?: Overrides & { from?: string } + ): Promise + + addRelayer( + _relayer: string, + overrides?: Overrides & { from?: string } + ): Promise + + bridge( + params: IFastBridge.BridgeParamsStruct, + overrides?: PayableOverrides & { from?: string } + ): Promise + + bridgeProofs( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber, string] & { timestamp: BigNumber; relayer: string }> + + bridgeRelays(arg0: BytesLike, overrides?: CallOverrides): Promise + + bridgeStatuses(arg0: BytesLike, overrides?: CallOverrides): Promise + + canClaim( + transactionId: BytesLike, + relayer: string, + overrides?: CallOverrides + ): Promise + + chainGasAmount(overrides?: CallOverrides): Promise + + claim( + request: BytesLike, + to: string, + overrides?: Overrides & { from?: string } + ): Promise + + deployBlock(overrides?: CallOverrides): Promise + + dispute( + transactionId: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + getBridgeTransaction( + request: BytesLike, + overrides?: CallOverrides + ): Promise + + getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise + + grantRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + hasRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise + + nonce(overrides?: CallOverrides): Promise + + protocolFeeRate(overrides?: CallOverrides): Promise + + protocolFees(arg0: string, overrides?: CallOverrides): Promise + + prove( + request: BytesLike, + destTxHash: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + refund( + request: BytesLike, + to: string, + overrides?: Overrides & { from?: string } + ): Promise + + relay( + request: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise + + removeGovernor( + _governor: string, + overrides?: Overrides & { from?: string } + ): Promise + + removeGuard( + _guard: string, + overrides?: Overrides & { from?: string } + ): Promise + + removeRelayer( + _relayer: string, + overrides?: Overrides & { from?: string } + ): Promise + + renounceRole( + role: BytesLike, + callerConfirmation: string, + overrides?: Overrides & { from?: string } + ): Promise + + revokeRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + setChainGasAmount( + newChainGasAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + setProtocolFeeRate( + newFeeRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise + + sweepProtocolFees( + token: string, + recipient: string, + overrides?: Overrides & { from?: string } + ): Promise + + callStatic: { + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise + + DISPUTE_PERIOD(overrides?: CallOverrides): Promise + + FEE_BPS(overrides?: CallOverrides): Promise + + FEE_RATE_MAX(overrides?: CallOverrides): Promise + + GOVERNOR_ROLE(overrides?: CallOverrides): Promise + + GUARD_ROLE(overrides?: CallOverrides): Promise + + MIN_DEADLINE_PERIOD(overrides?: CallOverrides): Promise + + RELAYER_ROLE(overrides?: CallOverrides): Promise + + addGovernor(_governor: string, overrides?: CallOverrides): Promise + + addGuard(_guard: string, overrides?: CallOverrides): Promise + + addRelayer(_relayer: string, overrides?: CallOverrides): Promise + + bridge( + params: IFastBridge.BridgeParamsStruct, + overrides?: CallOverrides + ): Promise + + bridgeProofs( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber, string] & { timestamp: BigNumber; relayer: string }> + + bridgeRelays(arg0: BytesLike, overrides?: CallOverrides): Promise + + bridgeStatuses(arg0: BytesLike, overrides?: CallOverrides): Promise + + canClaim( + transactionId: BytesLike, + relayer: string, + overrides?: CallOverrides + ): Promise + + chainGasAmount(overrides?: CallOverrides): Promise + + claim( + request: BytesLike, + to: string, + overrides?: CallOverrides + ): Promise + + deployBlock(overrides?: CallOverrides): Promise + + dispute(transactionId: BytesLike, overrides?: CallOverrides): Promise + + getBridgeTransaction( + request: BytesLike, + overrides?: CallOverrides + ): Promise + + getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise + + grantRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise + + hasRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise + + nonce(overrides?: CallOverrides): Promise + + protocolFeeRate(overrides?: CallOverrides): Promise + + protocolFees(arg0: string, overrides?: CallOverrides): Promise + + prove( + request: BytesLike, + destTxHash: BytesLike, + overrides?: CallOverrides + ): Promise + + refund( + request: BytesLike, + to: string, + overrides?: CallOverrides + ): Promise + + relay(request: BytesLike, overrides?: CallOverrides): Promise + + removeGovernor(_governor: string, overrides?: CallOverrides): Promise + + removeGuard(_guard: string, overrides?: CallOverrides): Promise + + removeRelayer(_relayer: string, overrides?: CallOverrides): Promise + + renounceRole( + role: BytesLike, + callerConfirmation: string, + overrides?: CallOverrides + ): Promise + + revokeRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise + + setChainGasAmount( + newChainGasAmount: BigNumberish, + overrides?: CallOverrides + ): Promise + + setProtocolFeeRate( + newFeeRate: BigNumberish, + overrides?: CallOverrides + ): Promise + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise + + sweepProtocolFees( + token: string, + recipient: string, + overrides?: CallOverrides + ): Promise + } + + filters: { + 'BridgeDepositClaimed(bytes32,address,address,address,uint256)'( + transactionId?: null, + relayer?: null, + to?: null, + token?: null, + amount?: null + ): BridgeDepositClaimedEventFilter + BridgeDepositClaimed( + transactionId?: null, + relayer?: null, + to?: null, + token?: null, + amount?: null + ): BridgeDepositClaimedEventFilter + + 'BridgeDepositRefunded(bytes32,address,address,uint256)'( + transactionId?: null, + to?: null, + token?: null, + amount?: null + ): BridgeDepositRefundedEventFilter + BridgeDepositRefunded( + transactionId?: null, + to?: null, + token?: null, + amount?: null + ): BridgeDepositRefundedEventFilter + + 'BridgeProofDisputed(bytes32,address)'( + transactionId?: null, + relayer?: null + ): BridgeProofDisputedEventFilter + BridgeProofDisputed( + transactionId?: null, + relayer?: null + ): BridgeProofDisputedEventFilter + + 'BridgeProofProvided(bytes32,address,bytes32)'( + transactionId?: null, + relayer?: null, + transactionHash?: null + ): BridgeProofProvidedEventFilter + BridgeProofProvided( + transactionId?: null, + relayer?: null, + transactionHash?: null + ): BridgeProofProvidedEventFilter + + 'BridgeRelayed(bytes32,address,address,address,uint256,uint256)'( + transactionId?: null, + relayer?: null, + to?: null, + token?: null, + amount?: null, + chainGasAmount?: null + ): BridgeRelayedEventFilter + BridgeRelayed( + transactionId?: null, + relayer?: null, + to?: null, + token?: null, + amount?: null, + chainGasAmount?: null + ): BridgeRelayedEventFilter + + 'BridgeRequested(bytes32,address,bytes)'( + transactionId?: null, + sender?: null, + request?: null + ): BridgeRequestedEventFilter + BridgeRequested( + transactionId?: null, + sender?: null, + request?: null + ): BridgeRequestedEventFilter + + 'ChainGasAmountUpdated(uint256,uint256)'( + oldChainGasAmount?: null, + newChainGasAmount?: null + ): ChainGasAmountUpdatedEventFilter + ChainGasAmountUpdated( + oldChainGasAmount?: null, + newChainGasAmount?: null + ): ChainGasAmountUpdatedEventFilter + + 'FeeRateUpdated(uint256,uint256)'( + oldFeeRate?: null, + newFeeRate?: null + ): FeeRateUpdatedEventFilter + FeeRateUpdated( + oldFeeRate?: null, + newFeeRate?: null + ): FeeRateUpdatedEventFilter + + 'FeesSwept(address,address,uint256)'( + token?: null, + recipient?: null, + amount?: null + ): FeesSweptEventFilter + FeesSwept( + token?: null, + recipient?: null, + amount?: null + ): FeesSweptEventFilter + + 'GovernorAdded(address)'(governor?: null): GovernorAddedEventFilter + GovernorAdded(governor?: null): GovernorAddedEventFilter + + 'GovernorRemoved(address)'(governor?: null): GovernorRemovedEventFilter + GovernorRemoved(governor?: null): GovernorRemovedEventFilter + + 'GuardAdded(address)'(guard?: null): GuardAddedEventFilter + GuardAdded(guard?: null): GuardAddedEventFilter + + 'GuardRemoved(address)'(guard?: null): GuardRemovedEventFilter + GuardRemoved(guard?: null): GuardRemovedEventFilter + + 'RelayerAdded(address)'(relayer?: null): RelayerAddedEventFilter + RelayerAdded(relayer?: null): RelayerAddedEventFilter + + 'RelayerRemoved(address)'(relayer?: null): RelayerRemovedEventFilter + RelayerRemoved(relayer?: null): RelayerRemovedEventFilter + + 'RoleAdminChanged(bytes32,bytes32,bytes32)'( + role?: BytesLike | null, + previousAdminRole?: BytesLike | null, + newAdminRole?: BytesLike | null + ): RoleAdminChangedEventFilter + RoleAdminChanged( + role?: BytesLike | null, + previousAdminRole?: BytesLike | null, + newAdminRole?: BytesLike | null + ): RoleAdminChangedEventFilter + + 'RoleGranted(bytes32,address,address)'( + role?: BytesLike | null, + account?: string | null, + sender?: string | null + ): RoleGrantedEventFilter + RoleGranted( + role?: BytesLike | null, + account?: string | null, + sender?: string | null + ): RoleGrantedEventFilter + + 'RoleRevoked(bytes32,address,address)'( + role?: BytesLike | null, + account?: string | null, + sender?: string | null + ): RoleRevokedEventFilter + RoleRevoked( + role?: BytesLike | null, + account?: string | null, + sender?: string | null + ): RoleRevokedEventFilter + } + + estimateGas: { + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise + + DISPUTE_PERIOD(overrides?: CallOverrides): Promise + + FEE_BPS(overrides?: CallOverrides): Promise + + FEE_RATE_MAX(overrides?: CallOverrides): Promise + + GOVERNOR_ROLE(overrides?: CallOverrides): Promise + + GUARD_ROLE(overrides?: CallOverrides): Promise + + MIN_DEADLINE_PERIOD(overrides?: CallOverrides): Promise + + RELAYER_ROLE(overrides?: CallOverrides): Promise + + addGovernor( + _governor: string, + overrides?: Overrides & { from?: string } + ): Promise + + addGuard( + _guard: string, + overrides?: Overrides & { from?: string } + ): Promise + + addRelayer( + _relayer: string, + overrides?: Overrides & { from?: string } + ): Promise + + bridge( + params: IFastBridge.BridgeParamsStruct, + overrides?: PayableOverrides & { from?: string } + ): Promise + + bridgeProofs(arg0: BytesLike, overrides?: CallOverrides): Promise + + bridgeRelays(arg0: BytesLike, overrides?: CallOverrides): Promise + + bridgeStatuses( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise + + canClaim( + transactionId: BytesLike, + relayer: string, + overrides?: CallOverrides + ): Promise + + chainGasAmount(overrides?: CallOverrides): Promise + + claim( + request: BytesLike, + to: string, + overrides?: Overrides & { from?: string } + ): Promise + + deployBlock(overrides?: CallOverrides): Promise + + dispute( + transactionId: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + getBridgeTransaction( + request: BytesLike, + overrides?: CallOverrides + ): Promise + + getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise + + grantRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + hasRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise + + nonce(overrides?: CallOverrides): Promise + + protocolFeeRate(overrides?: CallOverrides): Promise + + protocolFees(arg0: string, overrides?: CallOverrides): Promise + + prove( + request: BytesLike, + destTxHash: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + refund( + request: BytesLike, + to: string, + overrides?: Overrides & { from?: string } + ): Promise + + relay( + request: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise + + removeGovernor( + _governor: string, + overrides?: Overrides & { from?: string } + ): Promise + + removeGuard( + _guard: string, + overrides?: Overrides & { from?: string } + ): Promise + + removeRelayer( + _relayer: string, + overrides?: Overrides & { from?: string } + ): Promise + + renounceRole( + role: BytesLike, + callerConfirmation: string, + overrides?: Overrides & { from?: string } + ): Promise + + revokeRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + setChainGasAmount( + newChainGasAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + setProtocolFeeRate( + newFeeRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise + + sweepProtocolFees( + token: string, + recipient: string, + overrides?: Overrides & { from?: string } + ): Promise + } + + populateTransaction: { + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise + + DISPUTE_PERIOD(overrides?: CallOverrides): Promise + + FEE_BPS(overrides?: CallOverrides): Promise + + FEE_RATE_MAX(overrides?: CallOverrides): Promise + + GOVERNOR_ROLE(overrides?: CallOverrides): Promise + + GUARD_ROLE(overrides?: CallOverrides): Promise + + MIN_DEADLINE_PERIOD( + overrides?: CallOverrides + ): Promise + + RELAYER_ROLE(overrides?: CallOverrides): Promise + + addGovernor( + _governor: string, + overrides?: Overrides & { from?: string } + ): Promise + + addGuard( + _guard: string, + overrides?: Overrides & { from?: string } + ): Promise + + addRelayer( + _relayer: string, + overrides?: Overrides & { from?: string } + ): Promise + + bridge( + params: IFastBridge.BridgeParamsStruct, + overrides?: PayableOverrides & { from?: string } + ): Promise + + bridgeProofs( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise + + bridgeRelays( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise + + bridgeStatuses( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise + + canClaim( + transactionId: BytesLike, + relayer: string, + overrides?: CallOverrides + ): Promise + + chainGasAmount(overrides?: CallOverrides): Promise + + claim( + request: BytesLike, + to: string, + overrides?: Overrides & { from?: string } + ): Promise + + deployBlock(overrides?: CallOverrides): Promise + + dispute( + transactionId: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + getBridgeTransaction( + request: BytesLike, + overrides?: CallOverrides + ): Promise + + getRoleAdmin( + role: BytesLike, + overrides?: CallOverrides + ): Promise + + grantRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + hasRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise + + nonce(overrides?: CallOverrides): Promise + + protocolFeeRate(overrides?: CallOverrides): Promise + + protocolFees( + arg0: string, + overrides?: CallOverrides + ): Promise + + prove( + request: BytesLike, + destTxHash: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + refund( + request: BytesLike, + to: string, + overrides?: Overrides & { from?: string } + ): Promise + + relay( + request: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise + + removeGovernor( + _governor: string, + overrides?: Overrides & { from?: string } + ): Promise + + removeGuard( + _guard: string, + overrides?: Overrides & { from?: string } + ): Promise + + removeRelayer( + _relayer: string, + overrides?: Overrides & { from?: string } + ): Promise + + renounceRole( + role: BytesLike, + callerConfirmation: string, + overrides?: Overrides & { from?: string } + ): Promise + + revokeRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + setChainGasAmount( + newChainGasAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + setProtocolFeeRate( + newFeeRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise + + sweepProtocolFees( + token: string, + recipient: string, + overrides?: Overrides & { from?: string } + ): Promise + } +} diff --git a/packages/sdk-router/src/typechain/SynapseBridge.ts b/packages/sdk-router/src/typechain/SynapseBridge.ts index 7d66a8534a..0b141e44aa 100644 --- a/packages/sdk-router/src/typechain/SynapseBridge.ts +++ b/packages/sdk-router/src/typechain/SynapseBridge.ts @@ -4,11 +4,11 @@ import type { BaseContract, BigNumber, + BigNumberish, BytesLike, CallOverrides, ContractTransaction, Overrides, - PayableOverrides, PopulatedTransaction, Signer, utils, @@ -24,83 +24,613 @@ import type { TypedEvent, TypedListener, OnEvent, - PromiseOrValue, } from './common' export interface SynapseBridgeInterface extends utils.Interface { functions: { - 'admin()': FunctionFragment - 'changeAdmin(address)': FunctionFragment - 'implementation()': FunctionFragment - 'upgradeTo(address)': FunctionFragment - 'upgradeToAndCall(address,bytes)': FunctionFragment + 'DEFAULT_ADMIN_ROLE()': FunctionFragment + 'GOVERNANCE_ROLE()': FunctionFragment + 'NODEGROUP_ROLE()': FunctionFragment + 'WETH_ADDRESS()': FunctionFragment + 'addKappas(bytes32[])': FunctionFragment + 'bridgeVersion()': FunctionFragment + 'chainGasAmount()': FunctionFragment + 'deposit(address,uint256,address,uint256)': FunctionFragment + 'depositAndSwap(address,uint256,address,uint256,uint8,uint8,uint256,uint256)': FunctionFragment + 'getFeeBalance(address)': FunctionFragment + 'getRoleAdmin(bytes32)': FunctionFragment + 'getRoleMember(bytes32,uint256)': FunctionFragment + 'getRoleMemberCount(bytes32)': FunctionFragment + 'grantRole(bytes32,address)': FunctionFragment + 'hasRole(bytes32,address)': FunctionFragment + 'initialize()': FunctionFragment + 'kappaExists(bytes32)': FunctionFragment + 'mint(address,address,uint256,uint256,bytes32)': FunctionFragment + 'mintAndSwap(address,address,uint256,uint256,address,uint8,uint8,uint256,uint256,bytes32)': FunctionFragment + 'pause()': FunctionFragment + 'paused()': FunctionFragment + 'redeem(address,uint256,address,uint256)': FunctionFragment + 'redeemAndRemove(address,uint256,address,uint256,uint8,uint256,uint256)': FunctionFragment + 'redeemAndSwap(address,uint256,address,uint256,uint8,uint8,uint256,uint256)': FunctionFragment + 'redeemV2(bytes32,uint256,address,uint256)': FunctionFragment + 'renounceRole(bytes32,address)': FunctionFragment + 'revokeRole(bytes32,address)': FunctionFragment + 'setChainGasAmount(uint256)': FunctionFragment + 'setWethAddress(address)': FunctionFragment + 'startBlockNumber()': FunctionFragment + 'unpause()': FunctionFragment + 'withdraw(address,address,uint256,uint256,bytes32)': FunctionFragment + 'withdrawAndRemove(address,address,uint256,uint256,address,uint8,uint256,uint256,bytes32)': FunctionFragment + 'withdrawFees(address,address)': FunctionFragment } getFunction( nameOrSignatureOrTopic: - | 'admin' - | 'changeAdmin' - | 'implementation' - | 'upgradeTo' - | 'upgradeToAndCall' + | 'DEFAULT_ADMIN_ROLE' + | 'GOVERNANCE_ROLE' + | 'NODEGROUP_ROLE' + | 'WETH_ADDRESS' + | 'addKappas' + | 'bridgeVersion' + | 'chainGasAmount' + | 'deposit' + | 'depositAndSwap' + | 'getFeeBalance' + | 'getRoleAdmin' + | 'getRoleMember' + | 'getRoleMemberCount' + | 'grantRole' + | 'hasRole' + | 'initialize' + | 'kappaExists' + | 'mint' + | 'mintAndSwap' + | 'pause' + | 'paused' + | 'redeem' + | 'redeemAndRemove' + | 'redeemAndSwap' + | 'redeemV2' + | 'renounceRole' + | 'revokeRole' + | 'setChainGasAmount' + | 'setWethAddress' + | 'startBlockNumber' + | 'unpause' + | 'withdraw' + | 'withdrawAndRemove' + | 'withdrawFees' ): FunctionFragment - encodeFunctionData(functionFragment: 'admin', values?: undefined): string encodeFunctionData( - functionFragment: 'changeAdmin', - values: [PromiseOrValue] + functionFragment: 'DEFAULT_ADMIN_ROLE', + values?: undefined + ): string + encodeFunctionData( + functionFragment: 'GOVERNANCE_ROLE', + values?: undefined + ): string + encodeFunctionData( + functionFragment: 'NODEGROUP_ROLE', + values?: undefined + ): string + encodeFunctionData( + functionFragment: 'WETH_ADDRESS', + values?: undefined + ): string + encodeFunctionData( + functionFragment: 'addKappas', + values: [BytesLike[]] + ): string + encodeFunctionData( + functionFragment: 'bridgeVersion', + values?: undefined + ): string + encodeFunctionData( + functionFragment: 'chainGasAmount', + values?: undefined + ): string + encodeFunctionData( + functionFragment: 'deposit', + values: [string, BigNumberish, string, BigNumberish] + ): string + encodeFunctionData( + functionFragment: 'depositAndSwap', + values: [ + string, + BigNumberish, + string, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish + ] + ): string + encodeFunctionData( + functionFragment: 'getFeeBalance', + values: [string] + ): string + encodeFunctionData( + functionFragment: 'getRoleAdmin', + values: [BytesLike] + ): string + encodeFunctionData( + functionFragment: 'getRoleMember', + values: [BytesLike, BigNumberish] + ): string + encodeFunctionData( + functionFragment: 'getRoleMemberCount', + values: [BytesLike] + ): string + encodeFunctionData( + functionFragment: 'grantRole', + values: [BytesLike, string] + ): string + encodeFunctionData( + functionFragment: 'hasRole', + values: [BytesLike, string] + ): string + encodeFunctionData(functionFragment: 'initialize', values?: undefined): string + encodeFunctionData( + functionFragment: 'kappaExists', + values: [BytesLike] + ): string + encodeFunctionData( + functionFragment: 'mint', + values: [string, string, BigNumberish, BigNumberish, BytesLike] + ): string + encodeFunctionData( + functionFragment: 'mintAndSwap', + values: [ + string, + string, + BigNumberish, + BigNumberish, + string, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike + ] + ): string + encodeFunctionData(functionFragment: 'pause', values?: undefined): string + encodeFunctionData(functionFragment: 'paused', values?: undefined): string + encodeFunctionData( + functionFragment: 'redeem', + values: [string, BigNumberish, string, BigNumberish] + ): string + encodeFunctionData( + functionFragment: 'redeemAndRemove', + values: [ + string, + BigNumberish, + string, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish + ] + ): string + encodeFunctionData( + functionFragment: 'redeemAndSwap', + values: [ + string, + BigNumberish, + string, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish + ] + ): string + encodeFunctionData( + functionFragment: 'redeemV2', + values: [BytesLike, BigNumberish, string, BigNumberish] + ): string + encodeFunctionData( + functionFragment: 'renounceRole', + values: [BytesLike, string] + ): string + encodeFunctionData( + functionFragment: 'revokeRole', + values: [BytesLike, string] + ): string + encodeFunctionData( + functionFragment: 'setChainGasAmount', + values: [BigNumberish] ): string encodeFunctionData( - functionFragment: 'implementation', + functionFragment: 'setWethAddress', + values: [string] + ): string + encodeFunctionData( + functionFragment: 'startBlockNumber', values?: undefined ): string + encodeFunctionData(functionFragment: 'unpause', values?: undefined): string + encodeFunctionData( + functionFragment: 'withdraw', + values: [string, string, BigNumberish, BigNumberish, BytesLike] + ): string encodeFunctionData( - functionFragment: 'upgradeTo', - values: [PromiseOrValue] + functionFragment: 'withdrawAndRemove', + values: [ + string, + string, + BigNumberish, + BigNumberish, + string, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike + ] ): string encodeFunctionData( - functionFragment: 'upgradeToAndCall', - values: [PromiseOrValue, PromiseOrValue] + functionFragment: 'withdrawFees', + values: [string, string] ): string - decodeFunctionResult(functionFragment: 'admin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'changeAdmin', data: BytesLike): Result decodeFunctionResult( - functionFragment: 'implementation', + functionFragment: 'DEFAULT_ADMIN_ROLE', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'GOVERNANCE_ROLE', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'NODEGROUP_ROLE', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'WETH_ADDRESS', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'addKappas', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'bridgeVersion', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'chainGasAmount', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'deposit', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'depositAndSwap', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'getFeeBalance', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'getRoleAdmin', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'getRoleMember', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'getRoleMemberCount', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'grantRole', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'hasRole', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'initialize', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'kappaExists', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'mintAndSwap', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'pause', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'paused', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'redeem', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'redeemAndRemove', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'redeemAndSwap', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'redeemV2', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'renounceRole', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'revokeRole', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setChainGasAmount', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'setWethAddress', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'startBlockNumber', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'unpause', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'withdraw', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'withdrawAndRemove', data: BytesLike ): Result - decodeFunctionResult(functionFragment: 'upgradeTo', data: BytesLike): Result decodeFunctionResult( - functionFragment: 'upgradeToAndCall', + functionFragment: 'withdrawFees', data: BytesLike ): Result events: { - 'AdminChanged(address,address)': EventFragment - 'Upgraded(address)': EventFragment + 'Paused(address)': EventFragment + 'RoleAdminChanged(bytes32,bytes32,bytes32)': EventFragment + 'RoleGranted(bytes32,address,address)': EventFragment + 'RoleRevoked(bytes32,address,address)': EventFragment + 'TokenDeposit(address,uint256,address,uint256)': EventFragment + 'TokenDepositAndSwap(address,uint256,address,uint256,uint8,uint8,uint256,uint256)': EventFragment + 'TokenMint(address,address,uint256,uint256,bytes32)': EventFragment + 'TokenMintAndSwap(address,address,uint256,uint256,uint8,uint8,uint256,uint256,bool,bytes32)': EventFragment + 'TokenRedeem(address,uint256,address,uint256)': EventFragment + 'TokenRedeemAndRemove(address,uint256,address,uint256,uint8,uint256,uint256)': EventFragment + 'TokenRedeemAndSwap(address,uint256,address,uint256,uint8,uint8,uint256,uint256)': EventFragment + 'TokenRedeemV2(bytes32,uint256,address,uint256)': EventFragment + 'TokenWithdraw(address,address,uint256,uint256,bytes32)': EventFragment + 'TokenWithdrawAndRemove(address,address,uint256,uint256,uint8,uint256,uint256,bool,bytes32)': EventFragment + 'Unpaused(address)': EventFragment } - getEvent(nameOrSignatureOrTopic: 'AdminChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Upgraded'): EventFragment + getEvent(nameOrSignatureOrTopic: 'Paused'): EventFragment + getEvent(nameOrSignatureOrTopic: 'RoleAdminChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'RoleGranted'): EventFragment + getEvent(nameOrSignatureOrTopic: 'RoleRevoked'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TokenDeposit'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TokenDepositAndSwap'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TokenMint'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TokenMintAndSwap'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TokenRedeem'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TokenRedeemAndRemove'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TokenRedeemAndSwap'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TokenRedeemV2'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TokenWithdraw'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TokenWithdrawAndRemove'): EventFragment + getEvent(nameOrSignatureOrTopic: 'Unpaused'): EventFragment +} + +export interface PausedEventObject { + account: string +} +export type PausedEvent = TypedEvent<[string], PausedEventObject> + +export type PausedEventFilter = TypedEventFilter + +export interface RoleAdminChangedEventObject { + role: string + previousAdminRole: string + newAdminRole: string +} +export type RoleAdminChangedEvent = TypedEvent< + [string, string, string], + RoleAdminChangedEventObject +> + +export type RoleAdminChangedEventFilter = + TypedEventFilter + +export interface RoleGrantedEventObject { + role: string + account: string + sender: string +} +export type RoleGrantedEvent = TypedEvent< + [string, string, string], + RoleGrantedEventObject +> + +export type RoleGrantedEventFilter = TypedEventFilter + +export interface RoleRevokedEventObject { + role: string + account: string + sender: string +} +export type RoleRevokedEvent = TypedEvent< + [string, string, string], + RoleRevokedEventObject +> + +export type RoleRevokedEventFilter = TypedEventFilter + +export interface TokenDepositEventObject { + to: string + chainId: BigNumber + token: string + amount: BigNumber +} +export type TokenDepositEvent = TypedEvent< + [string, BigNumber, string, BigNumber], + TokenDepositEventObject +> + +export type TokenDepositEventFilter = TypedEventFilter + +export interface TokenDepositAndSwapEventObject { + to: string + chainId: BigNumber + token: string + amount: BigNumber + tokenIndexFrom: number + tokenIndexTo: number + minDy: BigNumber + deadline: BigNumber +} +export type TokenDepositAndSwapEvent = TypedEvent< + [string, BigNumber, string, BigNumber, number, number, BigNumber, BigNumber], + TokenDepositAndSwapEventObject +> + +export type TokenDepositAndSwapEventFilter = + TypedEventFilter + +export interface TokenMintEventObject { + to: string + token: string + amount: BigNumber + fee: BigNumber + kappa: string +} +export type TokenMintEvent = TypedEvent< + [string, string, BigNumber, BigNumber, string], + TokenMintEventObject +> + +export type TokenMintEventFilter = TypedEventFilter + +export interface TokenMintAndSwapEventObject { + to: string + token: string + amount: BigNumber + fee: BigNumber + tokenIndexFrom: number + tokenIndexTo: number + minDy: BigNumber + deadline: BigNumber + swapSuccess: boolean + kappa: string +} +export type TokenMintAndSwapEvent = TypedEvent< + [ + string, + string, + BigNumber, + BigNumber, + number, + number, + BigNumber, + BigNumber, + boolean, + string + ], + TokenMintAndSwapEventObject +> + +export type TokenMintAndSwapEventFilter = + TypedEventFilter + +export interface TokenRedeemEventObject { + to: string + chainId: BigNumber + token: string + amount: BigNumber } +export type TokenRedeemEvent = TypedEvent< + [string, BigNumber, string, BigNumber], + TokenRedeemEventObject +> + +export type TokenRedeemEventFilter = TypedEventFilter -export interface AdminChangedEventObject { - previousAdmin: string - newAdmin: string +export interface TokenRedeemAndRemoveEventObject { + to: string + chainId: BigNumber + token: string + amount: BigNumber + swapTokenIndex: number + swapMinAmount: BigNumber + swapDeadline: BigNumber } -export type AdminChangedEvent = TypedEvent< - [string, string], - AdminChangedEventObject +export type TokenRedeemAndRemoveEvent = TypedEvent< + [string, BigNumber, string, BigNumber, number, BigNumber, BigNumber], + TokenRedeemAndRemoveEventObject > -export type AdminChangedEventFilter = TypedEventFilter +export type TokenRedeemAndRemoveEventFilter = + TypedEventFilter -export interface UpgradedEventObject { - implementation: string +export interface TokenRedeemAndSwapEventObject { + to: string + chainId: BigNumber + token: string + amount: BigNumber + tokenIndexFrom: number + tokenIndexTo: number + minDy: BigNumber + deadline: BigNumber } -export type UpgradedEvent = TypedEvent<[string], UpgradedEventObject> +export type TokenRedeemAndSwapEvent = TypedEvent< + [string, BigNumber, string, BigNumber, number, number, BigNumber, BigNumber], + TokenRedeemAndSwapEventObject +> + +export type TokenRedeemAndSwapEventFilter = + TypedEventFilter + +export interface TokenRedeemV2EventObject { + to: string + chainId: BigNumber + token: string + amount: BigNumber +} +export type TokenRedeemV2Event = TypedEvent< + [string, BigNumber, string, BigNumber], + TokenRedeemV2EventObject +> -export type UpgradedEventFilter = TypedEventFilter +export type TokenRedeemV2EventFilter = TypedEventFilter + +export interface TokenWithdrawEventObject { + to: string + token: string + amount: BigNumber + fee: BigNumber + kappa: string +} +export type TokenWithdrawEvent = TypedEvent< + [string, string, BigNumber, BigNumber, string], + TokenWithdrawEventObject +> + +export type TokenWithdrawEventFilter = TypedEventFilter + +export interface TokenWithdrawAndRemoveEventObject { + to: string + token: string + amount: BigNumber + fee: BigNumber + swapTokenIndex: number + swapMinAmount: BigNumber + swapDeadline: BigNumber + swapSuccess: boolean + kappa: string +} +export type TokenWithdrawAndRemoveEvent = TypedEvent< + [ + string, + string, + BigNumber, + BigNumber, + number, + BigNumber, + BigNumber, + boolean, + string + ], + TokenWithdrawAndRemoveEventObject +> + +export type TokenWithdrawAndRemoveEventFilter = + TypedEventFilter + +export interface UnpausedEventObject { + account: string +} +export type UnpausedEvent = TypedEvent<[string], UnpausedEventObject> + +export type UnpausedEventFilter = TypedEventFilter export interface SynapseBridge extends BaseContract { connect(signerOrProvider: Signer | Provider | string): this @@ -129,141 +659,1203 @@ export interface SynapseBridge extends BaseContract { removeListener: OnEvent functions: { - admin( - overrides?: Overrides & { from?: PromiseOrValue } + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise<[string]> + + GOVERNANCE_ROLE(overrides?: CallOverrides): Promise<[string]> + + NODEGROUP_ROLE(overrides?: CallOverrides): Promise<[string]> + + WETH_ADDRESS(overrides?: CallOverrides): Promise<[string]> + + addKappas( + kappas: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise + + bridgeVersion(overrides?: CallOverrides): Promise<[BigNumber]> + + chainGasAmount(overrides?: CallOverrides): Promise<[BigNumber]> + + deposit( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + depositAndSwap( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + getFeeBalance( + tokenAddress: string, + overrides?: CallOverrides + ): Promise<[BigNumber]> + + getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise<[string]> + + getRoleMember( + role: BytesLike, + index: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]> + + getRoleMemberCount( + role: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]> + + grantRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + hasRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise<[boolean]> + + initialize( + overrides?: Overrides & { from?: string } + ): Promise + + kappaExists(kappa: BytesLike, overrides?: CallOverrides): Promise<[boolean]> + + mint( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + mintAndSwap( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + pool: string, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + pause( + overrides?: Overrides & { from?: string } + ): Promise + + paused(overrides?: CallOverrides): Promise<[boolean]> + + redeem( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + redeemAndRemove( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + swapTokenIndex: BigNumberish, + swapMinAmount: BigNumberish, + swapDeadline: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + redeemAndSwap( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + redeemV2( + to: BytesLike, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise - changeAdmin( - newAdmin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + renounceRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } ): Promise - implementation( - overrides?: Overrides & { from?: PromiseOrValue } + revokeRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } ): Promise - upgradeTo( - newImplementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + setChainGasAmount( + amount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } + setWethAddress( + _wethAddress: string, + overrides?: Overrides & { from?: string } + ): Promise + + startBlockNumber(overrides?: CallOverrides): Promise<[BigNumber]> + + unpause( + overrides?: Overrides & { from?: string } + ): Promise + + withdraw( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + withdrawAndRemove( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + pool: string, + swapTokenIndex: BigNumberish, + swapMinAmount: BigNumberish, + swapDeadline: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + withdrawFees( + token: string, + to: string, + overrides?: Overrides & { from?: string } ): Promise } - admin( - overrides?: Overrides & { from?: PromiseOrValue } + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise + + GOVERNANCE_ROLE(overrides?: CallOverrides): Promise + + NODEGROUP_ROLE(overrides?: CallOverrides): Promise + + WETH_ADDRESS(overrides?: CallOverrides): Promise + + addKappas( + kappas: BytesLike[], + overrides?: Overrides & { from?: string } ): Promise - changeAdmin( - newAdmin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + bridgeVersion(overrides?: CallOverrides): Promise + + chainGasAmount(overrides?: CallOverrides): Promise + + deposit( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise - implementation( - overrides?: Overrides & { from?: PromiseOrValue } + depositAndSwap( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise - upgradeTo( - newImplementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + getFeeBalance( + tokenAddress: string, + overrides?: CallOverrides + ): Promise + + getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise + + getRoleMember( + role: BytesLike, + index: BigNumberish, + overrides?: CallOverrides + ): Promise + + getRoleMemberCount( + role: BytesLike, + overrides?: CallOverrides + ): Promise + + grantRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + hasRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise + + initialize( + overrides?: Overrides & { from?: string } + ): Promise + + kappaExists(kappa: BytesLike, overrides?: CallOverrides): Promise + + mint( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + mintAndSwap( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + pool: string, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + pause(overrides?: Overrides & { from?: string }): Promise + + paused(overrides?: CallOverrides): Promise + + redeem( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + redeemAndRemove( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + swapTokenIndex: BigNumberish, + swapMinAmount: BigNumberish, + swapDeadline: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + redeemAndSwap( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + redeemV2( + to: BytesLike, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + renounceRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + revokeRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + setChainGasAmount( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + setWethAddress( + _wethAddress: string, + overrides?: Overrides & { from?: string } + ): Promise + + startBlockNumber(overrides?: CallOverrides): Promise + + unpause( + overrides?: Overrides & { from?: string } + ): Promise + + withdraw( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + withdrawAndRemove( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + pool: string, + swapTokenIndex: BigNumberish, + swapMinAmount: BigNumberish, + swapDeadline: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } ): Promise - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } + withdrawFees( + token: string, + to: string, + overrides?: Overrides & { from?: string } ): Promise callStatic: { - admin(overrides?: CallOverrides): Promise + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise + + GOVERNANCE_ROLE(overrides?: CallOverrides): Promise + + NODEGROUP_ROLE(overrides?: CallOverrides): Promise + + WETH_ADDRESS(overrides?: CallOverrides): Promise + + addKappas(kappas: BytesLike[], overrides?: CallOverrides): Promise + + bridgeVersion(overrides?: CallOverrides): Promise + + chainGasAmount(overrides?: CallOverrides): Promise + + deposit( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise + + depositAndSwap( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + overrides?: CallOverrides + ): Promise + + getFeeBalance( + tokenAddress: string, + overrides?: CallOverrides + ): Promise + + getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise + + getRoleMember( + role: BytesLike, + index: BigNumberish, + overrides?: CallOverrides + ): Promise + + getRoleMemberCount( + role: BytesLike, + overrides?: CallOverrides + ): Promise + + grantRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise + + hasRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise + + initialize(overrides?: CallOverrides): Promise + + kappaExists(kappa: BytesLike, overrides?: CallOverrides): Promise + + mint( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + kappa: BytesLike, + overrides?: CallOverrides + ): Promise + + mintAndSwap( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + pool: string, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + kappa: BytesLike, + overrides?: CallOverrides + ): Promise + + pause(overrides?: CallOverrides): Promise + + paused(overrides?: CallOverrides): Promise + + redeem( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise + + redeemAndRemove( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + swapTokenIndex: BigNumberish, + swapMinAmount: BigNumberish, + swapDeadline: BigNumberish, + overrides?: CallOverrides + ): Promise + + redeemAndSwap( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + overrides?: CallOverrides + ): Promise + + redeemV2( + to: BytesLike, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise + + renounceRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise + + revokeRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise + + setChainGasAmount( + amount: BigNumberish, + overrides?: CallOverrides + ): Promise - changeAdmin( - newAdmin: PromiseOrValue, + setWethAddress( + _wethAddress: string, overrides?: CallOverrides ): Promise - implementation(overrides?: CallOverrides): Promise + startBlockNumber(overrides?: CallOverrides): Promise - upgradeTo( - newImplementation: PromiseOrValue, + unpause(overrides?: CallOverrides): Promise + + withdraw( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + kappa: BytesLike, overrides?: CallOverrides ): Promise - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, + withdrawAndRemove( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + pool: string, + swapTokenIndex: BigNumberish, + swapMinAmount: BigNumberish, + swapDeadline: BigNumberish, + kappa: BytesLike, + overrides?: CallOverrides + ): Promise + + withdrawFees( + token: string, + to: string, overrides?: CallOverrides ): Promise } filters: { - 'AdminChanged(address,address)'( - previousAdmin?: null, - newAdmin?: null - ): AdminChangedEventFilter - AdminChanged(previousAdmin?: null, newAdmin?: null): AdminChangedEventFilter - - 'Upgraded(address)'( - implementation?: PromiseOrValue | null - ): UpgradedEventFilter - Upgraded( - implementation?: PromiseOrValue | null - ): UpgradedEventFilter + 'Paused(address)'(account?: null): PausedEventFilter + Paused(account?: null): PausedEventFilter + + 'RoleAdminChanged(bytes32,bytes32,bytes32)'( + role?: BytesLike | null, + previousAdminRole?: BytesLike | null, + newAdminRole?: BytesLike | null + ): RoleAdminChangedEventFilter + RoleAdminChanged( + role?: BytesLike | null, + previousAdminRole?: BytesLike | null, + newAdminRole?: BytesLike | null + ): RoleAdminChangedEventFilter + + 'RoleGranted(bytes32,address,address)'( + role?: BytesLike | null, + account?: string | null, + sender?: string | null + ): RoleGrantedEventFilter + RoleGranted( + role?: BytesLike | null, + account?: string | null, + sender?: string | null + ): RoleGrantedEventFilter + + 'RoleRevoked(bytes32,address,address)'( + role?: BytesLike | null, + account?: string | null, + sender?: string | null + ): RoleRevokedEventFilter + RoleRevoked( + role?: BytesLike | null, + account?: string | null, + sender?: string | null + ): RoleRevokedEventFilter + + 'TokenDeposit(address,uint256,address,uint256)'( + to?: string | null, + chainId?: null, + token?: null, + amount?: null + ): TokenDepositEventFilter + TokenDeposit( + to?: string | null, + chainId?: null, + token?: null, + amount?: null + ): TokenDepositEventFilter + + 'TokenDepositAndSwap(address,uint256,address,uint256,uint8,uint8,uint256,uint256)'( + to?: string | null, + chainId?: null, + token?: null, + amount?: null, + tokenIndexFrom?: null, + tokenIndexTo?: null, + minDy?: null, + deadline?: null + ): TokenDepositAndSwapEventFilter + TokenDepositAndSwap( + to?: string | null, + chainId?: null, + token?: null, + amount?: null, + tokenIndexFrom?: null, + tokenIndexTo?: null, + minDy?: null, + deadline?: null + ): TokenDepositAndSwapEventFilter + + 'TokenMint(address,address,uint256,uint256,bytes32)'( + to?: string | null, + token?: null, + amount?: null, + fee?: null, + kappa?: BytesLike | null + ): TokenMintEventFilter + TokenMint( + to?: string | null, + token?: null, + amount?: null, + fee?: null, + kappa?: BytesLike | null + ): TokenMintEventFilter + + 'TokenMintAndSwap(address,address,uint256,uint256,uint8,uint8,uint256,uint256,bool,bytes32)'( + to?: string | null, + token?: null, + amount?: null, + fee?: null, + tokenIndexFrom?: null, + tokenIndexTo?: null, + minDy?: null, + deadline?: null, + swapSuccess?: null, + kappa?: BytesLike | null + ): TokenMintAndSwapEventFilter + TokenMintAndSwap( + to?: string | null, + token?: null, + amount?: null, + fee?: null, + tokenIndexFrom?: null, + tokenIndexTo?: null, + minDy?: null, + deadline?: null, + swapSuccess?: null, + kappa?: BytesLike | null + ): TokenMintAndSwapEventFilter + + 'TokenRedeem(address,uint256,address,uint256)'( + to?: string | null, + chainId?: null, + token?: null, + amount?: null + ): TokenRedeemEventFilter + TokenRedeem( + to?: string | null, + chainId?: null, + token?: null, + amount?: null + ): TokenRedeemEventFilter + + 'TokenRedeemAndRemove(address,uint256,address,uint256,uint8,uint256,uint256)'( + to?: string | null, + chainId?: null, + token?: null, + amount?: null, + swapTokenIndex?: null, + swapMinAmount?: null, + swapDeadline?: null + ): TokenRedeemAndRemoveEventFilter + TokenRedeemAndRemove( + to?: string | null, + chainId?: null, + token?: null, + amount?: null, + swapTokenIndex?: null, + swapMinAmount?: null, + swapDeadline?: null + ): TokenRedeemAndRemoveEventFilter + + 'TokenRedeemAndSwap(address,uint256,address,uint256,uint8,uint8,uint256,uint256)'( + to?: string | null, + chainId?: null, + token?: null, + amount?: null, + tokenIndexFrom?: null, + tokenIndexTo?: null, + minDy?: null, + deadline?: null + ): TokenRedeemAndSwapEventFilter + TokenRedeemAndSwap( + to?: string | null, + chainId?: null, + token?: null, + amount?: null, + tokenIndexFrom?: null, + tokenIndexTo?: null, + minDy?: null, + deadline?: null + ): TokenRedeemAndSwapEventFilter + + 'TokenRedeemV2(bytes32,uint256,address,uint256)'( + to?: BytesLike | null, + chainId?: null, + token?: null, + amount?: null + ): TokenRedeemV2EventFilter + TokenRedeemV2( + to?: BytesLike | null, + chainId?: null, + token?: null, + amount?: null + ): TokenRedeemV2EventFilter + + 'TokenWithdraw(address,address,uint256,uint256,bytes32)'( + to?: string | null, + token?: null, + amount?: null, + fee?: null, + kappa?: BytesLike | null + ): TokenWithdrawEventFilter + TokenWithdraw( + to?: string | null, + token?: null, + amount?: null, + fee?: null, + kappa?: BytesLike | null + ): TokenWithdrawEventFilter + + 'TokenWithdrawAndRemove(address,address,uint256,uint256,uint8,uint256,uint256,bool,bytes32)'( + to?: string | null, + token?: null, + amount?: null, + fee?: null, + swapTokenIndex?: null, + swapMinAmount?: null, + swapDeadline?: null, + swapSuccess?: null, + kappa?: BytesLike | null + ): TokenWithdrawAndRemoveEventFilter + TokenWithdrawAndRemove( + to?: string | null, + token?: null, + amount?: null, + fee?: null, + swapTokenIndex?: null, + swapMinAmount?: null, + swapDeadline?: null, + swapSuccess?: null, + kappa?: BytesLike | null + ): TokenWithdrawAndRemoveEventFilter + + 'Unpaused(address)'(account?: null): UnpausedEventFilter + Unpaused(account?: null): UnpausedEventFilter } estimateGas: { - admin( - overrides?: Overrides & { from?: PromiseOrValue } + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise + + GOVERNANCE_ROLE(overrides?: CallOverrides): Promise + + NODEGROUP_ROLE(overrides?: CallOverrides): Promise + + WETH_ADDRESS(overrides?: CallOverrides): Promise + + addKappas( + kappas: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise + + bridgeVersion(overrides?: CallOverrides): Promise + + chainGasAmount(overrides?: CallOverrides): Promise + + deposit( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + depositAndSwap( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + getFeeBalance( + tokenAddress: string, + overrides?: CallOverrides + ): Promise + + getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise + + getRoleMember( + role: BytesLike, + index: BigNumberish, + overrides?: CallOverrides + ): Promise + + getRoleMemberCount( + role: BytesLike, + overrides?: CallOverrides + ): Promise + + grantRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + hasRole( + role: BytesLike, + account: string, + overrides?: CallOverrides ): Promise - changeAdmin( - newAdmin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + initialize(overrides?: Overrides & { from?: string }): Promise + + kappaExists(kappa: BytesLike, overrides?: CallOverrides): Promise + + mint( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + mintAndSwap( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + pool: string, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + pause(overrides?: Overrides & { from?: string }): Promise + + paused(overrides?: CallOverrides): Promise + + redeem( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + redeemAndRemove( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + swapTokenIndex: BigNumberish, + swapMinAmount: BigNumberish, + swapDeadline: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + redeemAndSwap( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + redeemV2( + to: BytesLike, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise - implementation( - overrides?: Overrides & { from?: PromiseOrValue } + renounceRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } ): Promise - upgradeTo( - newImplementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + revokeRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } ): Promise - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } + setChainGasAmount( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + setWethAddress( + _wethAddress: string, + overrides?: Overrides & { from?: string } + ): Promise + + startBlockNumber(overrides?: CallOverrides): Promise + + unpause(overrides?: Overrides & { from?: string }): Promise + + withdraw( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + withdrawAndRemove( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + pool: string, + swapTokenIndex: BigNumberish, + swapMinAmount: BigNumberish, + swapDeadline: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + withdrawFees( + token: string, + to: string, + overrides?: Overrides & { from?: string } ): Promise } populateTransaction: { - admin( - overrides?: Overrides & { from?: PromiseOrValue } + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise + + GOVERNANCE_ROLE(overrides?: CallOverrides): Promise + + NODEGROUP_ROLE(overrides?: CallOverrides): Promise + + WETH_ADDRESS(overrides?: CallOverrides): Promise + + addKappas( + kappas: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise + + bridgeVersion(overrides?: CallOverrides): Promise + + chainGasAmount(overrides?: CallOverrides): Promise + + deposit( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + depositAndSwap( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise - changeAdmin( - newAdmin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + getFeeBalance( + tokenAddress: string, + overrides?: CallOverrides + ): Promise + + getRoleAdmin( + role: BytesLike, + overrides?: CallOverrides + ): Promise + + getRoleMember( + role: BytesLike, + index: BigNumberish, + overrides?: CallOverrides + ): Promise + + getRoleMemberCount( + role: BytesLike, + overrides?: CallOverrides + ): Promise + + grantRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + hasRole( + role: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise + + initialize( + overrides?: Overrides & { from?: string } + ): Promise + + kappaExists( + kappa: BytesLike, + overrides?: CallOverrides + ): Promise + + mint( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + mintAndSwap( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + pool: string, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise + + pause( + overrides?: Overrides & { from?: string } + ): Promise + + paused(overrides?: CallOverrides): Promise + + redeem( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + redeemAndRemove( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + swapTokenIndex: BigNumberish, + swapMinAmount: BigNumberish, + swapDeadline: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + redeemAndSwap( + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + minDy: BigNumberish, + deadline: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + redeemV2( + to: BytesLike, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + renounceRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + revokeRole( + role: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise + + setChainGasAmount( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise + + setWethAddress( + _wethAddress: string, + overrides?: Overrides & { from?: string } + ): Promise + + startBlockNumber(overrides?: CallOverrides): Promise + + unpause( + overrides?: Overrides & { from?: string } ): Promise - implementation( - overrides?: Overrides & { from?: PromiseOrValue } + withdraw( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } ): Promise - upgradeTo( - newImplementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + withdrawAndRemove( + to: string, + token: string, + amount: BigNumberish, + fee: BigNumberish, + pool: string, + swapTokenIndex: BigNumberish, + swapMinAmount: BigNumberish, + swapDeadline: BigNumberish, + kappa: BytesLike, + overrides?: Overrides & { from?: string } ): Promise - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } + withdrawFees( + token: string, + to: string, + overrides?: Overrides & { from?: string } ): Promise } } diff --git a/packages/sdk-router/src/typechain/SynapseCCTPRouter.ts b/packages/sdk-router/src/typechain/SynapseCCTPRouter.ts index ce99912041..07bc5cb485 100644 --- a/packages/sdk-router/src/typechain/SynapseCCTPRouter.ts +++ b/packages/sdk-router/src/typechain/SynapseCCTPRouter.ts @@ -1,344 +1,233 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ - -import { - ethers, - EventFilter, - Signer, - BigNumber, - BigNumberish, - PopulatedTransaction, - BaseContract, - ContractTransaction, - PayableOverrides, - CallOverrides, - } from "ethers"; - import { BytesLike } from "@ethersproject/bytes"; - import { Listener, Provider } from "@ethersproject/providers"; - import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; - import type { TypedEventFilter, TypedEvent, TypedListener } from "./common"; - - interface SynapseCCTPRouterInterface extends ethers.utils.Interface { - functions: { - "adapterSwap(address,address,uint256,address,bytes)": FunctionFragment; - "bridge(address,uint256,address,uint256,(address,address,uint256,uint256,bytes),(address,address,uint256,uint256,bytes))": FunctionFragment; - "calculateFeeAmount(address,uint256,bool)": FunctionFragment; - "feeStructures(address)": FunctionFragment; - "getConnectedBridgeTokens(address)": FunctionFragment; - "getDestinationAmountOut(tuple[],address)": FunctionFragment; - "getOriginAmountOut(address,string[],uint256)": FunctionFragment; - "synapseCCTP()": FunctionFragment; - }; - - encodeFunctionData( - functionFragment: "adapterSwap", - values: [string, string, BigNumberish, string, BytesLike] - ): string; - encodeFunctionData( - functionFragment: "bridge", - values: [ - string, - BigNumberish, - string, - BigNumberish, - { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumberish; - deadline: BigNumberish; - rawParams: BytesLike; - }, - { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumberish; - deadline: BigNumberish; - rawParams: BytesLike; - } - ] - ): string; - encodeFunctionData( - functionFragment: "calculateFeeAmount", - values: [string, BigNumberish, boolean] - ): string; - encodeFunctionData( - functionFragment: "feeStructures", - values: [string] - ): string; - encodeFunctionData( - functionFragment: "getConnectedBridgeTokens", - values: [string] - ): string; - encodeFunctionData( - functionFragment: "getDestinationAmountOut", - values: [{ symbol: string; amountIn: BigNumberish }[], string] - ): string; - encodeFunctionData( - functionFragment: "getOriginAmountOut", - values: [string, string[], BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "synapseCCTP", - values?: undefined - ): string; - - decodeFunctionResult( - functionFragment: "adapterSwap", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "bridge", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "calculateFeeAmount", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "feeStructures", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getConnectedBridgeTokens", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getDestinationAmountOut", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getOriginAmountOut", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "synapseCCTP", - data: BytesLike - ): Result; - - events: {}; +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers' +import type { FunctionFragment, Result } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/providers' +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from './common' + +export type SwapQueryStruct = { + routerAdapter: string + tokenOut: string + minAmountOut: BigNumberish + deadline: BigNumberish + rawParams: BytesLike +} + +export type SwapQueryStructOutput = [ + string, + string, + BigNumber, + BigNumber, + string +] & { + routerAdapter: string + tokenOut: string + minAmountOut: BigNumber + deadline: BigNumber + rawParams: string +} + +export type BridgeTokenStruct = { symbol: string; token: string } + +export type BridgeTokenStructOutput = [string, string] & { + symbol: string + token: string +} + +export type DestRequestStruct = { symbol: string; amountIn: BigNumberish } + +export type DestRequestStructOutput = [string, BigNumber] & { + symbol: string + amountIn: BigNumber +} + +export interface SynapseCCTPRouterInterface extends utils.Interface { + functions: { + 'adapterSwap(address,address,uint256,address,bytes)': FunctionFragment + 'bridge(address,uint256,address,uint256,(address,address,uint256,uint256,bytes),(address,address,uint256,uint256,bytes))': FunctionFragment + 'calculateFeeAmount(address,uint256,bool)': FunctionFragment + 'feeStructures(address)': FunctionFragment + 'getConnectedBridgeTokens(address)': FunctionFragment + 'getDestinationAmountOut((string,uint256)[],address)': FunctionFragment + 'getOriginAmountOut(address,string[],uint256)': FunctionFragment + 'synapseCCTP()': FunctionFragment } - export class SynapseCCTPRouter extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - listeners, EventArgsObject>( - eventFilter?: TypedEventFilter - ): Array>; - off, EventArgsObject>( - eventFilter: TypedEventFilter, - listener: TypedListener - ): this; - on, EventArgsObject>( - eventFilter: TypedEventFilter, - listener: TypedListener - ): this; - once, EventArgsObject>( - eventFilter: TypedEventFilter, - listener: TypedListener - ): this; - removeListener, EventArgsObject>( - eventFilter: TypedEventFilter, - listener: TypedListener - ): this; - removeAllListeners, EventArgsObject>( - eventFilter: TypedEventFilter - ): this; - - listeners(eventName?: string): Array; - off(eventName: string, listener: Listener): this; - on(eventName: string, listener: Listener): this; - once(eventName: string, listener: Listener): this; - removeListener(eventName: string, listener: Listener): this; - removeAllListeners(eventName?: string): this; - - queryFilter, EventArgsObject>( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise>>; - - interface: SynapseCCTPRouterInterface; - - functions: { - adapterSwap( - recipient: string, - tokenIn: string, - amountIn: BigNumberish, - tokenOut: string, - rawParams: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise } - ): Promise; - - bridge( - recipient: string, - chainId: BigNumberish, - token: string, - amount: BigNumberish, - originQuery: { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumberish; - deadline: BigNumberish; - rawParams: BytesLike; - }, - destQuery: { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumberish; - deadline: BigNumberish; - rawParams: BytesLike; - }, - overrides?: PayableOverrides & { from?: string | Promise } - ): Promise; - - calculateFeeAmount( - token: string, - amount: BigNumberish, - isSwap: boolean, - overrides?: CallOverrides - ): Promise<[BigNumber] & { fee: BigNumber }>; - - feeStructures( - token: string, - overrides?: CallOverrides - ): Promise< - [number, BigNumber, BigNumber, BigNumber] & { - relayerFee: number; - minBaseFee: BigNumber; - minSwapFee: BigNumber; - maxFee: BigNumber; - } - >; - - getConnectedBridgeTokens( - tokenOut: string, - overrides?: CallOverrides - ): Promise< - [([string, string] & { symbol: string; token: string })[]] & { - tokens: ([string, string] & { symbol: string; token: string })[]; - } - >; - - getDestinationAmountOut( - requests: { symbol: string; amountIn: BigNumberish }[], - tokenOut: string, - overrides?: CallOverrides - ): Promise< - [ - ([string, string, BigNumber, BigNumber, string] & { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumber; - deadline: BigNumber; - rawParams: string; - })[] - ] & { - destQueries: ([string, string, BigNumber, BigNumber, string] & { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumber; - deadline: BigNumber; - rawParams: string; - })[]; - } - >; - - getOriginAmountOut( - tokenIn: string, - tokenSymbols: string[], - amountIn: BigNumberish, - overrides?: CallOverrides - ): Promise< - [ - ([string, string, BigNumber, BigNumber, string] & { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumber; - deadline: BigNumber; - rawParams: string; - })[] - ] & { - originQueries: ([string, string, BigNumber, BigNumber, string] & { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumber; - deadline: BigNumber; - rawParams: string; - })[]; - } - >; - - synapseCCTP(overrides?: CallOverrides): Promise<[string]>; - }; - + getFunction( + nameOrSignatureOrTopic: + | 'adapterSwap' + | 'bridge' + | 'calculateFeeAmount' + | 'feeStructures' + | 'getConnectedBridgeTokens' + | 'getDestinationAmountOut' + | 'getOriginAmountOut' + | 'synapseCCTP' + ): FunctionFragment + + encodeFunctionData( + functionFragment: 'adapterSwap', + values: [string, string, BigNumberish, string, BytesLike] + ): string + encodeFunctionData( + functionFragment: 'bridge', + values: [ + string, + BigNumberish, + string, + BigNumberish, + SwapQueryStruct, + SwapQueryStruct + ] + ): string + encodeFunctionData( + functionFragment: 'calculateFeeAmount', + values: [string, BigNumberish, boolean] + ): string + encodeFunctionData( + functionFragment: 'feeStructures', + values: [string] + ): string + encodeFunctionData( + functionFragment: 'getConnectedBridgeTokens', + values: [string] + ): string + encodeFunctionData( + functionFragment: 'getDestinationAmountOut', + values: [DestRequestStruct[], string] + ): string + encodeFunctionData( + functionFragment: 'getOriginAmountOut', + values: [string, string[], BigNumberish] + ): string + encodeFunctionData( + functionFragment: 'synapseCCTP', + values?: undefined + ): string + + decodeFunctionResult(functionFragment: 'adapterSwap', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'bridge', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'calculateFeeAmount', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'feeStructures', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'getConnectedBridgeTokens', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'getDestinationAmountOut', + data: BytesLike + ): Result + decodeFunctionResult( + functionFragment: 'getOriginAmountOut', + data: BytesLike + ): Result + decodeFunctionResult(functionFragment: 'synapseCCTP', data: BytesLike): Result + + events: {} +} + +export interface SynapseCCTPRouter extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: SynapseCCTPRouterInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise> + + listeners( + eventFilter?: TypedEventFilter + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { adapterSwap( recipient: string, tokenIn: string, amountIn: BigNumberish, tokenOut: string, rawParams: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise } - ): Promise; + overrides?: PayableOverrides & { from?: string } + ): Promise bridge( recipient: string, chainId: BigNumberish, token: string, amount: BigNumberish, - originQuery: { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumberish; - deadline: BigNumberish; - rawParams: BytesLike; - }, - destQuery: { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumberish; - deadline: BigNumberish; - rawParams: BytesLike; - }, - overrides?: PayableOverrides & { from?: string | Promise } - ): Promise; + originQuery: SwapQueryStruct, + destQuery: SwapQueryStruct, + overrides?: PayableOverrides & { from?: string } + ): Promise calculateFeeAmount( token: string, amount: BigNumberish, isSwap: boolean, overrides?: CallOverrides - ): Promise; + ): Promise<[BigNumber] & { fee: BigNumber }> feeStructures( token: string, overrides?: CallOverrides ): Promise< [number, BigNumber, BigNumber, BigNumber] & { - relayerFee: number; - minBaseFee: BigNumber; - minSwapFee: BigNumber; - maxFee: BigNumber; + relayerFee: number + minBaseFee: BigNumber + minSwapFee: BigNumber + maxFee: BigNumber } - >; + > getConnectedBridgeTokens( tokenOut: string, overrides?: CallOverrides - ): Promise<([string, string] & { symbol: string; token: string })[]>; + ): Promise< + [BridgeTokenStructOutput[]] & { tokens: BridgeTokenStructOutput[] } + > getDestinationAmountOut( - requests: { symbol: string; amountIn: BigNumberish }[], + requests: DestRequestStruct[], tokenOut: string, overrides?: CallOverrides ): Promise< - ([string, string, BigNumber, BigNumber, string] & { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumber; - deadline: BigNumber; - rawParams: string; - })[] - >; + [SwapQueryStructOutput[]] & { destQueries: SwapQueryStructOutput[] } + > getOriginAmountOut( tokenIn: string, @@ -346,231 +235,232 @@ import { amountIn: BigNumberish, overrides?: CallOverrides ): Promise< - ([string, string, BigNumber, BigNumber, string] & { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumber; - deadline: BigNumber; - rawParams: string; - })[] - >; - - synapseCCTP(overrides?: CallOverrides): Promise; - - callStatic: { - adapterSwap( - recipient: string, - tokenIn: string, - amountIn: BigNumberish, - tokenOut: string, - rawParams: BytesLike, - overrides?: CallOverrides - ): Promise; - - bridge( - recipient: string, - chainId: BigNumberish, - token: string, - amount: BigNumberish, - originQuery: { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumberish; - deadline: BigNumberish; - rawParams: BytesLike; - }, - destQuery: { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumberish; - deadline: BigNumberish; - rawParams: BytesLike; - }, - overrides?: CallOverrides - ): Promise; - - calculateFeeAmount( - token: string, - amount: BigNumberish, - isSwap: boolean, - overrides?: CallOverrides - ): Promise; - - feeStructures( - token: string, - overrides?: CallOverrides - ): Promise< - [number, BigNumber, BigNumber, BigNumber] & { - relayerFee: number; - minBaseFee: BigNumber; - minSwapFee: BigNumber; - maxFee: BigNumber; - } - >; - - getConnectedBridgeTokens( - tokenOut: string, - overrides?: CallOverrides - ): Promise<([string, string] & { symbol: string; token: string })[]>; - - getDestinationAmountOut( - requests: { symbol: string; amountIn: BigNumberish }[], - tokenOut: string, - overrides?: CallOverrides - ): Promise< - ([string, string, BigNumber, BigNumber, string] & { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumber; - deadline: BigNumber; - rawParams: string; - })[] - >; - - getOriginAmountOut( - tokenIn: string, - tokenSymbols: string[], - amountIn: BigNumberish, - overrides?: CallOverrides - ): Promise< - ([string, string, BigNumber, BigNumber, string] & { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumber; - deadline: BigNumber; - rawParams: string; - })[] - >; - - synapseCCTP(overrides?: CallOverrides): Promise; - }; - - filters: {}; - - estimateGas: { - adapterSwap( - recipient: string, - tokenIn: string, - amountIn: BigNumberish, - tokenOut: string, - rawParams: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise } - ): Promise; - - bridge( - recipient: string, - chainId: BigNumberish, - token: string, - amount: BigNumberish, - originQuery: { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumberish; - deadline: BigNumberish; - rawParams: BytesLike; - }, - destQuery: { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumberish; - deadline: BigNumberish; - rawParams: BytesLike; - }, - overrides?: PayableOverrides & { from?: string | Promise } - ): Promise; - - calculateFeeAmount( - token: string, - amount: BigNumberish, - isSwap: boolean, - overrides?: CallOverrides - ): Promise; - - feeStructures(token: string, overrides?: CallOverrides): Promise; - - getConnectedBridgeTokens( - tokenOut: string, - overrides?: CallOverrides - ): Promise; - - getDestinationAmountOut( - requests: { symbol: string; amountIn: BigNumberish }[], - tokenOut: string, - overrides?: CallOverrides - ): Promise; - - getOriginAmountOut( - tokenIn: string, - tokenSymbols: string[], - amountIn: BigNumberish, - overrides?: CallOverrides - ): Promise; - - synapseCCTP(overrides?: CallOverrides): Promise; - }; - - populateTransaction: { - adapterSwap( - recipient: string, - tokenIn: string, - amountIn: BigNumberish, - tokenOut: string, - rawParams: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise } - ): Promise; - - bridge( - recipient: string, - chainId: BigNumberish, - token: string, - amount: BigNumberish, - originQuery: { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumberish; - deadline: BigNumberish; - rawParams: BytesLike; - }, - destQuery: { - routerAdapter: string; - tokenOut: string; - minAmountOut: BigNumberish; - deadline: BigNumberish; - rawParams: BytesLike; - }, - overrides?: PayableOverrides & { from?: string | Promise } - ): Promise; - - calculateFeeAmount( - token: string, - amount: BigNumberish, - isSwap: boolean, - overrides?: CallOverrides - ): Promise; - - feeStructures( - token: string, - overrides?: CallOverrides - ): Promise; - - getConnectedBridgeTokens( - tokenOut: string, - overrides?: CallOverrides - ): Promise; - - getDestinationAmountOut( - requests: { symbol: string; amountIn: BigNumberish }[], - tokenOut: string, - overrides?: CallOverrides - ): Promise; - - getOriginAmountOut( - tokenIn: string, - tokenSymbols: string[], - amountIn: BigNumberish, - overrides?: CallOverrides - ): Promise; - - synapseCCTP(overrides?: CallOverrides): Promise; - }; - } \ No newline at end of file + [SwapQueryStructOutput[]] & { originQueries: SwapQueryStructOutput[] } + > + + synapseCCTP(overrides?: CallOverrides): Promise<[string]> + } + + adapterSwap( + recipient: string, + tokenIn: string, + amountIn: BigNumberish, + tokenOut: string, + rawParams: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise + + bridge( + recipient: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + originQuery: SwapQueryStruct, + destQuery: SwapQueryStruct, + overrides?: PayableOverrides & { from?: string } + ): Promise + + calculateFeeAmount( + token: string, + amount: BigNumberish, + isSwap: boolean, + overrides?: CallOverrides + ): Promise + + feeStructures( + token: string, + overrides?: CallOverrides + ): Promise< + [number, BigNumber, BigNumber, BigNumber] & { + relayerFee: number + minBaseFee: BigNumber + minSwapFee: BigNumber + maxFee: BigNumber + } + > + + getConnectedBridgeTokens( + tokenOut: string, + overrides?: CallOverrides + ): Promise + + getDestinationAmountOut( + requests: DestRequestStruct[], + tokenOut: string, + overrides?: CallOverrides + ): Promise + + getOriginAmountOut( + tokenIn: string, + tokenSymbols: string[], + amountIn: BigNumberish, + overrides?: CallOverrides + ): Promise + + synapseCCTP(overrides?: CallOverrides): Promise + + callStatic: { + adapterSwap( + recipient: string, + tokenIn: string, + amountIn: BigNumberish, + tokenOut: string, + rawParams: BytesLike, + overrides?: CallOverrides + ): Promise + + bridge( + recipient: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + originQuery: SwapQueryStruct, + destQuery: SwapQueryStruct, + overrides?: CallOverrides + ): Promise + + calculateFeeAmount( + token: string, + amount: BigNumberish, + isSwap: boolean, + overrides?: CallOverrides + ): Promise + + feeStructures( + token: string, + overrides?: CallOverrides + ): Promise< + [number, BigNumber, BigNumber, BigNumber] & { + relayerFee: number + minBaseFee: BigNumber + minSwapFee: BigNumber + maxFee: BigNumber + } + > + + getConnectedBridgeTokens( + tokenOut: string, + overrides?: CallOverrides + ): Promise + + getDestinationAmountOut( + requests: DestRequestStruct[], + tokenOut: string, + overrides?: CallOverrides + ): Promise + + getOriginAmountOut( + tokenIn: string, + tokenSymbols: string[], + amountIn: BigNumberish, + overrides?: CallOverrides + ): Promise + + synapseCCTP(overrides?: CallOverrides): Promise + } + + filters: {} + + estimateGas: { + adapterSwap( + recipient: string, + tokenIn: string, + amountIn: BigNumberish, + tokenOut: string, + rawParams: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise + + bridge( + recipient: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + originQuery: SwapQueryStruct, + destQuery: SwapQueryStruct, + overrides?: PayableOverrides & { from?: string } + ): Promise + + calculateFeeAmount( + token: string, + amount: BigNumberish, + isSwap: boolean, + overrides?: CallOverrides + ): Promise + + feeStructures(token: string, overrides?: CallOverrides): Promise + + getConnectedBridgeTokens( + tokenOut: string, + overrides?: CallOverrides + ): Promise + + getDestinationAmountOut( + requests: DestRequestStruct[], + tokenOut: string, + overrides?: CallOverrides + ): Promise + + getOriginAmountOut( + tokenIn: string, + tokenSymbols: string[], + amountIn: BigNumberish, + overrides?: CallOverrides + ): Promise + + synapseCCTP(overrides?: CallOverrides): Promise + } + + populateTransaction: { + adapterSwap( + recipient: string, + tokenIn: string, + amountIn: BigNumberish, + tokenOut: string, + rawParams: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise + + bridge( + recipient: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, + originQuery: SwapQueryStruct, + destQuery: SwapQueryStruct, + overrides?: PayableOverrides & { from?: string } + ): Promise + + calculateFeeAmount( + token: string, + amount: BigNumberish, + isSwap: boolean, + overrides?: CallOverrides + ): Promise + + feeStructures( + token: string, + overrides?: CallOverrides + ): Promise + + getConnectedBridgeTokens( + tokenOut: string, + overrides?: CallOverrides + ): Promise + + getDestinationAmountOut( + requests: DestRequestStruct[], + tokenOut: string, + overrides?: CallOverrides + ): Promise + + getOriginAmountOut( + tokenIn: string, + tokenSymbols: string[], + amountIn: BigNumberish, + overrides?: CallOverrides + ): Promise + + synapseCCTP(overrides?: CallOverrides): Promise + } +} diff --git a/packages/sdk-router/src/typechain/SynapseRouter.ts b/packages/sdk-router/src/typechain/SynapseRouter.ts index fef9e60b4e..ef1ee58fc1 100644 --- a/packages/sdk-router/src/typechain/SynapseRouter.ts +++ b/packages/sdk-router/src/typechain/SynapseRouter.ts @@ -25,13 +25,9 @@ import type { TypedEvent, TypedListener, OnEvent, - PromiseOrValue, } from './common' -export type PoolTokenStruct = { - isWeth: PromiseOrValue - token: PromiseOrValue -} +export type PoolTokenStruct = { isWeth: boolean; token: string } export type PoolTokenStructOutput = [boolean, string] & { isWeth: boolean @@ -39,8 +35,8 @@ export type PoolTokenStructOutput = [boolean, string] & { } export type PoolStruct = { - pool: PromiseOrValue - lpToken: PromiseOrValue + pool: string + lpToken: string tokens: PoolTokenStruct[] } @@ -51,11 +47,11 @@ export type PoolStructOutput = [string, string, PoolTokenStructOutput[]] & { } export type SwapQueryStruct = { - swapAdapter: PromiseOrValue - tokenOut: PromiseOrValue - minAmountOut: PromiseOrValue - deadline: PromiseOrValue - rawParams: PromiseOrValue + swapAdapter: string + tokenOut: string + minAmountOut: BigNumberish + deadline: BigNumberish + rawParams: BytesLike } export type SwapQueryStructOutput = [ @@ -72,20 +68,14 @@ export type SwapQueryStructOutput = [ rawParams: string } -export type BridgeTokenStruct = { - symbol: PromiseOrValue - token: PromiseOrValue -} +export type BridgeTokenStruct = { symbol: string; token: string } export type BridgeTokenStructOutput = [string, string] & { symbol: string token: string } -export type DestRequestStruct = { - symbol: PromiseOrValue - amountIn: PromiseOrValue -} +export type DestRequestStruct = { symbol: string; amountIn: BigNumberish } export type DestRequestStructOutput = [string, BigNumber] & { symbol: string @@ -94,18 +84,20 @@ export type DestRequestStructOutput = [string, BigNumber] & { export declare namespace LocalBridgeConfig { export type BridgeTokenConfigStruct = { - id: PromiseOrValue - token: PromiseOrValue - tokenType: PromiseOrValue - bridgeToken: PromiseOrValue - bridgeFee: PromiseOrValue - minFee: PromiseOrValue - maxFee: PromiseOrValue + id: string + token: string + decimals: BigNumberish + tokenType: BigNumberish + bridgeToken: string + bridgeFee: BigNumberish + minFee: BigNumberish + maxFee: BigNumberish } export type BridgeTokenConfigStructOutput = [ string, string, + BigNumber, number, string, BigNumber, @@ -114,6 +106,7 @@ export declare namespace LocalBridgeConfig { ] & { id: string token: string + decimals: BigNumber tokenType: number bridgeToken: string bridgeFee: BigNumber @@ -122,11 +115,20 @@ export declare namespace LocalBridgeConfig { } } +export declare namespace MulticallView { + export type ResultStruct = { success: boolean; returnData: BytesLike } + + export type ResultStructOutput = [boolean, string] & { + success: boolean + returnData: string + } +} + export interface SynapseRouterInterface extends utils.Interface { functions: { 'adapterSwap(address,address,uint256,address,bytes)': FunctionFragment 'addToken(string,address,uint8,address,uint256,uint256,uint256)': FunctionFragment - 'addTokens((string,address,uint8,address,uint256,uint256,uint256)[])': FunctionFragment + 'addTokens((string,address,uint256,uint8,address,uint256,uint256,uint256)[])': FunctionFragment 'allPools()': FunctionFragment 'bridge(address,uint256,address,uint256,(address,address,uint256,uint256,bytes),(address,address,uint256,uint256,bytes))': FunctionFragment 'bridgeTokens()': FunctionFragment @@ -142,6 +144,7 @@ export interface SynapseRouterInterface extends utils.Interface { 'getConnectedBridgeTokens(address)': FunctionFragment 'getDestinationAmountOut((string,uint256)[],address)': FunctionFragment 'getOriginAmountOut(address,string[],uint256)': FunctionFragment + 'multicallView(bytes[])': FunctionFragment 'owner()': FunctionFragment 'poolInfo(address)': FunctionFragment 'poolTokens(address)': FunctionFragment @@ -181,6 +184,7 @@ export interface SynapseRouterInterface extends utils.Interface { | 'getConnectedBridgeTokens' | 'getDestinationAmountOut' | 'getOriginAmountOut' + | 'multicallView' | 'owner' | 'poolInfo' | 'poolTokens' @@ -202,24 +206,18 @@ export interface SynapseRouterInterface extends utils.Interface { encodeFunctionData( functionFragment: 'adapterSwap', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [string, string, BigNumberish, string, BytesLike] ): string encodeFunctionData( functionFragment: 'addToken', values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue + string, + string, + BigNumberish, + string, + BigNumberish, + BigNumberish, + BigNumberish ] ): string encodeFunctionData( @@ -230,10 +228,10 @@ export interface SynapseRouterInterface extends utils.Interface { encodeFunctionData( functionFragment: 'bridge', values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, + string, + BigNumberish, + string, + BigNumberish, SwapQueryStruct, SwapQueryStruct ] @@ -248,85 +246,57 @@ export interface SynapseRouterInterface extends utils.Interface { ): string encodeFunctionData( functionFragment: 'calculateAddLiquidity', - values: [PromiseOrValue, PromiseOrValue[]] + values: [string, BigNumberish[]] ): string encodeFunctionData( functionFragment: 'calculateBridgeFee', - values: [PromiseOrValue, PromiseOrValue] + values: [string, BigNumberish] ): string encodeFunctionData( functionFragment: 'calculateRemoveLiquidity', - values: [PromiseOrValue, PromiseOrValue] + values: [string, BigNumberish] ): string encodeFunctionData( functionFragment: 'calculateSwap', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [string, BigNumberish, BigNumberish, BigNumberish] ): string encodeFunctionData( functionFragment: 'calculateWithdrawOneToken', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'config', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'fee', - values: [PromiseOrValue] + values: [string, BigNumberish, BigNumberish] ): string + encodeFunctionData(functionFragment: 'config', values: [string]): string + encodeFunctionData(functionFragment: 'fee', values: [string]): string encodeFunctionData( functionFragment: 'getAmountOut', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [string, string, BigNumberish] ): string encodeFunctionData( functionFragment: 'getConnectedBridgeTokens', - values: [PromiseOrValue] + values: [string] ): string encodeFunctionData( functionFragment: 'getDestinationAmountOut', - values: [DestRequestStruct[], PromiseOrValue] + values: [DestRequestStruct[], string] ): string encodeFunctionData( functionFragment: 'getOriginAmountOut', - values: [ - PromiseOrValue, - PromiseOrValue[], - PromiseOrValue - ] + values: [string, string[], BigNumberish] ): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string encodeFunctionData( - functionFragment: 'poolInfo', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'poolTokens', - values: [PromiseOrValue] + functionFragment: 'multicallView', + values: [BytesLike[]] ): string + encodeFunctionData(functionFragment: 'owner', values?: undefined): string + encodeFunctionData(functionFragment: 'poolInfo', values: [string]): string + encodeFunctionData(functionFragment: 'poolTokens', values: [string]): string encodeFunctionData( functionFragment: 'poolsAmount', values?: undefined ): string - encodeFunctionData( - functionFragment: 'removeToken', - values: [PromiseOrValue] - ): string + encodeFunctionData(functionFragment: 'removeToken', values: [string]): string encodeFunctionData( functionFragment: 'removeTokens', - values: [PromiseOrValue[]] + values: [string[]] ): string encodeFunctionData( functionFragment: 'renounceOwnership', @@ -334,46 +304,28 @@ export interface SynapseRouterInterface extends utils.Interface { ): string encodeFunctionData( functionFragment: 'setAllowance', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [string, string, BigNumberish] ): string encodeFunctionData( functionFragment: 'setSwapQuoter', - values: [PromiseOrValue] + values: [string] ): string encodeFunctionData( functionFragment: 'setTokenConfig', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [string, BigNumberish, string] ): string encodeFunctionData( functionFragment: 'setTokenFee', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [string, BigNumberish, BigNumberish, BigNumberish] ): string encodeFunctionData( functionFragment: 'swap', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - SwapQueryStruct - ] + values: [string, string, BigNumberish, SwapQueryStruct] ): string encodeFunctionData(functionFragment: 'swapQuoter', values?: undefined): string encodeFunctionData( functionFragment: 'symbolToToken', - values: [PromiseOrValue] + values: [string] ): string encodeFunctionData( functionFragment: 'synapseBridge', @@ -381,11 +333,11 @@ export interface SynapseRouterInterface extends utils.Interface { ): string encodeFunctionData( functionFragment: 'tokenToSymbol', - values: [PromiseOrValue] + values: [string] ): string encodeFunctionData( functionFragment: 'transferOwnership', - values: [PromiseOrValue] + values: [string] ): string decodeFunctionResult(functionFragment: 'adapterSwap', data: BytesLike): Result @@ -439,6 +391,10 @@ export interface SynapseRouterInterface extends utils.Interface { functionFragment: 'getOriginAmountOut', data: BytesLike ): Result + decodeFunctionResult( + functionFragment: 'multicallView', + data: BytesLike + ): Result decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result decodeFunctionResult(functionFragment: 'poolInfo', data: BytesLike): Result decodeFunctionResult(functionFragment: 'poolTokens', data: BytesLike): Result @@ -531,28 +487,28 @@ export interface SynapseRouter extends BaseContract { functions: { adapterSwap( - to: PromiseOrValue, - tokenIn: PromiseOrValue, - amountIn: PromiseOrValue, - tokenOut: PromiseOrValue, - rawParams: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } + to: string, + tokenIn: string, + amountIn: BigNumberish, + tokenOut: string, + rawParams: BytesLike, + overrides?: PayableOverrides & { from?: string } ): Promise addToken( - symbol: PromiseOrValue, - token: PromiseOrValue, - tokenType: PromiseOrValue, - bridgeToken: PromiseOrValue, - bridgeFee: PromiseOrValue, - minFee: PromiseOrValue, - maxFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + symbol: string, + token: string, + tokenType: BigNumberish, + bridgeToken: string, + bridgeFee: BigNumberish, + minFee: BigNumberish, + maxFee: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise addTokens( tokens: LocalBridgeConfig.BridgeTokenConfigStruct[], - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise allPools( @@ -560,13 +516,13 @@ export interface SynapseRouter extends BaseContract { ): Promise<[PoolStructOutput[]] & { pools: PoolStructOutput[] }> bridge( - to: PromiseOrValue, - chainId: PromiseOrValue, - token: PromiseOrValue, - amount: PromiseOrValue, + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, originQuery: SwapQueryStruct, destQuery: SwapQueryStruct, - overrides?: PayableOverrides & { from?: PromiseOrValue } + overrides?: PayableOverrides & { from?: string } ): Promise bridgeTokens( @@ -578,45 +534,45 @@ export interface SynapseRouter extends BaseContract { ): Promise<[BigNumber] & { amount: BigNumber }> calculateAddLiquidity( - pool: PromiseOrValue, - amounts: PromiseOrValue[], + pool: string, + amounts: BigNumberish[], overrides?: CallOverrides ): Promise<[BigNumber]> calculateBridgeFee( - token: PromiseOrValue, - amount: PromiseOrValue, + token: string, + amount: BigNumberish, overrides?: CallOverrides ): Promise<[BigNumber] & { feeAmount: BigNumber }> calculateRemoveLiquidity( - pool: PromiseOrValue, - amount: PromiseOrValue, + pool: string, + amount: BigNumberish, overrides?: CallOverrides ): Promise<[BigNumber[]] & { amountsOut: BigNumber[] }> calculateSwap( - pool: PromiseOrValue, - tokenIndexFrom: PromiseOrValue, - tokenIndexTo: PromiseOrValue, - dx: PromiseOrValue, + pool: string, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + dx: BigNumberish, overrides?: CallOverrides ): Promise<[BigNumber] & { amountOut: BigNumber }> calculateWithdrawOneToken( - pool: PromiseOrValue, - tokenAmount: PromiseOrValue, - tokenIndex: PromiseOrValue, + pool: string, + tokenAmount: BigNumberish, + tokenIndex: BigNumberish, overrides?: CallOverrides ): Promise<[BigNumber] & { amountOut: BigNumber }> config( - arg0: PromiseOrValue, + arg0: string, overrides?: CallOverrides ): Promise<[number, string] & { tokenType: number; bridgeToken: string }> fee( - arg0: PromiseOrValue, + arg0: string, overrides?: CallOverrides ): Promise< [number, BigNumber, BigNumber] & { @@ -627,14 +583,14 @@ export interface SynapseRouter extends BaseContract { > getAmountOut( - tokenIn: PromiseOrValue, - tokenOut: PromiseOrValue, - amountIn: PromiseOrValue, + tokenIn: string, + tokenOut: string, + amountIn: BigNumberish, overrides?: CallOverrides ): Promise<[SwapQueryStructOutput]> getConnectedBridgeTokens( - tokenOut: PromiseOrValue, + tokenOut: string, overrides?: CallOverrides ): Promise< [BridgeTokenStructOutput[]] & { tokens: BridgeTokenStructOutput[] } @@ -642,30 +598,39 @@ export interface SynapseRouter extends BaseContract { getDestinationAmountOut( requests: DestRequestStruct[], - tokenOut: PromiseOrValue, + tokenOut: string, overrides?: CallOverrides ): Promise< [SwapQueryStructOutput[]] & { destQueries: SwapQueryStructOutput[] } > getOriginAmountOut( - tokenIn: PromiseOrValue, - tokenSymbols: PromiseOrValue[], - amountIn: PromiseOrValue, + tokenIn: string, + tokenSymbols: string[], + amountIn: BigNumberish, overrides?: CallOverrides ): Promise< [SwapQueryStructOutput[]] & { originQueries: SwapQueryStructOutput[] } > + multicallView( + data: BytesLike[], + overrides?: CallOverrides + ): Promise< + [MulticallView.ResultStructOutput[]] & { + callResults: MulticallView.ResultStructOutput[] + } + > + owner(overrides?: CallOverrides): Promise<[string]> poolInfo( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise<[BigNumber, string]> poolTokens( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise<[PoolTokenStructOutput[]] & { tokens: PoolTokenStructOutput[] }> @@ -674,109 +639,103 @@ export interface SynapseRouter extends BaseContract { ): Promise<[BigNumber] & { amount: BigNumber }> removeToken( - token: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + overrides?: Overrides & { from?: string } ): Promise removeTokens( - tokens: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } + tokens: string[], + overrides?: Overrides & { from?: string } ): Promise renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise setAllowance( - token: PromiseOrValue, - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise setSwapQuoter( - _swapQuoter: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + _swapQuoter: string, + overrides?: Overrides & { from?: string } ): Promise setTokenConfig( - token: PromiseOrValue, - tokenType: PromiseOrValue, - bridgeToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + tokenType: BigNumberish, + bridgeToken: string, + overrides?: Overrides & { from?: string } ): Promise setTokenFee( - token: PromiseOrValue, - bridgeFee: PromiseOrValue, - minFee: PromiseOrValue, - maxFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + bridgeFee: BigNumberish, + minFee: BigNumberish, + maxFee: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise swap( - to: PromiseOrValue, - token: PromiseOrValue, - amount: PromiseOrValue, + to: string, + token: string, + amount: BigNumberish, query: SwapQueryStruct, - overrides?: PayableOverrides & { from?: PromiseOrValue } + overrides?: PayableOverrides & { from?: string } ): Promise swapQuoter(overrides?: CallOverrides): Promise<[string]> - symbolToToken( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string]> + symbolToToken(arg0: string, overrides?: CallOverrides): Promise<[string]> synapseBridge(overrides?: CallOverrides): Promise<[string]> - tokenToSymbol( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string]> + tokenToSymbol(arg0: string, overrides?: CallOverrides): Promise<[string]> transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + newOwner: string, + overrides?: Overrides & { from?: string } ): Promise } adapterSwap( - to: PromiseOrValue, - tokenIn: PromiseOrValue, - amountIn: PromiseOrValue, - tokenOut: PromiseOrValue, - rawParams: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } + to: string, + tokenIn: string, + amountIn: BigNumberish, + tokenOut: string, + rawParams: BytesLike, + overrides?: PayableOverrides & { from?: string } ): Promise addToken( - symbol: PromiseOrValue, - token: PromiseOrValue, - tokenType: PromiseOrValue, - bridgeToken: PromiseOrValue, - bridgeFee: PromiseOrValue, - minFee: PromiseOrValue, - maxFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + symbol: string, + token: string, + tokenType: BigNumberish, + bridgeToken: string, + bridgeFee: BigNumberish, + minFee: BigNumberish, + maxFee: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise addTokens( tokens: LocalBridgeConfig.BridgeTokenConfigStruct[], - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise allPools(overrides?: CallOverrides): Promise bridge( - to: PromiseOrValue, - chainId: PromiseOrValue, - token: PromiseOrValue, - amount: PromiseOrValue, + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, originQuery: SwapQueryStruct, destQuery: SwapQueryStruct, - overrides?: PayableOverrides & { from?: PromiseOrValue } + overrides?: PayableOverrides & { from?: string } ): Promise bridgeTokens(overrides?: CallOverrides): Promise @@ -784,45 +743,45 @@ export interface SynapseRouter extends BaseContract { bridgeTokensAmount(overrides?: CallOverrides): Promise calculateAddLiquidity( - pool: PromiseOrValue, - amounts: PromiseOrValue[], + pool: string, + amounts: BigNumberish[], overrides?: CallOverrides ): Promise calculateBridgeFee( - token: PromiseOrValue, - amount: PromiseOrValue, + token: string, + amount: BigNumberish, overrides?: CallOverrides ): Promise calculateRemoveLiquidity( - pool: PromiseOrValue, - amount: PromiseOrValue, + pool: string, + amount: BigNumberish, overrides?: CallOverrides ): Promise calculateSwap( - pool: PromiseOrValue, - tokenIndexFrom: PromiseOrValue, - tokenIndexTo: PromiseOrValue, - dx: PromiseOrValue, + pool: string, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + dx: BigNumberish, overrides?: CallOverrides ): Promise calculateWithdrawOneToken( - pool: PromiseOrValue, - tokenAmount: PromiseOrValue, - tokenIndex: PromiseOrValue, + pool: string, + tokenAmount: BigNumberish, + tokenIndex: BigNumberish, overrides?: CallOverrides ): Promise config( - arg0: PromiseOrValue, + arg0: string, overrides?: CallOverrides ): Promise<[number, string] & { tokenType: number; bridgeToken: string }> fee( - arg0: PromiseOrValue, + arg0: string, overrides?: CallOverrides ): Promise< [number, BigNumber, BigNumber] & { @@ -833,130 +792,129 @@ export interface SynapseRouter extends BaseContract { > getAmountOut( - tokenIn: PromiseOrValue, - tokenOut: PromiseOrValue, - amountIn: PromiseOrValue, + tokenIn: string, + tokenOut: string, + amountIn: BigNumberish, overrides?: CallOverrides ): Promise getConnectedBridgeTokens( - tokenOut: PromiseOrValue, + tokenOut: string, overrides?: CallOverrides ): Promise getDestinationAmountOut( requests: DestRequestStruct[], - tokenOut: PromiseOrValue, + tokenOut: string, overrides?: CallOverrides ): Promise getOriginAmountOut( - tokenIn: PromiseOrValue, - tokenSymbols: PromiseOrValue[], - amountIn: PromiseOrValue, + tokenIn: string, + tokenSymbols: string[], + amountIn: BigNumberish, overrides?: CallOverrides ): Promise + multicallView( + data: BytesLike[], + overrides?: CallOverrides + ): Promise + owner(overrides?: CallOverrides): Promise poolInfo( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise<[BigNumber, string]> poolTokens( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise poolsAmount(overrides?: CallOverrides): Promise removeToken( - token: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + overrides?: Overrides & { from?: string } ): Promise removeTokens( - tokens: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } + tokens: string[], + overrides?: Overrides & { from?: string } ): Promise renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise setAllowance( - token: PromiseOrValue, - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise setSwapQuoter( - _swapQuoter: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + _swapQuoter: string, + overrides?: Overrides & { from?: string } ): Promise setTokenConfig( - token: PromiseOrValue, - tokenType: PromiseOrValue, - bridgeToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + tokenType: BigNumberish, + bridgeToken: string, + overrides?: Overrides & { from?: string } ): Promise setTokenFee( - token: PromiseOrValue, - bridgeFee: PromiseOrValue, - minFee: PromiseOrValue, - maxFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + bridgeFee: BigNumberish, + minFee: BigNumberish, + maxFee: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise swap( - to: PromiseOrValue, - token: PromiseOrValue, - amount: PromiseOrValue, + to: string, + token: string, + amount: BigNumberish, query: SwapQueryStruct, - overrides?: PayableOverrides & { from?: PromiseOrValue } + overrides?: PayableOverrides & { from?: string } ): Promise swapQuoter(overrides?: CallOverrides): Promise - symbolToToken( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + symbolToToken(arg0: string, overrides?: CallOverrides): Promise synapseBridge(overrides?: CallOverrides): Promise - tokenToSymbol( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + tokenToSymbol(arg0: string, overrides?: CallOverrides): Promise transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + newOwner: string, + overrides?: Overrides & { from?: string } ): Promise callStatic: { adapterSwap( - to: PromiseOrValue, - tokenIn: PromiseOrValue, - amountIn: PromiseOrValue, - tokenOut: PromiseOrValue, - rawParams: PromiseOrValue, + to: string, + tokenIn: string, + amountIn: BigNumberish, + tokenOut: string, + rawParams: BytesLike, overrides?: CallOverrides ): Promise addToken( - symbol: PromiseOrValue, - token: PromiseOrValue, - tokenType: PromiseOrValue, - bridgeToken: PromiseOrValue, - bridgeFee: PromiseOrValue, - minFee: PromiseOrValue, - maxFee: PromiseOrValue, + symbol: string, + token: string, + tokenType: BigNumberish, + bridgeToken: string, + bridgeFee: BigNumberish, + minFee: BigNumberish, + maxFee: BigNumberish, overrides?: CallOverrides ): Promise @@ -968,10 +926,10 @@ export interface SynapseRouter extends BaseContract { allPools(overrides?: CallOverrides): Promise bridge( - to: PromiseOrValue, - chainId: PromiseOrValue, - token: PromiseOrValue, - amount: PromiseOrValue, + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, originQuery: SwapQueryStruct, destQuery: SwapQueryStruct, overrides?: CallOverrides @@ -982,45 +940,45 @@ export interface SynapseRouter extends BaseContract { bridgeTokensAmount(overrides?: CallOverrides): Promise calculateAddLiquidity( - pool: PromiseOrValue, - amounts: PromiseOrValue[], + pool: string, + amounts: BigNumberish[], overrides?: CallOverrides ): Promise calculateBridgeFee( - token: PromiseOrValue, - amount: PromiseOrValue, + token: string, + amount: BigNumberish, overrides?: CallOverrides ): Promise calculateRemoveLiquidity( - pool: PromiseOrValue, - amount: PromiseOrValue, + pool: string, + amount: BigNumberish, overrides?: CallOverrides ): Promise calculateSwap( - pool: PromiseOrValue, - tokenIndexFrom: PromiseOrValue, - tokenIndexTo: PromiseOrValue, - dx: PromiseOrValue, + pool: string, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + dx: BigNumberish, overrides?: CallOverrides ): Promise calculateWithdrawOneToken( - pool: PromiseOrValue, - tokenAmount: PromiseOrValue, - tokenIndex: PromiseOrValue, + pool: string, + tokenAmount: BigNumberish, + tokenIndex: BigNumberish, overrides?: CallOverrides ): Promise config( - arg0: PromiseOrValue, + arg0: string, overrides?: CallOverrides ): Promise<[number, string] & { tokenType: number; bridgeToken: string }> fee( - arg0: PromiseOrValue, + arg0: string, overrides?: CallOverrides ): Promise< [number, BigNumber, BigNumber] & { @@ -1031,158 +989,148 @@ export interface SynapseRouter extends BaseContract { > getAmountOut( - tokenIn: PromiseOrValue, - tokenOut: PromiseOrValue, - amountIn: PromiseOrValue, + tokenIn: string, + tokenOut: string, + amountIn: BigNumberish, overrides?: CallOverrides ): Promise getConnectedBridgeTokens( - tokenOut: PromiseOrValue, + tokenOut: string, overrides?: CallOverrides ): Promise getDestinationAmountOut( requests: DestRequestStruct[], - tokenOut: PromiseOrValue, + tokenOut: string, overrides?: CallOverrides ): Promise getOriginAmountOut( - tokenIn: PromiseOrValue, - tokenSymbols: PromiseOrValue[], - amountIn: PromiseOrValue, + tokenIn: string, + tokenSymbols: string[], + amountIn: BigNumberish, overrides?: CallOverrides ): Promise + multicallView( + data: BytesLike[], + overrides?: CallOverrides + ): Promise + owner(overrides?: CallOverrides): Promise poolInfo( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise<[BigNumber, string]> poolTokens( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise poolsAmount(overrides?: CallOverrides): Promise - removeToken( - token: PromiseOrValue, - overrides?: CallOverrides - ): Promise + removeToken(token: string, overrides?: CallOverrides): Promise - removeTokens( - tokens: PromiseOrValue[], - overrides?: CallOverrides - ): Promise + removeTokens(tokens: string[], overrides?: CallOverrides): Promise renounceOwnership(overrides?: CallOverrides): Promise setAllowance( - token: PromiseOrValue, - spender: PromiseOrValue, - amount: PromiseOrValue, + token: string, + spender: string, + amount: BigNumberish, overrides?: CallOverrides ): Promise - setSwapQuoter( - _swapQuoter: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setSwapQuoter(_swapQuoter: string, overrides?: CallOverrides): Promise setTokenConfig( - token: PromiseOrValue, - tokenType: PromiseOrValue, - bridgeToken: PromiseOrValue, + token: string, + tokenType: BigNumberish, + bridgeToken: string, overrides?: CallOverrides ): Promise setTokenFee( - token: PromiseOrValue, - bridgeFee: PromiseOrValue, - minFee: PromiseOrValue, - maxFee: PromiseOrValue, + token: string, + bridgeFee: BigNumberish, + minFee: BigNumberish, + maxFee: BigNumberish, overrides?: CallOverrides ): Promise swap( - to: PromiseOrValue, - token: PromiseOrValue, - amount: PromiseOrValue, + to: string, + token: string, + amount: BigNumberish, query: SwapQueryStruct, overrides?: CallOverrides ): Promise swapQuoter(overrides?: CallOverrides): Promise - symbolToToken( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + symbolToToken(arg0: string, overrides?: CallOverrides): Promise synapseBridge(overrides?: CallOverrides): Promise - tokenToSymbol( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + tokenToSymbol(arg0: string, overrides?: CallOverrides): Promise transferOwnership( - newOwner: PromiseOrValue, + newOwner: string, overrides?: CallOverrides ): Promise } filters: { 'OwnershipTransferred(address,address)'( - previousOwner?: PromiseOrValue | null, - newOwner?: PromiseOrValue | null + previousOwner?: string | null, + newOwner?: string | null ): OwnershipTransferredEventFilter OwnershipTransferred( - previousOwner?: PromiseOrValue | null, - newOwner?: PromiseOrValue | null + previousOwner?: string | null, + newOwner?: string | null ): OwnershipTransferredEventFilter } estimateGas: { adapterSwap( - to: PromiseOrValue, - tokenIn: PromiseOrValue, - amountIn: PromiseOrValue, - tokenOut: PromiseOrValue, - rawParams: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } + to: string, + tokenIn: string, + amountIn: BigNumberish, + tokenOut: string, + rawParams: BytesLike, + overrides?: PayableOverrides & { from?: string } ): Promise addToken( - symbol: PromiseOrValue, - token: PromiseOrValue, - tokenType: PromiseOrValue, - bridgeToken: PromiseOrValue, - bridgeFee: PromiseOrValue, - minFee: PromiseOrValue, - maxFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + symbol: string, + token: string, + tokenType: BigNumberish, + bridgeToken: string, + bridgeFee: BigNumberish, + minFee: BigNumberish, + maxFee: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise addTokens( tokens: LocalBridgeConfig.BridgeTokenConfigStruct[], - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise allPools(overrides?: CallOverrides): Promise bridge( - to: PromiseOrValue, - chainId: PromiseOrValue, - token: PromiseOrValue, - amount: PromiseOrValue, + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, originQuery: SwapQueryStruct, destQuery: SwapQueryStruct, - overrides?: PayableOverrides & { from?: PromiseOrValue } + overrides?: PayableOverrides & { from?: string } ): Promise bridgeTokens(overrides?: CallOverrides): Promise @@ -1190,192 +1138,179 @@ export interface SynapseRouter extends BaseContract { bridgeTokensAmount(overrides?: CallOverrides): Promise calculateAddLiquidity( - pool: PromiseOrValue, - amounts: PromiseOrValue[], + pool: string, + amounts: BigNumberish[], overrides?: CallOverrides ): Promise calculateBridgeFee( - token: PromiseOrValue, - amount: PromiseOrValue, + token: string, + amount: BigNumberish, overrides?: CallOverrides ): Promise calculateRemoveLiquidity( - pool: PromiseOrValue, - amount: PromiseOrValue, + pool: string, + amount: BigNumberish, overrides?: CallOverrides ): Promise calculateSwap( - pool: PromiseOrValue, - tokenIndexFrom: PromiseOrValue, - tokenIndexTo: PromiseOrValue, - dx: PromiseOrValue, + pool: string, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + dx: BigNumberish, overrides?: CallOverrides ): Promise calculateWithdrawOneToken( - pool: PromiseOrValue, - tokenAmount: PromiseOrValue, - tokenIndex: PromiseOrValue, + pool: string, + tokenAmount: BigNumberish, + tokenIndex: BigNumberish, overrides?: CallOverrides ): Promise - config( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + config(arg0: string, overrides?: CallOverrides): Promise - fee( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + fee(arg0: string, overrides?: CallOverrides): Promise getAmountOut( - tokenIn: PromiseOrValue, - tokenOut: PromiseOrValue, - amountIn: PromiseOrValue, + tokenIn: string, + tokenOut: string, + amountIn: BigNumberish, overrides?: CallOverrides ): Promise getConnectedBridgeTokens( - tokenOut: PromiseOrValue, + tokenOut: string, overrides?: CallOverrides ): Promise getDestinationAmountOut( requests: DestRequestStruct[], - tokenOut: PromiseOrValue, + tokenOut: string, overrides?: CallOverrides ): Promise getOriginAmountOut( - tokenIn: PromiseOrValue, - tokenSymbols: PromiseOrValue[], - amountIn: PromiseOrValue, + tokenIn: string, + tokenSymbols: string[], + amountIn: BigNumberish, overrides?: CallOverrides ): Promise - owner(overrides?: CallOverrides): Promise - - poolInfo( - pool: PromiseOrValue, + multicallView( + data: BytesLike[], overrides?: CallOverrides ): Promise - poolTokens( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise + owner(overrides?: CallOverrides): Promise + + poolInfo(pool: string, overrides?: CallOverrides): Promise + + poolTokens(pool: string, overrides?: CallOverrides): Promise poolsAmount(overrides?: CallOverrides): Promise removeToken( - token: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + overrides?: Overrides & { from?: string } ): Promise removeTokens( - tokens: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } + tokens: string[], + overrides?: Overrides & { from?: string } ): Promise renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise setAllowance( - token: PromiseOrValue, - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise setSwapQuoter( - _swapQuoter: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + _swapQuoter: string, + overrides?: Overrides & { from?: string } ): Promise setTokenConfig( - token: PromiseOrValue, - tokenType: PromiseOrValue, - bridgeToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + tokenType: BigNumberish, + bridgeToken: string, + overrides?: Overrides & { from?: string } ): Promise setTokenFee( - token: PromiseOrValue, - bridgeFee: PromiseOrValue, - minFee: PromiseOrValue, - maxFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + bridgeFee: BigNumberish, + minFee: BigNumberish, + maxFee: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise swap( - to: PromiseOrValue, - token: PromiseOrValue, - amount: PromiseOrValue, + to: string, + token: string, + amount: BigNumberish, query: SwapQueryStruct, - overrides?: PayableOverrides & { from?: PromiseOrValue } + overrides?: PayableOverrides & { from?: string } ): Promise swapQuoter(overrides?: CallOverrides): Promise - symbolToToken( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + symbolToToken(arg0: string, overrides?: CallOverrides): Promise synapseBridge(overrides?: CallOverrides): Promise - tokenToSymbol( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + tokenToSymbol(arg0: string, overrides?: CallOverrides): Promise transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + newOwner: string, + overrides?: Overrides & { from?: string } ): Promise } populateTransaction: { adapterSwap( - to: PromiseOrValue, - tokenIn: PromiseOrValue, - amountIn: PromiseOrValue, - tokenOut: PromiseOrValue, - rawParams: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } + to: string, + tokenIn: string, + amountIn: BigNumberish, + tokenOut: string, + rawParams: BytesLike, + overrides?: PayableOverrides & { from?: string } ): Promise addToken( - symbol: PromiseOrValue, - token: PromiseOrValue, - tokenType: PromiseOrValue, - bridgeToken: PromiseOrValue, - bridgeFee: PromiseOrValue, - minFee: PromiseOrValue, - maxFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + symbol: string, + token: string, + tokenType: BigNumberish, + bridgeToken: string, + bridgeFee: BigNumberish, + minFee: BigNumberish, + maxFee: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise addTokens( tokens: LocalBridgeConfig.BridgeTokenConfigStruct[], - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise allPools(overrides?: CallOverrides): Promise bridge( - to: PromiseOrValue, - chainId: PromiseOrValue, - token: PromiseOrValue, - amount: PromiseOrValue, + to: string, + chainId: BigNumberish, + token: string, + amount: BigNumberish, originQuery: SwapQueryStruct, destQuery: SwapQueryStruct, - overrides?: PayableOverrides & { from?: PromiseOrValue } + overrides?: PayableOverrides & { from?: string } ): Promise bridgeTokens(overrides?: CallOverrides): Promise @@ -1383,153 +1318,155 @@ export interface SynapseRouter extends BaseContract { bridgeTokensAmount(overrides?: CallOverrides): Promise calculateAddLiquidity( - pool: PromiseOrValue, - amounts: PromiseOrValue[], + pool: string, + amounts: BigNumberish[], overrides?: CallOverrides ): Promise calculateBridgeFee( - token: PromiseOrValue, - amount: PromiseOrValue, + token: string, + amount: BigNumberish, overrides?: CallOverrides ): Promise calculateRemoveLiquidity( - pool: PromiseOrValue, - amount: PromiseOrValue, + pool: string, + amount: BigNumberish, overrides?: CallOverrides ): Promise calculateSwap( - pool: PromiseOrValue, - tokenIndexFrom: PromiseOrValue, - tokenIndexTo: PromiseOrValue, - dx: PromiseOrValue, + pool: string, + tokenIndexFrom: BigNumberish, + tokenIndexTo: BigNumberish, + dx: BigNumberish, overrides?: CallOverrides ): Promise calculateWithdrawOneToken( - pool: PromiseOrValue, - tokenAmount: PromiseOrValue, - tokenIndex: PromiseOrValue, + pool: string, + tokenAmount: BigNumberish, + tokenIndex: BigNumberish, overrides?: CallOverrides ): Promise config( - arg0: PromiseOrValue, + arg0: string, overrides?: CallOverrides ): Promise - fee( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + fee(arg0: string, overrides?: CallOverrides): Promise getAmountOut( - tokenIn: PromiseOrValue, - tokenOut: PromiseOrValue, - amountIn: PromiseOrValue, + tokenIn: string, + tokenOut: string, + amountIn: BigNumberish, overrides?: CallOverrides ): Promise getConnectedBridgeTokens( - tokenOut: PromiseOrValue, + tokenOut: string, overrides?: CallOverrides ): Promise getDestinationAmountOut( requests: DestRequestStruct[], - tokenOut: PromiseOrValue, + tokenOut: string, overrides?: CallOverrides ): Promise getOriginAmountOut( - tokenIn: PromiseOrValue, - tokenSymbols: PromiseOrValue[], - amountIn: PromiseOrValue, + tokenIn: string, + tokenSymbols: string[], + amountIn: BigNumberish, + overrides?: CallOverrides + ): Promise + + multicallView( + data: BytesLike[], overrides?: CallOverrides ): Promise owner(overrides?: CallOverrides): Promise poolInfo( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise poolTokens( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise poolsAmount(overrides?: CallOverrides): Promise removeToken( - token: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + overrides?: Overrides & { from?: string } ): Promise removeTokens( - tokens: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } + tokens: string[], + overrides?: Overrides & { from?: string } ): Promise renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise setAllowance( - token: PromiseOrValue, - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise setSwapQuoter( - _swapQuoter: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + _swapQuoter: string, + overrides?: Overrides & { from?: string } ): Promise setTokenConfig( - token: PromiseOrValue, - tokenType: PromiseOrValue, - bridgeToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + tokenType: BigNumberish, + bridgeToken: string, + overrides?: Overrides & { from?: string } ): Promise setTokenFee( - token: PromiseOrValue, - bridgeFee: PromiseOrValue, - minFee: PromiseOrValue, - maxFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + bridgeFee: BigNumberish, + minFee: BigNumberish, + maxFee: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise swap( - to: PromiseOrValue, - token: PromiseOrValue, - amount: PromiseOrValue, + to: string, + token: string, + amount: BigNumberish, query: SwapQueryStruct, - overrides?: PayableOverrides & { from?: PromiseOrValue } + overrides?: PayableOverrides & { from?: string } ): Promise swapQuoter(overrides?: CallOverrides): Promise symbolToToken( - arg0: PromiseOrValue, + arg0: string, overrides?: CallOverrides ): Promise synapseBridge(overrides?: CallOverrides): Promise tokenToSymbol( - arg0: PromiseOrValue, + arg0: string, overrides?: CallOverrides ): Promise transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + newOwner: string, + overrides?: Overrides & { from?: string } ): Promise } } diff --git a/packages/sdk-router/src/typechain/common.ts b/packages/sdk-router/src/typechain/common.ts index 4c90b08bb4..bce91ad87e 100644 --- a/packages/sdk-router/src/typechain/common.ts +++ b/packages/sdk-router/src/typechain/common.ts @@ -1,46 +1,44 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -import type { Listener } from "@ethersproject/providers"; -import type { Event, EventFilter } from "ethers"; +import type { Listener } from '@ethersproject/providers' +import type { Event, EventFilter } from 'ethers' export interface TypedEvent< TArgsArray extends Array = any, TArgsObject = any > extends Event { - args: TArgsArray & TArgsObject; + args: TArgsArray & TArgsObject } export interface TypedEventFilter<_TEvent extends TypedEvent> extends EventFilter {} export interface TypedListener { - (...listenerArg: [...__TypechainArgsArray, TEvent]): void; + (...listenerArg: [...__TypechainArgsArray, TEvent]): void } -type __TypechainArgsArray = T extends TypedEvent ? U : never; +type __TypechainArgsArray = T extends TypedEvent ? U : never export interface OnEvent { ( eventFilter: TypedEventFilter, listener: TypedListener - ): TRes; - (eventName: string, listener: Listener): TRes; + ): TRes + (eventName: string, listener: Listener): TRes } export type MinEthersFactory = { - deploy(...a: ARGS[]): Promise; -}; + deploy(...a: ARGS[]): Promise +} export type GetContractTypeFromFactory = F extends MinEthersFactory< infer C, any > ? C - : never; + : never export type GetARGsTypeFromFactory = F extends MinEthersFactory - ? Parameters - : never; - -export type PromiseOrValue = T | Promise; + ? Parameters + : never