@miradexio/client 0.1.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/LICENSE +21 -0
- package/README.md +405 -0
- package/dist/address/base58.d.ts +9 -0
- package/dist/address/base58.d.ts.map +1 -0
- package/dist/address/base58.js +33 -0
- package/dist/address/base58.js.map +1 -0
- package/dist/address/bech32.d.ts +13 -0
- package/dist/address/bech32.d.ts.map +1 -0
- package/dist/address/bech32.js +41 -0
- package/dist/address/bech32.js.map +1 -0
- package/dist/address/evm.d.ts +5 -0
- package/dist/address/evm.d.ts.map +1 -0
- package/dist/address/evm.js +27 -0
- package/dist/address/evm.js.map +1 -0
- package/dist/address/index.d.ts +15 -0
- package/dist/address/index.d.ts.map +1 -0
- package/dist/address/index.js +134 -0
- package/dist/address/index.js.map +1 -0
- package/dist/address/monero.d.ts +15 -0
- package/dist/address/monero.d.ts.map +1 -0
- package/dist/address/monero.js +30 -0
- package/dist/address/monero.js.map +1 -0
- package/dist/address/polkadot.d.ts +10 -0
- package/dist/address/polkadot.d.ts.map +1 -0
- package/dist/address/polkadot.js +36 -0
- package/dist/address/polkadot.js.map +1 -0
- package/dist/address/solana.d.ts +5 -0
- package/dist/address/solana.d.ts.map +1 -0
- package/dist/address/solana.js +17 -0
- package/dist/address/solana.js.map +1 -0
- package/dist/address/ton.d.ts +11 -0
- package/dist/address/ton.d.ts.map +1 -0
- package/dist/address/ton.js +28 -0
- package/dist/address/ton.js.map +1 -0
- package/dist/api/index.d.ts +80 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +213 -0
- package/dist/api/index.js.map +1 -0
- package/dist/atomic-swap/drive.d.ts +22 -0
- package/dist/atomic-swap/drive.d.ts.map +1 -0
- package/dist/atomic-swap/drive.js +713 -0
- package/dist/atomic-swap/drive.js.map +1 -0
- package/dist/atomic-swap/extract.d.ts +46 -0
- package/dist/atomic-swap/extract.d.ts.map +1 -0
- package/dist/atomic-swap/extract.js +55 -0
- package/dist/atomic-swap/extract.js.map +1 -0
- package/dist/atomic-swap/index.d.ts +15 -0
- package/dist/atomic-swap/index.d.ts.map +1 -0
- package/dist/atomic-swap/index.js +13 -0
- package/dist/atomic-swap/index.js.map +1 -0
- package/dist/atomic-swap/monero-sweep/errors.d.ts +2 -0
- package/dist/atomic-swap/monero-sweep/errors.d.ts.map +1 -0
- package/dist/atomic-swap/monero-sweep/errors.js +43 -0
- package/dist/atomic-swap/monero-sweep/errors.js.map +1 -0
- package/dist/atomic-swap/monero-sweep/index.d.ts +33 -0
- package/dist/atomic-swap/monero-sweep/index.d.ts.map +1 -0
- package/dist/atomic-swap/monero-sweep/index.js +415 -0
- package/dist/atomic-swap/monero-sweep/index.js.map +1 -0
- package/dist/atomic-swap/monero-sweep/ring-select.d.ts +12 -0
- package/dist/atomic-swap/monero-sweep/ring-select.d.ts.map +1 -0
- package/dist/atomic-swap/monero-sweep/ring-select.js +61 -0
- package/dist/atomic-swap/monero-sweep/ring-select.js.map +1 -0
- package/dist/atomic-swap/presign.d.ts +101 -0
- package/dist/atomic-swap/presign.d.ts.map +1 -0
- package/dist/atomic-swap/presign.js +460 -0
- package/dist/atomic-swap/presign.js.map +1 -0
- package/dist/atomic-swap/refund.d.ts +72 -0
- package/dist/atomic-swap/refund.d.ts.map +1 -0
- package/dist/atomic-swap/refund.js +224 -0
- package/dist/atomic-swap/refund.js.map +1 -0
- package/dist/atomic-swap/run.d.ts +27 -0
- package/dist/atomic-swap/run.d.ts.map +1 -0
- package/dist/atomic-swap/run.js +282 -0
- package/dist/atomic-swap/run.js.map +1 -0
- package/dist/atomic-swap/snapshot.d.ts +111 -0
- package/dist/atomic-swap/snapshot.d.ts.map +1 -0
- package/dist/atomic-swap/snapshot.js +69 -0
- package/dist/atomic-swap/snapshot.js.map +1 -0
- package/dist/atomic-swap/submit-encsig.d.ts +10 -0
- package/dist/atomic-swap/submit-encsig.d.ts.map +1 -0
- package/dist/atomic-swap/submit-encsig.js +56 -0
- package/dist/atomic-swap/submit-encsig.js.map +1 -0
- package/dist/atomic-swap/types.d.ts +168 -0
- package/dist/atomic-swap/types.d.ts.map +1 -0
- package/dist/atomic-swap/types.js +5 -0
- package/dist/atomic-swap/types.js.map +1 -0
- package/dist/blockchain/quorum-provider.d.ts +25 -0
- package/dist/blockchain/quorum-provider.d.ts.map +1 -0
- package/dist/blockchain/quorum-provider.js +144 -0
- package/dist/blockchain/quorum-provider.js.map +1 -0
- package/dist/cooperative-redeem.d.ts +23 -0
- package/dist/cooperative-redeem.d.ts.map +1 -0
- package/dist/cooperative-redeem.js +40 -0
- package/dist/cooperative-redeem.js.map +1 -0
- package/dist/engine/blockchain-querier.d.ts +34 -0
- package/dist/engine/blockchain-querier.d.ts.map +1 -0
- package/dist/engine/blockchain-querier.js +2 -0
- package/dist/engine/blockchain-querier.js.map +1 -0
- package/dist/engine/engine-state.d.ts +20 -0
- package/dist/engine/engine-state.d.ts.map +1 -0
- package/dist/engine/engine-state.js +9 -0
- package/dist/engine/engine-state.js.map +1 -0
- package/dist/engine/flow-context.d.ts +494 -0
- package/dist/engine/flow-context.d.ts.map +1 -0
- package/dist/engine/flow-context.js +147 -0
- package/dist/engine/flow-context.js.map +1 -0
- package/dist/engine/flows/atomic-flow-state.d.ts +124 -0
- package/dist/engine/flows/atomic-flow-state.d.ts.map +1 -0
- package/dist/engine/flows/atomic-flow-state.js +2 -0
- package/dist/engine/flows/atomic-flow-state.js.map +1 -0
- package/dist/engine/flows/atomic-flow.d.ts +88 -0
- package/dist/engine/flows/atomic-flow.d.ts.map +1 -0
- package/dist/engine/flows/atomic-flow.js +1192 -0
- package/dist/engine/flows/atomic-flow.js.map +1 -0
- package/dist/engine/flows/history-flow-state.d.ts +19 -0
- package/dist/engine/flows/history-flow-state.d.ts.map +1 -0
- package/dist/engine/flows/history-flow-state.js +2 -0
- package/dist/engine/flows/history-flow-state.js.map +1 -0
- package/dist/engine/flows/providers-flow-state.d.ts +14 -0
- package/dist/engine/flows/providers-flow-state.d.ts.map +1 -0
- package/dist/engine/flows/providers-flow-state.js +2 -0
- package/dist/engine/flows/providers-flow-state.js.map +1 -0
- package/dist/engine/flows/quote-flow-state.d.ts +20 -0
- package/dist/engine/flows/quote-flow-state.d.ts.map +1 -0
- package/dist/engine/flows/quote-flow-state.js +2 -0
- package/dist/engine/flows/quote-flow-state.js.map +1 -0
- package/dist/engine/flows/swap-flow-state.d.ts +155 -0
- package/dist/engine/flows/swap-flow-state.d.ts.map +1 -0
- package/dist/engine/flows/swap-flow-state.js +2 -0
- package/dist/engine/flows/swap-flow-state.js.map +1 -0
- package/dist/engine/flows/swap-flow.d.ts +81 -0
- package/dist/engine/flows/swap-flow.d.ts.map +1 -0
- package/dist/engine/flows/swap-flow.js +720 -0
- package/dist/engine/flows/swap-flow.js.map +1 -0
- package/dist/engine/flows/tokens-flow-state.d.ts +16 -0
- package/dist/engine/flows/tokens-flow-state.d.ts.map +1 -0
- package/dist/engine/flows/tokens-flow-state.js +2 -0
- package/dist/engine/flows/tokens-flow-state.js.map +1 -0
- package/dist/engine/miradex-engine.d.ts +152 -0
- package/dist/engine/miradex-engine.d.ts.map +1 -0
- package/dist/engine/miradex-engine.js +278 -0
- package/dist/engine/miradex-engine.js.map +1 -0
- package/dist/engine/pipeline.d.ts +27 -0
- package/dist/engine/pipeline.d.ts.map +1 -0
- package/dist/engine/pipeline.js +166 -0
- package/dist/engine/pipeline.js.map +1 -0
- package/dist/engine/platform.d.ts +220 -0
- package/dist/engine/platform.d.ts.map +1 -0
- package/dist/engine/platform.js +2 -0
- package/dist/engine/platform.js.map +1 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/blockchain.d.ts +33 -0
- package/dist/interfaces/blockchain.d.ts.map +1 -0
- package/dist/interfaces/blockchain.js +2 -0
- package/dist/interfaces/blockchain.js.map +1 -0
- package/dist/interfaces/logger.d.ts +14 -0
- package/dist/interfaces/logger.d.ts.map +1 -0
- package/dist/interfaces/logger.js +7 -0
- package/dist/interfaces/logger.js.map +1 -0
- package/dist/lib/bitcoin/deposit-watcher.d.ts +66 -0
- package/dist/lib/bitcoin/deposit-watcher.d.ts.map +1 -0
- package/dist/lib/bitcoin/deposit-watcher.js +218 -0
- package/dist/lib/bitcoin/deposit-watcher.js.map +1 -0
- package/dist/lib/bitcoin/script-hash.d.ts +8 -0
- package/dist/lib/bitcoin/script-hash.d.ts.map +1 -0
- package/dist/lib/bitcoin/script-hash.js +29 -0
- package/dist/lib/bitcoin/script-hash.js.map +1 -0
- package/dist/lib/bitcoin/sweep.d.ts +56 -0
- package/dist/lib/bitcoin/sweep.d.ts.map +1 -0
- package/dist/lib/bitcoin/sweep.js +185 -0
- package/dist/lib/bitcoin/sweep.js.map +1 -0
- package/dist/lib/bitcoin/tx-verify.d.ts +43 -0
- package/dist/lib/bitcoin/tx-verify.d.ts.map +1 -0
- package/dist/lib/bitcoin/tx-verify.js +202 -0
- package/dist/lib/bitcoin/tx-verify.js.map +1 -0
- package/dist/lib/bitcoin/wallet.d.ts +71 -0
- package/dist/lib/bitcoin/wallet.d.ts.map +1 -0
- package/dist/lib/bitcoin/wallet.js +141 -0
- package/dist/lib/bitcoin/wallet.js.map +1 -0
- package/dist/lib/crypto/bytes.d.ts +21 -0
- package/dist/lib/crypto/bytes.d.ts.map +1 -0
- package/dist/lib/crypto/bytes.js +39 -0
- package/dist/lib/crypto/bytes.js.map +1 -0
- package/dist/lib/crypto/errors.d.ts +12 -0
- package/dist/lib/crypto/errors.d.ts.map +1 -0
- package/dist/lib/crypto/errors.js +16 -0
- package/dist/lib/crypto/errors.js.map +1 -0
- package/dist/lib/crypto/keygen.d.ts +19 -0
- package/dist/lib/crypto/keygen.d.ts.map +1 -0
- package/dist/lib/crypto/keygen.js +24 -0
- package/dist/lib/crypto/keygen.js.map +1 -0
- package/dist/lib/crypto/libp2p-identity.d.ts +25 -0
- package/dist/lib/crypto/libp2p-identity.d.ts.map +1 -0
- package/dist/lib/crypto/libp2p-identity.js +80 -0
- package/dist/lib/crypto/libp2p-identity.js.map +1 -0
- package/dist/lib/crypto/mnemonic.d.ts +28 -0
- package/dist/lib/crypto/mnemonic.d.ts.map +1 -0
- package/dist/lib/crypto/mnemonic.js +97 -0
- package/dist/lib/crypto/mnemonic.js.map +1 -0
- package/dist/lib/crypto/platform.d.ts +10 -0
- package/dist/lib/crypto/platform.d.ts.map +1 -0
- package/dist/lib/crypto/platform.js +38 -0
- package/dist/lib/crypto/platform.js.map +1 -0
- package/dist/lib/crypto/scalars.d.ts +33 -0
- package/dist/lib/crypto/scalars.d.ts.map +1 -0
- package/dist/lib/crypto/scalars.js +81 -0
- package/dist/lib/crypto/scalars.js.map +1 -0
- package/dist/lib/crypto/types.d.ts +24 -0
- package/dist/lib/crypto/types.d.ts.map +1 -0
- package/dist/lib/crypto/types.js +2 -0
- package/dist/lib/crypto/types.js.map +1 -0
- package/dist/lib/crypto/wasm.d.ts +51 -0
- package/dist/lib/crypto/wasm.d.ts.map +1 -0
- package/dist/lib/crypto/wasm.js +192 -0
- package/dist/lib/crypto/wasm.js.map +1 -0
- package/dist/lib/default-config.d.ts +140 -0
- package/dist/lib/default-config.d.ts.map +1 -0
- package/dist/lib/default-config.js +239 -0
- package/dist/lib/default-config.js.map +1 -0
- package/dist/lib/delay.d.ts +6 -0
- package/dist/lib/delay.d.ts.map +1 -0
- package/dist/lib/delay.js +20 -0
- package/dist/lib/delay.js.map +1 -0
- package/dist/lib/errors.d.ts +90 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +129 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/format.d.ts +7 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +43 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/keystore.d.ts +85 -0
- package/dist/lib/keystore.d.ts.map +1 -0
- package/dist/lib/keystore.js +105 -0
- package/dist/lib/keystore.js.map +1 -0
- package/dist/lib/monero/output-scanner.d.ts +53 -0
- package/dist/lib/monero/output-scanner.d.ts.map +1 -0
- package/dist/lib/monero/output-scanner.js +180 -0
- package/dist/lib/monero/output-scanner.js.map +1 -0
- package/dist/lib/monero/rpc.d.ts +131 -0
- package/dist/lib/monero/rpc.d.ts.map +1 -0
- package/dist/lib/monero/rpc.js +267 -0
- package/dist/lib/monero/rpc.js.map +1 -0
- package/dist/lib/monero/verify-lock.d.ts +50 -0
- package/dist/lib/monero/verify-lock.d.ts.map +1 -0
- package/dist/lib/monero/verify-lock.js +161 -0
- package/dist/lib/monero/verify-lock.js.map +1 -0
- package/dist/lib/monero/verify-sweep.d.ts +59 -0
- package/dist/lib/monero/verify-sweep.d.ts.map +1 -0
- package/dist/lib/monero/verify-sweep.js +82 -0
- package/dist/lib/monero/verify-sweep.js.map +1 -0
- package/dist/lib/monero/wasm.d.ts +19 -0
- package/dist/lib/monero/wasm.d.ts.map +1 -0
- package/dist/lib/monero/wasm.js +24 -0
- package/dist/lib/monero/wasm.js.map +1 -0
- package/dist/lib/pow-solver.d.ts +4 -0
- package/dist/lib/pow-solver.d.ts.map +1 -0
- package/dist/lib/pow-solver.js +37 -0
- package/dist/lib/pow-solver.js.map +1 -0
- package/dist/lib/retry.d.ts +86 -0
- package/dist/lib/retry.d.ts.map +1 -0
- package/dist/lib/retry.js +104 -0
- package/dist/lib/retry.js.map +1 -0
- package/dist/portable.d.ts +23 -0
- package/dist/portable.d.ts.map +1 -0
- package/dist/portable.js +13 -0
- package/dist/portable.js.map +1 -0
- package/dist/quote-binding.d.ts +31 -0
- package/dist/quote-binding.d.ts.map +1 -0
- package/dist/quote-binding.js +40 -0
- package/dist/quote-binding.js.map +1 -0
- package/dist/swap-executor.d.ts +51 -0
- package/dist/swap-executor.d.ts.map +1 -0
- package/dist/swap-executor.js +138 -0
- package/dist/swap-executor.js.map +1 -0
- package/dist/types/api.d.ts +34 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +18 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/errors.d.ts +94 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +93 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +10 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/keys.d.ts +33 -0
- package/dist/types/keys.d.ts.map +1 -0
- package/dist/types/keys.js +2 -0
- package/dist/types/keys.js.map +1 -0
- package/dist/types/protocol.d.ts +93 -0
- package/dist/types/protocol.d.ts.map +1 -0
- package/dist/types/protocol.js +18 -0
- package/dist/types/protocol.js.map +1 -0
- package/dist/types/status.d.ts +3 -0
- package/dist/types/status.d.ts.map +1 -0
- package/dist/types/status.js +23 -0
- package/dist/types/status.js.map +1 -0
- package/dist/types/verification.d.ts +49 -0
- package/dist/types/verification.d.ts.map +1 -0
- package/dist/types/verification.js +34 -0
- package/dist/types/verification.js.map +1 -0
- package/dist/verification/atomic-swap.d.ts +9 -0
- package/dist/verification/atomic-swap.d.ts.map +1 -0
- package/dist/verification/atomic-swap.js +22 -0
- package/dist/verification/atomic-swap.js.map +1 -0
- package/dist/verification/chainflip-networks.d.ts +46 -0
- package/dist/verification/chainflip-networks.d.ts.map +1 -0
- package/dist/verification/chainflip-networks.js +24 -0
- package/dist/verification/chainflip-networks.js.map +1 -0
- package/dist/verification/chainflip.d.ts +61 -0
- package/dist/verification/chainflip.d.ts.map +1 -0
- package/dist/verification/chainflip.js +377 -0
- package/dist/verification/chainflip.js.map +1 -0
- package/dist/verification/constants.d.ts +52 -0
- package/dist/verification/constants.d.ts.map +1 -0
- package/dist/verification/constants.js +54 -0
- package/dist/verification/constants.js.map +1 -0
- package/dist/verification/index.d.ts +71 -0
- package/dist/verification/index.d.ts.map +1 -0
- package/dist/verification/index.js +91 -0
- package/dist/verification/index.js.map +1 -0
- package/dist/verification/memo.d.ts +27 -0
- package/dist/verification/memo.d.ts.map +1 -0
- package/dist/verification/memo.js +52 -0
- package/dist/verification/memo.js.map +1 -0
- package/dist/verification/near-intents.d.ts +91 -0
- package/dist/verification/near-intents.d.ts.map +1 -0
- package/dist/verification/near-intents.js +213 -0
- package/dist/verification/near-intents.js.map +1 -0
- package/dist/verification/rate-oracle.d.ts +32 -0
- package/dist/verification/rate-oracle.d.ts.map +1 -0
- package/dist/verification/rate-oracle.js +43 -0
- package/dist/verification/rate-oracle.js.map +1 -0
- package/dist/verification/shared.d.ts +20 -0
- package/dist/verification/shared.d.ts.map +1 -0
- package/dist/verification/shared.js +25 -0
- package/dist/verification/shared.js.map +1 -0
- package/dist/verification/thorchain-networks.d.ts +35 -0
- package/dist/verification/thorchain-networks.d.ts.map +1 -0
- package/dist/verification/thorchain-networks.js +35 -0
- package/dist/verification/thorchain-networks.js.map +1 -0
- package/dist/verification/thorchain.d.ts +55 -0
- package/dist/verification/thorchain.d.ts.map +1 -0
- package/dist/verification/thorchain.js +232 -0
- package/dist/verification/thorchain.js.map +1 -0
- package/dist/wasm-pins.d.ts +4 -0
- package/dist/wasm-pins.d.ts.map +1 -0
- package/dist/wasm-pins.js +6 -0
- package/dist/wasm-pins.js.map +1 -0
- package/dist/wire/chainflip.zod.d.ts +144 -0
- package/dist/wire/chainflip.zod.d.ts.map +1 -0
- package/dist/wire/chainflip.zod.js +33 -0
- package/dist/wire/chainflip.zod.js.map +1 -0
- package/dist/wire/near-intents.zod.d.ts +376 -0
- package/dist/wire/near-intents.zod.d.ts.map +1 -0
- package/dist/wire/near-intents.zod.js +101 -0
- package/dist/wire/near-intents.zod.js.map +1 -0
- package/dist/wire/server/action.zod.d.ts +1119 -0
- package/dist/wire/server/action.zod.d.ts.map +1 -0
- package/dist/wire/server/action.zod.js +173 -0
- package/dist/wire/server/action.zod.js.map +1 -0
- package/dist/wire/server/common.zod.d.ts +62 -0
- package/dist/wire/server/common.zod.d.ts.map +1 -0
- package/dist/wire/server/common.zod.js +43 -0
- package/dist/wire/server/common.zod.js.map +1 -0
- package/dist/wire/server/index.d.ts +8 -0
- package/dist/wire/server/index.d.ts.map +1 -0
- package/dist/wire/server/index.js +8 -0
- package/dist/wire/server/index.js.map +1 -0
- package/dist/wire/server/pow.zod.d.ts +45 -0
- package/dist/wire/server/pow.zod.d.ts.map +1 -0
- package/dist/wire/server/pow.zod.js +18 -0
- package/dist/wire/server/pow.zod.js.map +1 -0
- package/dist/wire/server/quotes.zod.d.ts +694 -0
- package/dist/wire/server/quotes.zod.d.ts.map +1 -0
- package/dist/wire/server/quotes.zod.js +103 -0
- package/dist/wire/server/quotes.zod.js.map +1 -0
- package/dist/wire/server/swap.zod.d.ts +1981 -0
- package/dist/wire/server/swap.zod.d.ts.map +1 -0
- package/dist/wire/server/swap.zod.js +270 -0
- package/dist/wire/server/swap.zod.js.map +1 -0
- package/dist/wire/server/tokens.zod.d.ts +93 -0
- package/dist/wire/server/tokens.zod.d.ts.map +1 -0
- package/dist/wire/server/tokens.zod.js +28 -0
- package/dist/wire/server/tokens.zod.js.map +1 -0
- package/dist/wire/server/verify.zod.d.ts +30 -0
- package/dist/wire/server/verify.zod.d.ts.map +1 -0
- package/dist/wire/server/verify.zod.js +12 -0
- package/dist/wire/server/verify.zod.js.map +1 -0
- package/dist/wire/thorchain.zod.d.ts +224 -0
- package/dist/wire/thorchain.zod.d.ts.map +1 -0
- package/dist/wire/thorchain.zod.js +51 -0
- package/dist/wire/thorchain.zod.js.map +1 -0
- package/package.json +128 -0
- package/wasm/miradex-rust/README.md +74 -0
- package/wasm/miradex-rust/miradex_rust.d.ts +149 -0
- package/wasm/miradex-rust/miradex_rust.js +943 -0
- package/wasm/miradex-rust/miradex_rust_bg.wasm +0 -0
- package/wasm/miradex-rust/miradex_rust_bg.wasm.d.ts +31 -0
- package/wasm/miradex-rust/package.json +24 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import { check, errMsg, failOf, resultOf } from './shared.js';
|
|
2
|
+
import { CHAINFLIP_REST_RETRY_BACKOFF_MS, CHAINFLIP_REST_RETRY_TOTAL_MS, VERIFY_FETCH_TIMEOUT_MS, } from './constants.js';
|
|
3
|
+
import { VerificationError } from '../types/index.js';
|
|
4
|
+
import { ChainflipDepositChannelSchema, } from '../wire/chainflip.zod.js';
|
|
5
|
+
import { chainflipEndpointsForNetwork, } from './chainflip-networks.js';
|
|
6
|
+
const CHANNEL_SAFETY_MARGIN_MS = 90 * 60 * 1000;
|
|
7
|
+
/**
|
|
8
|
+
* Verify a Chainflip deposit address by reading the SDK-owned broker REST
|
|
9
|
+
* endpoint and confirming the channel binding matches the user's expected
|
|
10
|
+
* destination. The verifier URL comes from the SDK's hardcoded per-network
|
|
11
|
+
* registry (`chainflip-networks.ts`) — `v.status_url` from the server is
|
|
12
|
+
* intentionally ignored.
|
|
13
|
+
*
|
|
14
|
+
* Single-source design rationale: the only browser-reachable mainnet
|
|
15
|
+
* state-chain RPC node (`mainnet-archive.chainflip.io`) does not expose a
|
|
16
|
+
* single-channel lookup method, so a true two-source cross-check isn't
|
|
17
|
+
* feasible without proxying or fetching the entire open-channel set.
|
|
18
|
+
* Trust posture: the broker is Chainflip's own infrastructure (same
|
|
19
|
+
* trust assumption a Chainflip-hosted UI makes); a misreport cannot move
|
|
20
|
+
* funds because the user's wallet still holds them.
|
|
21
|
+
*
|
|
22
|
+
* Fails closed when the network has no configured verifier endpoint.
|
|
23
|
+
*/
|
|
24
|
+
export async function verifyChainflip(depositAddress, v, params, fetchFn, network, signal) {
|
|
25
|
+
const endpoints = chainflipEndpointsForNetwork(network);
|
|
26
|
+
if (!endpoints) {
|
|
27
|
+
return failOf('chainflip', [
|
|
28
|
+
check('Chainflip verifier configured', false, `No verification endpoints registered for network "${network}"`),
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
if (params.fromChain === undefined || params.toChain === undefined) {
|
|
32
|
+
return failOf('chainflip', [
|
|
33
|
+
check('Chainflip verification inputs', false, 'fromChain/toChain required for chainflip channel check'),
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
const checks = [];
|
|
37
|
+
try {
|
|
38
|
+
await verifyChainflipChannel({
|
|
39
|
+
channelId: v.channel_id,
|
|
40
|
+
endpoints,
|
|
41
|
+
expected: {
|
|
42
|
+
destAddress: params.destAddress,
|
|
43
|
+
refundAddress: params.refundAddress.length > 0 ? params.refundAddress : undefined,
|
|
44
|
+
srcChain: params.fromChain,
|
|
45
|
+
destChain: params.toChain,
|
|
46
|
+
destAsset: params.toToken,
|
|
47
|
+
},
|
|
48
|
+
fetchFn,
|
|
49
|
+
signal,
|
|
50
|
+
});
|
|
51
|
+
checks.push(check('Chainflip channel verified', true, 'Broker binding matches expected'));
|
|
52
|
+
const channelDepositOk = depositAddress.length > 0;
|
|
53
|
+
checks.push(check('Deposit address present', channelDepositOk, channelDepositOk ? `${depositAddress.slice(0, 12)}...` : 'Missing'));
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
checks.push(check('Chainflip channel verified', false, errMsg(err)));
|
|
57
|
+
}
|
|
58
|
+
return resultOf('chainflip', checks);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Read a Chainflip deposit channel from the appropriate verifier and
|
|
62
|
+
* confirm it binds to the caller's expected destination/refund address.
|
|
63
|
+
*
|
|
64
|
+
* @throws {VerificationError} `E_CHAINFLIP_CHANNEL_MISBINDING` when the
|
|
65
|
+
* broker disagrees with the caller's expected destination/refund.
|
|
66
|
+
* @throws {VerificationError} `E_CHAINFLIP_CHANNEL_EXPIRING` when the
|
|
67
|
+
* channel expires within the safety margin.
|
|
68
|
+
* @throws {VerificationError} `E_CHAINFLIP_AMOUNT_BELOW_MIN` /
|
|
69
|
+
* `E_CHAINFLIP_AMOUNT_ABOVE_MAX` when `depositAmountSats` is out of band.
|
|
70
|
+
*/
|
|
71
|
+
export async function verifyChainflipChannel(input) {
|
|
72
|
+
const timeoutMs = input.timeoutMs ?? VERIFY_FETCH_TIMEOUT_MS;
|
|
73
|
+
const channel = input.endpoints.mode === 'rest'
|
|
74
|
+
? await fetchBrokerChannelRest(input.endpoints.statusUrl, input.channelId, input.fetchFn, timeoutMs, input.signal)
|
|
75
|
+
: await fetchBrokerChannelJsonRpc(input.endpoints.rpcUrl, input.channelId, input.fetchFn, timeoutMs, input.signal);
|
|
76
|
+
requireBindsExpected(channel, input.expected);
|
|
77
|
+
if (input.depositAmountSats !== undefined) {
|
|
78
|
+
requireAmountInBand(channel, input.depositAmountSats);
|
|
79
|
+
}
|
|
80
|
+
if (channel.expiryTime) {
|
|
81
|
+
requireExpiryMargin(channel.expiryTime);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Coerce a Chainflip broker REST response into a `ChainflipDepositChannel`.
|
|
86
|
+
*
|
|
87
|
+
* The v2 hosted-broker endpoint (`/v2/swaps/<id>`) returns the swap status
|
|
88
|
+
* with a nested `depositChannel` carrying just the addressing primitives —
|
|
89
|
+
* the binding fields the verifier checks (`srcChain`, `destChain`,
|
|
90
|
+
* `destAsset`, `destAddress`, `refundAddress`) live at the wrapper top
|
|
91
|
+
* level. Localnet / older brokers still emit the flat shape with
|
|
92
|
+
* everything on the channel itself. Both are accepted: parser tries flat
|
|
93
|
+
* first, then merges nested-channel + wrapper, with the wrapper taking
|
|
94
|
+
* priority for any field the channel omits.
|
|
95
|
+
*
|
|
96
|
+
* Tolerates unknown / extra fields and unknown `state` values — Chainflip's
|
|
97
|
+
* v2 surface evolves faster than any enum we'd hardcode.
|
|
98
|
+
*/
|
|
99
|
+
function parseBrokerResponse(raw) {
|
|
100
|
+
const flat = ChainflipDepositChannelSchema.safeParse(raw);
|
|
101
|
+
if (flat.success && flat.data.srcChain && flat.data.destChain) {
|
|
102
|
+
return flat.data;
|
|
103
|
+
}
|
|
104
|
+
if (typeof raw !== 'object' || raw === null) {
|
|
105
|
+
throw flat.error ?? new Error('Chainflip broker response is not an object');
|
|
106
|
+
}
|
|
107
|
+
const wrapper = raw;
|
|
108
|
+
const nestedRaw = wrapper['depositChannel'];
|
|
109
|
+
if (typeof nestedRaw !== 'object' || nestedRaw === null) {
|
|
110
|
+
throw flat.error;
|
|
111
|
+
}
|
|
112
|
+
const channel = ChainflipDepositChannelSchema.parse(nestedRaw);
|
|
113
|
+
// Hoist the binding fields the verifier checks. The wrapper's value
|
|
114
|
+
// wins when the nested channel doesn't carry it (typical for
|
|
115
|
+
// chainflip's v2 response), but we never overwrite a non-null channel
|
|
116
|
+
// value with the wrapper. `refundAddress` sits inside one of several
|
|
117
|
+
// nested params objects depending on the Chainflip API revision —
|
|
118
|
+
// historically `fillOrKillParams.refundAddress` or
|
|
119
|
+
// `refundParameters.refundAddress`, sometimes at the wrapper level
|
|
120
|
+
// and sometimes under `depositChannel`. Walk every known path before
|
|
121
|
+
// declaring it missing.
|
|
122
|
+
return {
|
|
123
|
+
...channel,
|
|
124
|
+
srcChain: channel.srcChain ?? readPath(wrapper, [['srcChain']]),
|
|
125
|
+
srcAsset: channel.srcAsset ?? readPath(wrapper, [['srcAsset']]),
|
|
126
|
+
destChain: channel.destChain ?? readPath(wrapper, [['destChain']]),
|
|
127
|
+
destAsset: channel.destAsset ?? readPath(wrapper, [['destAsset']]),
|
|
128
|
+
destAddress: channel.destAddress ?? readPath(wrapper, [['destAddress']]),
|
|
129
|
+
refundAddress: channel.refundAddress ??
|
|
130
|
+
readPath(wrapper, [
|
|
131
|
+
['refundAddress'],
|
|
132
|
+
['refundParameters', 'refundAddress'],
|
|
133
|
+
['refundParameters', 'refund_address'],
|
|
134
|
+
['fillOrKillParams', 'refundAddress'],
|
|
135
|
+
['fillOrKillParams', 'refund_address'],
|
|
136
|
+
['depositChannel', 'refundParameters', 'refundAddress'],
|
|
137
|
+
['depositChannel', 'refundParameters', 'refund_address'],
|
|
138
|
+
['depositChannel', 'fillOrKillParams', 'refundAddress'],
|
|
139
|
+
['depositChannel', 'fillOrKillParams', 'refund_address'],
|
|
140
|
+
]),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Walk a list of dotted paths against `obj`, returning the first string
|
|
145
|
+
* value found. Returns undefined if no path resolves to a string.
|
|
146
|
+
*/
|
|
147
|
+
function readPath(obj, paths) {
|
|
148
|
+
for (const path of paths) {
|
|
149
|
+
let cur = obj;
|
|
150
|
+
for (const key of path) {
|
|
151
|
+
if (typeof cur !== 'object' || cur === null) {
|
|
152
|
+
cur = undefined;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
cur = cur[key];
|
|
156
|
+
}
|
|
157
|
+
if (typeof cur === 'string' && cur.length > 0)
|
|
158
|
+
return cur;
|
|
159
|
+
}
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
async function fetchBrokerChannelRest(baseUrl, channelId, fetchFn, timeoutMs, externalSignal) {
|
|
163
|
+
// Path-based lookup: GET ${baseUrl}/${channelId}. Trim a trailing
|
|
164
|
+
// slash so callers may pass `https://host/v2/swaps` or
|
|
165
|
+
// `https://host/v2/swaps/` interchangeably.
|
|
166
|
+
//
|
|
167
|
+
// `cache: 'no-store'` short-circuits the browser HTTP cache. Without it,
|
|
168
|
+
// a page reload re-issues the request with `If-None-Match` /
|
|
169
|
+
// `If-Modified-Since` from a previous successful fetch, the broker
|
|
170
|
+
// returns **304 Not Modified** with an empty body, and we have nothing
|
|
171
|
+
// to parse. (`res.ok` is false for 304 — only 200-299 qualify.) We need
|
|
172
|
+
// a parseable body every time, so always force a fresh round-trip.
|
|
173
|
+
const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(channelId)}`;
|
|
174
|
+
const start = Date.now();
|
|
175
|
+
let attempt = 0;
|
|
176
|
+
let lastError = new VerificationError('E_CHAINFLIP_HTTP', 'broker request not yet attempted');
|
|
177
|
+
while (Date.now() - start < CHAINFLIP_REST_RETRY_TOTAL_MS) {
|
|
178
|
+
if (externalSignal?.aborted) {
|
|
179
|
+
throw new VerificationError('E_CHAINFLIP_HTTP', 'verification aborted by caller');
|
|
180
|
+
}
|
|
181
|
+
try {
|
|
182
|
+
// `cache` is part of the standard fetch RequestInit but absent from
|
|
183
|
+
// the Node-only types this package compiles against (lib: ES2022).
|
|
184
|
+
// Cast through the broader browser shape — the option is a no-op in
|
|
185
|
+
// Node where it isn't supported, and exactly what we need in browsers.
|
|
186
|
+
// Combine the per-fetch timeout with the caller's abort signal so
|
|
187
|
+
// either path cancels the in-flight request.
|
|
188
|
+
const init = {
|
|
189
|
+
signal: combineSignals(AbortSignal.timeout(timeoutMs), externalSignal),
|
|
190
|
+
cache: 'no-store',
|
|
191
|
+
};
|
|
192
|
+
const res = await fetchFn(url, init);
|
|
193
|
+
if (res.ok) {
|
|
194
|
+
const raw = await res.json();
|
|
195
|
+
// Chainflip's `/v2/swaps/<composite>` returns the swap **status**
|
|
196
|
+
// wrapper — a top-level object with `state` and a NESTED
|
|
197
|
+
// `depositChannel`. The legacy `/v0/deposit_channels/<id>` endpoint
|
|
198
|
+
// returned the channel flat; both shapes are still seen in the wild.
|
|
199
|
+
// Try the status shape first (the v2 path we actually call), unwrap
|
|
200
|
+
// its `depositChannel`, and fall back to the flat shape so the
|
|
201
|
+
// verifier survives both response styles without touching the rest
|
|
202
|
+
// of the pipeline.
|
|
203
|
+
return parseBrokerResponse(raw);
|
|
204
|
+
}
|
|
205
|
+
// 304 only happens if the cache directive above is somehow ignored
|
|
206
|
+
// (older browsers, service workers, intermediary proxies). Treat it
|
|
207
|
+
// as a directive to retry without conditional headers — but, since
|
|
208
|
+
// the body is empty, we cannot proceed without a fresh fetch.
|
|
209
|
+
// Falling through to the retry loop is the right move: the next
|
|
210
|
+
// attempt will be a fresh request.
|
|
211
|
+
if (res.status === 304) {
|
|
212
|
+
lastError = new VerificationError('E_CHAINFLIP_HTTP', 'broker returned 304 — cache directive bypassed, retrying');
|
|
213
|
+
}
|
|
214
|
+
else if (res.status >= 400 && res.status < 500 && res.status !== 404) {
|
|
215
|
+
// 4xx other than 404 means a real misconfiguration (bad path,
|
|
216
|
+
// malformed id) — retrying won't help; bail out immediately.
|
|
217
|
+
throw new VerificationError('E_CHAINFLIP_HTTP', `broker HTTP ${String(res.status)}`);
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
// 404 (channel not yet ingested by REST) and 5xx (gateway / state
|
|
221
|
+
// chain RPC blip) are expected transient outcomes worth retrying.
|
|
222
|
+
lastError = new VerificationError('E_CHAINFLIP_HTTP', `broker HTTP ${String(res.status)}`);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
catch (err) {
|
|
226
|
+
if (err instanceof VerificationError)
|
|
227
|
+
throw err;
|
|
228
|
+
// Network error, timeout, or zod parse failure — treat as transient.
|
|
229
|
+
lastError = new VerificationError('E_CHAINFLIP_HTTP', err instanceof Error ? err.message : String(err));
|
|
230
|
+
}
|
|
231
|
+
const backoffMs = CHAINFLIP_REST_RETRY_BACKOFF_MS[attempt] ??
|
|
232
|
+
CHAINFLIP_REST_RETRY_BACKOFF_MS[CHAINFLIP_REST_RETRY_BACKOFF_MS.length - 1] ??
|
|
233
|
+
30_000;
|
|
234
|
+
attempt += 1;
|
|
235
|
+
if (Date.now() - start + backoffMs >= CHAINFLIP_REST_RETRY_TOTAL_MS)
|
|
236
|
+
break;
|
|
237
|
+
await sleepAbortable(backoffMs, externalSignal);
|
|
238
|
+
if (externalSignal?.aborted) {
|
|
239
|
+
throw new VerificationError('E_CHAINFLIP_HTTP', 'verification aborted by caller');
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
throw lastError;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Combine a per-fetch timeout signal with an optional external abort signal.
|
|
246
|
+
* If only one is provided, return it directly so consumers without
|
|
247
|
+
* `AbortSignal.any` support (older runtimes) still work in the common case.
|
|
248
|
+
*/
|
|
249
|
+
function combineSignals(timeout, external) {
|
|
250
|
+
if (external === undefined)
|
|
251
|
+
return timeout;
|
|
252
|
+
// `AbortSignal.any` is in Node 20+ and all modern browsers — the same
|
|
253
|
+
// baseline `AbortSignal.timeout` already requires.
|
|
254
|
+
return AbortSignal.any([timeout, external]);
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Like `setTimeout` as a promise, but resolves early when the optional
|
|
258
|
+
* external signal aborts. Intentionally does NOT throw on abort — the
|
|
259
|
+
* caller checks `signal.aborted` after the await and decides how to fail.
|
|
260
|
+
*/
|
|
261
|
+
function sleepAbortable(ms, signal) {
|
|
262
|
+
if (signal === undefined) {
|
|
263
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
264
|
+
}
|
|
265
|
+
return new Promise((resolve) => {
|
|
266
|
+
const timer = setTimeout(() => {
|
|
267
|
+
signal.removeEventListener('abort', onAbort);
|
|
268
|
+
resolve();
|
|
269
|
+
}, ms);
|
|
270
|
+
const onAbort = () => {
|
|
271
|
+
clearTimeout(timer);
|
|
272
|
+
signal.removeEventListener('abort', onAbort);
|
|
273
|
+
resolve();
|
|
274
|
+
};
|
|
275
|
+
if (signal.aborted) {
|
|
276
|
+
clearTimeout(timer);
|
|
277
|
+
resolve();
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
signal.addEventListener('abort', onAbort);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Regtest-only path. The localnet chainflip-broker exposes the legacy
|
|
285
|
+
* `cf_deposit_channel_info` state-chain RPC method that the public
|
|
286
|
+
* mainnet hosted broker does not.
|
|
287
|
+
*/
|
|
288
|
+
async function fetchBrokerChannelJsonRpc(rpcUrl, channelId, fetchFn, timeoutMs, externalSignal) {
|
|
289
|
+
const body = {
|
|
290
|
+
jsonrpc: '2.0',
|
|
291
|
+
id: 1,
|
|
292
|
+
method: 'cf_deposit_channel_info',
|
|
293
|
+
params: { channel_id: channelId },
|
|
294
|
+
};
|
|
295
|
+
const res = await fetchFn(rpcUrl, {
|
|
296
|
+
method: 'POST',
|
|
297
|
+
headers: { 'content-type': 'application/json' },
|
|
298
|
+
body: JSON.stringify(body),
|
|
299
|
+
signal: combineSignals(AbortSignal.timeout(timeoutMs), externalSignal),
|
|
300
|
+
});
|
|
301
|
+
if (!res.ok) {
|
|
302
|
+
throw new VerificationError('E_CHAINFLIP_HTTP', `state-chain HTTP ${String(res.status)}`);
|
|
303
|
+
}
|
|
304
|
+
const raw = (await res.json());
|
|
305
|
+
return ChainflipDepositChannelSchema.parse(raw.result);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Canonicalise a chain identifier so the SDK can compare its caller-side
|
|
309
|
+
* value (the public crypto-server API emits the base name `ethereum`)
|
|
310
|
+
* against Chainflip's REST response (TitleCase like `Ethereum`). Just
|
|
311
|
+
* lowercases — the server is responsible for stripping its internal
|
|
312
|
+
* routing prefix, so we don't second-guess it here.
|
|
313
|
+
*/
|
|
314
|
+
function canonicalChain(chain) {
|
|
315
|
+
return chain ? chain.toLowerCase() : undefined;
|
|
316
|
+
}
|
|
317
|
+
/** Canonicalise a token symbol — Chainflip is consistent on uppercase but
|
|
318
|
+
* callers occasionally pass mixed case. */
|
|
319
|
+
function canonicalAsset(asset) {
|
|
320
|
+
return asset ? asset.toLowerCase() : undefined;
|
|
321
|
+
}
|
|
322
|
+
/** Ethereum-style addresses come back in unspecified case from Chainflip;
|
|
323
|
+
* the user always sends lowercase from the wallet. Compare case-insensitively
|
|
324
|
+
* for hex addresses; Bitcoin/Polkadot/Solana addresses are case-sensitive
|
|
325
|
+
* and pass through unchanged. */
|
|
326
|
+
function canonicalAddress(addr) {
|
|
327
|
+
if (!addr)
|
|
328
|
+
return undefined;
|
|
329
|
+
return addr.startsWith('0x') ? addr.toLowerCase() : addr;
|
|
330
|
+
}
|
|
331
|
+
function requireBindsExpected(channel, expected) {
|
|
332
|
+
if (canonicalAddress(channel.destAddress) !== canonicalAddress(expected.destAddress)) {
|
|
333
|
+
throw new VerificationError('E_CHAINFLIP_CHANNEL_MISBINDING', `channel destAddress ${String(channel.destAddress)} != expected ${expected.destAddress}`);
|
|
334
|
+
}
|
|
335
|
+
if (canonicalChain(channel.srcChain) !== canonicalChain(expected.srcChain)) {
|
|
336
|
+
throw new VerificationError('E_CHAINFLIP_CHANNEL_MISBINDING', `channel srcChain ${String(channel.srcChain)} != expected ${expected.srcChain}`);
|
|
337
|
+
}
|
|
338
|
+
if (canonicalChain(channel.destChain) !== canonicalChain(expected.destChain)) {
|
|
339
|
+
throw new VerificationError('E_CHAINFLIP_CHANNEL_MISBINDING', `channel destChain ${String(channel.destChain)} != expected ${expected.destChain}`);
|
|
340
|
+
}
|
|
341
|
+
if (canonicalAsset(channel.destAsset) !== canonicalAsset(expected.destAsset)) {
|
|
342
|
+
throw new VerificationError('E_CHAINFLIP_CHANNEL_MISBINDING', `channel destAsset ${String(channel.destAsset)} != expected ${expected.destAsset}`);
|
|
343
|
+
}
|
|
344
|
+
// Refund address is a soft check: Chainflip's `/v2/swaps/<id>` doesn't
|
|
345
|
+
// always expose it (the field lives in the broker's deposit-channel
|
|
346
|
+
// creation request, not necessarily in the status query). When the
|
|
347
|
+
// channel object carries one, we strictly require it to match — that
|
|
348
|
+
// catches a real attack where the broker rebinds the refund. When it
|
|
349
|
+
// doesn't carry one, we skip silently rather than fail the whole
|
|
350
|
+
// verification on a check we can't perform. The destination address
|
|
351
|
+
// (the path funds actually flow through on success) is the strict
|
|
352
|
+
// gate above; this one only matters on the refund-on-failure branch.
|
|
353
|
+
if (expected.refundAddress !== undefined &&
|
|
354
|
+
channel.refundAddress !== undefined &&
|
|
355
|
+
canonicalAddress(channel.refundAddress) !== canonicalAddress(expected.refundAddress)) {
|
|
356
|
+
throw new VerificationError('E_CHAINFLIP_CHANNEL_MISBINDING', `channel refundAddress ${String(channel.refundAddress)} != expected ${expected.refundAddress}`);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function requireAmountInBand(channel, amountSats) {
|
|
360
|
+
const amount = BigInt(amountSats);
|
|
361
|
+
if (channel.minBtcAmount !== undefined && amount < BigInt(channel.minBtcAmount)) {
|
|
362
|
+
throw new VerificationError('E_CHAINFLIP_AMOUNT_BELOW_MIN', `deposit ${amount.toString()} below channel min ${channel.minBtcAmount}`);
|
|
363
|
+
}
|
|
364
|
+
if (channel.maxBtcAmount !== undefined && amount > BigInt(channel.maxBtcAmount)) {
|
|
365
|
+
throw new VerificationError('E_CHAINFLIP_AMOUNT_ABOVE_MAX', `deposit ${amount.toString()} above channel max ${channel.maxBtcAmount}`);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
function requireExpiryMargin(expiryTime) {
|
|
369
|
+
const expiryMs = new Date(expiryTime).getTime();
|
|
370
|
+
if (Number.isNaN(expiryMs))
|
|
371
|
+
return;
|
|
372
|
+
const remaining = expiryMs - Date.now();
|
|
373
|
+
if (remaining < CHANNEL_SAFETY_MARGIN_MS) {
|
|
374
|
+
throw new VerificationError('E_CHAINFLIP_CHANNEL_EXPIRING', `channel expires in ${(remaining / 60_000).toFixed(1)} minutes, below safety margin`);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
//# sourceMappingURL=chainflip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chainflip.js","sourceRoot":"","sources":["../../src/verification/chainflip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAqB,MAAM,aAAa,CAAC;AACjF,OAAO,EACL,+BAA+B,EAC/B,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,6BAA6B,GAE9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,4BAA4B,GAG7B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,wBAAwB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,eA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AI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;IAChD,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;QAAE,OAAO;IACnC,MAAM,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACxC,IAAI,SAAS,GAAG,wBAAwB,EAAE,CAAC;QACzC,MAAM,IAAI,iBAAiB,CACzB,8BAA8B,EAC9B,sBAAsB,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,+BAA+B,CACrF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const VERIFY_MAX_ATTEMPTS = 12;
|
|
2
|
+
export declare const VERIFY_RETRY_DELAY_MS = 5000;
|
|
3
|
+
export declare const VERIFY_FETCH_TIMEOUT_MS = 10000;
|
|
4
|
+
/**
|
|
5
|
+
* Chainflip's hosted broker REST `/v2/swaps/<composite>` lags channel
|
|
6
|
+
* creation by ~30-60s — the broker creates the on-chain channel via
|
|
7
|
+
* `broker_request_swap_deposit_address` immediately, but the REST
|
|
8
|
+
* indexer ingests it on its own cadence. A first-attempt 404 is normal.
|
|
9
|
+
*
|
|
10
|
+
* Total retry budget covers the typical worst-case ingest delay; the
|
|
11
|
+
* backoff schedule starts tight (so the common case clears in seconds)
|
|
12
|
+
* and lengthens to avoid hammering the gateway during real outages.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CHAINFLIP_REST_RETRY_TOTAL_MS = 120000;
|
|
15
|
+
export declare const CHAINFLIP_REST_RETRY_BACKOFF_MS: readonly number[];
|
|
16
|
+
export declare const ATOMICSWAP_TIMELOCK_MIN_BLOCKS = 5;
|
|
17
|
+
export declare const ATOMICSWAP_TIMELOCK_MAX_BLOCKS = 288;
|
|
18
|
+
/**
|
|
19
|
+
* Bounds for the BIP68 sequence applied to TxPunish — the relative timelock
|
|
20
|
+
* Alice must wait after TxCancel confirms before she can broadcast TxPunish.
|
|
21
|
+
*
|
|
22
|
+
* The minimum is the size of the refund window Bob is guaranteed: between
|
|
23
|
+
* TxCancel confirming and TxPunish becoming spendable, Bob must have time to
|
|
24
|
+
* notice, decrypt the encsig, and broadcast TxFullRefund/TxPartialRefund. A
|
|
25
|
+
* sub-block window degenerates into a fee race that Alice can win by
|
|
26
|
+
* out-of-band miner submission.
|
|
27
|
+
*
|
|
28
|
+
* Production deployments should configure ASB with the documented mainnet
|
|
29
|
+
* defaults (≥72). This lower bound (5) is the smallest positive integer that
|
|
30
|
+
* still rejects the degenerate `0` case the V-1 fix guards against, and exists
|
|
31
|
+
* to allow regtest tier2/system-test fixtures (which use 50) to run without
|
|
32
|
+
* patching every consumer of these constants.
|
|
33
|
+
*
|
|
34
|
+
* @security Closes V-1 — the Rust core enforces real production bounds via the
|
|
35
|
+
* env config (e.g. `bitcoin_punish_timelock` defaults).
|
|
36
|
+
*/
|
|
37
|
+
export declare const ATOMICSWAP_PUNISH_TIMELOCK_MIN_BLOCKS = 5;
|
|
38
|
+
export declare const ATOMICSWAP_PUNISH_TIMELOCK_MAX_BLOCKS = 288;
|
|
39
|
+
/**
|
|
40
|
+
* Bounds for the BIP68 sequence applied to TxReclaim — the additional wait
|
|
41
|
+
* after TxPartialRefund confirms before Bob can pull the amnesty back.
|
|
42
|
+
*
|
|
43
|
+
* Min is 1 — only the degenerate `0` case is rejected. Matches the Rust
|
|
44
|
+
* source (xmr-atomic-swap/core/swap-env/src/env.rs:65,88) which sets
|
|
45
|
+
* `bitcoin_remaining_refund_timelock = 2` for both mainnet and testnet;
|
|
46
|
+
* a stricter floor here would reject the Rust-shipped defaults.
|
|
47
|
+
*
|
|
48
|
+
* @security Closes V-1 (amnesty-path variant) — only `0` is unsafe.
|
|
49
|
+
*/
|
|
50
|
+
export declare const ATOMICSWAP_REMAINING_REFUND_TIMELOCK_MIN_BLOCKS = 1;
|
|
51
|
+
export declare const ATOMICSWAP_REMAINING_REFUND_TIMELOCK_MAX_BLOCKS = 288;
|
|
52
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/verification/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,eAAO,MAAM,qBAAqB,OAAQ,CAAC;AAC3C,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,SAAU,CAAC;AACrD,eAAO,MAAM,+BAA+B,EAAE,SAAS,MAAM,EAE5D,CAAC;AACF,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAChD,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qCAAqC,IAAI,CAAC;AACvD,eAAO,MAAM,qCAAqC,MAAM,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,+CAA+C,IAAI,CAAC;AACjE,eAAO,MAAM,+CAA+C,MAAM,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export const VERIFY_MAX_ATTEMPTS = 12;
|
|
2
|
+
export const VERIFY_RETRY_DELAY_MS = 5_000;
|
|
3
|
+
export const VERIFY_FETCH_TIMEOUT_MS = 10_000;
|
|
4
|
+
/**
|
|
5
|
+
* Chainflip's hosted broker REST `/v2/swaps/<composite>` lags channel
|
|
6
|
+
* creation by ~30-60s — the broker creates the on-chain channel via
|
|
7
|
+
* `broker_request_swap_deposit_address` immediately, but the REST
|
|
8
|
+
* indexer ingests it on its own cadence. A first-attempt 404 is normal.
|
|
9
|
+
*
|
|
10
|
+
* Total retry budget covers the typical worst-case ingest delay; the
|
|
11
|
+
* backoff schedule starts tight (so the common case clears in seconds)
|
|
12
|
+
* and lengthens to avoid hammering the gateway during real outages.
|
|
13
|
+
*/
|
|
14
|
+
export const CHAINFLIP_REST_RETRY_TOTAL_MS = 120_000;
|
|
15
|
+
export const CHAINFLIP_REST_RETRY_BACKOFF_MS = [
|
|
16
|
+
1_000, 2_000, 4_000, 8_000, 16_000, 30_000, 30_000, 30_000,
|
|
17
|
+
];
|
|
18
|
+
export const ATOMICSWAP_TIMELOCK_MIN_BLOCKS = 5;
|
|
19
|
+
export const ATOMICSWAP_TIMELOCK_MAX_BLOCKS = 288;
|
|
20
|
+
/**
|
|
21
|
+
* Bounds for the BIP68 sequence applied to TxPunish — the relative timelock
|
|
22
|
+
* Alice must wait after TxCancel confirms before she can broadcast TxPunish.
|
|
23
|
+
*
|
|
24
|
+
* The minimum is the size of the refund window Bob is guaranteed: between
|
|
25
|
+
* TxCancel confirming and TxPunish becoming spendable, Bob must have time to
|
|
26
|
+
* notice, decrypt the encsig, and broadcast TxFullRefund/TxPartialRefund. A
|
|
27
|
+
* sub-block window degenerates into a fee race that Alice can win by
|
|
28
|
+
* out-of-band miner submission.
|
|
29
|
+
*
|
|
30
|
+
* Production deployments should configure ASB with the documented mainnet
|
|
31
|
+
* defaults (≥72). This lower bound (5) is the smallest positive integer that
|
|
32
|
+
* still rejects the degenerate `0` case the V-1 fix guards against, and exists
|
|
33
|
+
* to allow regtest tier2/system-test fixtures (which use 50) to run without
|
|
34
|
+
* patching every consumer of these constants.
|
|
35
|
+
*
|
|
36
|
+
* @security Closes V-1 — the Rust core enforces real production bounds via the
|
|
37
|
+
* env config (e.g. `bitcoin_punish_timelock` defaults).
|
|
38
|
+
*/
|
|
39
|
+
export const ATOMICSWAP_PUNISH_TIMELOCK_MIN_BLOCKS = 5;
|
|
40
|
+
export const ATOMICSWAP_PUNISH_TIMELOCK_MAX_BLOCKS = 288;
|
|
41
|
+
/**
|
|
42
|
+
* Bounds for the BIP68 sequence applied to TxReclaim — the additional wait
|
|
43
|
+
* after TxPartialRefund confirms before Bob can pull the amnesty back.
|
|
44
|
+
*
|
|
45
|
+
* Min is 1 — only the degenerate `0` case is rejected. Matches the Rust
|
|
46
|
+
* source (xmr-atomic-swap/core/swap-env/src/env.rs:65,88) which sets
|
|
47
|
+
* `bitcoin_remaining_refund_timelock = 2` for both mainnet and testnet;
|
|
48
|
+
* a stricter floor here would reject the Rust-shipped defaults.
|
|
49
|
+
*
|
|
50
|
+
* @security Closes V-1 (amnesty-path variant) — only `0` is unsafe.
|
|
51
|
+
*/
|
|
52
|
+
export const ATOMICSWAP_REMAINING_REFUND_TIMELOCK_MIN_BLOCKS = 1;
|
|
53
|
+
export const ATOMICSWAP_REMAINING_REFUND_TIMELOCK_MAX_BLOCKS = 288;
|
|
54
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/verification/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAC3C,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,OAAO,CAAC;AACrD,MAAM,CAAC,MAAM,+BAA+B,GAAsB;IAChE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAC3D,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAChD,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,CAAC;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,qCAAqC,GAAG,GAAG,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,+CAA+C,GAAG,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,+CAA+C,GAAG,GAAG,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deposit-address verification dispatcher.
|
|
3
|
+
*
|
|
4
|
+
* Each provider has a dedicated verification path that validates the deposit
|
|
5
|
+
* address against the provider's own infrastructure (THORNode vaults,
|
|
6
|
+
* Chainflip channels, NEAR intent registry, atomic-swap lock script). Common
|
|
7
|
+
* client-side checks (address presence, output amount, destination match) run
|
|
8
|
+
* for every provider.
|
|
9
|
+
*/
|
|
10
|
+
import type { Logger } from '../interfaces/logger.js';
|
|
11
|
+
import type { SwapVerification, VerificationResult } from '../types/index.js';
|
|
12
|
+
import { verifyAtomicSwap } from './atomic-swap.js';
|
|
13
|
+
import { verifyThorchain } from './thorchain.js';
|
|
14
|
+
import { verifyChainflip } from './chainflip.js';
|
|
15
|
+
import { verifyNearIntents } from './near-intents.js';
|
|
16
|
+
import type { ProtocolContext } from './shared.js';
|
|
17
|
+
import type { ChainflipNetwork } from './chainflip-networks.js';
|
|
18
|
+
export { parseThorchainMemo, requireMemoBindsDestination } from './memo.js';
|
|
19
|
+
export type { ParsedThorchainMemo } from './memo.js';
|
|
20
|
+
export { verifyAtomicSwap, verifyThorchain, verifyChainflip, verifyNearIntents };
|
|
21
|
+
export { fetchThorchainVaults, verifyThorchainQuote } from './thorchain.js';
|
|
22
|
+
export type { FetchThorchainVaultsInput, VerifyThorchainQuoteInput, } from './thorchain.js';
|
|
23
|
+
export { verifyChainflipChannel } from './chainflip.js';
|
|
24
|
+
export type { VerifyChainflipChannelInput } from './chainflip.js';
|
|
25
|
+
export { CHAINFLIP_VERIFICATION_NETWORKS, chainflipEndpointsForNetwork, } from './chainflip-networks.js';
|
|
26
|
+
export type { ChainflipNetwork, ChainflipVerificationEndpoints, } from './chainflip-networks.js';
|
|
27
|
+
export { THORCHAIN_VERIFICATION_NETWORKS, thorchainEndpointsForNetwork, } from './thorchain-networks.js';
|
|
28
|
+
export type { ThorchainNetwork, ThorchainVerificationEndpoints, } from './thorchain-networks.js';
|
|
29
|
+
export { fetchNearIntentStatus, requireIntentBinds, requireIntentDeadlineMargin, verifyNearIntentOnChain, } from './near-intents.js';
|
|
30
|
+
export type { FetchNearIntentStatusInput, RequireIntentBindsInput, VerifyNearIntentOnChainInput, } from './near-intents.js';
|
|
31
|
+
export { fetchConsensusRate } from './rate-oracle.js';
|
|
32
|
+
export type { RateOracleConfig } from './rate-oracle.js';
|
|
33
|
+
export { VERIFY_FETCH_TIMEOUT_MS, VERIFY_MAX_ATTEMPTS, VERIFY_RETRY_DELAY_MS } from './constants.js';
|
|
34
|
+
export interface VerifyDepositParams {
|
|
35
|
+
readonly depositAddress: string;
|
|
36
|
+
readonly verification: SwapVerification;
|
|
37
|
+
readonly destAddress: string;
|
|
38
|
+
readonly refundAddress: string;
|
|
39
|
+
readonly toToken: string;
|
|
40
|
+
readonly amount: string;
|
|
41
|
+
readonly fromChain?: string;
|
|
42
|
+
readonly toChain?: string;
|
|
43
|
+
readonly fromToken?: string;
|
|
44
|
+
readonly network?: ChainflipNetwork;
|
|
45
|
+
readonly protocol?: ProtocolContext;
|
|
46
|
+
readonly expectedAmountOut?: string;
|
|
47
|
+
readonly expectedDestAddress?: string;
|
|
48
|
+
readonly fetchFn?: typeof globalThis.fetch;
|
|
49
|
+
readonly resume?: boolean;
|
|
50
|
+
readonly logger?: Logger;
|
|
51
|
+
/**
|
|
52
|
+
* External abort signal. Wired from the engine's AbortController so a
|
|
53
|
+
* caller-side `engine.destroy()` actually stops verification mid-flight.
|
|
54
|
+
* Without this, the chainflip REST retry loop alone can keep polling
|
|
55
|
+
* for up to CHAINFLIP_REST_RETRY_TOTAL_MS (120 s) after the engine has
|
|
56
|
+
* been told to stop — burning user bandwidth and racing whatever the
|
|
57
|
+
* caller spun up to replace it.
|
|
58
|
+
*/
|
|
59
|
+
readonly signal?: AbortSignal;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Verify a deposit address against the authoritative infrastructure for its
|
|
63
|
+
* provider. Common client-side checks (address presence, output amount,
|
|
64
|
+
* destination match) run for every provider.
|
|
65
|
+
*
|
|
66
|
+
* @throws {VerificationError} `E_PROVIDER_UNKNOWN` for an unrecognised
|
|
67
|
+
* provider; `E_UNEXPECTED_TIMELOCK` when `timelock_blocks` is set for a
|
|
68
|
+
* non-atomicswap provider.
|
|
69
|
+
*/
|
|
70
|
+
export declare function verifyDepositAddress(params: VerifyDepositParams): Promise<VerificationResult>;
|
|
71
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/verification/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAC5E,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,YAAY,EACV,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,C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