@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,224 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ThornodeInboundAddressSchema: z.ZodObject<{
|
|
3
|
+
chain: z.ZodString;
|
|
4
|
+
address: z.ZodString;
|
|
5
|
+
router: z.ZodOptional<z.ZodString>;
|
|
6
|
+
halted: z.ZodBoolean;
|
|
7
|
+
pub_key: z.ZodOptional<z.ZodString>;
|
|
8
|
+
global_trading_paused: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
chain_trading_paused: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
chain_lp_actions_paused: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
gas_rate: z.ZodOptional<z.ZodString>;
|
|
12
|
+
gas_rate_units: z.ZodOptional<z.ZodString>;
|
|
13
|
+
outbound_fee: z.ZodOptional<z.ZodString>;
|
|
14
|
+
outbound_tx_size: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
address: string;
|
|
17
|
+
chain: string;
|
|
18
|
+
halted: boolean;
|
|
19
|
+
router?: string | undefined;
|
|
20
|
+
pub_key?: string | undefined;
|
|
21
|
+
global_trading_paused?: boolean | undefined;
|
|
22
|
+
chain_trading_paused?: boolean | undefined;
|
|
23
|
+
chain_lp_actions_paused?: boolean | undefined;
|
|
24
|
+
gas_rate?: string | undefined;
|
|
25
|
+
gas_rate_units?: string | undefined;
|
|
26
|
+
outbound_fee?: string | undefined;
|
|
27
|
+
outbound_tx_size?: string | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
address: string;
|
|
30
|
+
chain: string;
|
|
31
|
+
halted: boolean;
|
|
32
|
+
router?: string | undefined;
|
|
33
|
+
pub_key?: string | undefined;
|
|
34
|
+
global_trading_paused?: boolean | undefined;
|
|
35
|
+
chain_trading_paused?: boolean | undefined;
|
|
36
|
+
chain_lp_actions_paused?: boolean | undefined;
|
|
37
|
+
gas_rate?: string | undefined;
|
|
38
|
+
gas_rate_units?: string | undefined;
|
|
39
|
+
outbound_fee?: string | undefined;
|
|
40
|
+
outbound_tx_size?: string | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
export type ThornodeInboundAddress = z.infer<typeof ThornodeInboundAddressSchema>;
|
|
43
|
+
export declare const ThornodeInboundAddressesSchema: z.ZodArray<z.ZodObject<{
|
|
44
|
+
chain: z.ZodString;
|
|
45
|
+
address: z.ZodString;
|
|
46
|
+
router: z.ZodOptional<z.ZodString>;
|
|
47
|
+
halted: z.ZodBoolean;
|
|
48
|
+
pub_key: z.ZodOptional<z.ZodString>;
|
|
49
|
+
global_trading_paused: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
chain_trading_paused: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
chain_lp_actions_paused: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
gas_rate: z.ZodOptional<z.ZodString>;
|
|
53
|
+
gas_rate_units: z.ZodOptional<z.ZodString>;
|
|
54
|
+
outbound_fee: z.ZodOptional<z.ZodString>;
|
|
55
|
+
outbound_tx_size: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
address: string;
|
|
58
|
+
chain: string;
|
|
59
|
+
halted: boolean;
|
|
60
|
+
router?: string | undefined;
|
|
61
|
+
pub_key?: string | undefined;
|
|
62
|
+
global_trading_paused?: boolean | undefined;
|
|
63
|
+
chain_trading_paused?: boolean | undefined;
|
|
64
|
+
chain_lp_actions_paused?: boolean | undefined;
|
|
65
|
+
gas_rate?: string | undefined;
|
|
66
|
+
gas_rate_units?: string | undefined;
|
|
67
|
+
outbound_fee?: string | undefined;
|
|
68
|
+
outbound_tx_size?: string | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
address: string;
|
|
71
|
+
chain: string;
|
|
72
|
+
halted: boolean;
|
|
73
|
+
router?: string | undefined;
|
|
74
|
+
pub_key?: string | undefined;
|
|
75
|
+
global_trading_paused?: boolean | undefined;
|
|
76
|
+
chain_trading_paused?: boolean | undefined;
|
|
77
|
+
chain_lp_actions_paused?: boolean | undefined;
|
|
78
|
+
gas_rate?: string | undefined;
|
|
79
|
+
gas_rate_units?: string | undefined;
|
|
80
|
+
outbound_fee?: string | undefined;
|
|
81
|
+
outbound_tx_size?: string | undefined;
|
|
82
|
+
}>, "many">;
|
|
83
|
+
/**
|
|
84
|
+
* `/thorchain/vaults/asgard` returns every Asgard vault, not just the
|
|
85
|
+
* current primary. During THORChain churn there are typically two active
|
|
86
|
+
* vaults per chain — the new "ActiveVault" and the "RetiringVault" that's
|
|
87
|
+
* still accepting late deposits. Both need to be treated as legitimate
|
|
88
|
+
* destinations for an in-flight swap. We only consume `status` and
|
|
89
|
+
* `addresses`; other fields are ignored.
|
|
90
|
+
*/
|
|
91
|
+
export declare const AsgardVaultAddressSchema: z.ZodObject<{
|
|
92
|
+
chain: z.ZodString;
|
|
93
|
+
address: z.ZodString;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
address: string;
|
|
96
|
+
chain: string;
|
|
97
|
+
}, {
|
|
98
|
+
address: string;
|
|
99
|
+
chain: string;
|
|
100
|
+
}>;
|
|
101
|
+
export type AsgardVaultAddress = z.infer<typeof AsgardVaultAddressSchema>;
|
|
102
|
+
export declare const AsgardVaultSchema: z.ZodObject<{
|
|
103
|
+
status: z.ZodString;
|
|
104
|
+
addresses: z.ZodArray<z.ZodObject<{
|
|
105
|
+
chain: z.ZodString;
|
|
106
|
+
address: z.ZodString;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
address: string;
|
|
109
|
+
chain: string;
|
|
110
|
+
}, {
|
|
111
|
+
address: string;
|
|
112
|
+
chain: string;
|
|
113
|
+
}>, "many">;
|
|
114
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
115
|
+
status: z.ZodString;
|
|
116
|
+
addresses: z.ZodArray<z.ZodObject<{
|
|
117
|
+
chain: z.ZodString;
|
|
118
|
+
address: z.ZodString;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
address: string;
|
|
121
|
+
chain: string;
|
|
122
|
+
}, {
|
|
123
|
+
address: string;
|
|
124
|
+
chain: string;
|
|
125
|
+
}>, "many">;
|
|
126
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
127
|
+
status: z.ZodString;
|
|
128
|
+
addresses: z.ZodArray<z.ZodObject<{
|
|
129
|
+
chain: z.ZodString;
|
|
130
|
+
address: z.ZodString;
|
|
131
|
+
}, "strip", z.ZodTypeAny, {
|
|
132
|
+
address: string;
|
|
133
|
+
chain: string;
|
|
134
|
+
}, {
|
|
135
|
+
address: string;
|
|
136
|
+
chain: string;
|
|
137
|
+
}>, "many">;
|
|
138
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
139
|
+
export type AsgardVault = z.infer<typeof AsgardVaultSchema>;
|
|
140
|
+
export declare const AsgardVaultsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
141
|
+
status: z.ZodString;
|
|
142
|
+
addresses: z.ZodArray<z.ZodObject<{
|
|
143
|
+
chain: z.ZodString;
|
|
144
|
+
address: z.ZodString;
|
|
145
|
+
}, "strip", z.ZodTypeAny, {
|
|
146
|
+
address: string;
|
|
147
|
+
chain: string;
|
|
148
|
+
}, {
|
|
149
|
+
address: string;
|
|
150
|
+
chain: string;
|
|
151
|
+
}>, "many">;
|
|
152
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
153
|
+
status: z.ZodString;
|
|
154
|
+
addresses: z.ZodArray<z.ZodObject<{
|
|
155
|
+
chain: z.ZodString;
|
|
156
|
+
address: z.ZodString;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
address: string;
|
|
159
|
+
chain: string;
|
|
160
|
+
}, {
|
|
161
|
+
address: string;
|
|
162
|
+
chain: string;
|
|
163
|
+
}>, "many">;
|
|
164
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
165
|
+
status: z.ZodString;
|
|
166
|
+
addresses: z.ZodArray<z.ZodObject<{
|
|
167
|
+
chain: z.ZodString;
|
|
168
|
+
address: z.ZodString;
|
|
169
|
+
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
address: string;
|
|
171
|
+
chain: string;
|
|
172
|
+
}, {
|
|
173
|
+
address: string;
|
|
174
|
+
chain: string;
|
|
175
|
+
}>, "many">;
|
|
176
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
177
|
+
export declare const ThornodeQuoteSchema: z.ZodObject<{
|
|
178
|
+
expected_amount_out: z.ZodString;
|
|
179
|
+
inbound_address: z.ZodOptional<z.ZodString>;
|
|
180
|
+
memo: z.ZodOptional<z.ZodString>;
|
|
181
|
+
fees: z.ZodOptional<z.ZodObject<{
|
|
182
|
+
asset: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
183
|
+
affiliate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
184
|
+
outbound: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
185
|
+
liquidity: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
186
|
+
total: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
187
|
+
}, "strip", z.ZodTypeAny, {
|
|
188
|
+
liquidity?: string | undefined;
|
|
189
|
+
asset?: string | undefined;
|
|
190
|
+
affiliate?: string | undefined;
|
|
191
|
+
outbound?: string | undefined;
|
|
192
|
+
total?: string | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
liquidity?: string | undefined;
|
|
195
|
+
asset?: string | undefined;
|
|
196
|
+
affiliate?: string | undefined;
|
|
197
|
+
outbound?: string | undefined;
|
|
198
|
+
total?: string | undefined;
|
|
199
|
+
}>>;
|
|
200
|
+
}, "strip", z.ZodTypeAny, {
|
|
201
|
+
expected_amount_out: string;
|
|
202
|
+
fees?: {
|
|
203
|
+
liquidity?: string | undefined;
|
|
204
|
+
asset?: string | undefined;
|
|
205
|
+
affiliate?: string | undefined;
|
|
206
|
+
outbound?: string | undefined;
|
|
207
|
+
total?: string | undefined;
|
|
208
|
+
} | undefined;
|
|
209
|
+
inbound_address?: string | undefined;
|
|
210
|
+
memo?: string | undefined;
|
|
211
|
+
}, {
|
|
212
|
+
expected_amount_out: string;
|
|
213
|
+
fees?: {
|
|
214
|
+
liquidity?: string | undefined;
|
|
215
|
+
asset?: string | undefined;
|
|
216
|
+
affiliate?: string | undefined;
|
|
217
|
+
outbound?: string | undefined;
|
|
218
|
+
total?: string | undefined;
|
|
219
|
+
} | undefined;
|
|
220
|
+
inbound_address?: string | undefined;
|
|
221
|
+
memo?: string | undefined;
|
|
222
|
+
}>;
|
|
223
|
+
export type ThornodeQuote = z.infer<typeof ThornodeQuoteSchema>;
|
|
224
|
+
//# sourceMappingURL=thorchain.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thorchain.zod.d.ts","sourceRoot":"","sources":["../../src/wire/thorchain.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAavC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAwC,CAAC;AAEpF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;EAGnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAKd,CAAC;AAEjB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAA6B,CAAC;AAErE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const ThornodeInboundAddressSchema = z.object({
|
|
3
|
+
chain: z.string(),
|
|
4
|
+
address: z.string(),
|
|
5
|
+
router: z.string().optional(),
|
|
6
|
+
halted: z.boolean(),
|
|
7
|
+
pub_key: z.string().optional(),
|
|
8
|
+
global_trading_paused: z.boolean().optional(),
|
|
9
|
+
chain_trading_paused: z.boolean().optional(),
|
|
10
|
+
chain_lp_actions_paused: z.boolean().optional(),
|
|
11
|
+
gas_rate: z.string().optional(),
|
|
12
|
+
gas_rate_units: z.string().optional(),
|
|
13
|
+
outbound_fee: z.string().optional(),
|
|
14
|
+
outbound_tx_size: z.string().optional(),
|
|
15
|
+
});
|
|
16
|
+
export const ThornodeInboundAddressesSchema = z.array(ThornodeInboundAddressSchema);
|
|
17
|
+
/**
|
|
18
|
+
* `/thorchain/vaults/asgard` returns every Asgard vault, not just the
|
|
19
|
+
* current primary. During THORChain churn there are typically two active
|
|
20
|
+
* vaults per chain — the new "ActiveVault" and the "RetiringVault" that's
|
|
21
|
+
* still accepting late deposits. Both need to be treated as legitimate
|
|
22
|
+
* destinations for an in-flight swap. We only consume `status` and
|
|
23
|
+
* `addresses`; other fields are ignored.
|
|
24
|
+
*/
|
|
25
|
+
export const AsgardVaultAddressSchema = z.object({
|
|
26
|
+
chain: z.string(),
|
|
27
|
+
address: z.string(),
|
|
28
|
+
});
|
|
29
|
+
export const AsgardVaultSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
status: z.string(),
|
|
32
|
+
addresses: z.array(AsgardVaultAddressSchema),
|
|
33
|
+
})
|
|
34
|
+
.passthrough();
|
|
35
|
+
export const AsgardVaultsResponseSchema = z.array(AsgardVaultSchema);
|
|
36
|
+
export const ThornodeQuoteSchema = z.object({
|
|
37
|
+
expected_amount_out: z.string(),
|
|
38
|
+
inbound_address: z.string().optional(),
|
|
39
|
+
memo: z.string().optional(),
|
|
40
|
+
fees: z
|
|
41
|
+
.object({
|
|
42
|
+
asset: z.string().optional(),
|
|
43
|
+
affiliate: z.string().optional(),
|
|
44
|
+
outbound: z.string().optional(),
|
|
45
|
+
liquidity: z.string().optional(),
|
|
46
|
+
total: z.string().optional(),
|
|
47
|
+
})
|
|
48
|
+
.partial()
|
|
49
|
+
.optional(),
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=thorchain.zod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thorchain.zod.js","sourceRoot":"","sources":["../../src/wire/thorchain.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,qBAAqB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC7C,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC5C,uBAAuB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;AAEpF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;CAC7C,CAAC;KACD,WAAW,EAAE,CAAC;AAIjB,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC/B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,CAAC;SACJ,MAAM,CAAC;QACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC/B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC7B,CAAC;SACD,OAAO,EAAE;SACT,QAAQ,EAAE;CACd,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@miradexio/client",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Headless crypto swap SDK — BTC/XMR atomic swaps, THORChain, Chainflip, NEAR Intents. Works in Node.js, browsers, React Native, and bots.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./portable": {
|
|
18
|
+
"types": "./dist/portable.d.ts",
|
|
19
|
+
"import": "./dist/portable.js"
|
|
20
|
+
},
|
|
21
|
+
"./api": {
|
|
22
|
+
"types": "./dist/api/index.d.ts",
|
|
23
|
+
"import": "./dist/api/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./atomic-swap": {
|
|
26
|
+
"types": "./dist/atomic-swap/index.d.ts",
|
|
27
|
+
"import": "./dist/atomic-swap/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./atomic-swap/presign": {
|
|
30
|
+
"types": "./dist/atomic-swap/presign.d.ts",
|
|
31
|
+
"import": "./dist/atomic-swap/presign.js"
|
|
32
|
+
},
|
|
33
|
+
"./atomic-swap/refund": {
|
|
34
|
+
"types": "./dist/atomic-swap/refund.d.ts",
|
|
35
|
+
"import": "./dist/atomic-swap/refund.js"
|
|
36
|
+
},
|
|
37
|
+
"./atomic-swap/monero-sweep": {
|
|
38
|
+
"types": "./dist/atomic-swap/monero-sweep/index.d.ts",
|
|
39
|
+
"import": "./dist/atomic-swap/monero-sweep/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./verification": {
|
|
42
|
+
"types": "./dist/verification/index.d.ts",
|
|
43
|
+
"import": "./dist/verification/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./verification/thorchain": {
|
|
46
|
+
"types": "./dist/verification/thorchain.d.ts",
|
|
47
|
+
"import": "./dist/verification/thorchain.js"
|
|
48
|
+
},
|
|
49
|
+
"./verification/chainflip": {
|
|
50
|
+
"types": "./dist/verification/chainflip.d.ts",
|
|
51
|
+
"import": "./dist/verification/chainflip.js"
|
|
52
|
+
},
|
|
53
|
+
"./verification/near-intents": {
|
|
54
|
+
"types": "./dist/verification/near-intents.d.ts",
|
|
55
|
+
"import": "./dist/verification/near-intents.js"
|
|
56
|
+
},
|
|
57
|
+
"./lib/bitcoin/tx-verify": {
|
|
58
|
+
"types": "./dist/lib/bitcoin/tx-verify.d.ts",
|
|
59
|
+
"import": "./dist/lib/bitcoin/tx-verify.js"
|
|
60
|
+
},
|
|
61
|
+
"./lib/monero/verify-lock": {
|
|
62
|
+
"types": "./dist/lib/monero/verify-lock.d.ts",
|
|
63
|
+
"import": "./dist/lib/monero/verify-lock.js"
|
|
64
|
+
},
|
|
65
|
+
"./package.json": "./package.json"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build:wasm": "bash miradex-rust/scripts/build-wasm.sh && pnpm run pin-wasm",
|
|
69
|
+
"build:all": "pnpm run build:wasm && pnpm run build",
|
|
70
|
+
"pin-wasm": "node scripts/pin-wasm.mjs",
|
|
71
|
+
"verify-wasm": "node scripts/verify-wasm.mjs",
|
|
72
|
+
"build": "tsc",
|
|
73
|
+
"dev": "tsc --watch",
|
|
74
|
+
"typecheck": "tsc --noEmit",
|
|
75
|
+
"test": "vitest run",
|
|
76
|
+
"test:watch": "vitest",
|
|
77
|
+
"prepublishOnly": "pnpm run build:all"
|
|
78
|
+
},
|
|
79
|
+
"keywords": [
|
|
80
|
+
"crypto",
|
|
81
|
+
"swap",
|
|
82
|
+
"atomic-swap",
|
|
83
|
+
"btc",
|
|
84
|
+
"xmr",
|
|
85
|
+
"monero",
|
|
86
|
+
"bitcoin",
|
|
87
|
+
"thorchain",
|
|
88
|
+
"chainflip",
|
|
89
|
+
"near-intents",
|
|
90
|
+
"sdk",
|
|
91
|
+
"headless",
|
|
92
|
+
"cross-chain"
|
|
93
|
+
],
|
|
94
|
+
"license": "MIT",
|
|
95
|
+
"repository": {
|
|
96
|
+
"type": "git",
|
|
97
|
+
"url": "https://github.com/miradxio/miradex-client"
|
|
98
|
+
},
|
|
99
|
+
"homepage": "https://github.com/miradxio/miradex-client",
|
|
100
|
+
"bugs": {
|
|
101
|
+
"url": "https://github.com/miradxio/miradex-client/issues"
|
|
102
|
+
},
|
|
103
|
+
"engines": {
|
|
104
|
+
"node": ">=20"
|
|
105
|
+
},
|
|
106
|
+
"files": [
|
|
107
|
+
"dist/",
|
|
108
|
+
"wasm/"
|
|
109
|
+
],
|
|
110
|
+
"dependencies": {
|
|
111
|
+
"@noble/ed25519": "^3.0.1",
|
|
112
|
+
"@noble/hashes": "^2.0.1",
|
|
113
|
+
"@scure/base": "^2.0.0",
|
|
114
|
+
"bip32": "^4.0.0",
|
|
115
|
+
"bip39": "^3.1.0",
|
|
116
|
+
"bitcoinjs-lib": "^7.0.1",
|
|
117
|
+
"ecpair": "^3.0.1",
|
|
118
|
+
"eventemitter3": "^5.0.4",
|
|
119
|
+
"miradex-rust": "file:./wasm/miradex-rust",
|
|
120
|
+
"tiny-secp256k1": "^2.2.4",
|
|
121
|
+
"zod": "^3.24.0"
|
|
122
|
+
},
|
|
123
|
+
"devDependencies": {
|
|
124
|
+
"fast-check": "^4.6.0",
|
|
125
|
+
"typescript": "^5.7.0",
|
|
126
|
+
"vitest": "^2.1.9"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# miradex-rust
|
|
2
|
+
|
|
3
|
+
Rust source for the BTC/XMR atomic-swap cryptographic primitives used by
|
|
4
|
+
[`@miradex/client`](..). Builds to a WebAssembly module that is consumed by
|
|
5
|
+
the TypeScript SDK at runtime.
|
|
6
|
+
|
|
7
|
+
This crate is the source of truth. The shipped binary lives at
|
|
8
|
+
`../wasm/miradex-rust/` and is checked into the repo so that ordinary
|
|
9
|
+
contributors do not need a Rust toolchain to work on `@miradex/client`.
|
|
10
|
+
|
|
11
|
+
## Build the wasm
|
|
12
|
+
|
|
13
|
+
From the `miradex-client/` package root (one level up):
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
pnpm run build:wasm
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
That runs `miradex-rust/scripts/build-wasm.sh` and then `pin-wasm`, which
|
|
20
|
+
re-hashes the resulting binary into `src/wasm-pins.ts`.
|
|
21
|
+
|
|
22
|
+
## Reproducing the published binary
|
|
23
|
+
|
|
24
|
+
Anyone with these tools can rebuild bit-identically and verify the SHA256
|
|
25
|
+
they get matches the one pinned in `src/wasm-pins.ts`:
|
|
26
|
+
|
|
27
|
+
| Tool | Pinned version | Source |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| Rust | `1.90.0` (channel) | `miradex-rust/rust-toolchain.toml` |
|
|
30
|
+
| `wasm-pack` | `0.14.0` | `cargo install wasm-pack --version 0.14.0` |
|
|
31
|
+
| `binaryen` (`wasm-opt`) | `version_119` | https://github.com/WebAssembly/binaryen/releases/tag/version_119 |
|
|
32
|
+
| `jq` | any 1.x | system package |
|
|
33
|
+
|
|
34
|
+
Steps:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
# 1. Toolchain (rust-toolchain.toml auto-installs on first cargo invocation)
|
|
38
|
+
cargo install wasm-pack --version 0.14.0
|
|
39
|
+
|
|
40
|
+
# 2. Install binaryen (Linux example; macOS users: brew install binaryen)
|
|
41
|
+
curl -L https://github.com/WebAssembly/binaryen/releases/download/version_119/binaryen-version_119-x86_64-linux.tar.gz \
|
|
42
|
+
| tar xz -C /tmp
|
|
43
|
+
sudo cp /tmp/binaryen-version_119/bin/wasm-opt /usr/local/bin/
|
|
44
|
+
|
|
45
|
+
# 3. Clone, build, verify
|
|
46
|
+
git clone <repo>
|
|
47
|
+
cd miradex-client
|
|
48
|
+
pnpm install
|
|
49
|
+
pnpm run build:wasm # rebuilds wasm + repins SHA256
|
|
50
|
+
pnpm run verify-wasm # exits 0 if the freshly-built binary matches the pin
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
If `verify-wasm` exits 0, the committed binary at
|
|
54
|
+
`../wasm/miradex-rust/miradex_rust_bg.wasm` is bit-identical to what this
|
|
55
|
+
source produces in this toolchain.
|
|
56
|
+
|
|
57
|
+
If you suspect drift between source and the binary committed to git, run
|
|
58
|
+
`pnpm run verify-wasm` *without* first rebuilding — it compares the
|
|
59
|
+
already-committed binary to the already-committed pin.
|
|
60
|
+
|
|
61
|
+
## Caveats on bit-reproducibility
|
|
62
|
+
|
|
63
|
+
- `Cargo.lock` is committed; do not delete it before building.
|
|
64
|
+
- `wasm-pack` patch versions can change the cdylib layout. Match the version
|
|
65
|
+
in the table above.
|
|
66
|
+
- `wasm-opt` produces different output across binaryen releases. Match the
|
|
67
|
+
pinned `binaryen` release.
|
|
68
|
+
- macOS / Linux produce identical wasm output for these crates in practice.
|
|
69
|
+
|
|
70
|
+
## What this crate exports
|
|
71
|
+
|
|
72
|
+
`#[wasm_bindgen]` exports in `src/lib.rs` are mirrored in
|
|
73
|
+
`packages/miradex-client/src/lib/crypto/types.ts`. Adding a new export means
|
|
74
|
+
updating both.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Compute the commitment mask for an output.
|
|
6
|
+
*/
|
|
7
|
+
export function compute_commitment_mask(view_key_hex: string, tx_public_key_hex: string, output_index: bigint): string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Decrypt a RingCT amount for an output.
|
|
11
|
+
*/
|
|
12
|
+
export function decrypt_amount(view_key_hex: string, tx_public_key_hex: string, output_index: bigint, encrypted_amount_hex: string): bigint;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Decrypt an adaptor-encrypted signature with the decryption scalar.
|
|
16
|
+
*/
|
|
17
|
+
export function decrypt_signature(scalar_hex: string, encsig_hex: string): string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Derive key images for a set of outputs using the combined spend key.
|
|
21
|
+
*/
|
|
22
|
+
export function derive_key_images(outputs_json: string, view_key_hex: string, spend_key_hex: string): string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Add two ed25519 scalars modulo the group order.
|
|
26
|
+
*/
|
|
27
|
+
export function ed25519_scalar_add(scalar_a_hex: string, scalar_b_hex: string): string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Produce an adaptor-encrypted signature under the given encryption point.
|
|
31
|
+
*/
|
|
32
|
+
export function encsign_digest(b_hex: string, encryption_key_hex: string, digest_hex: string): string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Generate a fresh BTC/XMR swap key bundle with DLEQ proof.
|
|
36
|
+
*/
|
|
37
|
+
export function generate_client_keys(): string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Derive a BTC/XMR key bundle from caller-supplied seed material.
|
|
41
|
+
*/
|
|
42
|
+
export function generate_client_keys_from_seed(s_b_hex: string, v_b_hex: string, b_hex: string): string;
|
|
43
|
+
|
|
44
|
+
export function init_panic_hook(): void;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Recover the adaptor scalar given the decrypted signature and the encsig.
|
|
48
|
+
*/
|
|
49
|
+
export function recover_adaptor_scalar(sig_hex: string, encsig_hex: string, encryption_key_hex: string): string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Convert a secp256k1 scalar (big-endian) to an ed25519 scalar (little-endian).
|
|
53
|
+
*/
|
|
54
|
+
export function secp256k1_scalar_to_ed25519(secp_scalar_hex: string): string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Select decoys for a CLSAG ring using wallet2's gamma distribution.
|
|
58
|
+
*
|
|
59
|
+
* The JSON input may optionally include `unlock_window_blocks` to override
|
|
60
|
+
* wallet2's `DEFAULT_LOCK_WINDOW` (10). Use 60 (coinbase lock) on chains
|
|
61
|
+
* dominated by coinbase outputs (regtest, conservative configurations).
|
|
62
|
+
*/
|
|
63
|
+
export function select_decoys(real_output_index: bigint, cumulative_distribution_json: string, ring_size: number): string;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Sign a 32-byte digest with a secp256k1 secret key. Returns 64-byte compact.
|
|
67
|
+
*/
|
|
68
|
+
export function sign_digest(b_hex: string, digest_hex: string): string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Sign a Monero sweep transaction.
|
|
72
|
+
*/
|
|
73
|
+
export function sign_sweep_tx(construction_data_json: string, spend_key_hex: string, view_key_hex: string): string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Verify a commitment matches expected mask + amount.
|
|
77
|
+
*/
|
|
78
|
+
export function verify_commitment(view_key_hex: string, tx_public_key_hex: string, output_index: bigint, amount: bigint, on_chain_commitment_hex: string): boolean;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Verify a DLEQ proof binding a secp256k1 key to an ed25519 key.
|
|
82
|
+
*/
|
|
83
|
+
export function verify_dleq_proof(s_bitcoin_hex: string, s_monero_hex: string, proof_hex: string): boolean;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Verify an adaptor-encrypted signature is valid for the triple.
|
|
87
|
+
*/
|
|
88
|
+
export function verify_encsig(verification_key_hex: string, encryption_key_hex: string, digest_hex: string, encsig_hex: string): boolean;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Crate version string — used by consumers to verify pin drift.
|
|
92
|
+
*/
|
|
93
|
+
export function version(): string;
|
|
94
|
+
|
|
95
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
96
|
+
|
|
97
|
+
export interface InitOutput {
|
|
98
|
+
readonly memory: WebAssembly.Memory;
|
|
99
|
+
readonly compute_commitment_mask: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
|
|
100
|
+
readonly decrypt_amount: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number) => void;
|
|
101
|
+
readonly decrypt_signature: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
102
|
+
readonly derive_key_images: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
103
|
+
readonly ed25519_scalar_add: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
104
|
+
readonly encsign_digest: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
105
|
+
readonly generate_client_keys: (a: number) => void;
|
|
106
|
+
readonly generate_client_keys_from_seed: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
107
|
+
readonly init_panic_hook: () => void;
|
|
108
|
+
readonly recover_adaptor_scalar: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
109
|
+
readonly secp256k1_scalar_to_ed25519: (a: number, b: number, c: number) => void;
|
|
110
|
+
readonly select_decoys: (a: number, b: bigint, c: number, d: number, e: number) => void;
|
|
111
|
+
readonly sign_digest: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
112
|
+
readonly sign_sweep_tx: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
113
|
+
readonly verify_commitment: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: bigint, h: number, i: number) => void;
|
|
114
|
+
readonly verify_dleq_proof: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
115
|
+
readonly verify_encsig: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
116
|
+
readonly version: (a: number) => void;
|
|
117
|
+
readonly rustsecp256k1_v0_9_2_context_create: (a: number) => number;
|
|
118
|
+
readonly rustsecp256k1_v0_9_2_context_destroy: (a: number) => void;
|
|
119
|
+
readonly rustsecp256k1_v0_9_2_default_error_callback_fn: (a: number, b: number) => void;
|
|
120
|
+
readonly rustsecp256k1_v0_9_2_default_illegal_callback_fn: (a: number, b: number) => void;
|
|
121
|
+
readonly __wbindgen_export: (a: number) => void;
|
|
122
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number) => void;
|
|
123
|
+
readonly __wbindgen_export3: (a: number, b: number) => number;
|
|
124
|
+
readonly __wbindgen_export4: (a: number, b: number, c: number, d: number) => number;
|
|
125
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
126
|
+
readonly __wbindgen_start: () => void;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
133
|
+
* a precompiled `WebAssembly.Module`.
|
|
134
|
+
*
|
|
135
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
136
|
+
*
|
|
137
|
+
* @returns {InitOutput}
|
|
138
|
+
*/
|
|
139
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
143
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
144
|
+
*
|
|
145
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
146
|
+
*
|
|
147
|
+
* @returns {Promise<InitOutput>}
|
|
148
|
+
*/
|
|
149
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|