From 3989669780cee3e970f82d11ed152d1380da2b1f Mon Sep 17 00:00:00 2001 From: Maxime Berenshteyn Date: Fri, 5 Apr 2024 14:27:22 -0400 Subject: [PATCH] [STABLE-6300] Migrate noble/eth bridging example scripts --- examples/bridge-eth-to-noble/.env.example | 3 + examples/bridge-eth-to-noble/README.md | 26 + .../abis/TokenMessenger.json | 547 +++ examples/bridge-eth-to-noble/abis/Usdc.json | 1228 ++++++ examples/bridge-eth-to-noble/index.js | 70 + .../bridge-eth-to-noble/package-lock.json | 1159 +++++ examples/bridge-eth-to-noble/package.json | 15 + examples/bridge-noble-to-eth/.env.example | 2 + examples/bridge-noble-to-eth/README.md | 26 + examples/bridge-noble-to-eth/generated/tx.ts | 3894 +++++++++++++++++ examples/bridge-noble-to-eth/index.ts | 77 + .../bridge-noble-to-eth/package-lock.json | 879 ++++ examples/bridge-noble-to-eth/package.json | 21 + 13 files changed, 7947 insertions(+) create mode 100644 examples/bridge-eth-to-noble/.env.example create mode 100644 examples/bridge-eth-to-noble/README.md create mode 100644 examples/bridge-eth-to-noble/abis/TokenMessenger.json create mode 100644 examples/bridge-eth-to-noble/abis/Usdc.json create mode 100644 examples/bridge-eth-to-noble/index.js create mode 100644 examples/bridge-eth-to-noble/package-lock.json create mode 100644 examples/bridge-eth-to-noble/package.json create mode 100644 examples/bridge-noble-to-eth/.env.example create mode 100644 examples/bridge-noble-to-eth/README.md create mode 100644 examples/bridge-noble-to-eth/generated/tx.ts create mode 100644 examples/bridge-noble-to-eth/index.ts create mode 100644 examples/bridge-noble-to-eth/package-lock.json create mode 100644 examples/bridge-noble-to-eth/package.json diff --git a/examples/bridge-eth-to-noble/.env.example b/examples/bridge-eth-to-noble/.env.example new file mode 100644 index 0000000..bd4a8b8 --- /dev/null +++ b/examples/bridge-eth-to-noble/.env.example @@ -0,0 +1,3 @@ +ETH_TESTNET_RPC=https://sepolia.infura.io/v3/ +ETH_PRIVATE_KEY=0x.... +NOBLE_ADDRESS=noble... \ No newline at end of file diff --git a/examples/bridge-eth-to-noble/README.md b/examples/bridge-eth-to-noble/README.md new file mode 100644 index 0000000..d4bcc80 --- /dev/null +++ b/examples/bridge-eth-to-noble/README.md @@ -0,0 +1,26 @@ +# Ethereum -> Noble (Javascript) + +## Instructions + +1. Install require packages: + + ``` + npm install + ``` + +2. (If needed) Obtain tokens from the faucet: https://faucet.circle.com/ + +3. Set up `.env` file based on `.env.example`: + + ``` + ETH_TESTNET_RPC=https://sepolia.infura.io/v3/ + ETH_PRIVATE_KEY=0xabc123456... + NOBLE_ADDRESS=noble... + ``` + +4. Run ETH -> Noble bridging script: + ``` + npm run mint + ``` + +The Eth Sepolia -> Noble testnet CCTP relayer should pick these messages up automatically. \ No newline at end of file diff --git a/examples/bridge-eth-to-noble/abis/TokenMessenger.json b/examples/bridge-eth-to-noble/abis/TokenMessenger.json new file mode 100644 index 0000000..4e9e5d8 --- /dev/null +++ b/examples/bridge-eth-to-noble/abis/TokenMessenger.json @@ -0,0 +1,547 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_messageTransmitter", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_messageBodyVersion", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "address", + "name": "burnToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "mintRecipient", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "destinationDomain", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "destinationTokenMessenger", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "destinationCaller", + "type": "bytes32" + } + ], + "name": "DepositForBurn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "localMinter", + "type": "address" + } + ], + "name": "LocalMinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "localMinter", + "type": "address" + } + ], + "name": "LocalMinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "mintRecipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "mintToken", + "type": "address" + } + ], + "name": "MintAndWithdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "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": "uint32", + "name": "domain", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "tokenMessenger", + "type": "bytes32" + } + ], + "name": "RemoteTokenMessengerAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "domain", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "tokenMessenger", + "type": "bytes32" + } + ], + "name": "RemoteTokenMessengerRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newRescuer", + "type": "address" + } + ], + "name": "RescuerChanged", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newLocalMinter", + "type": "address" + } + ], + "name": "addLocalMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "domain", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "tokenMessenger", + "type": "bytes32" + } + ], + "name": "addRemoteTokenMessenger", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "destinationDomain", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "mintRecipient", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "burnToken", + "type": "address" + } + ], + "name": "depositForBurn", + "outputs": [ + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "destinationDomain", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "mintRecipient", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "burnToken", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "destinationCaller", + "type": "bytes32" + } + ], + "name": "depositForBurnWithCaller", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "remoteDomain", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "messageBody", + "type": "bytes" + } + ], + "name": "handleReceiveMessage", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "localMessageTransmitter", + "outputs": [ + { + "internalType": "contract IMessageTransmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "localMinter", + "outputs": [ + { + "internalType": "contract ITokenMinter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "messageBodyVersion", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "remoteTokenMessengers", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "removeLocalMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "domain", + "type": "uint32" + } + ], + "name": "removeRemoteTokenMessenger", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "originalMessage", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "originalAttestation", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "newDestinationCaller", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "newMintRecipient", + "type": "bytes32" + } + ], + "name": "replaceDepositForBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "tokenContract", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "rescueERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rescuer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newRescuer", + "type": "address" + } + ], + "name": "updateRescuer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/examples/bridge-eth-to-noble/abis/Usdc.json b/examples/bridge-eth-to-noble/abis/Usdc.json new file mode 100644 index 0000000..02c8f58 --- /dev/null +++ b/examples/bridge-eth-to-noble/abis/Usdc.json @@ -0,0 +1,1228 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "authorizer", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "nonce", + "type": "bytes32" + } + ], + "name": "AuthorizationCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "authorizer", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "nonce", + "type": "bytes32" + } + ], + "name": "AuthorizationUsed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "Blacklisted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newBlacklister", + "type": "address" + } + ], + "name": "BlacklisterChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "burner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newMasterMinter", + "type": "address" + } + ], + "name": "MasterMinterChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minterAllowedAmount", + "type": "uint256" + } + ], + "name": "MinterConfigured", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldMinter", + "type": "address" + } + ], + "name": "MinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Pause", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PauserChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newRescuer", + "type": "address" + } + ], + "name": "RescuerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "UnBlacklisted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Unpause", + "type": "event" + }, + { + "inputs": [], + "name": "CANCEL_AUTHORIZATION_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PERMIT_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RECEIVE_WITH_AUTHORIZATION_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "TRANSFER_WITH_AUTHORIZATION_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "authorizer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "nonce", + "type": "bytes32" + } + ], + "name": "authorizationState", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "blacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "blacklister", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "authorizer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "nonce", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "cancelAuthorization", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minterAllowedAmount", + "type": "uint256" + } + ], + "name": "configureMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currency", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "decrement", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "increment", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "tokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "tokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "tokenCurrency", + "type": "string" + }, + { + "internalType": "uint8", + "name": "tokenDecimals", + "type": "uint8" + }, + { + "internalType": "address", + "name": "newMasterMinter", + "type": "address" + }, + { + "internalType": "address", + "name": "newPauser", + "type": "address" + }, + { + "internalType": "address", + "name": "newBlacklister", + "type": "address" + }, + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newName", + "type": "string" + } + ], + "name": "initializeV2", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "lostAndFound", + "type": "address" + } + ], + "name": "initializeV2_1", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "isBlacklisted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterMinter", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "minterAllowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauser", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validAfter", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validBefore", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "nonce", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "receiveWithAuthorization", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "removeMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "tokenContract", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "rescueERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rescuer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validAfter", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validBefore", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "nonce", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "transferWithAuthorization", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "unBlacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBlacklister", + "type": "address" + } + ], + "name": "updateBlacklister", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newMasterMinter", + "type": "address" + } + ], + "name": "updateMasterMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newPauser", + "type": "address" + } + ], + "name": "updatePauser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newRescuer", + "type": "address" + } + ], + "name": "updateRescuer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/examples/bridge-eth-to-noble/index.js b/examples/bridge-eth-to-noble/index.js new file mode 100644 index 0000000..d21925d --- /dev/null +++ b/examples/bridge-eth-to-noble/index.js @@ -0,0 +1,70 @@ +require("dotenv").config(); +const { Web3 } = require('web3') +const { bech32 } = require('bech32') + +const tokenMessenger = require('./abis/TokenMessenger.json'); +const usdcAbi = require('./abis/Usdc.json'); + +const waitForTransaction = async(web3, txHash) => { + let transactionReceipt = await web3.eth.getTransactionReceipt(txHash); + while(transactionReceipt != null && transactionReceipt.status === 'FALSE') { + transactionReceipt = await web3.eth.getTransactionReceipt(txHash); + await new Promise(r => setTimeout(r, 4000)); + } + return transactionReceipt; +} + +const main = async() => { + const web3 = new Web3(process.env.ETH_TESTNET_RPC); + + // Add ETH private key used for signing transactions + const ethSigner = web3.eth.accounts.privateKeyToAccount(process.env.ETH_PRIVATE_KEY); + web3.eth.accounts.wallet.add(ethSigner); + + // ETH Sepolia Contract Addresses + // Obtainable at https://developers.circle.com/stablecoins/docs/evm-smart-contracts#testnet-contract-addresses + const ETH_TOKEN_MESSENGER_CONTRACT_ADDRESS = "0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5"; + const USDC_ETH_CONTRACT_ADDRESS = "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"; + + // initialize contracts using address and ABI + const ethTokenMessengerContract = new web3.eth.Contract(tokenMessenger, ETH_TOKEN_MESSENGER_CONTRACT_ADDRESS, {from: ethSigner.address}); + const usdcEthContract = new web3.eth.Contract(usdcAbi, USDC_ETH_CONTRACT_ADDRESS, {from: ethSigner.address}); + + // Noble destination address + const nobleAddress = process.env.NOBLE_ADDRESS; + const mintRecipient = bech32.fromWords(bech32.decode(nobleAddress).words) + + // Amount that will be transferred + const amount = 1; + + const mintRecipientBytes = new Uint8Array(32); + mintRecipientBytes.set(mintRecipient, 32 - mintRecipient.length); + const mintRecipientHex = web3.utils.bytesToHex(mintRecipientBytes) + + // STEP 1: Approve TokenMessenger contract to withdraw from our active eth address + const approveTxGas = await usdcEthContract.methods.approve(ETH_TOKEN_MESSENGER_CONTRACT_ADDRESS, amount).estimateGas() + const approveTx = await usdcEthContract.methods.approve(ETH_TOKEN_MESSENGER_CONTRACT_ADDRESS, amount).send({gas: approveTxGas}) + const approveTxReceipt = await waitForTransaction(web3, approveTx.transactionHash); + console.log(approveTxReceipt) + + // STEP 2: Burn USDC + const burnTxGas = await ethTokenMessengerContract.methods.depositForBurn( + amount, + 4, + mintRecipientHex, + USDC_ETH_CONTRACT_ADDRESS + ).estimateGas( {from: ethSigner.address}); + + const burnTx = await ethTokenMessengerContract.methods.depositForBurn( + amount, + 4, + mintRecipientHex, + USDC_ETH_CONTRACT_ADDRESS + ).send({gas: burnTxGas}); + + const burnTxReceipt = await waitForTransaction(web3, burnTx.transactionHash); + console.log(burnTxReceipt) + console.log(`Minting on Noble to https://mintscan.io/noble-testnet/account/${nobleAddress}`) +}; + +main() \ No newline at end of file diff --git a/examples/bridge-eth-to-noble/package-lock.json b/examples/bridge-eth-to-noble/package-lock.json new file mode 100644 index 0000000..82fdf39 --- /dev/null +++ b/examples/bridge-eth-to-noble/package-lock.json @@ -0,0 +1,1159 @@ +{ + "name": "example", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "example", + "version": "1.0.0", + "dependencies": { + "bech32": "^2.0.0", + "dotenv": "^16.0.3", + "web3": "^4.1.2" + } + }, + "node_modules/@adraffy/ens-normalize": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz", + "integrity": "sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==" + }, + "node_modules/@ethereumjs/rlp": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", + "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==", + "bin": { + "rlp": "bin/rlp" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@ethersproject/abi": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-provider": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-signer": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/address": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" + } + }, + "node_modules/@ethersproject/base64": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0" + } + }, + "node_modules/@ethersproject/bignumber": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "bn.js": "^5.2.1" + } + }, + "node_modules/@ethersproject/bytes": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/constants": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0" + } + }, + "node_modules/@ethersproject/hash": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/keccak256": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "js-sha3": "0.8.0" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ] + }, + "node_modules/@ethersproject/networks": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/properties": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/rlp": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/signing-key": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/strings": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/transactions": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" + } + }, + "node_modules/@ethersproject/web": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@noble/curves": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", + "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", + "dependencies": { + "@noble/hashes": "1.3.1" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", + "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/base": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.3.tgz", + "integrity": "sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.1.tgz", + "integrity": "sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==", + "dependencies": { + "@noble/curves": "~1.1.0", + "@noble/hashes": "~1.3.1", + "@scure/base": "~1.1.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", + "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", + "dependencies": { + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@types/node": { + "version": "20.8.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.2.tgz", + "integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w==" + }, + "node_modules/@types/ws": { + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", + "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/bech32": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" + }, + "node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/cross-fetch": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/ethereum-cryptography": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz", + "integrity": "sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==", + "dependencies": { + "@noble/curves": "1.1.0", + "@noble/hashes": "1.3.1", + "@scure/bip32": "1.3.1", + "@scure/bip39": "1.2.1" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dependencies": { + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isomorphic-ws": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz", + "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "node_modules/web3": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/web3/-/web3-4.1.2.tgz", + "integrity": "sha512-BTUCJU7LvL0JDvB1RCRtHe5jFZ0sVYVqHvlNbG4uzebZ6ebtX/CnwiyiJ08UOuvKWzHrZQ+7jPuYuF65BMAXnQ==", + "dependencies": { + "web3-core": "^4.2.0", + "web3-errors": "^1.1.2", + "web3-eth": "^4.2.0", + "web3-eth-abi": "^4.1.2", + "web3-eth-accounts": "^4.0.6", + "web3-eth-contract": "^4.1.0", + "web3-eth-ens": "^4.0.6", + "web3-eth-iban": "^4.0.6", + "web3-eth-personal": "^4.0.6", + "web3-net": "^4.0.6", + "web3-providers-http": "^4.0.6", + "web3-providers-ws": "^4.0.6", + "web3-rpc-methods": "^1.1.2", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6", + "web3-validator": "^2.0.2" + }, + "engines": { + "node": ">=14.0.0", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-core": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-4.2.0.tgz", + "integrity": "sha512-pkZJx3HAY3b3CutaFarODFgK3TDvcXC4T0n8cpvwiZjDzakUUFAssVUDwrmFyCFKAo5kmfs6qWFW7BAZLJeBFA==", + "dependencies": { + "web3-errors": "^1.1.2", + "web3-eth-iban": "^4.0.6", + "web3-providers-http": "^4.0.6", + "web3-providers-ws": "^4.0.6", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6", + "web3-validator": "^2.0.2" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + }, + "optionalDependencies": { + "web3-providers-ipc": "^4.0.6" + } + }, + "node_modules/web3-errors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/web3-errors/-/web3-errors-1.1.2.tgz", + "integrity": "sha512-qlyuV5r6MzjLasIalVWBIIfW4Y7hBX2bZv8TRnXvI1EjiZ36zIFKgE9RF+/iRBjXmOsvIUQQ2Z9gMvYGfOwUwQ==", + "dependencies": { + "web3-types": "^1.2.0" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-eth": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-4.2.0.tgz", + "integrity": "sha512-8YUEp5bq8j6KzlWpf856e0ZTXSNgJEYPg1gzzrmFC2+l0cjbul7vHnLA7DAsQGrIvXvvHvRp8da/8Ogm+G6FYQ==", + "dependencies": { + "setimmediate": "^1.0.5", + "web3-core": "^4.2.0", + "web3-errors": "^1.1.2", + "web3-eth-abi": "^4.1.2", + "web3-eth-accounts": "^4.0.6", + "web3-net": "^4.0.6", + "web3-providers-ws": "^4.0.6", + "web3-rpc-methods": "^1.1.2", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6", + "web3-validator": "^2.0.2" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-eth-abi": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-4.1.2.tgz", + "integrity": "sha512-s8gvjUwzb2ZnAef0Jy68pjmeshYIKBoYlVj/1yuuFP9t3io3oQQIEyGlaCx7P4ifsZ186gMa4QjCCeIt7HYm7Q==", + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "web3-errors": "^1.1.2", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-eth-accounts": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-4.0.6.tgz", + "integrity": "sha512-xkOXXAEZs2CcR2v33CvFwtGJQS05ye7c3dlXcqwre91fhah9e6u4CPztpyR7HIKegWfIG1DRUwrcEqM2EMo4/w==", + "dependencies": { + "@ethereumjs/rlp": "^4.0.1", + "crc-32": "^1.2.2", + "ethereum-cryptography": "^2.0.0", + "web3-errors": "^1.1.2", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6", + "web3-validator": "^2.0.2" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-eth-contract": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-4.1.0.tgz", + "integrity": "sha512-e1eEXSwzNUaC5j0WWDqQ527fPFtIswoJZ/cov8mWvTQi3+dqyI590/6s7IF6A5CGew1RrewAqPMrR9m7WQt7hw==", + "dependencies": { + "web3-core": "^4.2.0", + "web3-errors": "^1.1.2", + "web3-eth": "^4.2.0", + "web3-eth-abi": "^4.1.2", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6", + "web3-validator": "^2.0.2" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-eth-ens": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-4.0.6.tgz", + "integrity": "sha512-ulEX1XRuTojcpWuSd5pk7+CWkE7Yrgi18TcgiQkz+ltQWOVlSHBjcQ/guA9MJoFPa2d3ADSdCbRQEZDZ8Lu3gw==", + "dependencies": { + "@adraffy/ens-normalize": "^1.8.8", + "web3-core": "^4.2.0", + "web3-errors": "^1.1.2", + "web3-eth": "^4.2.0", + "web3-eth-contract": "^4.1.0", + "web3-net": "^4.0.6", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6", + "web3-validator": "^2.0.2" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-eth-iban": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-4.0.6.tgz", + "integrity": "sha512-q47MbmoYWdfoylHlKZkZRHiPYeiFWqRiHou/wTYJEeZa2D3NG0wuPWz3jeQdZ5NzmS85yh+p2hxa54azVT8qmw==", + "dependencies": { + "web3-errors": "^1.1.2", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6", + "web3-validator": "^2.0.2" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-eth-personal": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-4.0.6.tgz", + "integrity": "sha512-QBIl5fH5GPzDfYWxOvOLghnPruopVFfgnYsRmxEu85WAFidBb+XCqIOLmKe4qfF5czPG7gA/7PCPdsPqGNlf7Q==", + "dependencies": { + "web3-core": "^4.2.0", + "web3-eth": "^4.2.0", + "web3-rpc-methods": "^1.1.2", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6", + "web3-validator": "^2.0.2" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-net": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-4.0.6.tgz", + "integrity": "sha512-Th4AtgpBgMdt76PmYyNBQxwAd2hAR8hIjhU4xjhqk1JATlXpcfgzyhegeAsvnSht4tcLnVQt6SN4ZVccllpd4A==", + "dependencies": { + "web3-core": "^4.2.0", + "web3-rpc-methods": "^1.1.2", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-providers-http": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-4.0.6.tgz", + "integrity": "sha512-FnBw0X25Xu0FejOgY2Ra7WY4p3fSrHxZuQ5a4j0ytDCE+0wxKQN0BaLRC7+uigbVvwEziQwzrhe+tn8bYAQKXQ==", + "dependencies": { + "cross-fetch": "^3.1.5", + "web3-errors": "^1.1.2", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-providers-ipc": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-4.0.6.tgz", + "integrity": "sha512-17Ky978qGgdSWtctc/WKj9kX+QUypk6arZLI/Rfmq4zQpoR5ngH38CGozRkXUonr9hITYNaLW82NB1SPi1pRPQ==", + "optional": true, + "dependencies": { + "web3-errors": "^1.1.2", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-providers-ws": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-4.0.6.tgz", + "integrity": "sha512-0Q0SuKpr05gK+tUXdzPNmYlDV3exdqxnHx3f8p3cqz+v66J04EOT31bbETS0VcpDiQ9YaVS8FVSjT4PaseuNag==", + "dependencies": { + "@types/ws": "8.5.3", + "isomorphic-ws": "^5.0.0", + "web3-errors": "^1.1.2", + "web3-types": "^1.2.0", + "web3-utils": "^4.0.6", + "ws": "^8.8.1" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-rpc-methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/web3-rpc-methods/-/web3-rpc-methods-1.1.2.tgz", + "integrity": "sha512-fzYp9eJyzq/UBzpP9kOQormelLfvl1kJnX5ucHv4T6kZaQfDuBt5XoYDtCDXSXVaz2MgTowsXwKEVAzN6h7+Ag==", + "dependencies": { + "web3-core": "^4.2.0", + "web3-types": "^1.2.0", + "web3-validator": "^2.0.2" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-types": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/web3-types/-/web3-types-1.2.0.tgz", + "integrity": "sha512-ljx8mrkrOI8fRqvgOdxfpKYoso6n7I8T9LsqXl+Mz2Db0L+2H15an0xgdoWYpKndTPiU2NKRWFiopYifBQzcxQ==", + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-utils": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-4.0.6.tgz", + "integrity": "sha512-nLVtMf9mWTX604XiQQkWZlHLCag9GdHfQtnGJDNaDssTLUx5SpOm1CjhKCHcVcAH/QazEsWcLqUAuyqwKST1kA==", + "dependencies": { + "ethereum-cryptography": "^2.0.0", + "web3-errors": "^1.1.2", + "web3-types": "^1.2.0", + "web3-validator": "^2.0.2" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-validator": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/web3-validator/-/web3-validator-2.0.2.tgz", + "integrity": "sha512-9sQ5owd2UldTsva3o3htj2fTPpbmUwb4TfBXhjIkew8FyT0ss3DPI+j3p6XrfdxIVBEQ5r17YUakElDV99aW+A==", + "dependencies": { + "ethereum-cryptography": "^2.0.0", + "util": "^0.12.5", + "web3-errors": "^1.1.2", + "web3-types": "^1.2.0", + "zod": "^3.21.4" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ws": { + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", + "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/zod": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/examples/bridge-eth-to-noble/package.json b/examples/bridge-eth-to-noble/package.json new file mode 100644 index 0000000..2905f27 --- /dev/null +++ b/examples/bridge-eth-to-noble/package.json @@ -0,0 +1,15 @@ +{ + "name": "example", + "version": "1.0.0", + "description": "CCTP Quickstart - ETH to Noble", + "main": "index.js", + "scripts": { + "bridge-eth-to-noble": "node index.js" + }, + "author": "", + "dependencies": { + "bech32": "^2.0.0", + "dotenv": "^16.0.3", + "web3": "^4.1.2" + } +} diff --git a/examples/bridge-noble-to-eth/.env.example b/examples/bridge-noble-to-eth/.env.example new file mode 100644 index 0000000..9657996 --- /dev/null +++ b/examples/bridge-noble-to-eth/.env.example @@ -0,0 +1,2 @@ +MNEMONIC="..." +ETH_MINT_RECIPIENT=0x... \ No newline at end of file diff --git a/examples/bridge-noble-to-eth/README.md b/examples/bridge-noble-to-eth/README.md new file mode 100644 index 0000000..76d2698 --- /dev/null +++ b/examples/bridge-noble-to-eth/README.md @@ -0,0 +1,26 @@ +# Noble -> Ethereum (Typescript) + +## Instructions + +1. Install require packages: + + ``` + npm install + ``` + +2. (If needed) Obtain tokens from the faucet: https://faucet.circle.com/ + +3. Set up `.env` file based on `.env.example`: + + ``` + MNEMONIC="word1 word2..." + ETH_MINT_RECIPIENT=0x... + ``` + +4. Run Noble -> ETH bridging script: + + ``` + npm run burn + ``` + +The Noble testnet -> ETH Sepolia CCTP relayer should pick up these messages automatically. diff --git a/examples/bridge-noble-to-eth/generated/tx.ts b/examples/bridge-noble-to-eth/generated/tx.ts new file mode 100644 index 0000000..9110b1a --- /dev/null +++ b/examples/bridge-noble-to-eth/generated/tx.ts @@ -0,0 +1,3894 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "circle.cctp.v1"; + +/** TODO add comments */ +export interface MsgUpdateOwner { + from: string; + newOwner: string; +} + +export interface MsgUpdateOwnerResponse { +} + +export interface MsgUpdateAttesterManager { + from: string; + newAttesterManager: string; +} + +export interface MsgUpdateAttesterManagerResponse { +} + +export interface MsgUpdateTokenController { + from: string; + newTokenController: string; +} + +export interface MsgUpdateTokenControllerResponse { +} + +export interface MsgUpdatePauser { + from: string; + newPauser: string; +} + +export interface MsgUpdatePauserResponse { +} + +export interface MsgAcceptOwner { + from: string; +} + +export interface MsgAcceptOwnerResponse { +} + +export interface MsgEnableAttester { + from: string; + attester: string; +} + +export interface MsgEnableAttesterResponse { +} + +export interface MsgDisableAttester { + from: string; + attester: string; +} + +export interface MsgDisableAttesterResponse { +} + +export interface MsgPauseBurningAndMinting { + from: string; +} + +export interface MsgPauseBurningAndMintingResponse { +} + +export interface MsgUnpauseBurningAndMinting { + from: string; +} + +export interface MsgUnpauseBurningAndMintingResponse { +} + +export interface MsgPauseSendingAndReceivingMessages { + from: string; +} + +export interface MsgPauseSendingAndReceivingMessagesResponse { +} + +export interface MsgUnpauseSendingAndReceivingMessages { + from: string; +} + +export interface MsgUnpauseSendingAndReceivingMessagesResponse { +} + +export interface MsgUpdateMaxMessageBodySize { + from: string; + messageSize: Long; +} + +export interface MsgUpdateMaxMessageBodySizeResponse { +} + +export interface MsgSetMaxBurnAmountPerMessage { + from: string; + localToken: string; + amount: string; +} + +export interface MsgSetMaxBurnAmountPerMessageResponse { +} + +export interface MsgDepositForBurn { + from: string; + amount: string; + destinationDomain: number; + mintRecipient: Uint8Array; + burnToken: string; +} + +export interface MsgDepositForBurnResponse { + nonce: Long; +} + +export interface MsgDepositForBurnWithCaller { + from: string; + amount: string; + destinationDomain: number; + mintRecipient: Uint8Array; + burnToken: string; + destinationCaller: Uint8Array; +} + +export interface MsgDepositForBurnWithCallerResponse { + nonce: Long; +} + +export interface MsgReplaceDepositForBurn { + from: string; + originalMessage: Uint8Array; + originalAttestation: Uint8Array; + newDestinationCaller: Uint8Array; + newMintRecipient: Uint8Array; +} + +export interface MsgReplaceDepositForBurnResponse { +} + +export interface MsgReceiveMessage { + from: string; + message: Uint8Array; + attestation: Uint8Array; +} + +export interface MsgReceiveMessageResponse { + success: boolean; +} + +export interface MsgSendMessage { + from: string; + destinationDomain: number; + recipient: Uint8Array; + messageBody: Uint8Array; +} + +export interface MsgSendMessageResponse { + nonce: Long; +} + +export interface MsgSendMessageWithCaller { + from: string; + destinationDomain: number; + recipient: Uint8Array; + messageBody: Uint8Array; + destinationCaller: Uint8Array; +} + +export interface MsgSendMessageWithCallerResponse { + nonce: Long; +} + +export interface MsgReplaceMessage { + from: string; + originalMessage: Uint8Array; + originalAttestation: Uint8Array; + newMessageBody: Uint8Array; + newDestinationCaller: Uint8Array; +} + +export interface MsgReplaceMessageResponse { +} + +export interface MsgUpdateSignatureThreshold { + from: string; + amount: number; +} + +export interface MsgUpdateSignatureThresholdResponse { +} + +export interface MsgLinkTokenPair { + from: string; + remoteDomain: number; + remoteToken: Uint8Array; + localToken: string; +} + +export interface MsgLinkTokenPairResponse { +} + +export interface MsgUnlinkTokenPair { + from: string; + remoteDomain: number; + remoteToken: Uint8Array; + localToken: string; +} + +export interface MsgUnlinkTokenPairResponse { +} + +export interface MsgAddRemoteTokenMessenger { + from: string; + domainId: number; + address: Uint8Array; +} + +export interface MsgAddRemoteTokenMessengerResponse { +} + +export interface MsgRemoveRemoteTokenMessenger { + from: string; + domainId: number; +} + +export interface MsgRemoveRemoteTokenMessengerResponse { +} + +function createBaseMsgUpdateOwner(): MsgUpdateOwner { + return { from: "", newOwner: "" }; +} + +export const MsgUpdateOwner = { + encode(message: MsgUpdateOwner, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.newOwner !== "") { + writer.uint32(18).string(message.newOwner); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateOwner { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateOwner(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.newOwner = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUpdateOwner { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + newOwner: isSet(object.newOwner) ? globalThis.String(object.newOwner) : "", + }; + }, + + toJSON(message: MsgUpdateOwner): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.newOwner !== "") { + obj.newOwner = message.newOwner; + } + return obj; + }, + + create, I>>(base?: I): MsgUpdateOwner { + return MsgUpdateOwner.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgUpdateOwner { + const message = createBaseMsgUpdateOwner(); + message.from = object.from ?? ""; + message.newOwner = object.newOwner ?? ""; + return message; + }, +}; + +function createBaseMsgUpdateOwnerResponse(): MsgUpdateOwnerResponse { + return {}; +} + +export const MsgUpdateOwnerResponse = { + encode(_: MsgUpdateOwnerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateOwnerResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateOwnerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUpdateOwnerResponse { + return {}; + }, + + toJSON(_: MsgUpdateOwnerResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): MsgUpdateOwnerResponse { + return MsgUpdateOwnerResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): MsgUpdateOwnerResponse { + const message = createBaseMsgUpdateOwnerResponse(); + return message; + }, +}; + +function createBaseMsgUpdateAttesterManager(): MsgUpdateAttesterManager { + return { from: "", newAttesterManager: "" }; +} + +export const MsgUpdateAttesterManager = { + encode(message: MsgUpdateAttesterManager, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.newAttesterManager !== "") { + writer.uint32(18).string(message.newAttesterManager); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAttesterManager { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAttesterManager(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.newAttesterManager = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUpdateAttesterManager { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + newAttesterManager: isSet(object.newAttesterManager) ? globalThis.String(object.newAttesterManager) : "", + }; + }, + + toJSON(message: MsgUpdateAttesterManager): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.newAttesterManager !== "") { + obj.newAttesterManager = message.newAttesterManager; + } + return obj; + }, + + create, I>>(base?: I): MsgUpdateAttesterManager { + return MsgUpdateAttesterManager.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgUpdateAttesterManager { + const message = createBaseMsgUpdateAttesterManager(); + message.from = object.from ?? ""; + message.newAttesterManager = object.newAttesterManager ?? ""; + return message; + }, +}; + +function createBaseMsgUpdateAttesterManagerResponse(): MsgUpdateAttesterManagerResponse { + return {}; +} + +export const MsgUpdateAttesterManagerResponse = { + encode(_: MsgUpdateAttesterManagerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAttesterManagerResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAttesterManagerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUpdateAttesterManagerResponse { + return {}; + }, + + toJSON(_: MsgUpdateAttesterManagerResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateAttesterManagerResponse { + return MsgUpdateAttesterManagerResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgUpdateAttesterManagerResponse { + const message = createBaseMsgUpdateAttesterManagerResponse(); + return message; + }, +}; + +function createBaseMsgUpdateTokenController(): MsgUpdateTokenController { + return { from: "", newTokenController: "" }; +} + +export const MsgUpdateTokenController = { + encode(message: MsgUpdateTokenController, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.newTokenController !== "") { + writer.uint32(18).string(message.newTokenController); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateTokenController { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateTokenController(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.newTokenController = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUpdateTokenController { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + newTokenController: isSet(object.newTokenController) ? globalThis.String(object.newTokenController) : "", + }; + }, + + toJSON(message: MsgUpdateTokenController): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.newTokenController !== "") { + obj.newTokenController = message.newTokenController; + } + return obj; + }, + + create, I>>(base?: I): MsgUpdateTokenController { + return MsgUpdateTokenController.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgUpdateTokenController { + const message = createBaseMsgUpdateTokenController(); + message.from = object.from ?? ""; + message.newTokenController = object.newTokenController ?? ""; + return message; + }, +}; + +function createBaseMsgUpdateTokenControllerResponse(): MsgUpdateTokenControllerResponse { + return {}; +} + +export const MsgUpdateTokenControllerResponse = { + encode(_: MsgUpdateTokenControllerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateTokenControllerResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateTokenControllerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUpdateTokenControllerResponse { + return {}; + }, + + toJSON(_: MsgUpdateTokenControllerResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateTokenControllerResponse { + return MsgUpdateTokenControllerResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgUpdateTokenControllerResponse { + const message = createBaseMsgUpdateTokenControllerResponse(); + return message; + }, +}; + +function createBaseMsgUpdatePauser(): MsgUpdatePauser { + return { from: "", newPauser: "" }; +} + +export const MsgUpdatePauser = { + encode(message: MsgUpdatePauser, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.newPauser !== "") { + writer.uint32(18).string(message.newPauser); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdatePauser { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdatePauser(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.newPauser = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUpdatePauser { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + newPauser: isSet(object.newPauser) ? globalThis.String(object.newPauser) : "", + }; + }, + + toJSON(message: MsgUpdatePauser): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.newPauser !== "") { + obj.newPauser = message.newPauser; + } + return obj; + }, + + create, I>>(base?: I): MsgUpdatePauser { + return MsgUpdatePauser.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgUpdatePauser { + const message = createBaseMsgUpdatePauser(); + message.from = object.from ?? ""; + message.newPauser = object.newPauser ?? ""; + return message; + }, +}; + +function createBaseMsgUpdatePauserResponse(): MsgUpdatePauserResponse { + return {}; +} + +export const MsgUpdatePauserResponse = { + encode(_: MsgUpdatePauserResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdatePauserResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdatePauserResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUpdatePauserResponse { + return {}; + }, + + toJSON(_: MsgUpdatePauserResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): MsgUpdatePauserResponse { + return MsgUpdatePauserResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): MsgUpdatePauserResponse { + const message = createBaseMsgUpdatePauserResponse(); + return message; + }, +}; + +function createBaseMsgAcceptOwner(): MsgAcceptOwner { + return { from: "" }; +} + +export const MsgAcceptOwner = { + encode(message: MsgAcceptOwner, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgAcceptOwner { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcceptOwner(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgAcceptOwner { + return { from: isSet(object.from) ? globalThis.String(object.from) : "" }; + }, + + toJSON(message: MsgAcceptOwner): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + return obj; + }, + + create, I>>(base?: I): MsgAcceptOwner { + return MsgAcceptOwner.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgAcceptOwner { + const message = createBaseMsgAcceptOwner(); + message.from = object.from ?? ""; + return message; + }, +}; + +function createBaseMsgAcceptOwnerResponse(): MsgAcceptOwnerResponse { + return {}; +} + +export const MsgAcceptOwnerResponse = { + encode(_: MsgAcceptOwnerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgAcceptOwnerResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcceptOwnerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgAcceptOwnerResponse { + return {}; + }, + + toJSON(_: MsgAcceptOwnerResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): MsgAcceptOwnerResponse { + return MsgAcceptOwnerResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): MsgAcceptOwnerResponse { + const message = createBaseMsgAcceptOwnerResponse(); + return message; + }, +}; + +function createBaseMsgEnableAttester(): MsgEnableAttester { + return { from: "", attester: "" }; +} + +export const MsgEnableAttester = { + encode(message: MsgEnableAttester, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.attester !== "") { + writer.uint32(18).string(message.attester); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgEnableAttester { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEnableAttester(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attester = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgEnableAttester { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + attester: isSet(object.attester) ? globalThis.String(object.attester) : "", + }; + }, + + toJSON(message: MsgEnableAttester): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.attester !== "") { + obj.attester = message.attester; + } + return obj; + }, + + create, I>>(base?: I): MsgEnableAttester { + return MsgEnableAttester.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgEnableAttester { + const message = createBaseMsgEnableAttester(); + message.from = object.from ?? ""; + message.attester = object.attester ?? ""; + return message; + }, +}; + +function createBaseMsgEnableAttesterResponse(): MsgEnableAttesterResponse { + return {}; +} + +export const MsgEnableAttesterResponse = { + encode(_: MsgEnableAttesterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgEnableAttesterResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEnableAttesterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgEnableAttesterResponse { + return {}; + }, + + toJSON(_: MsgEnableAttesterResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): MsgEnableAttesterResponse { + return MsgEnableAttesterResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): MsgEnableAttesterResponse { + const message = createBaseMsgEnableAttesterResponse(); + return message; + }, +}; + +function createBaseMsgDisableAttester(): MsgDisableAttester { + return { from: "", attester: "" }; +} + +export const MsgDisableAttester = { + encode(message: MsgDisableAttester, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.attester !== "") { + writer.uint32(18).string(message.attester); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDisableAttester { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDisableAttester(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.attester = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDisableAttester { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + attester: isSet(object.attester) ? globalThis.String(object.attester) : "", + }; + }, + + toJSON(message: MsgDisableAttester): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.attester !== "") { + obj.attester = message.attester; + } + return obj; + }, + + create, I>>(base?: I): MsgDisableAttester { + return MsgDisableAttester.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgDisableAttester { + const message = createBaseMsgDisableAttester(); + message.from = object.from ?? ""; + message.attester = object.attester ?? ""; + return message; + }, +}; + +function createBaseMsgDisableAttesterResponse(): MsgDisableAttesterResponse { + return {}; +} + +export const MsgDisableAttesterResponse = { + encode(_: MsgDisableAttesterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDisableAttesterResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDisableAttesterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgDisableAttesterResponse { + return {}; + }, + + toJSON(_: MsgDisableAttesterResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): MsgDisableAttesterResponse { + return MsgDisableAttesterResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): MsgDisableAttesterResponse { + const message = createBaseMsgDisableAttesterResponse(); + return message; + }, +}; + +function createBaseMsgPauseBurningAndMinting(): MsgPauseBurningAndMinting { + return { from: "" }; +} + +export const MsgPauseBurningAndMinting = { + encode(message: MsgPauseBurningAndMinting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgPauseBurningAndMinting { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPauseBurningAndMinting(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgPauseBurningAndMinting { + return { from: isSet(object.from) ? globalThis.String(object.from) : "" }; + }, + + toJSON(message: MsgPauseBurningAndMinting): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + return obj; + }, + + create, I>>(base?: I): MsgPauseBurningAndMinting { + return MsgPauseBurningAndMinting.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgPauseBurningAndMinting { + const message = createBaseMsgPauseBurningAndMinting(); + message.from = object.from ?? ""; + return message; + }, +}; + +function createBaseMsgPauseBurningAndMintingResponse(): MsgPauseBurningAndMintingResponse { + return {}; +} + +export const MsgPauseBurningAndMintingResponse = { + encode(_: MsgPauseBurningAndMintingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgPauseBurningAndMintingResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPauseBurningAndMintingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgPauseBurningAndMintingResponse { + return {}; + }, + + toJSON(_: MsgPauseBurningAndMintingResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgPauseBurningAndMintingResponse { + return MsgPauseBurningAndMintingResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgPauseBurningAndMintingResponse { + const message = createBaseMsgPauseBurningAndMintingResponse(); + return message; + }, +}; + +function createBaseMsgUnpauseBurningAndMinting(): MsgUnpauseBurningAndMinting { + return { from: "" }; +} + +export const MsgUnpauseBurningAndMinting = { + encode(message: MsgUnpauseBurningAndMinting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnpauseBurningAndMinting { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnpauseBurningAndMinting(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUnpauseBurningAndMinting { + return { from: isSet(object.from) ? globalThis.String(object.from) : "" }; + }, + + toJSON(message: MsgUnpauseBurningAndMinting): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + return obj; + }, + + create, I>>(base?: I): MsgUnpauseBurningAndMinting { + return MsgUnpauseBurningAndMinting.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgUnpauseBurningAndMinting { + const message = createBaseMsgUnpauseBurningAndMinting(); + message.from = object.from ?? ""; + return message; + }, +}; + +function createBaseMsgUnpauseBurningAndMintingResponse(): MsgUnpauseBurningAndMintingResponse { + return {}; +} + +export const MsgUnpauseBurningAndMintingResponse = { + encode(_: MsgUnpauseBurningAndMintingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnpauseBurningAndMintingResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnpauseBurningAndMintingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUnpauseBurningAndMintingResponse { + return {}; + }, + + toJSON(_: MsgUnpauseBurningAndMintingResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgUnpauseBurningAndMintingResponse { + return MsgUnpauseBurningAndMintingResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgUnpauseBurningAndMintingResponse { + const message = createBaseMsgUnpauseBurningAndMintingResponse(); + return message; + }, +}; + +function createBaseMsgPauseSendingAndReceivingMessages(): MsgPauseSendingAndReceivingMessages { + return { from: "" }; +} + +export const MsgPauseSendingAndReceivingMessages = { + encode(message: MsgPauseSendingAndReceivingMessages, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgPauseSendingAndReceivingMessages { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPauseSendingAndReceivingMessages(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgPauseSendingAndReceivingMessages { + return { from: isSet(object.from) ? globalThis.String(object.from) : "" }; + }, + + toJSON(message: MsgPauseSendingAndReceivingMessages): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgPauseSendingAndReceivingMessages { + return MsgPauseSendingAndReceivingMessages.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgPauseSendingAndReceivingMessages { + const message = createBaseMsgPauseSendingAndReceivingMessages(); + message.from = object.from ?? ""; + return message; + }, +}; + +function createBaseMsgPauseSendingAndReceivingMessagesResponse(): MsgPauseSendingAndReceivingMessagesResponse { + return {}; +} + +export const MsgPauseSendingAndReceivingMessagesResponse = { + encode(_: MsgPauseSendingAndReceivingMessagesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgPauseSendingAndReceivingMessagesResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPauseSendingAndReceivingMessagesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgPauseSendingAndReceivingMessagesResponse { + return {}; + }, + + toJSON(_: MsgPauseSendingAndReceivingMessagesResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgPauseSendingAndReceivingMessagesResponse { + return MsgPauseSendingAndReceivingMessagesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgPauseSendingAndReceivingMessagesResponse { + const message = createBaseMsgPauseSendingAndReceivingMessagesResponse(); + return message; + }, +}; + +function createBaseMsgUnpauseSendingAndReceivingMessages(): MsgUnpauseSendingAndReceivingMessages { + return { from: "" }; +} + +export const MsgUnpauseSendingAndReceivingMessages = { + encode(message: MsgUnpauseSendingAndReceivingMessages, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnpauseSendingAndReceivingMessages { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnpauseSendingAndReceivingMessages(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUnpauseSendingAndReceivingMessages { + return { from: isSet(object.from) ? globalThis.String(object.from) : "" }; + }, + + toJSON(message: MsgUnpauseSendingAndReceivingMessages): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgUnpauseSendingAndReceivingMessages { + return MsgUnpauseSendingAndReceivingMessages.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgUnpauseSendingAndReceivingMessages { + const message = createBaseMsgUnpauseSendingAndReceivingMessages(); + message.from = object.from ?? ""; + return message; + }, +}; + +function createBaseMsgUnpauseSendingAndReceivingMessagesResponse(): MsgUnpauseSendingAndReceivingMessagesResponse { + return {}; +} + +export const MsgUnpauseSendingAndReceivingMessagesResponse = { + encode(_: MsgUnpauseSendingAndReceivingMessagesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnpauseSendingAndReceivingMessagesResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnpauseSendingAndReceivingMessagesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUnpauseSendingAndReceivingMessagesResponse { + return {}; + }, + + toJSON(_: MsgUnpauseSendingAndReceivingMessagesResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgUnpauseSendingAndReceivingMessagesResponse { + return MsgUnpauseSendingAndReceivingMessagesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgUnpauseSendingAndReceivingMessagesResponse { + const message = createBaseMsgUnpauseSendingAndReceivingMessagesResponse(); + return message; + }, +}; + +function createBaseMsgUpdateMaxMessageBodySize(): MsgUpdateMaxMessageBodySize { + return { from: "", messageSize: Long.UZERO }; +} + +export const MsgUpdateMaxMessageBodySize = { + encode(message: MsgUpdateMaxMessageBodySize, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (!message.messageSize.isZero()) { + writer.uint32(16).uint64(message.messageSize); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateMaxMessageBodySize { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMaxMessageBodySize(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.messageSize = reader.uint64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUpdateMaxMessageBodySize { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + messageSize: isSet(object.messageSize) ? Long.fromValue(object.messageSize) : Long.UZERO, + }; + }, + + toJSON(message: MsgUpdateMaxMessageBodySize): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (!message.messageSize.isZero()) { + obj.messageSize = (message.messageSize || Long.UZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): MsgUpdateMaxMessageBodySize { + return MsgUpdateMaxMessageBodySize.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgUpdateMaxMessageBodySize { + const message = createBaseMsgUpdateMaxMessageBodySize(); + message.from = object.from ?? ""; + message.messageSize = (object.messageSize !== undefined && object.messageSize !== null) + ? Long.fromValue(object.messageSize) + : Long.UZERO; + return message; + }, +}; + +function createBaseMsgUpdateMaxMessageBodySizeResponse(): MsgUpdateMaxMessageBodySizeResponse { + return {}; +} + +export const MsgUpdateMaxMessageBodySizeResponse = { + encode(_: MsgUpdateMaxMessageBodySizeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateMaxMessageBodySizeResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMaxMessageBodySizeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUpdateMaxMessageBodySizeResponse { + return {}; + }, + + toJSON(_: MsgUpdateMaxMessageBodySizeResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateMaxMessageBodySizeResponse { + return MsgUpdateMaxMessageBodySizeResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgUpdateMaxMessageBodySizeResponse { + const message = createBaseMsgUpdateMaxMessageBodySizeResponse(); + return message; + }, +}; + +function createBaseMsgSetMaxBurnAmountPerMessage(): MsgSetMaxBurnAmountPerMessage { + return { from: "", localToken: "", amount: "" }; +} + +export const MsgSetMaxBurnAmountPerMessage = { + encode(message: MsgSetMaxBurnAmountPerMessage, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.localToken !== "") { + writer.uint32(18).string(message.localToken); + } + if (message.amount !== "") { + writer.uint32(26).string(message.amount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetMaxBurnAmountPerMessage { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMaxBurnAmountPerMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.localToken = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.amount = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgSetMaxBurnAmountPerMessage { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + localToken: isSet(object.localToken) ? globalThis.String(object.localToken) : "", + amount: isSet(object.amount) ? globalThis.String(object.amount) : "", + }; + }, + + toJSON(message: MsgSetMaxBurnAmountPerMessage): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.localToken !== "") { + obj.localToken = message.localToken; + } + if (message.amount !== "") { + obj.amount = message.amount; + } + return obj; + }, + + create, I>>(base?: I): MsgSetMaxBurnAmountPerMessage { + return MsgSetMaxBurnAmountPerMessage.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgSetMaxBurnAmountPerMessage { + const message = createBaseMsgSetMaxBurnAmountPerMessage(); + message.from = object.from ?? ""; + message.localToken = object.localToken ?? ""; + message.amount = object.amount ?? ""; + return message; + }, +}; + +function createBaseMsgSetMaxBurnAmountPerMessageResponse(): MsgSetMaxBurnAmountPerMessageResponse { + return {}; +} + +export const MsgSetMaxBurnAmountPerMessageResponse = { + encode(_: MsgSetMaxBurnAmountPerMessageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetMaxBurnAmountPerMessageResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMaxBurnAmountPerMessageResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgSetMaxBurnAmountPerMessageResponse { + return {}; + }, + + toJSON(_: MsgSetMaxBurnAmountPerMessageResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgSetMaxBurnAmountPerMessageResponse { + return MsgSetMaxBurnAmountPerMessageResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgSetMaxBurnAmountPerMessageResponse { + const message = createBaseMsgSetMaxBurnAmountPerMessageResponse(); + return message; + }, +}; + +function createBaseMsgDepositForBurn(): MsgDepositForBurn { + return { from: "", amount: "", destinationDomain: 0, mintRecipient: new Uint8Array(0), burnToken: "" }; +} + +export const MsgDepositForBurn = { + encode(message: MsgDepositForBurn, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + if (message.destinationDomain !== 0) { + writer.uint32(24).uint32(message.destinationDomain); + } + if (message.mintRecipient.length !== 0) { + writer.uint32(34).bytes(message.mintRecipient); + } + if (message.burnToken !== "") { + writer.uint32(42).string(message.burnToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositForBurn { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositForBurn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.amount = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.destinationDomain = reader.uint32(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.mintRecipient = reader.bytes(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.burnToken = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDepositForBurn { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + amount: isSet(object.amount) ? globalThis.String(object.amount) : "", + destinationDomain: isSet(object.destinationDomain) ? globalThis.Number(object.destinationDomain) : 0, + mintRecipient: isSet(object.mintRecipient) ? bytesFromBase64(object.mintRecipient) : new Uint8Array(0), + burnToken: isSet(object.burnToken) ? globalThis.String(object.burnToken) : "", + }; + }, + + toJSON(message: MsgDepositForBurn): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.amount !== "") { + obj.amount = message.amount; + } + if (message.destinationDomain !== 0) { + obj.destinationDomain = Math.round(message.destinationDomain); + } + if (message.mintRecipient.length !== 0) { + obj.mintRecipient = base64FromBytes(message.mintRecipient); + } + if (message.burnToken !== "") { + obj.burnToken = message.burnToken; + } + return obj; + }, + + create, I>>(base?: I): MsgDepositForBurn { + return MsgDepositForBurn.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgDepositForBurn { + const message = createBaseMsgDepositForBurn(); + message.from = object.from ?? ""; + message.amount = object.amount ?? ""; + message.destinationDomain = object.destinationDomain ?? 0; + message.mintRecipient = object.mintRecipient ?? new Uint8Array(0); + message.burnToken = object.burnToken ?? ""; + return message; + }, +}; + +function createBaseMsgDepositForBurnResponse(): MsgDepositForBurnResponse { + return { nonce: Long.UZERO }; +} + +export const MsgDepositForBurnResponse = { + encode(message: MsgDepositForBurnResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.nonce.isZero()) { + writer.uint32(8).uint64(message.nonce); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositForBurnResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositForBurnResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.nonce = reader.uint64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDepositForBurnResponse { + return { nonce: isSet(object.nonce) ? Long.fromValue(object.nonce) : Long.UZERO }; + }, + + toJSON(message: MsgDepositForBurnResponse): unknown { + const obj: any = {}; + if (!message.nonce.isZero()) { + obj.nonce = (message.nonce || Long.UZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): MsgDepositForBurnResponse { + return MsgDepositForBurnResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgDepositForBurnResponse { + const message = createBaseMsgDepositForBurnResponse(); + message.nonce = (object.nonce !== undefined && object.nonce !== null) ? Long.fromValue(object.nonce) : Long.UZERO; + return message; + }, +}; + +function createBaseMsgDepositForBurnWithCaller(): MsgDepositForBurnWithCaller { + return { + from: "", + amount: "", + destinationDomain: 0, + mintRecipient: new Uint8Array(0), + burnToken: "", + destinationCaller: new Uint8Array(0), + }; +} + +export const MsgDepositForBurnWithCaller = { + encode(message: MsgDepositForBurnWithCaller, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + if (message.destinationDomain !== 0) { + writer.uint32(24).uint32(message.destinationDomain); + } + if (message.mintRecipient.length !== 0) { + writer.uint32(34).bytes(message.mintRecipient); + } + if (message.burnToken !== "") { + writer.uint32(42).string(message.burnToken); + } + if (message.destinationCaller.length !== 0) { + writer.uint32(50).bytes(message.destinationCaller); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositForBurnWithCaller { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositForBurnWithCaller(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.amount = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.destinationDomain = reader.uint32(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.mintRecipient = reader.bytes(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.burnToken = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.destinationCaller = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDepositForBurnWithCaller { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + amount: isSet(object.amount) ? globalThis.String(object.amount) : "", + destinationDomain: isSet(object.destinationDomain) ? globalThis.Number(object.destinationDomain) : 0, + mintRecipient: isSet(object.mintRecipient) ? bytesFromBase64(object.mintRecipient) : new Uint8Array(0), + burnToken: isSet(object.burnToken) ? globalThis.String(object.burnToken) : "", + destinationCaller: isSet(object.destinationCaller) + ? bytesFromBase64(object.destinationCaller) + : new Uint8Array(0), + }; + }, + + toJSON(message: MsgDepositForBurnWithCaller): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.amount !== "") { + obj.amount = message.amount; + } + if (message.destinationDomain !== 0) { + obj.destinationDomain = Math.round(message.destinationDomain); + } + if (message.mintRecipient.length !== 0) { + obj.mintRecipient = base64FromBytes(message.mintRecipient); + } + if (message.burnToken !== "") { + obj.burnToken = message.burnToken; + } + if (message.destinationCaller.length !== 0) { + obj.destinationCaller = base64FromBytes(message.destinationCaller); + } + return obj; + }, + + create, I>>(base?: I): MsgDepositForBurnWithCaller { + return MsgDepositForBurnWithCaller.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgDepositForBurnWithCaller { + const message = createBaseMsgDepositForBurnWithCaller(); + message.from = object.from ?? ""; + message.amount = object.amount ?? ""; + message.destinationDomain = object.destinationDomain ?? 0; + message.mintRecipient = object.mintRecipient ?? new Uint8Array(0); + message.burnToken = object.burnToken ?? ""; + message.destinationCaller = object.destinationCaller ?? new Uint8Array(0); + return message; + }, +}; + +function createBaseMsgDepositForBurnWithCallerResponse(): MsgDepositForBurnWithCallerResponse { + return { nonce: Long.UZERO }; +} + +export const MsgDepositForBurnWithCallerResponse = { + encode(message: MsgDepositForBurnWithCallerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.nonce.isZero()) { + writer.uint32(8).uint64(message.nonce); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositForBurnWithCallerResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositForBurnWithCallerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.nonce = reader.uint64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgDepositForBurnWithCallerResponse { + return { nonce: isSet(object.nonce) ? Long.fromValue(object.nonce) : Long.UZERO }; + }, + + toJSON(message: MsgDepositForBurnWithCallerResponse): unknown { + const obj: any = {}; + if (!message.nonce.isZero()) { + obj.nonce = (message.nonce || Long.UZERO).toString(); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgDepositForBurnWithCallerResponse { + return MsgDepositForBurnWithCallerResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgDepositForBurnWithCallerResponse { + const message = createBaseMsgDepositForBurnWithCallerResponse(); + message.nonce = (object.nonce !== undefined && object.nonce !== null) ? Long.fromValue(object.nonce) : Long.UZERO; + return message; + }, +}; + +function createBaseMsgReplaceDepositForBurn(): MsgReplaceDepositForBurn { + return { + from: "", + originalMessage: new Uint8Array(0), + originalAttestation: new Uint8Array(0), + newDestinationCaller: new Uint8Array(0), + newMintRecipient: new Uint8Array(0), + }; +} + +export const MsgReplaceDepositForBurn = { + encode(message: MsgReplaceDepositForBurn, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.originalMessage.length !== 0) { + writer.uint32(18).bytes(message.originalMessage); + } + if (message.originalAttestation.length !== 0) { + writer.uint32(26).bytes(message.originalAttestation); + } + if (message.newDestinationCaller.length !== 0) { + writer.uint32(34).bytes(message.newDestinationCaller); + } + if (message.newMintRecipient.length !== 0) { + writer.uint32(42).bytes(message.newMintRecipient); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgReplaceDepositForBurn { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReplaceDepositForBurn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.originalMessage = reader.bytes(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.originalAttestation = reader.bytes(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.newDestinationCaller = reader.bytes(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.newMintRecipient = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgReplaceDepositForBurn { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + originalMessage: isSet(object.originalMessage) ? bytesFromBase64(object.originalMessage) : new Uint8Array(0), + originalAttestation: isSet(object.originalAttestation) + ? bytesFromBase64(object.originalAttestation) + : new Uint8Array(0), + newDestinationCaller: isSet(object.newDestinationCaller) + ? bytesFromBase64(object.newDestinationCaller) + : new Uint8Array(0), + newMintRecipient: isSet(object.newMintRecipient) ? bytesFromBase64(object.newMintRecipient) : new Uint8Array(0), + }; + }, + + toJSON(message: MsgReplaceDepositForBurn): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.originalMessage.length !== 0) { + obj.originalMessage = base64FromBytes(message.originalMessage); + } + if (message.originalAttestation.length !== 0) { + obj.originalAttestation = base64FromBytes(message.originalAttestation); + } + if (message.newDestinationCaller.length !== 0) { + obj.newDestinationCaller = base64FromBytes(message.newDestinationCaller); + } + if (message.newMintRecipient.length !== 0) { + obj.newMintRecipient = base64FromBytes(message.newMintRecipient); + } + return obj; + }, + + create, I>>(base?: I): MsgReplaceDepositForBurn { + return MsgReplaceDepositForBurn.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgReplaceDepositForBurn { + const message = createBaseMsgReplaceDepositForBurn(); + message.from = object.from ?? ""; + message.originalMessage = object.originalMessage ?? new Uint8Array(0); + message.originalAttestation = object.originalAttestation ?? new Uint8Array(0); + message.newDestinationCaller = object.newDestinationCaller ?? new Uint8Array(0); + message.newMintRecipient = object.newMintRecipient ?? new Uint8Array(0); + return message; + }, +}; + +function createBaseMsgReplaceDepositForBurnResponse(): MsgReplaceDepositForBurnResponse { + return {}; +} + +export const MsgReplaceDepositForBurnResponse = { + encode(_: MsgReplaceDepositForBurnResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgReplaceDepositForBurnResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReplaceDepositForBurnResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgReplaceDepositForBurnResponse { + return {}; + }, + + toJSON(_: MsgReplaceDepositForBurnResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgReplaceDepositForBurnResponse { + return MsgReplaceDepositForBurnResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgReplaceDepositForBurnResponse { + const message = createBaseMsgReplaceDepositForBurnResponse(); + return message; + }, +}; + +function createBaseMsgReceiveMessage(): MsgReceiveMessage { + return { from: "", message: new Uint8Array(0), attestation: new Uint8Array(0) }; +} + +export const MsgReceiveMessage = { + encode(message: MsgReceiveMessage, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.message.length !== 0) { + writer.uint32(18).bytes(message.message); + } + if (message.attestation.length !== 0) { + writer.uint32(26).bytes(message.attestation); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgReceiveMessage { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReceiveMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.message = reader.bytes(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.attestation = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgReceiveMessage { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + message: isSet(object.message) ? bytesFromBase64(object.message) : new Uint8Array(0), + attestation: isSet(object.attestation) ? bytesFromBase64(object.attestation) : new Uint8Array(0), + }; + }, + + toJSON(message: MsgReceiveMessage): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.message.length !== 0) { + obj.message = base64FromBytes(message.message); + } + if (message.attestation.length !== 0) { + obj.attestation = base64FromBytes(message.attestation); + } + return obj; + }, + + create, I>>(base?: I): MsgReceiveMessage { + return MsgReceiveMessage.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgReceiveMessage { + const message = createBaseMsgReceiveMessage(); + message.from = object.from ?? ""; + message.message = object.message ?? new Uint8Array(0); + message.attestation = object.attestation ?? new Uint8Array(0); + return message; + }, +}; + +function createBaseMsgReceiveMessageResponse(): MsgReceiveMessageResponse { + return { success: false }; +} + +export const MsgReceiveMessageResponse = { + encode(message: MsgReceiveMessageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgReceiveMessageResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReceiveMessageResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.success = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgReceiveMessageResponse { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + + toJSON(message: MsgReceiveMessageResponse): unknown { + const obj: any = {}; + if (message.success === true) { + obj.success = message.success; + } + return obj; + }, + + create, I>>(base?: I): MsgReceiveMessageResponse { + return MsgReceiveMessageResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgReceiveMessageResponse { + const message = createBaseMsgReceiveMessageResponse(); + message.success = object.success ?? false; + return message; + }, +}; + +function createBaseMsgSendMessage(): MsgSendMessage { + return { from: "", destinationDomain: 0, recipient: new Uint8Array(0), messageBody: new Uint8Array(0) }; +} + +export const MsgSendMessage = { + encode(message: MsgSendMessage, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.destinationDomain !== 0) { + writer.uint32(16).uint32(message.destinationDomain); + } + if (message.recipient.length !== 0) { + writer.uint32(26).bytes(message.recipient); + } + if (message.messageBody.length !== 0) { + writer.uint32(34).bytes(message.messageBody); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendMessage { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.destinationDomain = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.recipient = reader.bytes(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.messageBody = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgSendMessage { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + destinationDomain: isSet(object.destinationDomain) ? globalThis.Number(object.destinationDomain) : 0, + recipient: isSet(object.recipient) ? bytesFromBase64(object.recipient) : new Uint8Array(0), + messageBody: isSet(object.messageBody) ? bytesFromBase64(object.messageBody) : new Uint8Array(0), + }; + }, + + toJSON(message: MsgSendMessage): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.destinationDomain !== 0) { + obj.destinationDomain = Math.round(message.destinationDomain); + } + if (message.recipient.length !== 0) { + obj.recipient = base64FromBytes(message.recipient); + } + if (message.messageBody.length !== 0) { + obj.messageBody = base64FromBytes(message.messageBody); + } + return obj; + }, + + create, I>>(base?: I): MsgSendMessage { + return MsgSendMessage.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgSendMessage { + const message = createBaseMsgSendMessage(); + message.from = object.from ?? ""; + message.destinationDomain = object.destinationDomain ?? 0; + message.recipient = object.recipient ?? new Uint8Array(0); + message.messageBody = object.messageBody ?? new Uint8Array(0); + return message; + }, +}; + +function createBaseMsgSendMessageResponse(): MsgSendMessageResponse { + return { nonce: Long.UZERO }; +} + +export const MsgSendMessageResponse = { + encode(message: MsgSendMessageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.nonce.isZero()) { + writer.uint32(8).uint64(message.nonce); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendMessageResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendMessageResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.nonce = reader.uint64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgSendMessageResponse { + return { nonce: isSet(object.nonce) ? Long.fromValue(object.nonce) : Long.UZERO }; + }, + + toJSON(message: MsgSendMessageResponse): unknown { + const obj: any = {}; + if (!message.nonce.isZero()) { + obj.nonce = (message.nonce || Long.UZERO).toString(); + } + return obj; + }, + + create, I>>(base?: I): MsgSendMessageResponse { + return MsgSendMessageResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgSendMessageResponse { + const message = createBaseMsgSendMessageResponse(); + message.nonce = (object.nonce !== undefined && object.nonce !== null) ? Long.fromValue(object.nonce) : Long.UZERO; + return message; + }, +}; + +function createBaseMsgSendMessageWithCaller(): MsgSendMessageWithCaller { + return { + from: "", + destinationDomain: 0, + recipient: new Uint8Array(0), + messageBody: new Uint8Array(0), + destinationCaller: new Uint8Array(0), + }; +} + +export const MsgSendMessageWithCaller = { + encode(message: MsgSendMessageWithCaller, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.destinationDomain !== 0) { + writer.uint32(16).uint32(message.destinationDomain); + } + if (message.recipient.length !== 0) { + writer.uint32(26).bytes(message.recipient); + } + if (message.messageBody.length !== 0) { + writer.uint32(34).bytes(message.messageBody); + } + if (message.destinationCaller.length !== 0) { + writer.uint32(42).bytes(message.destinationCaller); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendMessageWithCaller { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendMessageWithCaller(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.destinationDomain = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.recipient = reader.bytes(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.messageBody = reader.bytes(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.destinationCaller = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgSendMessageWithCaller { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + destinationDomain: isSet(object.destinationDomain) ? globalThis.Number(object.destinationDomain) : 0, + recipient: isSet(object.recipient) ? bytesFromBase64(object.recipient) : new Uint8Array(0), + messageBody: isSet(object.messageBody) ? bytesFromBase64(object.messageBody) : new Uint8Array(0), + destinationCaller: isSet(object.destinationCaller) + ? bytesFromBase64(object.destinationCaller) + : new Uint8Array(0), + }; + }, + + toJSON(message: MsgSendMessageWithCaller): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.destinationDomain !== 0) { + obj.destinationDomain = Math.round(message.destinationDomain); + } + if (message.recipient.length !== 0) { + obj.recipient = base64FromBytes(message.recipient); + } + if (message.messageBody.length !== 0) { + obj.messageBody = base64FromBytes(message.messageBody); + } + if (message.destinationCaller.length !== 0) { + obj.destinationCaller = base64FromBytes(message.destinationCaller); + } + return obj; + }, + + create, I>>(base?: I): MsgSendMessageWithCaller { + return MsgSendMessageWithCaller.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgSendMessageWithCaller { + const message = createBaseMsgSendMessageWithCaller(); + message.from = object.from ?? ""; + message.destinationDomain = object.destinationDomain ?? 0; + message.recipient = object.recipient ?? new Uint8Array(0); + message.messageBody = object.messageBody ?? new Uint8Array(0); + message.destinationCaller = object.destinationCaller ?? new Uint8Array(0); + return message; + }, +}; + +function createBaseMsgSendMessageWithCallerResponse(): MsgSendMessageWithCallerResponse { + return { nonce: Long.UZERO }; +} + +export const MsgSendMessageWithCallerResponse = { + encode(message: MsgSendMessageWithCallerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.nonce.isZero()) { + writer.uint32(8).uint64(message.nonce); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendMessageWithCallerResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendMessageWithCallerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.nonce = reader.uint64() as Long; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgSendMessageWithCallerResponse { + return { nonce: isSet(object.nonce) ? Long.fromValue(object.nonce) : Long.UZERO }; + }, + + toJSON(message: MsgSendMessageWithCallerResponse): unknown { + const obj: any = {}; + if (!message.nonce.isZero()) { + obj.nonce = (message.nonce || Long.UZERO).toString(); + } + return obj; + }, + + create, I>>( + base?: I, + ): MsgSendMessageWithCallerResponse { + return MsgSendMessageWithCallerResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgSendMessageWithCallerResponse { + const message = createBaseMsgSendMessageWithCallerResponse(); + message.nonce = (object.nonce !== undefined && object.nonce !== null) ? Long.fromValue(object.nonce) : Long.UZERO; + return message; + }, +}; + +function createBaseMsgReplaceMessage(): MsgReplaceMessage { + return { + from: "", + originalMessage: new Uint8Array(0), + originalAttestation: new Uint8Array(0), + newMessageBody: new Uint8Array(0), + newDestinationCaller: new Uint8Array(0), + }; +} + +export const MsgReplaceMessage = { + encode(message: MsgReplaceMessage, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.originalMessage.length !== 0) { + writer.uint32(18).bytes(message.originalMessage); + } + if (message.originalAttestation.length !== 0) { + writer.uint32(26).bytes(message.originalAttestation); + } + if (message.newMessageBody.length !== 0) { + writer.uint32(34).bytes(message.newMessageBody); + } + if (message.newDestinationCaller.length !== 0) { + writer.uint32(42).bytes(message.newDestinationCaller); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgReplaceMessage { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReplaceMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.originalMessage = reader.bytes(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.originalAttestation = reader.bytes(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.newMessageBody = reader.bytes(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.newDestinationCaller = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgReplaceMessage { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + originalMessage: isSet(object.originalMessage) ? bytesFromBase64(object.originalMessage) : new Uint8Array(0), + originalAttestation: isSet(object.originalAttestation) + ? bytesFromBase64(object.originalAttestation) + : new Uint8Array(0), + newMessageBody: isSet(object.newMessageBody) ? bytesFromBase64(object.newMessageBody) : new Uint8Array(0), + newDestinationCaller: isSet(object.newDestinationCaller) + ? bytesFromBase64(object.newDestinationCaller) + : new Uint8Array(0), + }; + }, + + toJSON(message: MsgReplaceMessage): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.originalMessage.length !== 0) { + obj.originalMessage = base64FromBytes(message.originalMessage); + } + if (message.originalAttestation.length !== 0) { + obj.originalAttestation = base64FromBytes(message.originalAttestation); + } + if (message.newMessageBody.length !== 0) { + obj.newMessageBody = base64FromBytes(message.newMessageBody); + } + if (message.newDestinationCaller.length !== 0) { + obj.newDestinationCaller = base64FromBytes(message.newDestinationCaller); + } + return obj; + }, + + create, I>>(base?: I): MsgReplaceMessage { + return MsgReplaceMessage.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgReplaceMessage { + const message = createBaseMsgReplaceMessage(); + message.from = object.from ?? ""; + message.originalMessage = object.originalMessage ?? new Uint8Array(0); + message.originalAttestation = object.originalAttestation ?? new Uint8Array(0); + message.newMessageBody = object.newMessageBody ?? new Uint8Array(0); + message.newDestinationCaller = object.newDestinationCaller ?? new Uint8Array(0); + return message; + }, +}; + +function createBaseMsgReplaceMessageResponse(): MsgReplaceMessageResponse { + return {}; +} + +export const MsgReplaceMessageResponse = { + encode(_: MsgReplaceMessageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgReplaceMessageResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReplaceMessageResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgReplaceMessageResponse { + return {}; + }, + + toJSON(_: MsgReplaceMessageResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): MsgReplaceMessageResponse { + return MsgReplaceMessageResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): MsgReplaceMessageResponse { + const message = createBaseMsgReplaceMessageResponse(); + return message; + }, +}; + +function createBaseMsgUpdateSignatureThreshold(): MsgUpdateSignatureThreshold { + return { from: "", amount: 0 }; +} + +export const MsgUpdateSignatureThreshold = { + encode(message: MsgUpdateSignatureThreshold, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.amount !== 0) { + writer.uint32(16).uint32(message.amount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateSignatureThreshold { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateSignatureThreshold(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.amount = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUpdateSignatureThreshold { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + amount: isSet(object.amount) ? globalThis.Number(object.amount) : 0, + }; + }, + + toJSON(message: MsgUpdateSignatureThreshold): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.amount !== 0) { + obj.amount = Math.round(message.amount); + } + return obj; + }, + + create, I>>(base?: I): MsgUpdateSignatureThreshold { + return MsgUpdateSignatureThreshold.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgUpdateSignatureThreshold { + const message = createBaseMsgUpdateSignatureThreshold(); + message.from = object.from ?? ""; + message.amount = object.amount ?? 0; + return message; + }, +}; + +function createBaseMsgUpdateSignatureThresholdResponse(): MsgUpdateSignatureThresholdResponse { + return {}; +} + +export const MsgUpdateSignatureThresholdResponse = { + encode(_: MsgUpdateSignatureThresholdResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateSignatureThresholdResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateSignatureThresholdResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUpdateSignatureThresholdResponse { + return {}; + }, + + toJSON(_: MsgUpdateSignatureThresholdResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgUpdateSignatureThresholdResponse { + return MsgUpdateSignatureThresholdResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgUpdateSignatureThresholdResponse { + const message = createBaseMsgUpdateSignatureThresholdResponse(); + return message; + }, +}; + +function createBaseMsgLinkTokenPair(): MsgLinkTokenPair { + return { from: "", remoteDomain: 0, remoteToken: new Uint8Array(0), localToken: "" }; +} + +export const MsgLinkTokenPair = { + encode(message: MsgLinkTokenPair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.remoteDomain !== 0) { + writer.uint32(16).uint32(message.remoteDomain); + } + if (message.remoteToken.length !== 0) { + writer.uint32(26).bytes(message.remoteToken); + } + if (message.localToken !== "") { + writer.uint32(34).string(message.localToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgLinkTokenPair { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLinkTokenPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.remoteDomain = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.remoteToken = reader.bytes(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.localToken = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgLinkTokenPair { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + remoteDomain: isSet(object.remoteDomain) ? globalThis.Number(object.remoteDomain) : 0, + remoteToken: isSet(object.remoteToken) ? bytesFromBase64(object.remoteToken) : new Uint8Array(0), + localToken: isSet(object.localToken) ? globalThis.String(object.localToken) : "", + }; + }, + + toJSON(message: MsgLinkTokenPair): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.remoteDomain !== 0) { + obj.remoteDomain = Math.round(message.remoteDomain); + } + if (message.remoteToken.length !== 0) { + obj.remoteToken = base64FromBytes(message.remoteToken); + } + if (message.localToken !== "") { + obj.localToken = message.localToken; + } + return obj; + }, + + create, I>>(base?: I): MsgLinkTokenPair { + return MsgLinkTokenPair.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgLinkTokenPair { + const message = createBaseMsgLinkTokenPair(); + message.from = object.from ?? ""; + message.remoteDomain = object.remoteDomain ?? 0; + message.remoteToken = object.remoteToken ?? new Uint8Array(0); + message.localToken = object.localToken ?? ""; + return message; + }, +}; + +function createBaseMsgLinkTokenPairResponse(): MsgLinkTokenPairResponse { + return {}; +} + +export const MsgLinkTokenPairResponse = { + encode(_: MsgLinkTokenPairResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgLinkTokenPairResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLinkTokenPairResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgLinkTokenPairResponse { + return {}; + }, + + toJSON(_: MsgLinkTokenPairResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): MsgLinkTokenPairResponse { + return MsgLinkTokenPairResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): MsgLinkTokenPairResponse { + const message = createBaseMsgLinkTokenPairResponse(); + return message; + }, +}; + +function createBaseMsgUnlinkTokenPair(): MsgUnlinkTokenPair { + return { from: "", remoteDomain: 0, remoteToken: new Uint8Array(0), localToken: "" }; +} + +export const MsgUnlinkTokenPair = { + encode(message: MsgUnlinkTokenPair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.remoteDomain !== 0) { + writer.uint32(16).uint32(message.remoteDomain); + } + if (message.remoteToken.length !== 0) { + writer.uint32(26).bytes(message.remoteToken); + } + if (message.localToken !== "") { + writer.uint32(34).string(message.localToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnlinkTokenPair { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnlinkTokenPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.remoteDomain = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.remoteToken = reader.bytes(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.localToken = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgUnlinkTokenPair { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + remoteDomain: isSet(object.remoteDomain) ? globalThis.Number(object.remoteDomain) : 0, + remoteToken: isSet(object.remoteToken) ? bytesFromBase64(object.remoteToken) : new Uint8Array(0), + localToken: isSet(object.localToken) ? globalThis.String(object.localToken) : "", + }; + }, + + toJSON(message: MsgUnlinkTokenPair): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.remoteDomain !== 0) { + obj.remoteDomain = Math.round(message.remoteDomain); + } + if (message.remoteToken.length !== 0) { + obj.remoteToken = base64FromBytes(message.remoteToken); + } + if (message.localToken !== "") { + obj.localToken = message.localToken; + } + return obj; + }, + + create, I>>(base?: I): MsgUnlinkTokenPair { + return MsgUnlinkTokenPair.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgUnlinkTokenPair { + const message = createBaseMsgUnlinkTokenPair(); + message.from = object.from ?? ""; + message.remoteDomain = object.remoteDomain ?? 0; + message.remoteToken = object.remoteToken ?? new Uint8Array(0); + message.localToken = object.localToken ?? ""; + return message; + }, +}; + +function createBaseMsgUnlinkTokenPairResponse(): MsgUnlinkTokenPairResponse { + return {}; +} + +export const MsgUnlinkTokenPairResponse = { + encode(_: MsgUnlinkTokenPairResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnlinkTokenPairResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnlinkTokenPairResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgUnlinkTokenPairResponse { + return {}; + }, + + toJSON(_: MsgUnlinkTokenPairResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): MsgUnlinkTokenPairResponse { + return MsgUnlinkTokenPairResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): MsgUnlinkTokenPairResponse { + const message = createBaseMsgUnlinkTokenPairResponse(); + return message; + }, +}; + +function createBaseMsgAddRemoteTokenMessenger(): MsgAddRemoteTokenMessenger { + return { from: "", domainId: 0, address: new Uint8Array(0) }; +} + +export const MsgAddRemoteTokenMessenger = { + encode(message: MsgAddRemoteTokenMessenger, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.domainId !== 0) { + writer.uint32(16).uint32(message.domainId); + } + if (message.address.length !== 0) { + writer.uint32(26).bytes(message.address); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddRemoteTokenMessenger { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddRemoteTokenMessenger(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.domainId = reader.uint32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.address = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgAddRemoteTokenMessenger { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + domainId: isSet(object.domainId) ? globalThis.Number(object.domainId) : 0, + address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(0), + }; + }, + + toJSON(message: MsgAddRemoteTokenMessenger): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.domainId !== 0) { + obj.domainId = Math.round(message.domainId); + } + if (message.address.length !== 0) { + obj.address = base64FromBytes(message.address); + } + return obj; + }, + + create, I>>(base?: I): MsgAddRemoteTokenMessenger { + return MsgAddRemoteTokenMessenger.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MsgAddRemoteTokenMessenger { + const message = createBaseMsgAddRemoteTokenMessenger(); + message.from = object.from ?? ""; + message.domainId = object.domainId ?? 0; + message.address = object.address ?? new Uint8Array(0); + return message; + }, +}; + +function createBaseMsgAddRemoteTokenMessengerResponse(): MsgAddRemoteTokenMessengerResponse { + return {}; +} + +export const MsgAddRemoteTokenMessengerResponse = { + encode(_: MsgAddRemoteTokenMessengerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddRemoteTokenMessengerResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddRemoteTokenMessengerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgAddRemoteTokenMessengerResponse { + return {}; + }, + + toJSON(_: MsgAddRemoteTokenMessengerResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgAddRemoteTokenMessengerResponse { + return MsgAddRemoteTokenMessengerResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgAddRemoteTokenMessengerResponse { + const message = createBaseMsgAddRemoteTokenMessengerResponse(); + return message; + }, +}; + +function createBaseMsgRemoveRemoteTokenMessenger(): MsgRemoveRemoteTokenMessenger { + return { from: "", domainId: 0 }; +} + +export const MsgRemoveRemoteTokenMessenger = { + encode(message: MsgRemoveRemoteTokenMessenger, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.domainId !== 0) { + writer.uint32(16).uint32(message.domainId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgRemoveRemoteTokenMessenger { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveRemoteTokenMessenger(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.from = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.domainId = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MsgRemoveRemoteTokenMessenger { + return { + from: isSet(object.from) ? globalThis.String(object.from) : "", + domainId: isSet(object.domainId) ? globalThis.Number(object.domainId) : 0, + }; + }, + + toJSON(message: MsgRemoveRemoteTokenMessenger): unknown { + const obj: any = {}; + if (message.from !== "") { + obj.from = message.from; + } + if (message.domainId !== 0) { + obj.domainId = Math.round(message.domainId); + } + return obj; + }, + + create, I>>(base?: I): MsgRemoveRemoteTokenMessenger { + return MsgRemoveRemoteTokenMessenger.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MsgRemoveRemoteTokenMessenger { + const message = createBaseMsgRemoveRemoteTokenMessenger(); + message.from = object.from ?? ""; + message.domainId = object.domainId ?? 0; + return message; + }, +}; + +function createBaseMsgRemoveRemoteTokenMessengerResponse(): MsgRemoveRemoteTokenMessengerResponse { + return {}; +} + +export const MsgRemoveRemoteTokenMessengerResponse = { + encode(_: MsgRemoveRemoteTokenMessengerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgRemoveRemoteTokenMessengerResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveRemoteTokenMessengerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): MsgRemoveRemoteTokenMessengerResponse { + return {}; + }, + + toJSON(_: MsgRemoveRemoteTokenMessengerResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): MsgRemoveRemoteTokenMessengerResponse { + return MsgRemoveRemoteTokenMessengerResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): MsgRemoveRemoteTokenMessengerResponse { + const message = createBaseMsgRemoveRemoteTokenMessengerResponse(); + return message; + }, +}; + +/** Msg defines the Msg service. */ +export interface Msg { + AcceptOwner(request: MsgAcceptOwner): Promise; + AddRemoteTokenMessenger(request: MsgAddRemoteTokenMessenger): Promise; + DepositForBurn(request: MsgDepositForBurn): Promise; + DepositForBurnWithCaller(request: MsgDepositForBurnWithCaller): Promise; + DisableAttester(request: MsgDisableAttester): Promise; + EnableAttester(request: MsgEnableAttester): Promise; + LinkTokenPair(request: MsgLinkTokenPair): Promise; + PauseBurningAndMinting(request: MsgPauseBurningAndMinting): Promise; + PauseSendingAndReceivingMessages( + request: MsgPauseSendingAndReceivingMessages, + ): Promise; + ReceiveMessage(request: MsgReceiveMessage): Promise; + RemoveRemoteTokenMessenger(request: MsgRemoveRemoteTokenMessenger): Promise; + ReplaceDepositForBurn(request: MsgReplaceDepositForBurn): Promise; + ReplaceMessage(request: MsgReplaceMessage): Promise; + SendMessage(request: MsgSendMessage): Promise; + SendMessageWithCaller(request: MsgSendMessageWithCaller): Promise; + UnlinkTokenPair(request: MsgUnlinkTokenPair): Promise; + UnpauseBurningAndMinting(request: MsgUnpauseBurningAndMinting): Promise; + UnpauseSendingAndReceivingMessages( + request: MsgUnpauseSendingAndReceivingMessages, + ): Promise; + UpdateOwner(request: MsgUpdateOwner): Promise; + UpdateAttesterManager(request: MsgUpdateAttesterManager): Promise; + UpdateTokenController(request: MsgUpdateTokenController): Promise; + UpdatePauser(request: MsgUpdatePauser): Promise; + UpdateMaxMessageBodySize(request: MsgUpdateMaxMessageBodySize): Promise; + SetMaxBurnAmountPerMessage(request: MsgSetMaxBurnAmountPerMessage): Promise; + UpdateSignatureThreshold(request: MsgUpdateSignatureThreshold): Promise; +} + +export const MsgServiceName = "circle.cctp.v1.Msg"; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || MsgServiceName; + this.rpc = rpc; + this.AcceptOwner = this.AcceptOwner.bind(this); + this.AddRemoteTokenMessenger = this.AddRemoteTokenMessenger.bind(this); + this.DepositForBurn = this.DepositForBurn.bind(this); + this.DepositForBurnWithCaller = this.DepositForBurnWithCaller.bind(this); + this.DisableAttester = this.DisableAttester.bind(this); + this.EnableAttester = this.EnableAttester.bind(this); + this.LinkTokenPair = this.LinkTokenPair.bind(this); + this.PauseBurningAndMinting = this.PauseBurningAndMinting.bind(this); + this.PauseSendingAndReceivingMessages = this.PauseSendingAndReceivingMessages.bind(this); + this.ReceiveMessage = this.ReceiveMessage.bind(this); + this.RemoveRemoteTokenMessenger = this.RemoveRemoteTokenMessenger.bind(this); + this.ReplaceDepositForBurn = this.ReplaceDepositForBurn.bind(this); + this.ReplaceMessage = this.ReplaceMessage.bind(this); + this.SendMessage = this.SendMessage.bind(this); + this.SendMessageWithCaller = this.SendMessageWithCaller.bind(this); + this.UnlinkTokenPair = this.UnlinkTokenPair.bind(this); + this.UnpauseBurningAndMinting = this.UnpauseBurningAndMinting.bind(this); + this.UnpauseSendingAndReceivingMessages = this.UnpauseSendingAndReceivingMessages.bind(this); + this.UpdateOwner = this.UpdateOwner.bind(this); + this.UpdateAttesterManager = this.UpdateAttesterManager.bind(this); + this.UpdateTokenController = this.UpdateTokenController.bind(this); + this.UpdatePauser = this.UpdatePauser.bind(this); + this.UpdateMaxMessageBodySize = this.UpdateMaxMessageBodySize.bind(this); + this.SetMaxBurnAmountPerMessage = this.SetMaxBurnAmountPerMessage.bind(this); + this.UpdateSignatureThreshold = this.UpdateSignatureThreshold.bind(this); + } + AcceptOwner(request: MsgAcceptOwner): Promise { + const data = MsgAcceptOwner.encode(request).finish(); + const promise = this.rpc.request(this.service, "AcceptOwner", data); + return promise.then((data) => MsgAcceptOwnerResponse.decode(_m0.Reader.create(data))); + } + + AddRemoteTokenMessenger(request: MsgAddRemoteTokenMessenger): Promise { + const data = MsgAddRemoteTokenMessenger.encode(request).finish(); + const promise = this.rpc.request(this.service, "AddRemoteTokenMessenger", data); + return promise.then((data) => MsgAddRemoteTokenMessengerResponse.decode(_m0.Reader.create(data))); + } + + DepositForBurn(request: MsgDepositForBurn): Promise { + const data = MsgDepositForBurn.encode(request).finish(); + const promise = this.rpc.request(this.service, "DepositForBurn", data); + return promise.then((data) => MsgDepositForBurnResponse.decode(_m0.Reader.create(data))); + } + + DepositForBurnWithCaller(request: MsgDepositForBurnWithCaller): Promise { + const data = MsgDepositForBurnWithCaller.encode(request).finish(); + const promise = this.rpc.request(this.service, "DepositForBurnWithCaller", data); + return promise.then((data) => MsgDepositForBurnWithCallerResponse.decode(_m0.Reader.create(data))); + } + + DisableAttester(request: MsgDisableAttester): Promise { + const data = MsgDisableAttester.encode(request).finish(); + const promise = this.rpc.request(this.service, "DisableAttester", data); + return promise.then((data) => MsgDisableAttesterResponse.decode(_m0.Reader.create(data))); + } + + EnableAttester(request: MsgEnableAttester): Promise { + const data = MsgEnableAttester.encode(request).finish(); + const promise = this.rpc.request(this.service, "EnableAttester", data); + return promise.then((data) => MsgEnableAttesterResponse.decode(_m0.Reader.create(data))); + } + + LinkTokenPair(request: MsgLinkTokenPair): Promise { + const data = MsgLinkTokenPair.encode(request).finish(); + const promise = this.rpc.request(this.service, "LinkTokenPair", data); + return promise.then((data) => MsgLinkTokenPairResponse.decode(_m0.Reader.create(data))); + } + + PauseBurningAndMinting(request: MsgPauseBurningAndMinting): Promise { + const data = MsgPauseBurningAndMinting.encode(request).finish(); + const promise = this.rpc.request(this.service, "PauseBurningAndMinting", data); + return promise.then((data) => MsgPauseBurningAndMintingResponse.decode(_m0.Reader.create(data))); + } + + PauseSendingAndReceivingMessages( + request: MsgPauseSendingAndReceivingMessages, + ): Promise { + const data = MsgPauseSendingAndReceivingMessages.encode(request).finish(); + const promise = this.rpc.request(this.service, "PauseSendingAndReceivingMessages", data); + return promise.then((data) => MsgPauseSendingAndReceivingMessagesResponse.decode(_m0.Reader.create(data))); + } + + ReceiveMessage(request: MsgReceiveMessage): Promise { + const data = MsgReceiveMessage.encode(request).finish(); + const promise = this.rpc.request(this.service, "ReceiveMessage", data); + return promise.then((data) => MsgReceiveMessageResponse.decode(_m0.Reader.create(data))); + } + + RemoveRemoteTokenMessenger(request: MsgRemoveRemoteTokenMessenger): Promise { + const data = MsgRemoveRemoteTokenMessenger.encode(request).finish(); + const promise = this.rpc.request(this.service, "RemoveRemoteTokenMessenger", data); + return promise.then((data) => MsgRemoveRemoteTokenMessengerResponse.decode(_m0.Reader.create(data))); + } + + ReplaceDepositForBurn(request: MsgReplaceDepositForBurn): Promise { + const data = MsgReplaceDepositForBurn.encode(request).finish(); + const promise = this.rpc.request(this.service, "ReplaceDepositForBurn", data); + return promise.then((data) => MsgReplaceDepositForBurnResponse.decode(_m0.Reader.create(data))); + } + + ReplaceMessage(request: MsgReplaceMessage): Promise { + const data = MsgReplaceMessage.encode(request).finish(); + const promise = this.rpc.request(this.service, "ReplaceMessage", data); + return promise.then((data) => MsgReplaceMessageResponse.decode(_m0.Reader.create(data))); + } + + SendMessage(request: MsgSendMessage): Promise { + const data = MsgSendMessage.encode(request).finish(); + const promise = this.rpc.request(this.service, "SendMessage", data); + return promise.then((data) => MsgSendMessageResponse.decode(_m0.Reader.create(data))); + } + + SendMessageWithCaller(request: MsgSendMessageWithCaller): Promise { + const data = MsgSendMessageWithCaller.encode(request).finish(); + const promise = this.rpc.request(this.service, "SendMessageWithCaller", data); + return promise.then((data) => MsgSendMessageWithCallerResponse.decode(_m0.Reader.create(data))); + } + + UnlinkTokenPair(request: MsgUnlinkTokenPair): Promise { + const data = MsgUnlinkTokenPair.encode(request).finish(); + const promise = this.rpc.request(this.service, "UnlinkTokenPair", data); + return promise.then((data) => MsgUnlinkTokenPairResponse.decode(_m0.Reader.create(data))); + } + + UnpauseBurningAndMinting(request: MsgUnpauseBurningAndMinting): Promise { + const data = MsgUnpauseBurningAndMinting.encode(request).finish(); + const promise = this.rpc.request(this.service, "UnpauseBurningAndMinting", data); + return promise.then((data) => MsgUnpauseBurningAndMintingResponse.decode(_m0.Reader.create(data))); + } + + UnpauseSendingAndReceivingMessages( + request: MsgUnpauseSendingAndReceivingMessages, + ): Promise { + const data = MsgUnpauseSendingAndReceivingMessages.encode(request).finish(); + const promise = this.rpc.request(this.service, "UnpauseSendingAndReceivingMessages", data); + return promise.then((data) => MsgUnpauseSendingAndReceivingMessagesResponse.decode(_m0.Reader.create(data))); + } + + UpdateOwner(request: MsgUpdateOwner): Promise { + const data = MsgUpdateOwner.encode(request).finish(); + const promise = this.rpc.request(this.service, "UpdateOwner", data); + return promise.then((data) => MsgUpdateOwnerResponse.decode(_m0.Reader.create(data))); + } + + UpdateAttesterManager(request: MsgUpdateAttesterManager): Promise { + const data = MsgUpdateAttesterManager.encode(request).finish(); + const promise = this.rpc.request(this.service, "UpdateAttesterManager", data); + return promise.then((data) => MsgUpdateAttesterManagerResponse.decode(_m0.Reader.create(data))); + } + + UpdateTokenController(request: MsgUpdateTokenController): Promise { + const data = MsgUpdateTokenController.encode(request).finish(); + const promise = this.rpc.request(this.service, "UpdateTokenController", data); + return promise.then((data) => MsgUpdateTokenControllerResponse.decode(_m0.Reader.create(data))); + } + + UpdatePauser(request: MsgUpdatePauser): Promise { + const data = MsgUpdatePauser.encode(request).finish(); + const promise = this.rpc.request(this.service, "UpdatePauser", data); + return promise.then((data) => MsgUpdatePauserResponse.decode(_m0.Reader.create(data))); + } + + UpdateMaxMessageBodySize(request: MsgUpdateMaxMessageBodySize): Promise { + const data = MsgUpdateMaxMessageBodySize.encode(request).finish(); + const promise = this.rpc.request(this.service, "UpdateMaxMessageBodySize", data); + return promise.then((data) => MsgUpdateMaxMessageBodySizeResponse.decode(_m0.Reader.create(data))); + } + + SetMaxBurnAmountPerMessage(request: MsgSetMaxBurnAmountPerMessage): Promise { + const data = MsgSetMaxBurnAmountPerMessage.encode(request).finish(); + const promise = this.rpc.request(this.service, "SetMaxBurnAmountPerMessage", data); + return promise.then((data) => MsgSetMaxBurnAmountPerMessageResponse.decode(_m0.Reader.create(data))); + } + + UpdateSignatureThreshold(request: MsgUpdateSignatureThreshold): Promise { + const data = MsgUpdateSignatureThreshold.encode(request).finish(); + const promise = this.rpc.request(this.service, "UpdateSignatureThreshold", data); + return promise.then((data) => MsgUpdateSignatureThresholdResponse.decode(_m0.Reader.create(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +function bytesFromBase64(b64: string): Uint8Array { + if (globalThis.Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if (globalThis.Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/examples/bridge-noble-to-eth/index.ts b/examples/bridge-noble-to-eth/index.ts new file mode 100644 index 0000000..ce07229 --- /dev/null +++ b/examples/bridge-noble-to-eth/index.ts @@ -0,0 +1,77 @@ +import {GeneratedType, Registry} from "@cosmjs/proto-signing"; + +require("dotenv").config(); +const { DirectSecp256k1HdWallet } = require("@cosmjs/proto-signing") +const { SigningStargateClient } = require("@cosmjs/stargate") +const { MsgDepositForBurn } = require("./generated/tx") + +export const cctpTypes: ReadonlyArray<[string, GeneratedType]> = [ + ["/circle.cctp.v1.MsgDepositForBurn", MsgDepositForBurn], +]; + +function createDefaultRegistry(): Registry { + return new Registry(cctpTypes) +}; + +const main = async() => { + + const mnemonic = process.env.MNEMONIC; + const wallet = await DirectSecp256k1HdWallet.fromMnemonic( + mnemonic, + { + prefix: "noble" + } + ); + + const [account] = await wallet.getAccounts(); + + console.log(account.address) + const client = await SigningStargateClient.connectWithSigner( + "https://rpc.testnet.noble.strange.love", + wallet, + { + registry: createDefaultRegistry() + } + ); + + // Left pad the mint recipient address with 0's to 32 bytes + const rawMintRecipient = process.env.ETH_MINT_RECIPIENT ? process.env.ETH_MINT_RECIPIENT : ""; + const cleanedMintRecipient = rawMintRecipient.replace(/^0x/, ''); + const zeroesNeeded = 64 - cleanedMintRecipient.length; + const mintRecipient = '0'.repeat(zeroesNeeded) + cleanedMintRecipient; + const buffer = Buffer.from(mintRecipient, "hex"); + const mintRecipientBytes = new Uint8Array(buffer); + + const msg = { + typeUrl: "/circle.cctp.v1.MsgDepositForBurn", + value: { + from: account.address, + amount: "1", + destinationDomain: 0, + mintRecipient: mintRecipientBytes, + burnToken: "uusdc" + } + } + + const fee = { + amount: [ + { + denom: "uusdc", + amount: "0", + }, + ], + gas: "200000", + }; + const memo = ""; + const result = await client.signAndBroadcast( + account.address, + [msg], + fee, + memo + ); + + console.log(`Burned on Noble, tx: https://mintscan.io/noble-testnet/tx/${result.transactionHash}`); + console.log(`Minting on Ethereum to https://sepolia.etherscan.io/address/${rawMintRecipient}`); +} + +main() \ No newline at end of file diff --git a/examples/bridge-noble-to-eth/package-lock.json b/examples/bridge-noble-to-eth/package-lock.json new file mode 100644 index 0000000..59128e3 --- /dev/null +++ b/examples/bridge-noble-to-eth/package-lock.json @@ -0,0 +1,879 @@ +{ + "name": "example", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "example", + "version": "1.0.0", + "dependencies": { + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/proto-signing": "^0.31.1", + "@cosmjs/stargate": "^0.31.1", + "dotenv": "^16.0.3", + "ts-node": "10.9.1" + }, + "devDependencies": { + "ts-proto": "^1.162.1" + } + }, + "node_modules/@confio/ics23": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz", + "integrity": "sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w==", + "dependencies": { + "@noble/hashes": "^1.0.0", + "protobufjs": "^6.8.8" + } + }, + "node_modules/@cosmjs/amino": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.31.1.tgz", + "integrity": "sha512-kkB9IAkNEUFtjp/uwHv95TgM8VGJ4VWfZwrTyLNqBDD1EpSX2dsNrmUe7k8OMPzKlZUFcKmD4iA0qGvIwzjbGA==", + "dependencies": { + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1" + } + }, + "node_modules/@cosmjs/crypto": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.31.1.tgz", + "integrity": "sha512-4R/SqdzdVzd4E5dpyEh1IKm5GbTqwDogutyIyyb1bcOXiX/x3CrvPI9Tb4WSIMDLvlb5TVzu2YnUV51Q1+6mMA==", + "dependencies": { + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers-sumo": "^0.7.11" + } + }, + "node_modules/@cosmjs/encoding": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.31.1.tgz", + "integrity": "sha512-IuxP6ewwX6vg9sUJ8ocJD92pkerI4lyG8J5ynAM3NaX3q+n+uMoPRSQXNeL9bnlrv01FF1kIm8if/f5F7ZPtkA==", + "dependencies": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "node_modules/@cosmjs/json-rpc": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.31.1.tgz", + "integrity": "sha512-gIkCj2mUDHAxvmJnHtybXtMLZDeXrkDZlujjzhvJlWsIuj1kpZbKtYqh+eNlfwhMkMMAlQa/y4422jDmizW+ng==", + "dependencies": { + "@cosmjs/stream": "^0.31.1", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/math": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.31.1.tgz", + "integrity": "sha512-kiuHV6m6DSB8/4UV1qpFhlc4ul8SgLXTGRlYkYiIIP4l0YNeJ+OpPYaOlEgx4Unk2mW3/O2FWYj7Jc93+BWXng==", + "dependencies": { + "bn.js": "^5.2.0" + } + }, + "node_modules/@cosmjs/proto-signing": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.31.1.tgz", + "integrity": "sha512-hipbBVrssPu+jnmRzQRP5hhS/mbz2nU7RvxG/B1ZcdNhr1AtZC5DN09OTUoEpMSRgyQvScXmk/NTbyf+xmCgYg==", + "dependencies": { + "@cosmjs/amino": "^0.31.1", + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "cosmjs-types": "^0.8.0", + "long": "^4.0.0" + } + }, + "node_modules/@cosmjs/socket": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.31.1.tgz", + "integrity": "sha512-XTtEr+x3WGbqkzoGX0sCkwVqf5n+bBqDwqNgb+DWaBABQxHVRuuainrTVp0Yc91D3Iy2twLQzeBA9OrRxDSerw==", + "dependencies": { + "@cosmjs/stream": "^0.31.1", + "isomorphic-ws": "^4.0.1", + "ws": "^7", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/stargate": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.31.1.tgz", + "integrity": "sha512-TqOJZYOH5W3sZIjR6949GfjhGXO3kSHQ3/KmE+SuKyMMmQ5fFZ45beawiRtVF0/CJg5RyPFyFGJKhb1Xxv3Lcg==", + "dependencies": { + "@confio/ics23": "^0.6.8", + "@cosmjs/amino": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/proto-signing": "^0.31.1", + "@cosmjs/stream": "^0.31.1", + "@cosmjs/tendermint-rpc": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "cosmjs-types": "^0.8.0", + "long": "^4.0.0", + "protobufjs": "~6.11.3", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/stream": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.31.1.tgz", + "integrity": "sha512-xsIGD9bpBvYYZASajCyOevh1H5pDdbOWmvb4UwGZ78doGVz3IC3Kb9BZKJHIX2fjq9CMdGVJHmlM+Zp5aM8yZA==", + "dependencies": { + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/tendermint-rpc": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.31.1.tgz", + "integrity": "sha512-KX+wwi725sSePqIxfMPPOqg+xTETV8BHGOBhRhCZXEl5Fq48UlXXq3/yG1sn7K67ADC0kqHqcCF41Wn1GxNNPA==", + "dependencies": { + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/json-rpc": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/socket": "^0.31.1", + "@cosmjs/stream": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "axios": "^0.21.2", + "readonly-date": "^1.0.0", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/utils": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.31.1.tgz", + "integrity": "sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA==" + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==" + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + }, + "node_modules/@types/node": { + "version": "20.8.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.4.tgz", + "integrity": "sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==", + "dependencies": { + "undici-types": "~5.25.1" + } + }, + "node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" + }, + "node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" + }, + "node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + }, + "node_modules/case-anything": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz", + "integrity": "sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==", + "dev": true, + "engines": { + "node": ">=12.13" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, + "node_modules/cosmjs-types": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.8.0.tgz", + "integrity": "sha512-Q2Mj95Fl0PYMWEhA2LuGEIhipF7mQwd9gTQ85DdP9jjjopeoGaDxvmPa5nakNzsq7FnO1DMTatXTAx6bxMH7Lg==", + "dependencies": { + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + }, + "node_modules/define-data-property": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", + "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, + "node_modules/dprint-node": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/dprint-node/-/dprint-node-1.0.8.tgz", + "integrity": "sha512-iVKnUtYfGrYcW1ZAlfR/F59cUVL8QIhWoBJoSjkkdua/dkWIgjZfiLMeTjiB06X0ZLkQ0M2C1VbUj/CxkIf1zg==", + "dev": true, + "dependencies": { + "detect-libc": "^1.0.3" + } + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/follow-redirects": { + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/libsodium-sumo": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/libsodium-sumo/-/libsodium-sumo-0.7.13.tgz", + "integrity": "sha512-zTGdLu4b9zSNLfovImpBCbdAA4xkpkZbMnSQjP8HShyOutnGjRHmSOKlsylh1okao6QhLiz7nG98EGn+04cZjQ==" + }, + "node_modules/libsodium-wrappers-sumo": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.13.tgz", + "integrity": "sha512-lz4YdplzDRh6AhnLGF2Dj2IUj94xRN6Bh8T0HLNwzYGwPehQJX6c7iYVrFUPZ3QqxE0bqC+K0IIqqZJYWumwSQ==", + "dependencies": { + "libsodium-sumo": "^0.7.13" + } + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/readonly-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz", + "integrity": "sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ==" + }, + "node_modules/symbol-observable": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz", + "integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-poet": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-6.6.0.tgz", + "integrity": "sha512-4vEH/wkhcjRPFOdBwIh9ItO6jOoumVLRF4aABDX5JSNEubSqwOulihxQPqai+OkuygJm3WYMInxXQX4QwVNMuw==", + "dev": true, + "dependencies": { + "dprint-node": "^1.0.7" + } + }, + "node_modules/ts-proto": { + "version": "1.162.1", + "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.162.1.tgz", + "integrity": "sha512-pzg5AKS04Nju6MNR2OSoQKszo5Q8FkB1SOrCvspCuIiAMDa0mJj4m5V99DFjdoyek+lx/U1x/ox/p99tOztKvg==", + "dev": true, + "dependencies": { + "case-anything": "^2.1.13", + "protobufjs": "^7.2.4", + "ts-poet": "^6.5.0", + "ts-proto-descriptors": "1.15.0" + }, + "bin": { + "protoc-gen-ts_proto": "protoc-gen-ts_proto" + } + }, + "node_modules/ts-proto-descriptors": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.15.0.tgz", + "integrity": "sha512-TYyJ7+H+7Jsqawdv+mfsEpZPTIj9siDHS6EMCzG/z3b/PZiphsX+mWtqFfFVe5/N0Th6V3elK9lQqjnrgTOfrg==", + "dev": true, + "dependencies": { + "long": "^5.2.3", + "protobufjs": "^7.2.4" + } + }, + "node_modules/ts-proto-descriptors/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "dev": true + }, + "node_modules/ts-proto-descriptors/node_modules/protobufjs": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz", + "integrity": "sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/ts-proto/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "dev": true + }, + "node_modules/ts-proto/node_modules/protobufjs": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz", + "integrity": "sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.25.3", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", + "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==" + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" + }, + "node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xstream": { + "version": "11.14.0", + "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", + "integrity": "sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw==", + "dependencies": { + "globalthis": "^1.0.1", + "symbol-observable": "^2.0.3" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "engines": { + "node": ">=6" + } + } + } +} diff --git a/examples/bridge-noble-to-eth/package.json b/examples/bridge-noble-to-eth/package.json new file mode 100644 index 0000000..6d1f178 --- /dev/null +++ b/examples/bridge-noble-to-eth/package.json @@ -0,0 +1,21 @@ +{ + "name": "example", + "version": "1.0.0", + "description": "CCTP Quickstart - Noble to ETH", + "main": "index.ts", + "scripts": { + "bridge-noble-to-eth": "ts-node index.ts", + "codegen": "ts-proto.sh" + }, + "author": "", + "dependencies": { + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/proto-signing": "^0.31.1", + "@cosmjs/stargate": "^0.31.1", + "dotenv": "^16.0.3", + "ts-node": "10.9.1" + }, + "devDependencies": { + "ts-proto": "^1.162.1" + } +}