@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,376 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Wire schemas for the real 1Click `/v0/status` response.
|
|
4
|
+
*
|
|
5
|
+
* Source-of-truth: 1Click OpenAPI v0.1.10 (`@defuse-protocol/one-click-sdk-typescript`)
|
|
6
|
+
* cross-validated against live API captures stored in
|
|
7
|
+
* `apps/swap-engine/tests/fixtures/oneclick/`. Any divergence here from the
|
|
8
|
+
* real response will silently break verification — keep these in sync.
|
|
9
|
+
*
|
|
10
|
+
* Notable shape facts:
|
|
11
|
+
* - Status enum has exactly 7 values. There is **no** NOT_FOUND or EXPIRED
|
|
12
|
+
* sentinel — `NOT_FOUND` is signaled via HTTP 404, and post-deadline
|
|
13
|
+
* expiry is computed against `quote.deadline`.
|
|
14
|
+
* - Most user-visible fields (recipient, refundTo, depositAddress, deadline)
|
|
15
|
+
* are **nested** under `quoteResponse.quoteRequest` / `quoteResponse.quote`
|
|
16
|
+
* — not at the top level.
|
|
17
|
+
* - `swapDetails.*Amount` fields are explicit `null` for not-yet-applicable
|
|
18
|
+
* states (PENDING_DEPOSIT etc.) — `.nullish()` is required, not `.optional()`.
|
|
19
|
+
* - The nested `quoteResponse.correlationId` is dropped on this nested copy
|
|
20
|
+
* (the outer status response carries its own correlationId).
|
|
21
|
+
*/
|
|
22
|
+
export declare const NearIntentStatusCode: z.ZodEnum<["KNOWN_DEPOSIT_TX", "PENDING_DEPOSIT", "INCOMPLETE_DEPOSIT", "PROCESSING", "SUCCESS", "REFUNDED", "FAILED"]>;
|
|
23
|
+
export type NearIntentStatusCode = z.infer<typeof NearIntentStatusCode>;
|
|
24
|
+
/** Raw shape returned by GET /v0/status. */
|
|
25
|
+
export declare const NearIntentRawStatusSchema: z.ZodObject<{
|
|
26
|
+
correlationId: z.ZodString;
|
|
27
|
+
status: z.ZodEnum<["KNOWN_DEPOSIT_TX", "PENDING_DEPOSIT", "INCOMPLETE_DEPOSIT", "PROCESSING", "SUCCESS", "REFUNDED", "FAILED"]>;
|
|
28
|
+
updatedAt: z.ZodString;
|
|
29
|
+
swapDetails: z.ZodObject<{
|
|
30
|
+
intentHashes: z.ZodArray<z.ZodString, "many">;
|
|
31
|
+
nearTxHashes: z.ZodArray<z.ZodString, "many">;
|
|
32
|
+
amountIn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
amountInFormatted: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
amountInUsd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
amountOut: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
amountOutFormatted: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
amountOutUsd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
|
+
slippage: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
39
|
+
originChainTxHashes: z.ZodArray<z.ZodObject<{
|
|
40
|
+
hash: z.ZodString;
|
|
41
|
+
explorerUrl: z.ZodString;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
hash: string;
|
|
44
|
+
explorerUrl: string;
|
|
45
|
+
}, {
|
|
46
|
+
hash: string;
|
|
47
|
+
explorerUrl: string;
|
|
48
|
+
}>, "many">;
|
|
49
|
+
destinationChainTxHashes: z.ZodArray<z.ZodObject<{
|
|
50
|
+
hash: z.ZodString;
|
|
51
|
+
explorerUrl: z.ZodString;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
hash: string;
|
|
54
|
+
explorerUrl: string;
|
|
55
|
+
}, {
|
|
56
|
+
hash: string;
|
|
57
|
+
explorerUrl: string;
|
|
58
|
+
}>, "many">;
|
|
59
|
+
refundedAmount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
refundedAmountFormatted: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
refundedAmountUsd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
62
|
+
refundReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
|
+
depositedAmount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
|
+
depositedAmountFormatted: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
65
|
+
depositedAmountUsd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
refundFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
referral: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
intentHashes: string[];
|
|
70
|
+
nearTxHashes: string[];
|
|
71
|
+
originChainTxHashes: {
|
|
72
|
+
hash: string;
|
|
73
|
+
explorerUrl: string;
|
|
74
|
+
}[];
|
|
75
|
+
destinationChainTxHashes: {
|
|
76
|
+
hash: string;
|
|
77
|
+
explorerUrl: string;
|
|
78
|
+
}[];
|
|
79
|
+
amountInUsd?: string | null | undefined;
|
|
80
|
+
amountOut?: string | null | undefined;
|
|
81
|
+
amountIn?: string | null | undefined;
|
|
82
|
+
amountInFormatted?: string | null | undefined;
|
|
83
|
+
amountOutFormatted?: string | null | undefined;
|
|
84
|
+
amountOutUsd?: string | null | undefined;
|
|
85
|
+
slippage?: number | null | undefined;
|
|
86
|
+
refundedAmount?: string | null | undefined;
|
|
87
|
+
refundedAmountFormatted?: string | null | undefined;
|
|
88
|
+
refundedAmountUsd?: string | null | undefined;
|
|
89
|
+
refundReason?: string | null | undefined;
|
|
90
|
+
depositedAmount?: string | null | undefined;
|
|
91
|
+
depositedAmountFormatted?: string | null | undefined;
|
|
92
|
+
depositedAmountUsd?: string | null | undefined;
|
|
93
|
+
refundFee?: string | null | undefined;
|
|
94
|
+
referral?: string | null | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
intentHashes: string[];
|
|
97
|
+
nearTxHashes: string[];
|
|
98
|
+
originChainTxHashes: {
|
|
99
|
+
hash: string;
|
|
100
|
+
explorerUrl: string;
|
|
101
|
+
}[];
|
|
102
|
+
destinationChainTxHashes: {
|
|
103
|
+
hash: string;
|
|
104
|
+
explorerUrl: string;
|
|
105
|
+
}[];
|
|
106
|
+
amountInUsd?: string | null | undefined;
|
|
107
|
+
amountOut?: string | null | undefined;
|
|
108
|
+
amountIn?: string | null | undefined;
|
|
109
|
+
amountInFormatted?: string | null | undefined;
|
|
110
|
+
amountOutFormatted?: string | null | undefined;
|
|
111
|
+
amountOutUsd?: string | null | undefined;
|
|
112
|
+
slippage?: number | null | undefined;
|
|
113
|
+
refundedAmount?: string | null | undefined;
|
|
114
|
+
refundedAmountFormatted?: string | null | undefined;
|
|
115
|
+
refundedAmountUsd?: string | null | undefined;
|
|
116
|
+
refundReason?: string | null | undefined;
|
|
117
|
+
depositedAmount?: string | null | undefined;
|
|
118
|
+
depositedAmountFormatted?: string | null | undefined;
|
|
119
|
+
depositedAmountUsd?: string | null | undefined;
|
|
120
|
+
refundFee?: string | null | undefined;
|
|
121
|
+
referral?: string | null | undefined;
|
|
122
|
+
}>;
|
|
123
|
+
quoteResponse: z.ZodOptional<z.ZodObject<{
|
|
124
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
125
|
+
timestamp: z.ZodString;
|
|
126
|
+
signature: z.ZodString;
|
|
127
|
+
quoteRequest: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
128
|
+
quote: z.ZodObject<{
|
|
129
|
+
depositAddress: z.ZodOptional<z.ZodString>;
|
|
130
|
+
depositMemo: z.ZodOptional<z.ZodString>;
|
|
131
|
+
amountIn: z.ZodString;
|
|
132
|
+
amountInFormatted: z.ZodString;
|
|
133
|
+
amountInUsd: z.ZodString;
|
|
134
|
+
minAmountIn: z.ZodString;
|
|
135
|
+
amountOut: z.ZodString;
|
|
136
|
+
amountOutFormatted: z.ZodString;
|
|
137
|
+
amountOutUsd: z.ZodString;
|
|
138
|
+
minAmountOut: z.ZodString;
|
|
139
|
+
deadline: z.ZodOptional<z.ZodString>;
|
|
140
|
+
timeWhenInactive: z.ZodOptional<z.ZodString>;
|
|
141
|
+
timeEstimate: z.ZodNumber;
|
|
142
|
+
refundFee: z.ZodOptional<z.ZodString>;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
amountInUsd: string;
|
|
145
|
+
amountOut: string;
|
|
146
|
+
amountIn: string;
|
|
147
|
+
amountInFormatted: string;
|
|
148
|
+
amountOutFormatted: string;
|
|
149
|
+
amountOutUsd: string;
|
|
150
|
+
minAmountIn: string;
|
|
151
|
+
minAmountOut: string;
|
|
152
|
+
timeEstimate: number;
|
|
153
|
+
depositAddress?: string | undefined;
|
|
154
|
+
refundFee?: string | undefined;
|
|
155
|
+
depositMemo?: string | undefined;
|
|
156
|
+
deadline?: string | undefined;
|
|
157
|
+
timeWhenInactive?: string | undefined;
|
|
158
|
+
}, {
|
|
159
|
+
amountInUsd: string;
|
|
160
|
+
amountOut: string;
|
|
161
|
+
amountIn: string;
|
|
162
|
+
amountInFormatted: string;
|
|
163
|
+
amountOutFormatted: string;
|
|
164
|
+
amountOutUsd: string;
|
|
165
|
+
minAmountIn: string;
|
|
166
|
+
minAmountOut: string;
|
|
167
|
+
timeEstimate: number;
|
|
168
|
+
depositAddress?: string | undefined;
|
|
169
|
+
refundFee?: string | undefined;
|
|
170
|
+
depositMemo?: string | undefined;
|
|
171
|
+
deadline?: string | undefined;
|
|
172
|
+
timeWhenInactive?: string | undefined;
|
|
173
|
+
}>;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
signature: string;
|
|
176
|
+
timestamp: string;
|
|
177
|
+
quoteRequest: Record<string, unknown>;
|
|
178
|
+
quote: {
|
|
179
|
+
amountInUsd: string;
|
|
180
|
+
amountOut: string;
|
|
181
|
+
amountIn: string;
|
|
182
|
+
amountInFormatted: string;
|
|
183
|
+
amountOutFormatted: string;
|
|
184
|
+
amountOutUsd: string;
|
|
185
|
+
minAmountIn: string;
|
|
186
|
+
minAmountOut: string;
|
|
187
|
+
timeEstimate: number;
|
|
188
|
+
depositAddress?: string | undefined;
|
|
189
|
+
refundFee?: string | undefined;
|
|
190
|
+
depositMemo?: string | undefined;
|
|
191
|
+
deadline?: string | undefined;
|
|
192
|
+
timeWhenInactive?: string | undefined;
|
|
193
|
+
};
|
|
194
|
+
correlationId?: string | undefined;
|
|
195
|
+
}, {
|
|
196
|
+
signature: string;
|
|
197
|
+
timestamp: string;
|
|
198
|
+
quoteRequest: Record<string, unknown>;
|
|
199
|
+
quote: {
|
|
200
|
+
amountInUsd: string;
|
|
201
|
+
amountOut: string;
|
|
202
|
+
amountIn: string;
|
|
203
|
+
amountInFormatted: string;
|
|
204
|
+
amountOutFormatted: string;
|
|
205
|
+
amountOutUsd: string;
|
|
206
|
+
minAmountIn: string;
|
|
207
|
+
minAmountOut: string;
|
|
208
|
+
timeEstimate: number;
|
|
209
|
+
depositAddress?: string | undefined;
|
|
210
|
+
refundFee?: string | undefined;
|
|
211
|
+
depositMemo?: string | undefined;
|
|
212
|
+
deadline?: string | undefined;
|
|
213
|
+
timeWhenInactive?: string | undefined;
|
|
214
|
+
};
|
|
215
|
+
correlationId?: string | undefined;
|
|
216
|
+
}>>;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
status: "FAILED" | "KNOWN_DEPOSIT_TX" | "PENDING_DEPOSIT" | "INCOMPLETE_DEPOSIT" | "PROCESSING" | "SUCCESS" | "REFUNDED";
|
|
219
|
+
updatedAt: string;
|
|
220
|
+
correlationId: string;
|
|
221
|
+
swapDetails: {
|
|
222
|
+
intentHashes: string[];
|
|
223
|
+
nearTxHashes: string[];
|
|
224
|
+
originChainTxHashes: {
|
|
225
|
+
hash: string;
|
|
226
|
+
explorerUrl: string;
|
|
227
|
+
}[];
|
|
228
|
+
destinationChainTxHashes: {
|
|
229
|
+
hash: string;
|
|
230
|
+
explorerUrl: string;
|
|
231
|
+
}[];
|
|
232
|
+
amountInUsd?: string | null | undefined;
|
|
233
|
+
amountOut?: string | null | undefined;
|
|
234
|
+
amountIn?: string | null | undefined;
|
|
235
|
+
amountInFormatted?: string | null | undefined;
|
|
236
|
+
amountOutFormatted?: string | null | undefined;
|
|
237
|
+
amountOutUsd?: string | null | undefined;
|
|
238
|
+
slippage?: number | null | undefined;
|
|
239
|
+
refundedAmount?: string | null | undefined;
|
|
240
|
+
refundedAmountFormatted?: string | null | undefined;
|
|
241
|
+
refundedAmountUsd?: string | null | undefined;
|
|
242
|
+
refundReason?: string | null | undefined;
|
|
243
|
+
depositedAmount?: string | null | undefined;
|
|
244
|
+
depositedAmountFormatted?: string | null | undefined;
|
|
245
|
+
depositedAmountUsd?: string | null | undefined;
|
|
246
|
+
refundFee?: string | null | undefined;
|
|
247
|
+
referral?: string | null | undefined;
|
|
248
|
+
};
|
|
249
|
+
quoteResponse?: {
|
|
250
|
+
signature: string;
|
|
251
|
+
timestamp: string;
|
|
252
|
+
quoteRequest: Record<string, unknown>;
|
|
253
|
+
quote: {
|
|
254
|
+
amountInUsd: string;
|
|
255
|
+
amountOut: string;
|
|
256
|
+
amountIn: string;
|
|
257
|
+
amountInFormatted: string;
|
|
258
|
+
amountOutFormatted: string;
|
|
259
|
+
amountOutUsd: string;
|
|
260
|
+
minAmountIn: string;
|
|
261
|
+
minAmountOut: string;
|
|
262
|
+
timeEstimate: number;
|
|
263
|
+
depositAddress?: string | undefined;
|
|
264
|
+
refundFee?: string | undefined;
|
|
265
|
+
depositMemo?: string | undefined;
|
|
266
|
+
deadline?: string | undefined;
|
|
267
|
+
timeWhenInactive?: string | undefined;
|
|
268
|
+
};
|
|
269
|
+
correlationId?: string | undefined;
|
|
270
|
+
} | undefined;
|
|
271
|
+
}, {
|
|
272
|
+
status: "FAILED" | "KNOWN_DEPOSIT_TX" | "PENDING_DEPOSIT" | "INCOMPLETE_DEPOSIT" | "PROCESSING" | "SUCCESS" | "REFUNDED";
|
|
273
|
+
updatedAt: string;
|
|
274
|
+
correlationId: string;
|
|
275
|
+
swapDetails: {
|
|
276
|
+
intentHashes: string[];
|
|
277
|
+
nearTxHashes: string[];
|
|
278
|
+
originChainTxHashes: {
|
|
279
|
+
hash: string;
|
|
280
|
+
explorerUrl: string;
|
|
281
|
+
}[];
|
|
282
|
+
destinationChainTxHashes: {
|
|
283
|
+
hash: string;
|
|
284
|
+
explorerUrl: string;
|
|
285
|
+
}[];
|
|
286
|
+
amountInUsd?: string | null | undefined;
|
|
287
|
+
amountOut?: string | null | undefined;
|
|
288
|
+
amountIn?: string | null | undefined;
|
|
289
|
+
amountInFormatted?: string | null | undefined;
|
|
290
|
+
amountOutFormatted?: string | null | undefined;
|
|
291
|
+
amountOutUsd?: string | null | undefined;
|
|
292
|
+
slippage?: number | null | undefined;
|
|
293
|
+
refundedAmount?: string | null | undefined;
|
|
294
|
+
refundedAmountFormatted?: string | null | undefined;
|
|
295
|
+
refundedAmountUsd?: string | null | undefined;
|
|
296
|
+
refundReason?: string | null | undefined;
|
|
297
|
+
depositedAmount?: string | null | undefined;
|
|
298
|
+
depositedAmountFormatted?: string | null | undefined;
|
|
299
|
+
depositedAmountUsd?: string | null | undefined;
|
|
300
|
+
refundFee?: string | null | undefined;
|
|
301
|
+
referral?: string | null | undefined;
|
|
302
|
+
};
|
|
303
|
+
quoteResponse?: {
|
|
304
|
+
signature: string;
|
|
305
|
+
timestamp: string;
|
|
306
|
+
quoteRequest: Record<string, unknown>;
|
|
307
|
+
quote: {
|
|
308
|
+
amountInUsd: string;
|
|
309
|
+
amountOut: string;
|
|
310
|
+
amountIn: string;
|
|
311
|
+
amountInFormatted: string;
|
|
312
|
+
amountOutFormatted: string;
|
|
313
|
+
amountOutUsd: string;
|
|
314
|
+
minAmountIn: string;
|
|
315
|
+
minAmountOut: string;
|
|
316
|
+
timeEstimate: number;
|
|
317
|
+
depositAddress?: string | undefined;
|
|
318
|
+
refundFee?: string | undefined;
|
|
319
|
+
depositMemo?: string | undefined;
|
|
320
|
+
deadline?: string | undefined;
|
|
321
|
+
timeWhenInactive?: string | undefined;
|
|
322
|
+
};
|
|
323
|
+
correlationId?: string | undefined;
|
|
324
|
+
} | undefined;
|
|
325
|
+
}>;
|
|
326
|
+
export type NearIntentRawStatus = z.infer<typeof NearIntentRawStatusSchema>;
|
|
327
|
+
/**
|
|
328
|
+
* Flattened, callable-friendly view of an intent's status. Built from the
|
|
329
|
+
* raw response by `fetchNearIntentStatus`. Holds the fields a verifier needs
|
|
330
|
+
* to bind a swap to its claimed destination, refund, deadline, and amounts —
|
|
331
|
+
* pulled out from the nested `quoteResponse.quoteRequest` / `quote` objects.
|
|
332
|
+
*/
|
|
333
|
+
export interface NearIntentStatusResponse {
|
|
334
|
+
readonly status: NearIntentStatusCode;
|
|
335
|
+
readonly correlationId: string;
|
|
336
|
+
readonly updatedAt: string;
|
|
337
|
+
readonly depositAddress: string | null;
|
|
338
|
+
readonly depositMemo: string | null;
|
|
339
|
+
readonly destinationAddress: string | null;
|
|
340
|
+
readonly destinationAssetId: string | null;
|
|
341
|
+
readonly refundAddress: string | null;
|
|
342
|
+
readonly deadline: string | null;
|
|
343
|
+
readonly expectedOutputAmount: string | null;
|
|
344
|
+
readonly actualOutputAmount: string | null;
|
|
345
|
+
readonly intentHash: string | null;
|
|
346
|
+
readonly originTxHashes: readonly string[];
|
|
347
|
+
readonly destinationTxHashes: readonly string[];
|
|
348
|
+
readonly refundReason: string | null;
|
|
349
|
+
}
|
|
350
|
+
export declare const NearRpcResponseSchema: z.ZodObject<{
|
|
351
|
+
jsonrpc: z.ZodString;
|
|
352
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
353
|
+
result: z.ZodUnknown;
|
|
354
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
355
|
+
}, "strip", z.ZodTypeAny, {
|
|
356
|
+
id: string | number;
|
|
357
|
+
jsonrpc: string;
|
|
358
|
+
error?: unknown;
|
|
359
|
+
result?: unknown;
|
|
360
|
+
}, {
|
|
361
|
+
id: string | number;
|
|
362
|
+
jsonrpc: string;
|
|
363
|
+
error?: unknown;
|
|
364
|
+
result?: unknown;
|
|
365
|
+
}>;
|
|
366
|
+
export declare const NearIntentOnChainSchema: z.ZodObject<{
|
|
367
|
+
destinationAddress: z.ZodString;
|
|
368
|
+
expectedOutputAmount: z.ZodString;
|
|
369
|
+
}, "strip", z.ZodTypeAny, {
|
|
370
|
+
destinationAddress: string;
|
|
371
|
+
expectedOutputAmount: string;
|
|
372
|
+
}, {
|
|
373
|
+
destinationAddress: string;
|
|
374
|
+
expectedOutputAmount: string;
|
|
375
|
+
}>;
|
|
376
|
+
//# sourceMappingURL=near-intents.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"near-intents.zod.d.ts","sourceRoot":"","sources":["../../src/wire/near-intents.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,oBAAoB,yHAQ/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAyDxE,4CAA4C;AAC5C,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAGD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAKhC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;EAGlC,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Wire schemas for the real 1Click `/v0/status` response.
|
|
4
|
+
*
|
|
5
|
+
* Source-of-truth: 1Click OpenAPI v0.1.10 (`@defuse-protocol/one-click-sdk-typescript`)
|
|
6
|
+
* cross-validated against live API captures stored in
|
|
7
|
+
* `apps/swap-engine/tests/fixtures/oneclick/`. Any divergence here from the
|
|
8
|
+
* real response will silently break verification — keep these in sync.
|
|
9
|
+
*
|
|
10
|
+
* Notable shape facts:
|
|
11
|
+
* - Status enum has exactly 7 values. There is **no** NOT_FOUND or EXPIRED
|
|
12
|
+
* sentinel — `NOT_FOUND` is signaled via HTTP 404, and post-deadline
|
|
13
|
+
* expiry is computed against `quote.deadline`.
|
|
14
|
+
* - Most user-visible fields (recipient, refundTo, depositAddress, deadline)
|
|
15
|
+
* are **nested** under `quoteResponse.quoteRequest` / `quoteResponse.quote`
|
|
16
|
+
* — not at the top level.
|
|
17
|
+
* - `swapDetails.*Amount` fields are explicit `null` for not-yet-applicable
|
|
18
|
+
* states (PENDING_DEPOSIT etc.) — `.nullish()` is required, not `.optional()`.
|
|
19
|
+
* - The nested `quoteResponse.correlationId` is dropped on this nested copy
|
|
20
|
+
* (the outer status response carries its own correlationId).
|
|
21
|
+
*/
|
|
22
|
+
export const NearIntentStatusCode = z.enum([
|
|
23
|
+
'KNOWN_DEPOSIT_TX',
|
|
24
|
+
'PENDING_DEPOSIT',
|
|
25
|
+
'INCOMPLETE_DEPOSIT',
|
|
26
|
+
'PROCESSING',
|
|
27
|
+
'SUCCESS',
|
|
28
|
+
'REFUNDED',
|
|
29
|
+
'FAILED',
|
|
30
|
+
]);
|
|
31
|
+
const TransactionDetailsSchema = z.object({
|
|
32
|
+
hash: z.string(),
|
|
33
|
+
explorerUrl: z.string(),
|
|
34
|
+
});
|
|
35
|
+
const SwapDetailsSchema = z.object({
|
|
36
|
+
intentHashes: z.array(z.string()),
|
|
37
|
+
nearTxHashes: z.array(z.string()),
|
|
38
|
+
amountIn: z.string().nullish(),
|
|
39
|
+
amountInFormatted: z.string().nullish(),
|
|
40
|
+
amountInUsd: z.string().nullish(),
|
|
41
|
+
amountOut: z.string().nullish(),
|
|
42
|
+
amountOutFormatted: z.string().nullish(),
|
|
43
|
+
amountOutUsd: z.string().nullish(),
|
|
44
|
+
slippage: z.number().nullish(),
|
|
45
|
+
originChainTxHashes: z.array(TransactionDetailsSchema),
|
|
46
|
+
destinationChainTxHashes: z.array(TransactionDetailsSchema),
|
|
47
|
+
refundedAmount: z.string().nullish(),
|
|
48
|
+
refundedAmountFormatted: z.string().nullish(),
|
|
49
|
+
refundedAmountUsd: z.string().nullish(),
|
|
50
|
+
refundReason: z.string().nullish(),
|
|
51
|
+
depositedAmount: z.string().nullish(),
|
|
52
|
+
depositedAmountFormatted: z.string().nullish(),
|
|
53
|
+
depositedAmountUsd: z.string().nullish(),
|
|
54
|
+
refundFee: z.string().nullish(),
|
|
55
|
+
referral: z.string().nullish(),
|
|
56
|
+
});
|
|
57
|
+
const QuoteSchema = z.object({
|
|
58
|
+
depositAddress: z.string().optional(),
|
|
59
|
+
depositMemo: z.string().optional(),
|
|
60
|
+
amountIn: z.string(),
|
|
61
|
+
amountInFormatted: z.string(),
|
|
62
|
+
amountInUsd: z.string(),
|
|
63
|
+
minAmountIn: z.string(),
|
|
64
|
+
amountOut: z.string(),
|
|
65
|
+
amountOutFormatted: z.string(),
|
|
66
|
+
amountOutUsd: z.string(),
|
|
67
|
+
minAmountOut: z.string(),
|
|
68
|
+
deadline: z.string().optional(),
|
|
69
|
+
timeWhenInactive: z.string().optional(),
|
|
70
|
+
timeEstimate: z.number().nonnegative(),
|
|
71
|
+
refundFee: z.string().optional(),
|
|
72
|
+
});
|
|
73
|
+
// `correlationId` is dropped on the nested copy; everything else mirrors the
|
|
74
|
+
// top-level QuoteResponse.
|
|
75
|
+
const NestedQuoteResponseSchema = z.object({
|
|
76
|
+
correlationId: z.string().optional(),
|
|
77
|
+
timestamp: z.string(),
|
|
78
|
+
signature: z.string().min(1),
|
|
79
|
+
quoteRequest: z.record(z.string(), z.unknown()),
|
|
80
|
+
quote: QuoteSchema,
|
|
81
|
+
});
|
|
82
|
+
/** Raw shape returned by GET /v0/status. */
|
|
83
|
+
export const NearIntentRawStatusSchema = z.object({
|
|
84
|
+
correlationId: z.string(),
|
|
85
|
+
status: NearIntentStatusCode,
|
|
86
|
+
updatedAt: z.string(),
|
|
87
|
+
swapDetails: SwapDetailsSchema,
|
|
88
|
+
quoteResponse: NestedQuoteResponseSchema.optional(),
|
|
89
|
+
});
|
|
90
|
+
// NEAR RPC schemas — direct-blockchain near-intents only, NOT the 1Click API.
|
|
91
|
+
export const NearRpcResponseSchema = z.object({
|
|
92
|
+
jsonrpc: z.string(),
|
|
93
|
+
id: z.union([z.string(), z.number()]),
|
|
94
|
+
result: z.unknown(),
|
|
95
|
+
error: z.unknown().optional(),
|
|
96
|
+
});
|
|
97
|
+
export const NearIntentOnChainSchema = z.object({
|
|
98
|
+
destinationAddress: z.string(),
|
|
99
|
+
expectedOutputAmount: z.string(),
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=near-intents.zod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"near-intents.zod.js","sourceRoot":"","sources":["../../src/wire/near-intents.zod.ts"],"names":[],"mappings":"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"}
|