@yellow-org/sdk 1.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +999 -0
- package/dist/abis/generated.d.ts +4300 -0
- package/dist/abis/generated.js +1 -0
- package/dist/app/index.d.ts +2 -0
- package/dist/app/index.js +2 -0
- package/dist/app/packing.d.ts +7 -0
- package/dist/app/packing.js +111 -0
- package/dist/app/types.d.ts +91 -0
- package/dist/app/types.js +42 -0
- package/dist/asset_store.d.ts +13 -0
- package/dist/asset_store.js +121 -0
- package/dist/blockchain/evm/channel_hub_abi.d.ts +4284 -0
- package/dist/blockchain/evm/channel_hub_abi.js +5475 -0
- package/dist/blockchain/evm/client.d.ts +46 -0
- package/dist/blockchain/evm/client.js +428 -0
- package/dist/blockchain/evm/erc20.d.ts +13 -0
- package/dist/blockchain/evm/erc20.js +54 -0
- package/dist/blockchain/evm/erc20_abi.d.ts +144 -0
- package/dist/blockchain/evm/erc20_abi.js +96 -0
- package/dist/blockchain/evm/index.d.ts +6 -0
- package/dist/blockchain/evm/index.js +6 -0
- package/dist/blockchain/evm/interface.d.ts +10 -0
- package/dist/blockchain/evm/interface.js +1 -0
- package/dist/blockchain/evm/types.d.ts +27 -0
- package/dist/blockchain/evm/types.js +1 -0
- package/dist/blockchain/evm/utils.d.ts +9 -0
- package/dist/blockchain/evm/utils.js +129 -0
- package/dist/blockchain/index.d.ts +1 -0
- package/dist/blockchain/index.js +1 -0
- package/dist/client.d.ts +99 -0
- package/dist/client.js +720 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.js +28 -0
- package/dist/core/event.d.ts +29 -0
- package/dist/core/event.js +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +6 -0
- package/dist/core/interface.d.ts +53 -0
- package/dist/core/interface.js +1 -0
- package/dist/core/state.d.ts +21 -0
- package/dist/core/state.js +267 -0
- package/dist/core/state_packer.d.ts +13 -0
- package/dist/core/state_packer.js +98 -0
- package/dist/core/types.d.ts +203 -0
- package/dist/core/types.js +220 -0
- package/dist/core/utils.d.ts +16 -0
- package/dist/core/utils.js +181 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/rpc/api.d.ts +181 -0
- package/dist/rpc/api.js +1 -0
- package/dist/rpc/client.d.ts +36 -0
- package/dist/rpc/client.js +102 -0
- package/dist/rpc/dialer.d.ts +30 -0
- package/dist/rpc/dialer.js +146 -0
- package/dist/rpc/error.d.ts +18 -0
- package/dist/rpc/error.js +27 -0
- package/dist/rpc/index.d.ts +7 -0
- package/dist/rpc/index.js +7 -0
- package/dist/rpc/message.d.ts +25 -0
- package/dist/rpc/message.js +102 -0
- package/dist/rpc/methods.d.ts +30 -0
- package/dist/rpc/methods.js +27 -0
- package/dist/rpc/types.d.ts +101 -0
- package/dist/rpc/types.js +1 -0
- package/dist/signers.d.ts +48 -0
- package/dist/signers.js +96 -0
- package/dist/utils/sign.d.ts +2 -0
- package/dist/utils/sign.js +8 -0
- package/dist/utils.d.ts +42 -0
- package/dist/utils.js +226 -0
- package/package.json +89 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const custodyAbi = [{ "type": "constructor", "inputs": [{ "name": "_defaultSigValidator", "type": "address", "internalType": "contract ISignatureValidator" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "DEFAULT_SIG_VALIDATOR", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "contract ISignatureValidator" }], "stateMutability": "view" }, { "type": "function", "name": "ESCROW_DEPOSIT_UNLOCK_DELAY", "inputs": [], "outputs": [{ "name": "", "type": "uint32", "internalType": "uint32" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_DEPOSIT_ESCROW_PURGE", "inputs": [], "outputs": [{ "name": "", "type": "uint32", "internalType": "uint32" }], "stateMutability": "view" }, { "type": "function", "name": "MIN_CHALLENGE_DURATION", "inputs": [], "outputs": [{ "name": "", "type": "uint32", "internalType": "uint32" }], "stateMutability": "view" }, { "type": "function", "name": "VERSION", "inputs": [], "outputs": [{ "name": "", "type": "uint8", "internalType": "uint8" }], "stateMutability": "view" }, { "type": "function", "name": "challengeChannel", "inputs": [{ "name": "channelId", "type": "bytes32", "internalType": "bytes32" }, { "name": "candidate", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }, { "name": "challengerSig", "type": "bytes", "internalType": "bytes" }, { "name": "challengerIdx", "type": "uint8", "internalType": "enum ParticipantIndex" }], "outputs": [], "stateMutability": "payable" }, { "type": "function", "name": "challengeEscrowDeposit", "inputs": [{ "name": "escrowId", "type": "bytes32", "internalType": "bytes32" }, { "name": "challengerSig", "type": "bytes", "internalType": "bytes" }, { "name": "challengerIdx", "type": "uint8", "internalType": "enum ParticipantIndex" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "challengeEscrowWithdrawal", "inputs": [{ "name": "escrowId", "type": "bytes32", "internalType": "bytes32" }, { "name": "challengerSig", "type": "bytes", "internalType": "bytes" }, { "name": "challengerIdx", "type": "uint8", "internalType": "enum ParticipantIndex" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "checkpointChannel", "inputs": [{ "name": "channelId", "type": "bytes32", "internalType": "bytes32" }, { "name": "candidate", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "payable" }, { "type": "function", "name": "closeChannel", "inputs": [{ "name": "channelId", "type": "bytes32", "internalType": "bytes32" }, { "name": "candidate", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "payable" }, { "type": "function", "name": "createChannel", "inputs": [{ "name": "def", "type": "tuple", "internalType": "struct ChannelDefinition", "components": [{ "name": "challengeDuration", "type": "uint32", "internalType": "uint32" }, { "name": "user", "type": "address", "internalType": "address" }, { "name": "node", "type": "address", "internalType": "address" }, { "name": "nonce", "type": "uint64", "internalType": "uint64" }, { "name": "approvedSignatureValidators", "type": "uint256", "internalType": "uint256" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }] }, { "name": "initState", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "payable" }, { "type": "function", "name": "depositToChannel", "inputs": [{ "name": "channelId", "type": "bytes32", "internalType": "bytes32" }, { "name": "candidate", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "payable" }, { "type": "function", "name": "depositToVault", "inputs": [{ "name": "node", "type": "address", "internalType": "address" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "payable" }, { "type": "function", "name": "escrowHead", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "finalizeEscrowDeposit", "inputs": [{ "name": "escrowId", "type": "bytes32", "internalType": "bytes32" }, { "name": "candidate", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "finalizeEscrowWithdrawal", "inputs": [{ "name": "escrowId", "type": "bytes32", "internalType": "bytes32" }, { "name": "candidate", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "finalizeMigration", "inputs": [{ "name": "channelId", "type": "bytes32", "internalType": "bytes32" }, { "name": "candidate", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "getAccountBalance", "inputs": [{ "name": "node", "type": "address", "internalType": "address" }, { "name": "token", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getChannelData", "inputs": [{ "name": "channelId", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "status", "type": "uint8", "internalType": "enum ChannelStatus" }, { "name": "definition", "type": "tuple", "internalType": "struct ChannelDefinition", "components": [{ "name": "challengeDuration", "type": "uint32", "internalType": "uint32" }, { "name": "user", "type": "address", "internalType": "address" }, { "name": "node", "type": "address", "internalType": "address" }, { "name": "nonce", "type": "uint64", "internalType": "uint64" }, { "name": "approvedSignatureValidators", "type": "uint256", "internalType": "uint256" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }] }, { "name": "lastState", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }, { "name": "challengeExpiry", "type": "uint256", "internalType": "uint256" }, { "name": "lockedFunds", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getChannelIds", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bytes32[]", "internalType": "bytes32[]" }], "stateMutability": "view" }, { "type": "function", "name": "getEscrowDepositData", "inputs": [{ "name": "escrowId", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "channelId", "type": "bytes32", "internalType": "bytes32" }, { "name": "status", "type": "uint8", "internalType": "enum EscrowStatus" }, { "name": "unlockAt", "type": "uint64", "internalType": "uint64" }, { "name": "challengeExpiry", "type": "uint64", "internalType": "uint64" }, { "name": "lockedAmount", "type": "uint256", "internalType": "uint256" }, { "name": "initState", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "stateMutability": "view" }, { "type": "function", "name": "getEscrowDepositIds", "inputs": [{ "name": "page", "type": "uint256", "internalType": "uint256" }, { "name": "pageSize", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "ids", "type": "bytes32[]", "internalType": "bytes32[]" }], "stateMutability": "view" }, { "type": "function", "name": "getEscrowWithdrawalData", "inputs": [{ "name": "escrowId", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "channelId", "type": "bytes32", "internalType": "bytes32" }, { "name": "status", "type": "uint8", "internalType": "enum EscrowStatus" }, { "name": "challengeExpiry", "type": "uint64", "internalType": "uint64" }, { "name": "lockedAmount", "type": "uint256", "internalType": "uint256" }, { "name": "initState", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "stateMutability": "view" }, { "type": "function", "name": "getNodeValidator", "inputs": [{ "name": "node", "type": "address", "internalType": "address" }, { "name": "validatorId", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "address", "internalType": "contract ISignatureValidator" }], "stateMutability": "view" }, { "type": "function", "name": "getOpenChannels", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "openChannels", "type": "bytes32[]", "internalType": "bytes32[]" }], "stateMutability": "view" }, { "type": "function", "name": "initiateEscrowDeposit", "inputs": [{ "name": "def", "type": "tuple", "internalType": "struct ChannelDefinition", "components": [{ "name": "challengeDuration", "type": "uint32", "internalType": "uint32" }, { "name": "user", "type": "address", "internalType": "address" }, { "name": "node", "type": "address", "internalType": "address" }, { "name": "nonce", "type": "uint64", "internalType": "uint64" }, { "name": "approvedSignatureValidators", "type": "uint256", "internalType": "uint256" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }] }, { "name": "candidate", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "payable" }, { "type": "function", "name": "initiateEscrowWithdrawal", "inputs": [{ "name": "def", "type": "tuple", "internalType": "struct ChannelDefinition", "components": [{ "name": "challengeDuration", "type": "uint32", "internalType": "uint32" }, { "name": "user", "type": "address", "internalType": "address" }, { "name": "node", "type": "address", "internalType": "address" }, { "name": "nonce", "type": "uint64", "internalType": "uint64" }, { "name": "approvedSignatureValidators", "type": "uint256", "internalType": "uint256" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }] }, { "name": "candidate", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "initiateMigration", "inputs": [{ "name": "def", "type": "tuple", "internalType": "struct ChannelDefinition", "components": [{ "name": "challengeDuration", "type": "uint32", "internalType": "uint32" }, { "name": "user", "type": "address", "internalType": "address" }, { "name": "node", "type": "address", "internalType": "address" }, { "name": "nonce", "type": "uint64", "internalType": "uint64" }, { "name": "approvedSignatureValidators", "type": "uint256", "internalType": "uint256" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }] }, { "name": "candidate", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "purgeEscrowDeposits", "inputs": [{ "name": "maxToPurge", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "registerNodeValidator", "inputs": [{ "name": "node", "type": "address", "internalType": "address" }, { "name": "validatorId", "type": "uint8", "internalType": "uint8" }, { "name": "validator", "type": "address", "internalType": "contract ISignatureValidator" }, { "name": "signature", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "withdrawFromChannel", "inputs": [{ "name": "channelId", "type": "bytes32", "internalType": "bytes32" }, { "name": "candidate", "type": "tuple", "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "payable" }, { "type": "function", "name": "withdrawFromVault", "inputs": [{ "name": "to", "type": "address", "internalType": "address" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "event", "name": "ChannelChallenged", "inputs": [{ "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "candidate", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }, { "name": "challengeExpireAt", "type": "uint64", "indexed": false, "internalType": "uint64" }], "anonymous": false }, { "type": "event", "name": "ChannelCheckpointed", "inputs": [{ "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "candidate", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "ChannelClosed", "inputs": [{ "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "finalState", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "ChannelCreated", "inputs": [{ "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "user", "type": "address", "indexed": true, "internalType": "address" }, { "name": "node", "type": "address", "indexed": true, "internalType": "address" }, { "name": "definition", "type": "tuple", "indexed": false, "internalType": "struct ChannelDefinition", "components": [{ "name": "challengeDuration", "type": "uint32", "internalType": "uint32" }, { "name": "user", "type": "address", "internalType": "address" }, { "name": "node", "type": "address", "internalType": "address" }, { "name": "nonce", "type": "uint64", "internalType": "uint64" }, { "name": "approvedSignatureValidators", "type": "uint256", "internalType": "uint256" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }] }, { "name": "initialState", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "ChannelDeposited", "inputs": [{ "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "candidate", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "ChannelWithdrawn", "inputs": [{ "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "candidate", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "Deposited", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "token", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "EscrowDepositChallenged", "inputs": [{ "name": "escrowId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }, { "name": "challengeExpireAt", "type": "uint64", "indexed": false, "internalType": "uint64" }], "anonymous": false }, { "type": "event", "name": "EscrowDepositFinalized", "inputs": [{ "name": "escrowId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "EscrowDepositFinalizedOnHome", "inputs": [{ "name": "escrowId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "EscrowDepositInitiated", "inputs": [{ "name": "escrowId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "EscrowDepositInitiatedOnHome", "inputs": [{ "name": "escrowId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "EscrowDepositsPurged", "inputs": [{ "name": "purgedCount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "EscrowWithdrawalChallenged", "inputs": [{ "name": "escrowId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }, { "name": "challengeExpireAt", "type": "uint64", "indexed": false, "internalType": "uint64" }], "anonymous": false }, { "type": "event", "name": "EscrowWithdrawalFinalized", "inputs": [{ "name": "escrowId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "EscrowWithdrawalFinalizedOnHome", "inputs": [{ "name": "escrowId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "EscrowWithdrawalInitiated", "inputs": [{ "name": "escrowId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "EscrowWithdrawalInitiatedOnHome", "inputs": [{ "name": "escrowId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "MigrationInFinalized", "inputs": [{ "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "MigrationInInitiated", "inputs": [{ "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "MigrationOutFinalized", "inputs": [{ "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "MigrationOutInitiated", "inputs": [{ "name": "channelId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "state", "type": "tuple", "indexed": false, "internalType": "struct State", "components": [{ "name": "version", "type": "uint64", "internalType": "uint64" }, { "name": "intent", "type": "uint8", "internalType": "enum StateIntent" }, { "name": "metadata", "type": "bytes32", "internalType": "bytes32" }, { "name": "homeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "nonHomeLedger", "type": "tuple", "internalType": "struct Ledger", "components": [{ "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "decimals", "type": "uint8", "internalType": "uint8" }, { "name": "userAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "userNetFlow", "type": "int256", "internalType": "int256" }, { "name": "nodeAllocation", "type": "uint256", "internalType": "uint256" }, { "name": "nodeNetFlow", "type": "int256", "internalType": "int256" }] }, { "name": "userSig", "type": "bytes", "internalType": "bytes" }, { "name": "nodeSig", "type": "bytes", "internalType": "bytes" }] }], "anonymous": false }, { "type": "event", "name": "ValidatorRegistered", "inputs": [{ "name": "node", "type": "address", "indexed": true, "internalType": "address" }, { "name": "validatorId", "type": "uint8", "indexed": true, "internalType": "uint8" }, { "name": "validator", "type": "address", "indexed": true, "internalType": "contract ISignatureValidator" }], "anonymous": false }, { "type": "event", "name": "Withdrawn", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "token", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "error", "name": "AddressCollision", "inputs": [{ "name": "collision", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "ChallengerVersionTooLow", "inputs": [] }, { "type": "error", "name": "ECDSAInvalidSignature", "inputs": [] }, { "type": "error", "name": "ECDSAInvalidSignatureLength", "inputs": [{ "name": "length", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "ECDSAInvalidSignatureS", "inputs": [{ "name": "s", "type": "bytes32", "internalType": "bytes32" }] }, { "type": "error", "name": "EmptySignature", "inputs": [] }, { "type": "error", "name": "IncorrectAmount", "inputs": [] }, { "type": "error", "name": "IncorrectChallengeDuration", "inputs": [] }, { "type": "error", "name": "IncorrectChannelStatus", "inputs": [] }, { "type": "error", "name": "IncorrectSignature", "inputs": [] }, { "type": "error", "name": "IncorrectStateIntent", "inputs": [] }, { "type": "error", "name": "IncorrectValue", "inputs": [] }, { "type": "error", "name": "InsufficientBalance", "inputs": [] }, { "type": "error", "name": "InvalidAddress", "inputs": [] }, { "type": "error", "name": "InvalidValidatorId", "inputs": [] }, { "type": "error", "name": "OnlyNonHomeEscrowsCanBeChallenged", "inputs": [] }, { "type": "error", "name": "ReentrancyGuardReentrantCall", "inputs": [] }, { "type": "error", "name": "SafeCastOverflowedIntToUint", "inputs": [{ "name": "value", "type": "int256", "internalType": "int256" }] }, { "type": "error", "name": "SafeERC20FailedOperation", "inputs": [{ "name": "token", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "TransferFailed", "inputs": [{ "name": "recepient", "type": "address", "internalType": "address" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "ValidatorAlreadyRegistered", "inputs": [{ "name": "node", "type": "address", "internalType": "address" }, { "name": "validatorId", "type": "uint8", "internalType": "uint8" }] }, { "type": "error", "name": "ValidatorNotApproved", "inputs": [] }, { "type": "error", "name": "ValidatorNotRegistered", "inputs": [{ "name": "node", "type": "address", "internalType": "address" }, { "name": "validatorId", "type": "uint8", "internalType": "uint8" }] }];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AppDefinitionV1, AppStateUpdateV1, AppSessionKeyStateV1, AppSessionVersionV1 } from './types';
|
|
2
|
+
export declare function packCreateAppSessionRequestV1(definition: AppDefinitionV1, sessionData: string): `0x${string}`;
|
|
3
|
+
export declare function packAppStateUpdateV1(stateUpdate: AppStateUpdateV1): `0x${string}`;
|
|
4
|
+
export declare function generateAppSessionIDV1(definition: AppDefinitionV1): `0x${string}`;
|
|
5
|
+
export declare function generateRebalanceBatchIDV1(sessionVersions: AppSessionVersionV1[]): `0x${string}`;
|
|
6
|
+
export declare function generateRebalanceTransactionIDV1(batchId: string, sessionId: string, asset: string): `0x${string}`;
|
|
7
|
+
export declare function packAppSessionKeyStateV1(state: AppSessionKeyStateV1): `0x${string}`;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { encodeAbiParameters, keccak256 } from 'viem';
|
|
2
|
+
export function packCreateAppSessionRequestV1(definition, sessionData) {
|
|
3
|
+
const participantComponents = [
|
|
4
|
+
{ name: 'walletAddress', type: 'address' },
|
|
5
|
+
{ name: 'signatureWeight', type: 'uint8' },
|
|
6
|
+
];
|
|
7
|
+
const participants = definition.participants.map((p) => ({
|
|
8
|
+
walletAddress: p.walletAddress,
|
|
9
|
+
signatureWeight: p.signatureWeight,
|
|
10
|
+
}));
|
|
11
|
+
const packed = encodeAbiParameters([
|
|
12
|
+
{ type: 'string' },
|
|
13
|
+
{ type: 'tuple[]', components: participantComponents },
|
|
14
|
+
{ type: 'uint8' },
|
|
15
|
+
{ type: 'uint64' },
|
|
16
|
+
{ type: 'string' },
|
|
17
|
+
], [
|
|
18
|
+
definition.application,
|
|
19
|
+
participants,
|
|
20
|
+
definition.quorum,
|
|
21
|
+
definition.nonce,
|
|
22
|
+
sessionData,
|
|
23
|
+
]);
|
|
24
|
+
return keccak256(packed);
|
|
25
|
+
}
|
|
26
|
+
export function packAppStateUpdateV1(stateUpdate) {
|
|
27
|
+
const allocationComponents = [
|
|
28
|
+
{ name: 'participant', type: 'address' },
|
|
29
|
+
{ name: 'asset', type: 'string' },
|
|
30
|
+
{ name: 'amount', type: 'string' },
|
|
31
|
+
];
|
|
32
|
+
const allocations = stateUpdate.allocations.map((a) => ({
|
|
33
|
+
participant: a.participant,
|
|
34
|
+
asset: a.asset,
|
|
35
|
+
amount: a.amount.toString(),
|
|
36
|
+
}));
|
|
37
|
+
const appSessionIdHash = stateUpdate.appSessionId;
|
|
38
|
+
const packed = encodeAbiParameters([
|
|
39
|
+
{ type: 'bytes32' },
|
|
40
|
+
{ type: 'uint8' },
|
|
41
|
+
{ type: 'uint64' },
|
|
42
|
+
{ type: 'tuple[]', components: allocationComponents },
|
|
43
|
+
{ type: 'string' },
|
|
44
|
+
], [
|
|
45
|
+
appSessionIdHash,
|
|
46
|
+
stateUpdate.intent,
|
|
47
|
+
stateUpdate.version,
|
|
48
|
+
allocations,
|
|
49
|
+
stateUpdate.sessionData,
|
|
50
|
+
]);
|
|
51
|
+
return keccak256(packed);
|
|
52
|
+
}
|
|
53
|
+
export function generateAppSessionIDV1(definition) {
|
|
54
|
+
const participantComponents = [
|
|
55
|
+
{ name: 'walletAddress', type: 'address' },
|
|
56
|
+
{ name: 'signatureWeight', type: 'uint8' },
|
|
57
|
+
];
|
|
58
|
+
const participants = definition.participants.map((p) => ({
|
|
59
|
+
walletAddress: p.walletAddress,
|
|
60
|
+
signatureWeight: p.signatureWeight,
|
|
61
|
+
}));
|
|
62
|
+
const packed = encodeAbiParameters([
|
|
63
|
+
{ type: 'string' },
|
|
64
|
+
{ type: 'tuple[]', components: participantComponents },
|
|
65
|
+
{ type: 'uint8' },
|
|
66
|
+
{ type: 'uint64' },
|
|
67
|
+
], [definition.application, participants, definition.quorum, definition.nonce]);
|
|
68
|
+
return keccak256(packed);
|
|
69
|
+
}
|
|
70
|
+
export function generateRebalanceBatchIDV1(sessionVersions) {
|
|
71
|
+
const sessionVersionComponents = [
|
|
72
|
+
{ name: 'sessionID', type: 'bytes32' },
|
|
73
|
+
{ name: 'version', type: 'uint64' },
|
|
74
|
+
];
|
|
75
|
+
const sessionVersionsArray = sessionVersions.map((sv) => ({
|
|
76
|
+
sessionID: sv.sessionId,
|
|
77
|
+
version: sv.version,
|
|
78
|
+
}));
|
|
79
|
+
const packed = encodeAbiParameters([
|
|
80
|
+
{ type: 'tuple[]', components: sessionVersionComponents },
|
|
81
|
+
], [sessionVersionsArray]);
|
|
82
|
+
return keccak256(packed);
|
|
83
|
+
}
|
|
84
|
+
export function generateRebalanceTransactionIDV1(batchId, sessionId, asset) {
|
|
85
|
+
const packed = encodeAbiParameters([
|
|
86
|
+
{ type: 'bytes32' },
|
|
87
|
+
{ type: 'bytes32' },
|
|
88
|
+
{ type: 'string' },
|
|
89
|
+
], [batchId, sessionId, asset]);
|
|
90
|
+
return keccak256(packed);
|
|
91
|
+
}
|
|
92
|
+
export function packAppSessionKeyStateV1(state) {
|
|
93
|
+
const applicationIDHashes = state.application_ids.map((id) => id);
|
|
94
|
+
const appSessionIDHashes = state.app_session_ids.map((id) => id);
|
|
95
|
+
const packed = encodeAbiParameters([
|
|
96
|
+
{ type: 'address' },
|
|
97
|
+
{ type: 'address' },
|
|
98
|
+
{ type: 'uint64' },
|
|
99
|
+
{ type: 'bytes32[]' },
|
|
100
|
+
{ type: 'bytes32[]' },
|
|
101
|
+
{ type: 'uint64' },
|
|
102
|
+
], [
|
|
103
|
+
state.user_address,
|
|
104
|
+
state.session_key,
|
|
105
|
+
BigInt(state.version),
|
|
106
|
+
applicationIDHashes,
|
|
107
|
+
appSessionIDHashes,
|
|
108
|
+
BigInt(state.expires_at),
|
|
109
|
+
]);
|
|
110
|
+
return keccak256(packed);
|
|
111
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import Decimal from 'decimal.js';
|
|
3
|
+
export declare enum AppStateUpdateIntent {
|
|
4
|
+
Operate = 0,
|
|
5
|
+
Deposit = 1,
|
|
6
|
+
Withdraw = 2,
|
|
7
|
+
Close = 3,
|
|
8
|
+
Rebalance = 4
|
|
9
|
+
}
|
|
10
|
+
export declare enum AppSessionStatus {
|
|
11
|
+
Void = 0,
|
|
12
|
+
Open = 1,
|
|
13
|
+
Closed = 2
|
|
14
|
+
}
|
|
15
|
+
export declare function appStateUpdateIntentToString(intent: AppStateUpdateIntent): string;
|
|
16
|
+
export declare function appSessionStatusToString(status: AppSessionStatus): string;
|
|
17
|
+
export interface AppSessionV1 {
|
|
18
|
+
sessionId: string;
|
|
19
|
+
application: string;
|
|
20
|
+
participants: AppParticipantV1[];
|
|
21
|
+
quorum: number;
|
|
22
|
+
nonce: bigint;
|
|
23
|
+
status: AppSessionStatus;
|
|
24
|
+
version: bigint;
|
|
25
|
+
sessionData: string;
|
|
26
|
+
createdAt: Date;
|
|
27
|
+
updatedAt: Date;
|
|
28
|
+
}
|
|
29
|
+
export interface AppParticipantV1 {
|
|
30
|
+
walletAddress: Address;
|
|
31
|
+
signatureWeight: number;
|
|
32
|
+
}
|
|
33
|
+
export interface AppDefinitionV1 {
|
|
34
|
+
application: string;
|
|
35
|
+
participants: AppParticipantV1[];
|
|
36
|
+
quorum: number;
|
|
37
|
+
nonce: bigint;
|
|
38
|
+
}
|
|
39
|
+
export interface AppSessionVersionV1 {
|
|
40
|
+
sessionId: string;
|
|
41
|
+
version: bigint;
|
|
42
|
+
}
|
|
43
|
+
export interface AppAllocationV1 {
|
|
44
|
+
participant: Address;
|
|
45
|
+
asset: string;
|
|
46
|
+
amount: Decimal;
|
|
47
|
+
}
|
|
48
|
+
export interface AppStateUpdateV1 {
|
|
49
|
+
appSessionId: string;
|
|
50
|
+
intent: AppStateUpdateIntent;
|
|
51
|
+
version: bigint;
|
|
52
|
+
allocations: AppAllocationV1[];
|
|
53
|
+
sessionData: string;
|
|
54
|
+
}
|
|
55
|
+
export interface SignedAppStateUpdateV1 {
|
|
56
|
+
appStateUpdate: AppStateUpdateV1;
|
|
57
|
+
quorumSigs: string[];
|
|
58
|
+
}
|
|
59
|
+
export interface AppSessionInfoV1 {
|
|
60
|
+
appSessionId: string;
|
|
61
|
+
isClosed: boolean;
|
|
62
|
+
participants: AppParticipantV1[];
|
|
63
|
+
sessionData: string;
|
|
64
|
+
quorum: number;
|
|
65
|
+
version: bigint;
|
|
66
|
+
nonce: bigint;
|
|
67
|
+
allocations: AppAllocationV1[];
|
|
68
|
+
}
|
|
69
|
+
export interface SessionKeyV1 {
|
|
70
|
+
id: bigint;
|
|
71
|
+
sessionKey: string;
|
|
72
|
+
application: string;
|
|
73
|
+
allowances: AssetAllowanceV1[];
|
|
74
|
+
scope?: string;
|
|
75
|
+
expiresAt: Date;
|
|
76
|
+
createdAt: Date;
|
|
77
|
+
}
|
|
78
|
+
export interface AppSessionKeyStateV1 {
|
|
79
|
+
user_address: string;
|
|
80
|
+
session_key: string;
|
|
81
|
+
version: string;
|
|
82
|
+
application_ids: string[];
|
|
83
|
+
app_session_ids: string[];
|
|
84
|
+
expires_at: string;
|
|
85
|
+
user_sig: string;
|
|
86
|
+
}
|
|
87
|
+
export interface AssetAllowanceV1 {
|
|
88
|
+
asset: string;
|
|
89
|
+
allowance: Decimal;
|
|
90
|
+
used: Decimal;
|
|
91
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export var AppStateUpdateIntent;
|
|
2
|
+
(function (AppStateUpdateIntent) {
|
|
3
|
+
AppStateUpdateIntent[AppStateUpdateIntent["Operate"] = 0] = "Operate";
|
|
4
|
+
AppStateUpdateIntent[AppStateUpdateIntent["Deposit"] = 1] = "Deposit";
|
|
5
|
+
AppStateUpdateIntent[AppStateUpdateIntent["Withdraw"] = 2] = "Withdraw";
|
|
6
|
+
AppStateUpdateIntent[AppStateUpdateIntent["Close"] = 3] = "Close";
|
|
7
|
+
AppStateUpdateIntent[AppStateUpdateIntent["Rebalance"] = 4] = "Rebalance";
|
|
8
|
+
})(AppStateUpdateIntent || (AppStateUpdateIntent = {}));
|
|
9
|
+
export var AppSessionStatus;
|
|
10
|
+
(function (AppSessionStatus) {
|
|
11
|
+
AppSessionStatus[AppSessionStatus["Void"] = 0] = "Void";
|
|
12
|
+
AppSessionStatus[AppSessionStatus["Open"] = 1] = "Open";
|
|
13
|
+
AppSessionStatus[AppSessionStatus["Closed"] = 2] = "Closed";
|
|
14
|
+
})(AppSessionStatus || (AppSessionStatus = {}));
|
|
15
|
+
export function appStateUpdateIntentToString(intent) {
|
|
16
|
+
switch (intent) {
|
|
17
|
+
case AppStateUpdateIntent.Operate:
|
|
18
|
+
return 'operate';
|
|
19
|
+
case AppStateUpdateIntent.Deposit:
|
|
20
|
+
return 'deposit';
|
|
21
|
+
case AppStateUpdateIntent.Withdraw:
|
|
22
|
+
return 'withdraw';
|
|
23
|
+
case AppStateUpdateIntent.Close:
|
|
24
|
+
return 'close';
|
|
25
|
+
case AppStateUpdateIntent.Rebalance:
|
|
26
|
+
return 'rebalance';
|
|
27
|
+
default:
|
|
28
|
+
return 'unknown';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function appSessionStatusToString(status) {
|
|
32
|
+
switch (status) {
|
|
33
|
+
case AppSessionStatus.Void:
|
|
34
|
+
return '';
|
|
35
|
+
case AppSessionStatus.Open:
|
|
36
|
+
return 'open';
|
|
37
|
+
case AppSessionStatus.Closed:
|
|
38
|
+
return 'closed';
|
|
39
|
+
default:
|
|
40
|
+
return 'unknown';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import * as core from './core/types';
|
|
3
|
+
export declare class ClientAssetStore {
|
|
4
|
+
private cache;
|
|
5
|
+
private getAssetsFn;
|
|
6
|
+
constructor(getAssetsFn: () => Promise<core.Asset[]>);
|
|
7
|
+
getAssetDecimals(asset: string): Promise<number>;
|
|
8
|
+
getTokenDecimals(blockchainId: bigint, tokenAddress: string): Promise<number>;
|
|
9
|
+
getTokenAddress(asset: string, blockchainId: bigint): Promise<Address>;
|
|
10
|
+
assetExistsOnBlockchain(blockchainId: bigint, asset: string): Promise<boolean>;
|
|
11
|
+
getSuggestedBlockchainId(asset: string): Promise<bigint>;
|
|
12
|
+
clearCache(): void;
|
|
13
|
+
}
|