UNPKG

@xswap-link/sdk

Version:
954 lines (953 loc) 19.3 kB
[ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [ { "internalType": "uint64", "name": "destinationChainSelector", "type": "uint64" } ], "name": "DestinationChainNotWhitelisted", "type": "error" }, { "inputs": [], "name": "FailedToSendNative", "type": "error" }, { "inputs": [], "name": "IncorrectArrayLength", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" } ], "name": "InsufficientTokenBalance", "type": "error" }, { "inputs": [], "name": "InvalidAddress", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "sourceTokenAddress", "type": "address" }, { "internalType": "uint64", "name": "chainId", "type": "uint64" }, { "internalType": "address", "name": "destinationTokenAddress", "type": "address" } ], "name": "InvalidMappedTokenOnSelectedChain", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "router", "type": "address" } ], "name": "InvalidRouter", "type": "error" }, { "inputs": [ { "internalType": "uint64", "name": "chainId", "type": "uint64" } ], "name": "NoCorrespondingRouterOnSelectedChain", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "currentBalance", "type": "uint256" }, { "internalType": "uint256", "name": "calculatedFees", "type": "uint256" } ], "name": "NotEnoughBalance", "type": "error" }, { "inputs": [ { "internalType": "uint64", "name": "sourceChainSelector", "type": "uint64" }, { "internalType": "address", "name": "sender", "type": "address" } ], "name": "SenderNotWhitelisted", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" } ], "name": "TokenNotWhitelisted", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "previousAdmin", "type": "address" }, { "indexed": false, "internalType": "address", "name": "newAdmin", "type": "address" } ], "name": "AdminChanged", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "beacon", "type": "address" } ], "name": "BeaconUpgraded", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "token", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "tokenAmount", "type": "uint256" } ], "name": "EmergencyWithdraw", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" } ], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "messageId", "type": "bytes32" }, { "indexed": true, "internalType": "uint64", "name": "sourceChainSelector", "type": "uint64" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": false, "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "MessageReceived", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "messageId", "type": "bytes32" }, { "indexed": true, "internalType": "uint64", "name": "destinationChainSelector", "type": "uint64" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": false, "internalType": "address", "name": "receiver", "type": "address" }, { "indexed": false, "internalType": "address", "name": "burnedToken", "type": "address" }, { "indexed": false, "internalType": "address", "name": "mintedToken", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "MessageSent", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "newFeeCollectorAddress", "type": "address" } ], "name": "SetFeeCollectorAddress", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "newFeeOracleAddress", "type": "address" } ], "name": "SetFeeOracleAddress", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "implementation", "type": "address" } ], "name": "Upgraded", "type": "event" }, { "inputs": [ { "components": [ { "internalType": "bytes32", "name": "messageId", "type": "bytes32" }, { "internalType": "uint64", "name": "sourceChainSelector", "type": "uint64" }, { "internalType": "bytes", "name": "sender", "type": "bytes" }, { "internalType": "bytes", "name": "data", "type": "bytes" }, { "components": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "internalType": "struct Client.EVMTokenAmount[]", "name": "destTokenAmounts", "type": "tuple[]" } ], "internalType": "struct Client.Any2EVMMessage", "name": "message", "type": "tuple" } ], "name": "ccipReceive", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint64", "name": "", "type": "uint64" } ], "name": "chainSelectorToCorrespondingRouterMap", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_tokenToWithdraw", "type": "address" }, { "internalType": "uint256", "name": "_amountToWithdraw", "type": "uint256" } ], "name": "emergencyWithdraw", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "feeCollectorAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feeOracleAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_paymentToken", "type": "address" }, { "internalType": "uint64", "name": "_destinationChainSelector", "type": "uint64" }, { "components": [ { "internalType": "address", "name": "receiver", "type": "address" }, { "internalType": "address", "name": "sourceTokenAddress", "type": "address" }, { "internalType": "address", "name": "destinationTokenAddress", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "internalType": "struct TokenData", "name": "_tokenData", "type": "tuple" }, { "internalType": "uint256", "name": "_gasLimit", "type": "uint256" } ], "name": "getFees", "outputs": [ { "components": [ { "internalType": "uint256", "name": "ccipFee", "type": "uint256" }, { "components": [ { "internalType": "uint256", "name": "tokenFee", "type": "uint256" }, { "internalType": "uint256", "name": "nativeFee", "type": "uint256" } ], "internalType": "struct XSwapFee", "name": "xSwapFee", "type": "tuple" } ], "internalType": "struct MessageFees", "name": "fees", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getRouter", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_ccipRouter", "type": "address" }, { "internalType": "address", "name": "_feeOracle", "type": "address" }, { "internalType": "address", "name": "_feeCollector", "type": "address" }, { "internalType": "address", "name": "_owner", "type": "address" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_paymentToken", "type": "address" }, { "internalType": "uint64", "name": "_destinationChainSelector", "type": "uint64" }, { "components": [ { "internalType": "address", "name": "receiver", "type": "address" }, { "internalType": "address", "name": "sourceTokenAddress", "type": "address" }, { "internalType": "address", "name": "destinationTokenAddress", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "internalType": "struct TokenData", "name": "_tokenData", "type": "tuple" }, { "internalType": "uint256", "name": "_gasLimit", "type": "uint256" } ], "name": "sendMessage", "outputs": [ { "internalType": "bytes32", "name": "messageId", "type": "bytes32" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_feeCollectorAddress", "type": "address" } ], "name": "setFeeCollectorAddress", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_feeOracleAddress", "type": "address" } ], "name": "setFeeOracleAddress", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_sourceTokenAddress", "type": "address" }, { "internalType": "uint64", "name": "_destinationChainSelector", "type": "uint64" }, { "internalType": "address", "name": "_destinationTokenAddress", "type": "address" } ], "name": "setMappedTokens", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_router", "type": "address" } ], "name": "setRouter", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint64", "name": "", "type": "uint64" } ], "name": "sourceTokenToDestinationChainSelectorToDestinationTokenMap", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint64", "name": "_chainSelector", "type": "uint64" }, { "internalType": "address", "name": "_correspondingRouter", "type": "address" } ], "name": "updateChainSelectorToCorrespondingRouterMap", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint64[]", "name": "_chainSelectors", "type": "uint64[]" }, { "internalType": "address[]", "name": "_correspondingRouters", "type": "address[]" } ], "name": "updateChainSelectorToCorrespondingRouterMapMany", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint64", "name": "_sourceChainSelector", "type": "uint64" }, { "internalType": "address", "name": "_sender", "type": "address" }, { "internalType": "bool", "name": "_isWhitelisted", "type": "bool" } ], "name": "updateWhitelistSender", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint64[]", "name": "_sourceChainSelectors", "type": "uint64[]" }, { "internalType": "address[]", "name": "_senders", "type": "address[]" }, { "internalType": "bool[]", "name": "_areWhitelisted", "type": "bool[]" } ], "name": "updateWhitelistSenderMany", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "bool", "name": "_isWhitelisted", "type": "bool" } ], "name": "updateWhitelistToken", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newImplementation", "type": "address" } ], "name": "upgradeTo", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint64", "name": "", "type": "uint64" }, { "internalType": "address", "name": "", "type": "address" } ], "name": "whitelistedSenders", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "whitelistedTokens", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ]