crypto-aio 0.0.3 → 0.2.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/CHANGELOG.md +167 -0
- package/README.md +163 -13
- package/dist/adapters/avalanche/address.d.ts +15 -0
- package/dist/adapters/avalanche/address.js +74 -0
- package/dist/adapters/avalanche/address.js.map +1 -0
- package/dist/adapters/avalanche/api.d.ts +100 -0
- package/dist/adapters/avalanche/api.js +381 -0
- package/dist/adapters/avalanche/api.js.map +1 -0
- package/dist/adapters/avalanche/builder.d.ts +13 -0
- package/dist/adapters/avalanche/builder.js +336 -0
- package/dist/adapters/avalanche/builder.js.map +1 -0
- package/dist/adapters/avalanche/cb58.d.ts +7 -0
- package/dist/adapters/avalanche/cb58.js +49 -0
- package/dist/adapters/avalanche/cb58.js.map +1 -0
- package/dist/adapters/avalanche/chains.d.ts +21 -0
- package/dist/adapters/avalanche/chains.js +79 -0
- package/dist/adapters/avalanche/chains.js.map +1 -0
- package/dist/adapters/avalanche/codec.d.ts +94 -0
- package/dist/adapters/avalanche/codec.js +371 -0
- package/dist/adapters/avalanche/codec.js.map +1 -0
- package/dist/adapters/avalanche/context.d.ts +59 -0
- package/dist/adapters/avalanche/context.js +114 -0
- package/dist/adapters/avalanche/context.js.map +1 -0
- package/dist/adapters/avalanche/decode.d.ts +16 -0
- package/dist/adapters/avalanche/decode.js +101 -0
- package/dist/adapters/avalanche/decode.js.map +1 -0
- package/dist/adapters/avalanche/driver.d.ts +22 -0
- package/dist/adapters/avalanche/driver.js +81 -0
- package/dist/adapters/avalanche/driver.js.map +1 -0
- package/dist/adapters/avalanche/errors.d.ts +18 -0
- package/dist/adapters/avalanche/errors.js +61 -0
- package/dist/adapters/avalanche/errors.js.map +1 -0
- package/dist/adapters/avalanche/fees.d.ts +23 -0
- package/dist/adapters/avalanche/fees.js +105 -0
- package/dist/adapters/avalanche/fees.js.map +1 -0
- package/dist/adapters/avalanche/index.d.ts +19 -0
- package/dist/adapters/avalanche/index.js +8 -0
- package/dist/adapters/avalanche/index.js.map +1 -0
- package/dist/adapters/avalanche/network.d.ts +37 -0
- package/dist/adapters/avalanche/network.js +135 -0
- package/dist/adapters/avalanche/network.js.map +1 -0
- package/dist/adapters/avalanche/plugin.d.ts +21 -0
- package/dist/adapters/avalanche/plugin.js +46 -0
- package/dist/adapters/avalanche/plugin.js.map +1 -0
- package/dist/adapters/avalanche/presets.d.ts +6 -0
- package/dist/adapters/avalanche/presets.js +86 -0
- package/dist/adapters/avalanche/presets.js.map +1 -0
- package/dist/adapters/avalanche/proofs.d.ts +41 -0
- package/dist/adapters/avalanche/proofs.js +270 -0
- package/dist/adapters/avalanche/proofs.js.map +1 -0
- package/dist/adapters/avalanche/reader.d.ts +40 -0
- package/dist/adapters/avalanche/reader.js +231 -0
- package/dist/adapters/avalanche/reader.js.map +1 -0
- package/dist/adapters/avalanche/sdk.d.ts +182 -0
- package/dist/adapters/avalanche/sdk.js +21 -0
- package/dist/adapters/avalanche/sdk.js.map +1 -0
- package/dist/adapters/avalanche/types.d.ts +86 -0
- package/dist/{type/common.js → adapters/avalanche/types.js} +1 -1
- package/dist/adapters/avalanche/types.js.map +1 -0
- package/dist/adapters/evm/builder.d.ts +11 -0
- package/dist/adapters/evm/builder.js +386 -0
- package/dist/adapters/evm/builder.js.map +1 -0
- package/dist/adapters/evm/chains.d.ts +6 -0
- package/dist/adapters/evm/chains.js +203 -0
- package/dist/adapters/evm/chains.js.map +1 -0
- package/dist/adapters/evm/client.d.ts +84 -0
- package/dist/adapters/evm/client.js +335 -0
- package/dist/adapters/evm/client.js.map +1 -0
- package/dist/adapters/evm/decode.d.ts +35 -0
- package/dist/adapters/evm/decode.js +175 -0
- package/dist/adapters/evm/decode.js.map +1 -0
- package/dist/adapters/evm/driver.d.ts +8 -0
- package/dist/adapters/evm/driver.js +61 -0
- package/dist/adapters/evm/driver.js.map +1 -0
- package/dist/adapters/evm/errors.d.ts +20 -0
- package/dist/adapters/evm/errors.js +110 -0
- package/dist/adapters/evm/errors.js.map +1 -0
- package/dist/adapters/evm/ethers-client.d.ts +43 -0
- package/dist/adapters/evm/ethers-client.js +139 -0
- package/dist/adapters/evm/ethers-client.js.map +1 -0
- package/dist/adapters/evm/fees.d.ts +103 -0
- package/dist/adapters/evm/fees.js +277 -0
- package/dist/adapters/evm/fees.js.map +1 -0
- package/dist/adapters/evm/index.d.ts +20 -0
- package/dist/adapters/evm/index.js +12 -0
- package/dist/adapters/evm/index.js.map +1 -0
- package/dist/adapters/evm/network.d.ts +65 -0
- package/dist/adapters/evm/network.js +150 -0
- package/dist/adapters/evm/network.js.map +1 -0
- package/dist/adapters/evm/plugin.d.ts +35 -0
- package/dist/adapters/evm/plugin.js +150 -0
- package/dist/adapters/evm/plugin.js.map +1 -0
- package/dist/adapters/evm/presets.d.ts +2 -0
- package/dist/adapters/evm/presets.js +105 -0
- package/dist/adapters/evm/presets.js.map +1 -0
- package/dist/adapters/evm/proofs.d.ts +19 -0
- package/dist/adapters/evm/proofs.js +370 -0
- package/dist/adapters/evm/proofs.js.map +1 -0
- package/dist/adapters/evm/rawtx.d.ts +25 -0
- package/dist/adapters/evm/rawtx.js +176 -0
- package/dist/adapters/evm/rawtx.js.map +1 -0
- package/dist/adapters/evm/reader.d.ts +83 -0
- package/dist/adapters/evm/reader.js +326 -0
- package/dist/adapters/evm/reader.js.map +1 -0
- package/dist/adapters/evm/rpc.d.ts +39 -0
- package/dist/adapters/evm/rpc.js +152 -0
- package/dist/adapters/evm/rpc.js.map +1 -0
- package/dist/adapters/evm/tokens.d.ts +10 -0
- package/dist/adapters/evm/tokens.js +23 -0
- package/dist/adapters/evm/tokens.js.map +1 -0
- package/dist/adapters/evm/types.d.ts +265 -0
- package/dist/{type/account.js → adapters/evm/types.js} +1 -1
- package/dist/adapters/evm/types.js.map +1 -0
- package/dist/adapters/evm/web3-client.d.ts +26 -0
- package/dist/adapters/evm/web3-client.js +176 -0
- package/dist/adapters/evm/web3-client.js.map +1 -0
- package/dist/adapters/solana/builder.d.ts +18 -0
- package/dist/adapters/solana/builder.js +556 -0
- package/dist/adapters/solana/builder.js.map +1 -0
- package/dist/adapters/solana/chains.d.ts +13 -0
- package/dist/adapters/solana/chains.js +37 -0
- package/dist/adapters/solana/chains.js.map +1 -0
- package/dist/adapters/solana/decode.d.ts +111 -0
- package/dist/adapters/solana/decode.js +595 -0
- package/dist/adapters/solana/decode.js.map +1 -0
- package/dist/adapters/solana/driver.d.ts +15 -0
- package/dist/adapters/solana/driver.js +72 -0
- package/dist/adapters/solana/driver.js.map +1 -0
- package/dist/adapters/solana/errors.d.ts +36 -0
- package/dist/adapters/solana/errors.js +154 -0
- package/dist/adapters/solana/errors.js.map +1 -0
- package/dist/adapters/solana/fees.d.ts +77 -0
- package/dist/adapters/solana/fees.js +214 -0
- package/dist/adapters/solana/fees.js.map +1 -0
- package/dist/adapters/solana/heights.d.ts +47 -0
- package/dist/adapters/solana/heights.js +185 -0
- package/dist/adapters/solana/heights.js.map +1 -0
- package/dist/adapters/solana/history.d.ts +10 -0
- package/dist/adapters/solana/history.js +71 -0
- package/dist/adapters/solana/history.js.map +1 -0
- package/dist/adapters/solana/index.d.ts +16 -0
- package/dist/adapters/solana/index.js +9 -0
- package/dist/adapters/solana/index.js.map +1 -0
- package/dist/adapters/solana/keys.d.ts +13 -0
- package/dist/adapters/solana/keys.js +69 -0
- package/dist/adapters/solana/keys.js.map +1 -0
- package/dist/adapters/solana/message.d.ts +15 -0
- package/dist/adapters/solana/message.js +120 -0
- package/dist/adapters/solana/message.js.map +1 -0
- package/dist/adapters/solana/network.d.ts +24 -0
- package/dist/adapters/solana/network.js +95 -0
- package/dist/adapters/solana/network.js.map +1 -0
- package/dist/adapters/solana/plugin.d.ts +18 -0
- package/dist/adapters/solana/plugin.js +44 -0
- package/dist/adapters/solana/plugin.js.map +1 -0
- package/dist/adapters/solana/presets.d.ts +2 -0
- package/dist/adapters/solana/presets.js +77 -0
- package/dist/adapters/solana/presets.js.map +1 -0
- package/dist/adapters/solana/programs.d.ts +44 -0
- package/dist/adapters/solana/programs.js +159 -0
- package/dist/adapters/solana/programs.js.map +1 -0
- package/dist/adapters/solana/proofs.d.ts +56 -0
- package/dist/adapters/solana/proofs.js +540 -0
- package/dist/adapters/solana/proofs.js.map +1 -0
- package/dist/adapters/solana/reader.d.ts +82 -0
- package/dist/adapters/solana/reader.js +326 -0
- package/dist/adapters/solana/reader.js.map +1 -0
- package/dist/adapters/solana/rpc.d.ts +102 -0
- package/dist/adapters/solana/rpc.js +301 -0
- package/dist/adapters/solana/rpc.js.map +1 -0
- package/dist/adapters/solana/tokens.d.ts +7 -0
- package/dist/adapters/solana/tokens.js +19 -0
- package/dist/adapters/solana/tokens.js.map +1 -0
- package/dist/adapters/solana/types.d.ts +124 -0
- package/dist/{type/contract.js → adapters/solana/types.js} +1 -1
- package/dist/adapters/solana/types.js.map +1 -0
- package/dist/adapters/solana/web3.d.ts +5 -0
- package/dist/adapters/solana/web3.js +61 -0
- package/dist/adapters/solana/web3.js.map +1 -0
- package/dist/adapters/solana/wire.d.ts +62 -0
- package/dist/adapters/solana/wire.js +168 -0
- package/dist/adapters/solana/wire.js.map +1 -0
- package/dist/adapters/ton/address.d.ts +43 -0
- package/dist/adapters/ton/address.js +168 -0
- package/dist/adapters/ton/address.js.map +1 -0
- package/dist/adapters/ton/api.d.ts +344 -0
- package/dist/adapters/ton/api.js +942 -0
- package/dist/adapters/ton/api.js.map +1 -0
- package/dist/adapters/ton/builder.d.ts +18 -0
- package/dist/adapters/ton/builder.js +701 -0
- package/dist/adapters/ton/builder.js.map +1 -0
- package/dist/adapters/ton/chains.d.ts +16 -0
- package/dist/adapters/ton/chains.js +39 -0
- package/dist/adapters/ton/chains.js.map +1 -0
- package/dist/adapters/ton/decode.d.ts +43 -0
- package/dist/adapters/ton/decode.js +219 -0
- package/dist/adapters/ton/decode.js.map +1 -0
- package/dist/adapters/ton/driver.d.ts +10 -0
- package/dist/adapters/ton/driver.js +117 -0
- package/dist/adapters/ton/driver.js.map +1 -0
- package/dist/adapters/ton/errors.d.ts +36 -0
- package/dist/adapters/ton/errors.js +89 -0
- package/dist/adapters/ton/errors.js.map +1 -0
- package/dist/adapters/ton/fees.d.ts +28 -0
- package/dist/adapters/ton/fees.js +121 -0
- package/dist/adapters/ton/fees.js.map +1 -0
- package/dist/adapters/ton/index.d.ts +16 -0
- package/dist/adapters/ton/index.js +9 -0
- package/dist/adapters/ton/index.js.map +1 -0
- package/dist/adapters/ton/messages.d.ts +157 -0
- package/dist/adapters/ton/messages.js +397 -0
- package/dist/adapters/ton/messages.js.map +1 -0
- package/dist/adapters/ton/native-client.d.ts +10 -0
- package/dist/adapters/ton/native-client.js +47 -0
- package/dist/adapters/ton/native-client.js.map +1 -0
- package/dist/adapters/ton/network.d.ts +58 -0
- package/dist/adapters/ton/network.js +207 -0
- package/dist/adapters/ton/network.js.map +1 -0
- package/dist/adapters/ton/plugin.d.ts +24 -0
- package/dist/adapters/ton/plugin.js +57 -0
- package/dist/adapters/ton/plugin.js.map +1 -0
- package/dist/adapters/ton/presets.d.ts +6 -0
- package/dist/adapters/ton/presets.js +94 -0
- package/dist/adapters/ton/presets.js.map +1 -0
- package/dist/adapters/ton/proofs.d.ts +66 -0
- package/dist/adapters/ton/proofs.js +755 -0
- package/dist/adapters/ton/proofs.js.map +1 -0
- package/dist/adapters/ton/reader.d.ts +235 -0
- package/dist/adapters/ton/reader.js +976 -0
- package/dist/adapters/ton/reader.js.map +1 -0
- package/dist/adapters/ton/tokens.d.ts +10 -0
- package/dist/adapters/ton/tokens.js +27 -0
- package/dist/adapters/ton/tokens.js.map +1 -0
- package/dist/adapters/ton/trace.d.ts +74 -0
- package/dist/adapters/ton/trace.js +303 -0
- package/dist/adapters/ton/trace.js.map +1 -0
- package/dist/adapters/ton/types.d.ts +105 -0
- package/dist/{type/transact.js → adapters/ton/types.js} +1 -1
- package/dist/adapters/ton/types.js.map +1 -0
- package/dist/adapters/ton/wallets.d.ts +86 -0
- package/dist/adapters/ton/wallets.js +373 -0
- package/dist/adapters/ton/wallets.js.map +1 -0
- package/dist/adapters/tron/abi.d.ts +41 -0
- package/dist/adapters/tron/abi.js +112 -0
- package/dist/adapters/tron/abi.js.map +1 -0
- package/dist/adapters/tron/address.d.ts +20 -0
- package/dist/adapters/tron/address.js +110 -0
- package/dist/adapters/tron/address.js.map +1 -0
- package/dist/adapters/tron/builder.d.ts +12 -0
- package/dist/adapters/tron/builder.js +569 -0
- package/dist/adapters/tron/builder.js.map +1 -0
- package/dist/adapters/tron/chains.d.ts +12 -0
- package/dist/adapters/tron/chains.js +35 -0
- package/dist/adapters/tron/chains.js.map +1 -0
- package/dist/adapters/tron/codec.d.ts +10 -0
- package/dist/adapters/tron/codec.js +322 -0
- package/dist/adapters/tron/codec.js.map +1 -0
- package/dist/adapters/tron/decode.d.ts +52 -0
- package/dist/adapters/tron/decode.js +280 -0
- package/dist/adapters/tron/decode.js.map +1 -0
- package/dist/adapters/tron/driver.d.ts +12 -0
- package/dist/adapters/tron/driver.js +106 -0
- package/dist/adapters/tron/driver.js.map +1 -0
- package/dist/adapters/tron/errors.d.ts +74 -0
- package/dist/adapters/tron/errors.js +261 -0
- package/dist/adapters/tron/errors.js.map +1 -0
- package/dist/adapters/tron/fees.d.ts +49 -0
- package/dist/adapters/tron/fees.js +166 -0
- package/dist/adapters/tron/fees.js.map +1 -0
- package/dist/adapters/tron/http.d.ts +173 -0
- package/dist/adapters/tron/http.js +729 -0
- package/dist/adapters/tron/http.js.map +1 -0
- package/dist/adapters/tron/index.d.ts +16 -0
- package/dist/adapters/tron/index.js +15 -0
- package/dist/adapters/tron/index.js.map +1 -0
- package/dist/adapters/tron/network.d.ts +44 -0
- package/dist/adapters/tron/network.js +163 -0
- package/dist/adapters/tron/network.js.map +1 -0
- package/dist/adapters/tron/plugin.d.ts +17 -0
- package/dist/adapters/tron/plugin.js +39 -0
- package/dist/adapters/tron/plugin.js.map +1 -0
- package/dist/adapters/tron/presets.d.ts +5 -0
- package/dist/adapters/tron/presets.js +68 -0
- package/dist/adapters/tron/presets.js.map +1 -0
- package/dist/adapters/tron/proofs.d.ts +80 -0
- package/dist/adapters/tron/proofs.js +371 -0
- package/dist/adapters/tron/proofs.js.map +1 -0
- package/dist/adapters/tron/protobuf.d.ts +36 -0
- package/dist/adapters/tron/protobuf.js +90 -0
- package/dist/adapters/tron/protobuf.js.map +1 -0
- package/dist/adapters/tron/reader.d.ts +57 -0
- package/dist/adapters/tron/reader.js +220 -0
- package/dist/adapters/tron/reader.js.map +1 -0
- package/dist/adapters/tron/tokens.d.ts +9 -0
- package/dist/adapters/tron/tokens.js +14 -0
- package/dist/adapters/tron/tokens.js.map +1 -0
- package/dist/adapters/tron/types.d.ts +166 -0
- package/dist/adapters/tron/types.js +3 -0
- package/dist/adapters/tron/types.js.map +1 -0
- package/dist/adapters/utxo/address.d.ts +51 -0
- package/dist/adapters/utxo/address.js +341 -0
- package/dist/adapters/utxo/address.js.map +1 -0
- package/dist/adapters/utxo/builder.d.ts +35 -0
- package/dist/adapters/utxo/builder.js +380 -0
- package/dist/adapters/utxo/builder.js.map +1 -0
- package/dist/adapters/utxo/chains.d.ts +17 -0
- package/dist/adapters/utxo/chains.js +100 -0
- package/dist/adapters/utxo/chains.js.map +1 -0
- package/dist/adapters/utxo/codec.d.ts +120 -0
- package/dist/adapters/utxo/codec.js +408 -0
- package/dist/adapters/utxo/codec.js.map +1 -0
- package/dist/adapters/utxo/coinselect.d.ts +48 -0
- package/dist/adapters/utxo/coinselect.js +131 -0
- package/dist/adapters/utxo/coinselect.js.map +1 -0
- package/dist/adapters/utxo/context.d.ts +63 -0
- package/dist/adapters/utxo/context.js +125 -0
- package/dist/adapters/utxo/context.js.map +1 -0
- package/dist/adapters/utxo/decode.d.ts +22 -0
- package/dist/adapters/utxo/decode.js +121 -0
- package/dist/adapters/utxo/decode.js.map +1 -0
- package/dist/adapters/utxo/driver.d.ts +16 -0
- package/dist/adapters/utxo/driver.js +79 -0
- package/dist/adapters/utxo/driver.js.map +1 -0
- package/dist/adapters/utxo/ecc.d.ts +9 -0
- package/dist/adapters/utxo/ecc.js +26 -0
- package/dist/adapters/utxo/ecc.js.map +1 -0
- package/dist/adapters/utxo/errors.d.ts +52 -0
- package/dist/adapters/utxo/errors.js +191 -0
- package/dist/adapters/utxo/errors.js.map +1 -0
- package/dist/adapters/utxo/esplora.d.ts +100 -0
- package/dist/adapters/utxo/esplora.js +498 -0
- package/dist/adapters/utxo/esplora.js.map +1 -0
- package/dist/adapters/utxo/fees.d.ts +41 -0
- package/dist/adapters/utxo/fees.js +125 -0
- package/dist/adapters/utxo/fees.js.map +1 -0
- package/dist/adapters/utxo/index.d.ts +17 -0
- package/dist/adapters/utxo/index.js +8 -0
- package/dist/adapters/utxo/index.js.map +1 -0
- package/dist/adapters/utxo/network.d.ts +50 -0
- package/dist/adapters/utxo/network.js +165 -0
- package/dist/adapters/utxo/network.js.map +1 -0
- package/dist/adapters/utxo/plugin.d.ts +17 -0
- package/dist/adapters/utxo/plugin.js +41 -0
- package/dist/adapters/utxo/plugin.js.map +1 -0
- package/dist/adapters/utxo/presets.d.ts +12 -0
- package/dist/adapters/utxo/presets.js +47 -0
- package/dist/adapters/utxo/presets.js.map +1 -0
- package/dist/adapters/utxo/preview.d.ts +3 -0
- package/dist/adapters/utxo/preview.js +65 -0
- package/dist/adapters/utxo/preview.js.map +1 -0
- package/dist/adapters/utxo/proofs.d.ts +66 -0
- package/dist/adapters/utxo/proofs.js +469 -0
- package/dist/adapters/utxo/proofs.js.map +1 -0
- package/dist/adapters/utxo/rawblock.d.ts +46 -0
- package/dist/adapters/utxo/rawblock.js +159 -0
- package/dist/adapters/utxo/rawblock.js.map +1 -0
- package/dist/adapters/utxo/rawtx.d.ts +73 -0
- package/dist/adapters/utxo/rawtx.js +264 -0
- package/dist/adapters/utxo/rawtx.js.map +1 -0
- package/dist/adapters/utxo/reader.d.ts +36 -0
- package/dist/adapters/utxo/reader.js +265 -0
- package/dist/adapters/utxo/reader.js.map +1 -0
- package/dist/adapters/utxo/sdk.d.ts +18 -0
- package/dist/adapters/utxo/sdk.js +17 -0
- package/dist/adapters/utxo/sdk.js.map +1 -0
- package/dist/adapters/utxo/signed-psbt.d.ts +36 -0
- package/dist/adapters/utxo/signed-psbt.js +428 -0
- package/dist/adapters/utxo/signed-psbt.js.map +1 -0
- package/dist/adapters/utxo/spend.d.ts +59 -0
- package/dist/adapters/utxo/spend.js +230 -0
- package/dist/adapters/utxo/spend.js.map +1 -0
- package/dist/adapters/utxo/types.d.ts +167 -0
- package/dist/adapters/utxo/types.js +3 -0
- package/dist/adapters/utxo/types.js.map +1 -0
- package/dist/core/assets/service.d.ts +18 -0
- package/dist/core/assets/service.js +69 -0
- package/dist/core/assets/service.js.map +1 -0
- package/dist/core/blockchain/default-ref.d.ts +4 -0
- package/dist/core/blockchain/default-ref.js +16 -0
- package/dist/core/blockchain/default-ref.js.map +1 -0
- package/dist/core/blockchain/handle.d.ts +179 -0
- package/dist/core/blockchain/handle.js +579 -0
- package/dist/core/blockchain/handle.js.map +1 -0
- package/dist/core/blockchain/internal.d.ts +19 -0
- package/dist/core/blockchain/internal.js +16 -0
- package/dist/core/blockchain/internal.js.map +1 -0
- package/dist/core/blockchain/mapping.d.ts +22 -0
- package/dist/core/blockchain/mapping.js +136 -0
- package/dist/core/blockchain/mapping.js.map +1 -0
- package/dist/core/config/env.d.ts +8 -0
- package/dist/core/config/env.js +60 -0
- package/dist/core/config/env.js.map +1 -0
- package/dist/core/config/merge.d.ts +26 -0
- package/dist/core/config/merge.js +144 -0
- package/dist/core/config/merge.js.map +1 -0
- package/dist/core/config/resolve.d.ts +12 -0
- package/dist/core/config/resolve.js +251 -0
- package/dist/core/config/resolve.js.map +1 -0
- package/dist/core/config/types.d.ts +180 -0
- package/dist/core/config/types.js +3 -0
- package/dist/core/config/types.js.map +1 -0
- package/dist/core/container/builtins.d.ts +4 -0
- package/dist/core/container/builtins.js +13 -0
- package/dist/core/container/builtins.js.map +1 -0
- package/dist/core/container/container.d.ts +62 -0
- package/dist/core/container/container.js +500 -0
- package/dist/core/container/container.js.map +1 -0
- package/dist/core/container/default.d.ts +15 -0
- package/dist/core/container/default.js +70 -0
- package/dist/core/container/default.js.map +1 -0
- package/dist/core/container/internals.d.ts +54 -0
- package/dist/core/container/internals.js +21 -0
- package/dist/core/container/internals.js.map +1 -0
- package/dist/core/container/pool.d.ts +27 -0
- package/dist/core/container/pool.js +77 -0
- package/dist/core/container/pool.js.map +1 -0
- package/dist/core/driver/types.d.ts +379 -0
- package/dist/core/driver/types.js +3 -0
- package/dist/core/driver/types.js.map +1 -0
- package/dist/core/errors/codes.d.ts +163 -0
- package/dist/core/errors/codes.js +53 -0
- package/dist/core/errors/codes.js.map +1 -0
- package/dist/core/errors/error.d.ts +66 -0
- package/dist/core/errors/error.js +129 -0
- package/dist/core/errors/error.js.map +1 -0
- package/dist/core/events/bus.d.ts +12 -0
- package/dist/core/events/bus.js +46 -0
- package/dist/core/events/bus.js.map +1 -0
- package/dist/core/events/logger.d.ts +13 -0
- package/dist/core/events/logger.js +42 -0
- package/dist/core/events/logger.js.map +1 -0
- package/dist/core/events/types.d.ts +131 -0
- package/dist/core/events/types.js +3 -0
- package/dist/core/events/types.js.map +1 -0
- package/dist/core/lifecycle/engine-rules.d.ts +106 -0
- package/dist/core/lifecycle/engine-rules.js +267 -0
- package/dist/core/lifecycle/engine-rules.js.map +1 -0
- package/dist/core/lifecycle/engine.d.ts +502 -0
- package/dist/core/lifecycle/engine.js +1750 -0
- package/dist/core/lifecycle/engine.js.map +1 -0
- package/dist/core/lifecycle/evaluate.d.ts +19 -0
- package/dist/core/lifecycle/evaluate.js +77 -0
- package/dist/core/lifecycle/evaluate.js.map +1 -0
- package/dist/core/lifecycle/intent.d.ts +11 -0
- package/dist/core/lifecycle/intent.js +88 -0
- package/dist/core/lifecycle/intent.js.map +1 -0
- package/dist/core/lifecycle/monitor.d.ts +138 -0
- package/dist/core/lifecycle/monitor.js +616 -0
- package/dist/core/lifecycle/monitor.js.map +1 -0
- package/dist/core/lifecycle/observations.d.ts +17 -0
- package/dist/core/lifecycle/observations.js +59 -0
- package/dist/core/lifecycle/observations.js.map +1 -0
- package/dist/core/lifecycle/reconcile.d.ts +58 -0
- package/dist/core/lifecycle/reconcile.js +112 -0
- package/dist/core/lifecycle/reconcile.js.map +1 -0
- package/dist/core/lifecycle/views.d.ts +49 -0
- package/dist/core/lifecycle/views.js +57 -0
- package/dist/core/lifecycle/views.js.map +1 -0
- package/dist/core/lifecycle/workers.d.ts +88 -0
- package/dist/core/lifecycle/workers.js +347 -0
- package/dist/core/lifecycle/workers.js.map +1 -0
- package/dist/core/model/address.d.ts +32 -0
- package/dist/core/model/address.js +43 -0
- package/dist/core/model/address.js.map +1 -0
- package/dist/core/model/amount.d.ts +25 -0
- package/dist/core/model/amount.js +102 -0
- package/dist/core/model/amount.js.map +1 -0
- package/dist/core/model/asset.d.ts +28 -0
- package/dist/core/model/asset.js +47 -0
- package/dist/core/model/asset.js.map +1 -0
- package/dist/core/model/capability.d.ts +3 -0
- package/dist/core/model/capability.js +18 -0
- package/dist/core/model/capability.js.map +1 -0
- package/dist/core/model/chain.d.ts +63 -0
- package/dist/core/model/chain.js +8 -0
- package/dist/core/model/chain.js.map +1 -0
- package/dist/core/model/fee.d.ts +36 -0
- package/dist/core/model/fee.js +17 -0
- package/dist/core/model/fee.js.map +1 -0
- package/dist/core/model/ids.d.ts +38 -0
- package/dist/core/model/ids.js +14 -0
- package/dist/core/model/ids.js.map +1 -0
- package/dist/core/model/intent.d.ts +63 -0
- package/dist/core/model/intent.js +81 -0
- package/dist/core/model/intent.js.map +1 -0
- package/dist/core/model/ordering.d.ts +28 -0
- package/dist/core/model/ordering.js +29 -0
- package/dist/core/model/ordering.js.map +1 -0
- package/dist/core/model/transaction.d.ts +123 -0
- package/dist/{type/lib-types.js → core/model/transaction.js} +1 -1
- package/dist/core/model/transaction.js.map +1 -0
- package/dist/core/observe/scanner.d.ts +135 -0
- package/dist/core/observe/scanner.js +358 -0
- package/dist/core/observe/scanner.js.map +1 -0
- package/dist/core/ordering/reservations.d.ts +16 -0
- package/dist/core/ordering/reservations.js +53 -0
- package/dist/core/ordering/reservations.js.map +1 -0
- package/dist/core/ordering/sequence.d.ts +61 -0
- package/dist/core/ordering/sequence.js +155 -0
- package/dist/core/ordering/sequence.js.map +1 -0
- package/dist/core/registry/adapters.d.ts +10 -0
- package/dist/core/registry/adapters.js +56 -0
- package/dist/core/registry/adapters.js.map +1 -0
- package/dist/core/registry/assets.d.ts +18 -0
- package/dist/core/registry/assets.js +90 -0
- package/dist/core/registry/assets.js.map +1 -0
- package/dist/core/registry/chains.d.ts +10 -0
- package/dist/core/registry/chains.js +80 -0
- package/dist/core/registry/chains.js.map +1 -0
- package/dist/core/registry/plugin.d.ts +41 -0
- package/dist/core/registry/plugin.js +109 -0
- package/dist/core/registry/plugin.js.map +1 -0
- package/dist/core/registry/providers.d.ts +31 -0
- package/dist/core/registry/providers.js +43 -0
- package/dist/core/registry/providers.js.map +1 -0
- package/dist/core/registry/schemes.d.ts +30 -0
- package/dist/core/registry/schemes.js +84 -0
- package/dist/core/registry/schemes.js.map +1 -0
- package/dist/core/secret/fragments.d.ts +33 -0
- package/dist/core/secret/fragments.js +110 -0
- package/dist/core/secret/fragments.js.map +1 -0
- package/dist/core/secret/redact.d.ts +10 -0
- package/dist/core/secret/redact.js +110 -0
- package/dist/core/secret/redact.js.map +1 -0
- package/dist/core/secret/secret.d.ts +14 -0
- package/dist/core/secret/secret.js +42 -0
- package/dist/core/secret/secret.js.map +1 -0
- package/dist/core/signing/callback.d.ts +10 -0
- package/dist/core/signing/callback.js +22 -0
- package/dist/core/signing/callback.js.map +1 -0
- package/dist/core/signing/guard.d.ts +18 -0
- package/dist/core/signing/guard.js +72 -0
- package/dist/core/signing/guard.js.map +1 -0
- package/dist/core/signing/hd.d.ts +36 -0
- package/dist/core/signing/hd.js +167 -0
- package/dist/core/signing/hd.js.map +1 -0
- package/dist/core/signing/local.d.ts +48 -0
- package/dist/core/signing/local.js +190 -0
- package/dist/core/signing/local.js.map +1 -0
- package/dist/core/signing/orchestrator.d.ts +40 -0
- package/dist/core/signing/orchestrator.js +300 -0
- package/dist/core/signing/orchestrator.js.map +1 -0
- package/dist/core/signing/types.d.ts +64 -0
- package/dist/core/signing/types.js +3 -0
- package/dist/core/signing/types.js.map +1 -0
- package/dist/core/signing/wallet.d.ts +48 -0
- package/dist/core/signing/wallet.js +161 -0
- package/dist/core/signing/wallet.js.map +1 -0
- package/dist/core/store/clone.d.ts +25 -0
- package/dist/core/store/clone.js +71 -0
- package/dist/core/store/clone.js.map +1 -0
- package/dist/core/store/format.d.ts +20 -0
- package/dist/core/store/format.js +86 -0
- package/dist/core/store/format.js.map +1 -0
- package/dist/core/store/memory.d.ts +38 -0
- package/dist/core/store/memory.js +325 -0
- package/dist/core/store/memory.js.map +1 -0
- package/dist/core/store/types.d.ts +258 -0
- package/dist/core/store/types.js +119 -0
- package/dist/core/store/types.js.map +1 -0
- package/dist/core/transport/backoff.d.ts +8 -0
- package/dist/core/transport/backoff.js +27 -0
- package/dist/core/transport/backoff.js.map +1 -0
- package/dist/core/transport/circuit.d.ts +25 -0
- package/dist/core/transport/circuit.js +61 -0
- package/dist/core/transport/circuit.js.map +1 -0
- package/dist/core/transport/http-transport.d.ts +30 -0
- package/dist/core/transport/http-transport.js +1703 -0
- package/dist/core/transport/http-transport.js.map +1 -0
- package/dist/core/transport/rate-limit.d.ts +27 -0
- package/dist/core/transport/rate-limit.js +78 -0
- package/dist/core/transport/rate-limit.js.map +1 -0
- package/dist/core/transport/stale-view.d.ts +11 -0
- package/dist/core/transport/stale-view.js +17 -0
- package/dist/core/transport/stale-view.js.map +1 -0
- package/dist/core/transport/types.d.ts +159 -0
- package/dist/core/transport/types.js +6 -0
- package/dist/core/transport/types.js.map +1 -0
- package/dist/core/util/bytes.d.ts +9 -0
- package/dist/core/util/bytes.js +40 -0
- package/dist/core/util/bytes.js.map +1 -0
- package/dist/core/util/clock.d.ts +6 -0
- package/dist/core/util/clock.js +26 -0
- package/dist/core/util/clock.js.map +1 -0
- package/dist/core/util/freeze.d.ts +8 -0
- package/dist/core/util/freeze.js +31 -0
- package/dist/core/util/freeze.js.map +1 -0
- package/dist/core/util/json.d.ts +35 -0
- package/dist/core/util/json.js +174 -0
- package/dist/core/util/json.js.map +1 -0
- package/dist/core/util/names.d.ts +27 -0
- package/dist/core/util/names.js +56 -0
- package/dist/core/util/names.js.map +1 -0
- package/dist/index.d.ts +65 -14
- package/dist/index.js +107 -49
- package/dist/index.js.map +1 -1
- package/dist/native.d.ts +21 -0
- package/dist/native.js +44 -0
- package/dist/native.js.map +1 -0
- package/dist/testing/contracts/api.d.ts +12 -0
- package/dist/testing/contracts/api.js +58 -0
- package/dist/testing/contracts/api.js.map +1 -0
- package/dist/testing/contracts/cursors.d.ts +6 -0
- package/dist/testing/contracts/cursors.js +43 -0
- package/dist/testing/contracts/cursors.js.map +1 -0
- package/dist/testing/contracts/locks.d.ts +10 -0
- package/dist/testing/contracts/locks.js +63 -0
- package/dist/testing/contracts/locks.js.map +1 -0
- package/dist/testing/contracts/operations.d.ts +21 -0
- package/dist/testing/contracts/operations.js +737 -0
- package/dist/testing/contracts/operations.js.map +1 -0
- package/dist/testing/contracts/sequences.d.ts +6 -0
- package/dist/testing/contracts/sequences.js +68 -0
- package/dist/testing/contracts/sequences.js.map +1 -0
- package/dist/testing/env.d.ts +68 -0
- package/dist/testing/env.js +105 -0
- package/dist/testing/env.js.map +1 -0
- package/dist/testing/fake-chain.d.ts +118 -0
- package/dist/testing/fake-chain.js +536 -0
- package/dist/testing/fake-chain.js.map +1 -0
- package/dist/testing/fake-clock.d.ts +15 -0
- package/dist/testing/fake-clock.js +86 -0
- package/dist/testing/fake-clock.js.map +1 -0
- package/dist/testing/fake-driver.d.ts +15 -0
- package/dist/testing/fake-driver.js +458 -0
- package/dist/testing/fake-driver.js.map +1 -0
- package/dist/testing/fake-fetch.d.ts +32 -0
- package/dist/testing/fake-fetch.js +81 -0
- package/dist/testing/fake-fetch.js.map +1 -0
- package/dist/testing/fake-plugin.d.ts +30 -0
- package/dist/testing/fake-plugin.js +66 -0
- package/dist/testing/fake-plugin.js.map +1 -0
- package/dist/testing/faulty-store.d.ts +38 -0
- package/dist/testing/faulty-store.js +71 -0
- package/dist/testing/faulty-store.js.map +1 -0
- package/dist/testing/generation.d.ts +60 -0
- package/dist/testing/generation.js +252 -0
- package/dist/testing/generation.js.map +1 -0
- package/dist/testing/index.d.ts +28 -0
- package/dist/testing/index.js +51 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +198 -45
- package/dist/libs/eth/account.d.ts +0 -9
- package/dist/libs/eth/account.js +0 -58
- package/dist/libs/eth/account.js.map +0 -1
- package/dist/libs/eth/contract.d.ts +0 -7
- package/dist/libs/eth/contract.js +0 -42
- package/dist/libs/eth/contract.js.map +0 -1
- package/dist/libs/eth/index.d.ts +0 -24
- package/dist/libs/eth/index.js +0 -72
- package/dist/libs/eth/index.js.map +0 -1
- package/dist/libs/eth/transact.d.ts +0 -7
- package/dist/libs/eth/transact.js +0 -26
- package/dist/libs/eth/transact.js.map +0 -1
- package/dist/libs/index.d.ts +0 -2
- package/dist/libs/index.js +0 -19
- package/dist/libs/index.js.map +0 -1
- package/dist/libs/trx/account.d.ts +0 -9
- package/dist/libs/trx/account.js +0 -55
- package/dist/libs/trx/account.js.map +0 -1
- package/dist/libs/trx/contract.d.ts +0 -7
- package/dist/libs/trx/contract.js +0 -27
- package/dist/libs/trx/contract.js.map +0 -1
- package/dist/libs/trx/index.d.ts +0 -22
- package/dist/libs/trx/index.js +0 -64
- package/dist/libs/trx/index.js.map +0 -1
- package/dist/libs/trx/transact.d.ts +0 -7
- package/dist/libs/trx/transact.js +0 -26
- package/dist/libs/trx/transact.js.map +0 -1
- package/dist/tool/common.d.ts +0 -28
- package/dist/tool/common.js +0 -33
- package/dist/tool/common.js.map +0 -1
- package/dist/tool/eth-tools.d.ts +0 -3
- package/dist/tool/eth-tools.js +0 -33
- package/dist/tool/eth-tools.js.map +0 -1
- package/dist/tool/index.d.ts +0 -5
- package/dist/tool/index.js +0 -22
- package/dist/tool/index.js.map +0 -1
- package/dist/tool/logging.d.ts +0 -3
- package/dist/tool/logging.js +0 -11
- package/dist/tool/logging.js.map +0 -1
- package/dist/tool/options.d.ts +0 -6
- package/dist/tool/options.js +0 -41
- package/dist/tool/options.js.map +0 -1
- package/dist/tool/trx-tools.d.ts +0 -3
- package/dist/tool/trx-tools.js +0 -20
- package/dist/tool/trx-tools.js.map +0 -1
- package/dist/type/account.d.ts +0 -9
- package/dist/type/account.js.map +0 -1
- package/dist/type/common.d.ts +0 -18
- package/dist/type/common.js.map +0 -1
- package/dist/type/contract.d.ts +0 -10
- package/dist/type/contract.js.map +0 -1
- package/dist/type/index.d.ts +0 -5
- package/dist/type/index.js +0 -22
- package/dist/type/index.js.map +0 -1
- package/dist/type/lib-types.d.ts +0 -9
- package/dist/type/lib-types.js.map +0 -1
- package/dist/type/transact.d.ts +0 -7
- package/dist/type/transact.js.map +0 -1
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import type { CodesOf } from '../errors/codes';
|
|
2
|
+
import type { Logger } from '../events/logger';
|
|
3
|
+
import type { AddressFormatter, NormalizedAddress } from '../model/address';
|
|
4
|
+
import type { AssetMetadata, AssetRef, TokenRef } from '../model/asset';
|
|
5
|
+
import type { Capability } from '../model/capability';
|
|
6
|
+
import type { ChainInfo, NetworkInfo } from '../model/chain';
|
|
7
|
+
import type { FeeEstimateDraft, FeeOverride, FeeSpeed } from '../model/fee';
|
|
8
|
+
import type { DriverIntent } from '../model/intent';
|
|
9
|
+
import type { OrderingData, OrderingKind } from '../model/ordering';
|
|
10
|
+
import type { AttemptRef, Decoding, RawTx, SignedTx, TransferSource, TxFailure, UnsignedTx } from '../model/transaction';
|
|
11
|
+
import type { KeyRef, SignatureBundle } from '../signing/types';
|
|
12
|
+
import type { Transport } from '../transport/types';
|
|
13
|
+
import type { Clock } from '../util/clock';
|
|
14
|
+
/**
|
|
15
|
+
* Family-specific wallet settings (e.g. `utxo.addressType`, TON wallet identity). The `hd`
|
|
16
|
+
* key is reserved and core-built: the core sets it to the wallet's `WalletHdOptions` when
|
|
17
|
+
* the wallet has an `xpub`, and a user's or caller's `hd` never reaches a driver, since a
|
|
18
|
+
* driver trusts `hd` to validate change addresses.
|
|
19
|
+
*/
|
|
20
|
+
export type WalletOptions = Readonly<Record<string, unknown>>;
|
|
21
|
+
export interface WalletKey {
|
|
22
|
+
readonly scheme: string;
|
|
23
|
+
readonly publicKey: Uint8Array;
|
|
24
|
+
readonly keyRef?: KeyRef;
|
|
25
|
+
}
|
|
26
|
+
export interface BuildContext {
|
|
27
|
+
readonly from: string;
|
|
28
|
+
readonly keys: readonly WalletKey[];
|
|
29
|
+
readonly wallet: WalletOptions;
|
|
30
|
+
/** Allocated by the core for `nonce` and `seqno` ordering. */
|
|
31
|
+
readonly ordering?: OrderingData;
|
|
32
|
+
/** Inputs held by other live Operations of this wallet (`inputs` ordering). */
|
|
33
|
+
readonly excludeInputs?: readonly string[];
|
|
34
|
+
/**
|
|
35
|
+
* The decimals the core scaled the intent's amounts with: the asset's registered
|
|
36
|
+
* metadata, or what the chain gave. Drivers work in base units. One whose transaction
|
|
37
|
+
* signs the decimals (Solana's `transferChecked`) reads them from the chain and must
|
|
38
|
+
* refuse a mismatch with this value (`ASSET_RESOLUTION`): the amounts were then scaled
|
|
39
|
+
* wrong. Absent where no transfer is built (a replacement or a cancel).
|
|
40
|
+
*/
|
|
41
|
+
readonly decimals?: number;
|
|
42
|
+
readonly signal?: AbortSignal;
|
|
43
|
+
}
|
|
44
|
+
export type FundsCheck = {
|
|
45
|
+
readonly ok: true;
|
|
46
|
+
} | {
|
|
47
|
+
readonly ok: false;
|
|
48
|
+
readonly asset: AssetRef;
|
|
49
|
+
readonly required: bigint;
|
|
50
|
+
readonly available: bigint;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* `refused`: state-dependent (may become valid, or may already be included) — observed only.
|
|
54
|
+
* `rejected`: permanently invalid by construction (malformed, bad signature, wrong chain).
|
|
55
|
+
*/
|
|
56
|
+
export type BroadcastResult = {
|
|
57
|
+
readonly kind: 'accepted';
|
|
58
|
+
} | {
|
|
59
|
+
readonly kind: 'already-known';
|
|
60
|
+
} | {
|
|
61
|
+
readonly kind: 'refused';
|
|
62
|
+
readonly code: CodesOf<'chain'>;
|
|
63
|
+
readonly reason: string;
|
|
64
|
+
} | {
|
|
65
|
+
readonly kind: 'rejected';
|
|
66
|
+
readonly reason: string;
|
|
67
|
+
};
|
|
68
|
+
export interface DriverTxObservation {
|
|
69
|
+
readonly seen: 'none' | 'mempool' | 'block';
|
|
70
|
+
readonly txHash?: string;
|
|
71
|
+
readonly blockHeight?: bigint;
|
|
72
|
+
readonly blockHash?: string;
|
|
73
|
+
/** For included transactions: false when execution failed or reverted. */
|
|
74
|
+
readonly success?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* With `success: false`, why, as a short fixed text: no addresses, amounts or node
|
|
77
|
+
* text, which can carry either. The monitor records it on the observation
|
|
78
|
+
* (`TxStatus.reason`).
|
|
79
|
+
*/
|
|
80
|
+
readonly reason?: string;
|
|
81
|
+
/**
|
|
82
|
+
* With `success: false`, what failed (`TxFailure`). Absent is `'reverted'`; a driver sets
|
|
83
|
+
* `'unevidenced'` when the transaction executed but shows no transfer to the recipient.
|
|
84
|
+
*/
|
|
85
|
+
readonly failure?: TxFailure;
|
|
86
|
+
}
|
|
87
|
+
export interface DriverTransfer {
|
|
88
|
+
/** Deterministic within the transaction, e.g. `native`, `log:3`, `vout:1`, `ix:0.2`. */
|
|
89
|
+
readonly locator: string;
|
|
90
|
+
readonly from: readonly string[];
|
|
91
|
+
readonly to: string;
|
|
92
|
+
readonly asset: AssetRef;
|
|
93
|
+
readonly amount: bigint;
|
|
94
|
+
readonly source: TransferSource;
|
|
95
|
+
readonly memo?: string;
|
|
96
|
+
}
|
|
97
|
+
export interface DriverTransaction {
|
|
98
|
+
readonly id: string;
|
|
99
|
+
readonly observation: DriverTxObservation;
|
|
100
|
+
readonly fee?: readonly {
|
|
101
|
+
readonly asset: AssetRef;
|
|
102
|
+
readonly amount: bigint;
|
|
103
|
+
}[];
|
|
104
|
+
readonly transfers: readonly DriverTransfer[];
|
|
105
|
+
readonly decoding: Decoding;
|
|
106
|
+
readonly raw?: RawTx;
|
|
107
|
+
readonly timestamp?: number;
|
|
108
|
+
readonly details: Readonly<Record<string, unknown>>;
|
|
109
|
+
}
|
|
110
|
+
export interface DriverBlock {
|
|
111
|
+
readonly height: bigint;
|
|
112
|
+
readonly hash: string;
|
|
113
|
+
readonly parentHash: string;
|
|
114
|
+
readonly timestamp?: number;
|
|
115
|
+
readonly transactionIds?: readonly string[];
|
|
116
|
+
}
|
|
117
|
+
export interface AddressCodec {
|
|
118
|
+
validate(address: string): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Throws `ValidationError('INVALID_ADDRESS')`. The returned `variant` is part of the
|
|
121
|
+
* intent hash: it must hold only JSON scalars (strings, finite numbers, booleans, `null`)
|
|
122
|
+
* and should contain only semantic fields that change what the transfer does (for example
|
|
123
|
+
* TON's `bounceable`), never encoding-only choices, so two spellings of one recipient
|
|
124
|
+
* with the same meaning hash the same.
|
|
125
|
+
*/
|
|
126
|
+
normalize(address: string): NormalizedAddress;
|
|
127
|
+
fromPublicKey(publicKey: Uint8Array, wallet?: WalletOptions): NormalizedAddress;
|
|
128
|
+
readonly format?: AddressFormatter;
|
|
129
|
+
}
|
|
130
|
+
export interface ChainReader {
|
|
131
|
+
getBalance(address: string, asset: AssetRef): Promise<bigint>;
|
|
132
|
+
getBlockHeight(): Promise<bigint>;
|
|
133
|
+
/** Highest block satisfying the network's finality policy. */
|
|
134
|
+
getFinalizedHeight(): Promise<bigint>;
|
|
135
|
+
getBlock(ref: bigint | string): Promise<DriverBlock | null>;
|
|
136
|
+
getTransaction(id: string): Promise<DriverTransaction | null>;
|
|
137
|
+
/**
|
|
138
|
+
* Current view of an Attempt (uses `purpose: 'monitor'` reads). `ordering` and `from` are
|
|
139
|
+
* `undefined` for a transaction the library does not manage (a status lookup by id).
|
|
140
|
+
*/
|
|
141
|
+
observe(ref: AttemptRef, ordering: OrderingData | undefined, from: string | undefined): Promise<DriverTxObservation>;
|
|
142
|
+
getTokenMetadata?(ref: TokenRef): Promise<AssetMetadata>;
|
|
143
|
+
/** Canonicalizes a token contract (e.g. EIP-55); identity for asset ids. */
|
|
144
|
+
normalizeTokenRef?(ref: TokenRef): TokenRef;
|
|
145
|
+
}
|
|
146
|
+
export interface TxBuilder {
|
|
147
|
+
estimateFee(intent: DriverIntent, ctx: BuildContext): Promise<FeeEstimateDraft>;
|
|
148
|
+
checkFunds(intent: DriverIntent, fee: FeeEstimateDraft, ctx: BuildContext): Promise<FundsCheck>;
|
|
149
|
+
build(intent: DriverIntent, fee: FeeEstimateDraft, ctx: BuildContext): Promise<UnsignedTx>;
|
|
150
|
+
assemble(unsigned: UnsignedTx, signatures: readonly SignatureBundle[]): Promise<SignedTx>;
|
|
151
|
+
/**
|
|
152
|
+
* The signatures a payload signed elsewhere carries for `unsigned`'s requests,
|
|
153
|
+
* e.g. a PSBT a cold signer returned. No I/O. Throws `ValidationError('INVALID_INTENT')`
|
|
154
|
+
* when `signed` is not the prepared transaction; one it does not tell apart still fails
|
|
155
|
+
* the core's check with `SIGNATURE_MISMATCH`. Only signature bytes are taken from it: the
|
|
156
|
+
* core verifies each one against its stored request, as for any bundle. A request
|
|
157
|
+
* without a signature in `signed` is left out (a partial set).
|
|
158
|
+
*/
|
|
159
|
+
signaturesFrom?(unsigned: UnsignedTx, signed: RawTx): readonly SignatureBundle[];
|
|
160
|
+
}
|
|
161
|
+
export interface Broadcaster {
|
|
162
|
+
/**
|
|
163
|
+
* Throws (ambiguous) on transport failure; returns a classified result otherwise.
|
|
164
|
+
* `signed.ref.id` is empty for bare broadcasts (`Blockchain.broadcast`); never rely on it.
|
|
165
|
+
*/
|
|
166
|
+
broadcast(signed: SignedTx, options?: {
|
|
167
|
+
readonly fanout?: number;
|
|
168
|
+
readonly signal?: AbortSignal;
|
|
169
|
+
}): Promise<BroadcastResult>;
|
|
170
|
+
}
|
|
171
|
+
export type FinalityLevel = 'latest' | 'finalized';
|
|
172
|
+
/**
|
|
173
|
+
* Finalized-state checks behind `proven` verdicts; implementations use quorum reads.
|
|
174
|
+
* Only a definitive negative proof answers "no". Every other RPC error (state or
|
|
175
|
+
* history not available, pruned data, indexing in progress, a non-definitive error) throws
|
|
176
|
+
* a retryable `ProviderError('PROVIDER_UNAVAILABLE')`, which decides nothing.
|
|
177
|
+
*/
|
|
178
|
+
export interface ProofSource {
|
|
179
|
+
finalizedHead(): Promise<{
|
|
180
|
+
readonly height: bigint;
|
|
181
|
+
readonly hash: string;
|
|
182
|
+
readonly timestamp?: number;
|
|
183
|
+
}>;
|
|
184
|
+
includedFinal(ref: AttemptRef, ordering: OrderingData, from: string): Promise<{
|
|
185
|
+
readonly included: false;
|
|
186
|
+
} | {
|
|
187
|
+
readonly included: true;
|
|
188
|
+
readonly success: boolean;
|
|
189
|
+
readonly blockHeight: bigint;
|
|
190
|
+
readonly blockHash: string;
|
|
191
|
+
readonly txHash: string;
|
|
192
|
+
/**
|
|
193
|
+
* With `success: false`, a short fixed text, never node text. It is recorded as
|
|
194
|
+
* proven.
|
|
195
|
+
*/
|
|
196
|
+
readonly reason?: string;
|
|
197
|
+
/** With `success: false`, what failed, as `DriverTxObservation.failure`. */
|
|
198
|
+
readonly failure?: TxFailure;
|
|
199
|
+
}>;
|
|
200
|
+
/** Whether the ordering slot (nonce/seqno/an input) is consumed by ANY transaction at `level`. */
|
|
201
|
+
slotConsumed(ordering: OrderingData, from: string, level: FinalityLevel): Promise<boolean>;
|
|
202
|
+
/** Whether expiry has passed per finalized state (expiry/seqno models; false otherwise). */
|
|
203
|
+
expired(ordering: OrderingData): Promise<boolean>;
|
|
204
|
+
/**
|
|
205
|
+
* The hash of the block at `height` on the chain at `level`, or `null` when there is
|
|
206
|
+
* none yet (above the head, or above the finalized height for `'finalized'`). Confirms
|
|
207
|
+
* the monitor's orphan decisions and the scanner's rollback and TOO_DEEP verdicts.
|
|
208
|
+
*/
|
|
209
|
+
blockHash(height: bigint, level: FinalityLevel): Promise<string | null>;
|
|
210
|
+
}
|
|
211
|
+
export interface SequenceSource {
|
|
212
|
+
/** Next nonce/seqno including pending transactions. */
|
|
213
|
+
pending(address: string): Promise<bigint>;
|
|
214
|
+
/** Next nonce/seqno per the latest block. */
|
|
215
|
+
latest(address: string): Promise<bigint>;
|
|
216
|
+
}
|
|
217
|
+
export interface ReplacementPolicy {
|
|
218
|
+
readonly replace: boolean;
|
|
219
|
+
readonly cancel: boolean;
|
|
220
|
+
buildReplacement?(previous: UnsignedTx, fee: FeeSpeed | FeeOverride, ctx: BuildContext): Promise<UnsignedTx>;
|
|
221
|
+
/**
|
|
222
|
+
* A transaction for `previous`'s slot that does not execute the transfer (e.g. a
|
|
223
|
+
* self-transfer). Without `fee` it pays the network's minimum bump over `previous`; with
|
|
224
|
+
* one, that fee, refused (FEE_TOO_LOW) below the bump. `previous` may itself be a cancel
|
|
225
|
+
* (a repeat cancel bumps a stuck one).
|
|
226
|
+
*/
|
|
227
|
+
buildCancel?(previous: UnsignedTx, ctx: BuildContext, fee?: FeeSpeed | FeeOverride): Promise<UnsignedTx>;
|
|
228
|
+
/**
|
|
229
|
+
* Orders two transactions of one slot by the price a node compares when one replaces
|
|
230
|
+
* the other: negative when `a` pays less, positive when it pays more, `0` when neither
|
|
231
|
+
* does. A repeat cancel bumps from the highest earlier cancel by this order; without it,
|
|
232
|
+
* the core compares their total charges, which a gas limit can skew.
|
|
233
|
+
*/
|
|
234
|
+
comparePrice?(a: UnsignedTx, b: UnsignedTx): number;
|
|
235
|
+
}
|
|
236
|
+
export interface ScanFilter {
|
|
237
|
+
readonly addresses?: readonly string[];
|
|
238
|
+
readonly assets?: readonly AssetRef[];
|
|
239
|
+
}
|
|
240
|
+
export interface BlockSource {
|
|
241
|
+
header(height: bigint): Promise<DriverBlock | null>;
|
|
242
|
+
transactions(block: DriverBlock, filter?: ScanFilter): Promise<readonly DriverTransaction[]>;
|
|
243
|
+
}
|
|
244
|
+
export interface AddressHistorySource {
|
|
245
|
+
list(address: string, options: {
|
|
246
|
+
readonly cursor?: string;
|
|
247
|
+
readonly limit: number;
|
|
248
|
+
}): Promise<{
|
|
249
|
+
readonly items: readonly DriverTransaction[];
|
|
250
|
+
readonly next?: string;
|
|
251
|
+
}>;
|
|
252
|
+
}
|
|
253
|
+
export interface DriverLimits {
|
|
254
|
+
readonly maxOutputs: number;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* A native SDK client for `crypto-aio/native` and how to release it. `close` frees
|
|
258
|
+
* what the client holds (sockets, timers, workers); the root container's `close()` runs it
|
|
259
|
+
* once, before closing its pooled drivers.
|
|
260
|
+
*/
|
|
261
|
+
export interface DisposableNativeClient {
|
|
262
|
+
readonly client: unknown;
|
|
263
|
+
close?(): void | Promise<void>;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* The driver port: every method's contract, as the core relies on it. Purpose, retry
|
|
267
|
+
* class and quorum are the `CallOptions` a driver passes to its `Transport` (defaults:
|
|
268
|
+
* purpose `read`, retry `safe`, no quorum). A `monitor` or `proof` read only goes to
|
|
269
|
+
* endpoints that are not lagging.
|
|
270
|
+
*
|
|
271
|
+
* | Method | Purpose | Retry | Quorum | Returns / throws |
|
|
272
|
+
* | --- | --- | --- | --- | --- |
|
|
273
|
+
* | `reader.getBalance`, `getBlock`, `getTransaction` | `read` | `safe` | none | `null` when not found; provider errors propagate |
|
|
274
|
+
* | `reader.getTokenMetadata` | `read` | `safe` | none (a driver may use a quorum) | A token's own unusable metadata (no contract, a reverting or malformed `decimals`/`symbol`) throws `ValidationError('ASSET_RESOLUTION')`, which the core caches per container (only a non-retryable `ASSET_RESOLUTION` is cached); every other failure, e.g. a transient provider failure (propagated retryable) or any other provider error, is not cached and the next lookup queries again. Stricter than this minimum, the EVM driver reads `decimals()` and `symbol()` under `quorum: 'proof'`: the metadata is cached for the container's life, and one endpoint's wrong `decimals` would mis-scale every amount; endpoints that disagree throw retryable `PROVIDER_INCONSISTENT`, which is not cached |
|
|
275
|
+
* | `reader.getBlockHeight`, `getFinalizedHeight` | `monitor` | `safe` | none | propagate; they feed the stale-view guards and confirmation depths |
|
|
276
|
+
* | `reader.observe(ref, ordering, from)` | `monitor` | `safe` | none | `{ seen: 'none' }` when not visible; `ordering` and `from` are `undefined` for a transaction the library does not manage |
|
|
277
|
+
* | `sequence.pending`, `sequence.latest` | `monitor` | `safe` | none | propagate |
|
|
278
|
+
* | `proofs.*` (`finalizedHead`, `includedFinal`, `slotConsumed`, `expired`, `blockHash`) | `proof` | `safe` | `'proof'` | endpoints that disagree throw retryable `PROVIDER_INCONSISTENT`, and the core then decides nothing. Only a definitive negative proof answers "no"; every other RPC error throws retryable `PROVIDER_UNAVAILABLE`, which decides nothing (see below). Only `slotConsumed(…, 'latest')` may be a single `monitor` read: the core records it as observed evidence |
|
|
279
|
+
* | `broadcaster.broadcast` | `broadcast` | `ambiguous-on-failure` | none (passes `fanout` and `signal` through) | classifies a definitive `RPC_ERROR` into a `BroadcastResult`; rethrows an ambiguous one (`error.ambiguous`) and every other failure unclassified |
|
|
280
|
+
* | `builder.estimateFee`, `checkFunds`, `build` | `read` | `safe` | none | `ValidationError` / `UnsupportedCapabilityError` for an intent it cannot build |
|
|
281
|
+
* | `builder.assemble` | no I/O | – | – | `SigningError('SIGNING_FAILED')` when a signature is missing |
|
|
282
|
+
* | `builder.signaturesFrom` (optional) | no I/O | – | – | `ValidationError('INVALID_INTENT')` when the signed payload is not the prepared transaction |
|
|
283
|
+
* | `replacement.buildReplacement`, `buildCancel` | `read` | `safe` | none | `ChainError('FEE_TOO_LOW')` below the network's bump; `buildCancel` honours a given `fee` and never substitutes its own |
|
|
284
|
+
* | `blocks.header` | `monitor` | `safe` | none | `null` while the height is not visible |
|
|
285
|
+
* | `blocks.transactions` | `monitor` | `safe` | none | retryable `PROVIDER_INCONSISTENT` when the block at `block.height` no longer has `block.hash` |
|
|
286
|
+
* | `history.list` | `read` (indexer transport when configured) | `safe` | none | propagate |
|
|
287
|
+
* | `createNativeClient` | no I/O | – | – | a fresh SDK instance on every call, never the pooled one |
|
|
288
|
+
* | `signingSchemes` (optional) | no I/O | – | – | `ConfigError('CONFIG_INVALID')` for wallet options it refuses |
|
|
289
|
+
*
|
|
290
|
+
* Further rules:
|
|
291
|
+
* - On a proof path (`proofs.*`), only a definitive negative proof may
|
|
292
|
+
* answer "no" (`included: false`, a slot not consumed, a `null` block hash). Every other
|
|
293
|
+
* RPC error, including state or history not available, pruned data, an index still being
|
|
294
|
+
* built ("transaction indexing is in progress"), or an endpoint's non-definitive error,
|
|
295
|
+
* must surface as a retryable `ProviderError('PROVIDER_UNAVAILABLE')`, which decides
|
|
296
|
+
* nothing: the core looks again later and never takes it for an answer.
|
|
297
|
+
* - `BlockSource` heights are dense: every height up to the head has one block, and
|
|
298
|
+
* `header(h)` is `null` only while `h` is not visible, never for a skipped slot.
|
|
299
|
+
* - A provider must serve headers at least about 2 × `reorgWindow` below the head. A new
|
|
300
|
+
* cursor loads `reorgWindow` blocks below its start, and a rollback refills its window
|
|
301
|
+
* below the common ancestor.
|
|
302
|
+
* - `ScanFilter.addresses`: when non-empty, return at least every transaction with a transfer
|
|
303
|
+
* from or to one of them; empty (`[]`) or absent means no filter. `ScanFilter.assets` is a
|
|
304
|
+
* hint only: a driver may narrow by it or ignore it, and the core does not filter again.
|
|
305
|
+
* - `fee.details.requestedFee` is reserved. On replacements the core records the requested
|
|
306
|
+
* fee spec there, so a driver never sets or reads it.
|
|
307
|
+
* - `DriverContext` has no asset resolver and `DriverIntent` carries no decimals. Amounts
|
|
308
|
+
* reach drivers in base units only; a driver that needs a token's decimals (Solana's
|
|
309
|
+
* `transferChecked`) reads them from the chain itself.
|
|
310
|
+
*/
|
|
311
|
+
export interface ChainDriver {
|
|
312
|
+
readonly ordering: OrderingKind;
|
|
313
|
+
readonly capabilities: ReadonlySet<Capability>;
|
|
314
|
+
readonly address: AddressCodec;
|
|
315
|
+
readonly reader: ChainReader;
|
|
316
|
+
readonly builder: TxBuilder;
|
|
317
|
+
readonly broadcaster: Broadcaster;
|
|
318
|
+
readonly proofs: ProofSource;
|
|
319
|
+
readonly sequence?: SequenceSource;
|
|
320
|
+
readonly replacement?: ReplacementPolicy;
|
|
321
|
+
readonly blocks?: BlockSource;
|
|
322
|
+
readonly history?: AddressHistorySource;
|
|
323
|
+
/** Two-level, capability-gated family API: `ext.<family>.<method>(...) → Promise`. */
|
|
324
|
+
readonly ext?: Readonly<Record<string, Readonly<Record<string, (...args: never[]) => Promise<unknown>>>>>;
|
|
325
|
+
limits?(wallet: WalletOptions): DriverLimits;
|
|
326
|
+
/**
|
|
327
|
+
* The signature schemes a wallet with these options signs with, when its options narrow
|
|
328
|
+
* the chain's `schemes` (a Bitcoin `p2tr` wallet signs with `secp256k1-schnorr` only). No
|
|
329
|
+
* I/O; it throws `CONFIG_INVALID` for options the driver refuses. When the core resolves
|
|
330
|
+
* a wallet that has a signer, it refuses (`CONFIG_INVALID`) one that does not declare each
|
|
331
|
+
* of them, before reading any key: the transfer would otherwise be built, reserved and
|
|
332
|
+
* fail only at signing. Without this method, a signer needs one of the chain's schemes.
|
|
333
|
+
* A watch-only wallet is not checked.
|
|
334
|
+
*/
|
|
335
|
+
signingSchemes?(wallet: WalletOptions): readonly string[];
|
|
336
|
+
/**
|
|
337
|
+
* A fresh, caller-owned SDK client for `crypto-aio/native`: a new SDK instance on every
|
|
338
|
+
* call, never the pooled one.
|
|
339
|
+
*/
|
|
340
|
+
createNativeClient?(): DisposableNativeClient;
|
|
341
|
+
close?(): Promise<void>;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* A factory's `create()` must call `transport.setProbes(...)` exactly once, before any
|
|
345
|
+
* other traffic, on every `Transport` it receives here — including `indexer`, when present.
|
|
346
|
+
* `setProbes` resets health/identity state, so calling it again later, or skipping it on one
|
|
347
|
+
* of the two transports, leaves that transport's health checks silently unconfigured.
|
|
348
|
+
*
|
|
349
|
+
* There is no asset resolver here, and `DriverIntent` carries no decimals: drivers work
|
|
350
|
+
* in base units only.
|
|
351
|
+
*/
|
|
352
|
+
export interface DriverContext {
|
|
353
|
+
readonly chain: ChainInfo;
|
|
354
|
+
readonly network: NetworkInfo;
|
|
355
|
+
readonly library: string;
|
|
356
|
+
readonly transport: Transport;
|
|
357
|
+
readonly indexer?: Transport;
|
|
358
|
+
readonly clock: Clock;
|
|
359
|
+
readonly log: Logger;
|
|
360
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
361
|
+
}
|
|
362
|
+
export interface DriverFactory {
|
|
363
|
+
create(ctx: DriverContext): Promise<ChainDriver>;
|
|
364
|
+
}
|
|
365
|
+
export interface PeerDependency {
|
|
366
|
+
readonly name: string;
|
|
367
|
+
readonly range: string;
|
|
368
|
+
}
|
|
369
|
+
/** Static metadata (no SDK import) plus a lazy `load()` that `require()`s the driver module. */
|
|
370
|
+
export interface AdapterManifest {
|
|
371
|
+
readonly family: string;
|
|
372
|
+
readonly library: string;
|
|
373
|
+
readonly chains: readonly string[];
|
|
374
|
+
readonly capabilities: readonly Capability[];
|
|
375
|
+
readonly indexerCapabilities?: readonly Capability[];
|
|
376
|
+
readonly requiresIndexer?: boolean;
|
|
377
|
+
readonly peerDependencies: readonly PeerDependency[];
|
|
378
|
+
load(): Promise<DriverFactory>;
|
|
379
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/driver/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { CodesOf } from '../errors/codes';\nimport type { Logger } from '../events/logger';\nimport type { AddressFormatter, NormalizedAddress } from '../model/address';\nimport type { AssetMetadata, AssetRef, TokenRef } from '../model/asset';\nimport type { Capability } from '../model/capability';\nimport type { ChainInfo, NetworkInfo } from '../model/chain';\nimport type { FeeEstimateDraft, FeeOverride, FeeSpeed } from '../model/fee';\nimport type { DriverIntent } from '../model/intent';\nimport type { OrderingData, OrderingKind } from '../model/ordering';\nimport type {\n AttemptRef,\n Decoding,\n RawTx,\n SignedTx,\n TransferSource,\n TxFailure,\n UnsignedTx,\n} from '../model/transaction';\nimport type { KeyRef, SignatureBundle } from '../signing/types';\nimport type { Transport } from '../transport/types';\nimport type { Clock } from '../util/clock';\n\n/**\n * Family-specific wallet settings (e.g. `utxo.addressType`, TON wallet identity). The `hd`\n * key is reserved and core-built: the core sets it to the wallet's `WalletHdOptions` when\n * the wallet has an `xpub`, and a user's or caller's `hd` never reaches a driver, since a\n * driver trusts `hd` to validate change addresses.\n */\nexport type WalletOptions = Readonly<Record<string, unknown>>;\n\nexport interface WalletKey {\n readonly scheme: string;\n readonly publicKey: Uint8Array;\n readonly keyRef?: KeyRef;\n}\n\nexport interface BuildContext {\n readonly from: string;\n readonly keys: readonly WalletKey[];\n readonly wallet: WalletOptions;\n /** Allocated by the core for `nonce` and `seqno` ordering. */\n readonly ordering?: OrderingData;\n /** Inputs held by other live Operations of this wallet (`inputs` ordering). */\n readonly excludeInputs?: readonly string[];\n /**\n * The decimals the core scaled the intent's amounts with: the asset's registered\n * metadata, or what the chain gave. Drivers work in base units. One whose transaction\n * signs the decimals (Solana's `transferChecked`) reads them from the chain and must\n * refuse a mismatch with this value (`ASSET_RESOLUTION`): the amounts were then scaled\n * wrong. Absent where no transfer is built (a replacement or a cancel).\n */\n readonly decimals?: number;\n readonly signal?: AbortSignal;\n}\n\nexport type FundsCheck =\n | { readonly ok: true }\n | {\n readonly ok: false;\n readonly asset: AssetRef;\n readonly required: bigint;\n readonly available: bigint;\n };\n\n/**\n * `refused`: state-dependent (may become valid, or may already be included) — observed only.\n * `rejected`: permanently invalid by construction (malformed, bad signature, wrong chain).\n */\nexport type BroadcastResult =\n | { readonly kind: 'accepted' }\n | { readonly kind: 'already-known' }\n | { readonly kind: 'refused'; readonly code: CodesOf<'chain'>; readonly reason: string }\n | { readonly kind: 'rejected'; readonly reason: string };\n\nexport interface DriverTxObservation {\n readonly seen: 'none' | 'mempool' | 'block';\n readonly txHash?: string;\n readonly blockHeight?: bigint;\n readonly blockHash?: string;\n /** For included transactions: false when execution failed or reverted. */\n readonly success?: boolean;\n /**\n * With `success: false`, why, as a short fixed text: no addresses, amounts or node\n * text, which can carry either. The monitor records it on the observation\n * (`TxStatus.reason`).\n */\n readonly reason?: string;\n /**\n * With `success: false`, what failed (`TxFailure`). Absent is `'reverted'`; a driver sets\n * `'unevidenced'` when the transaction executed but shows no transfer to the recipient.\n */\n readonly failure?: TxFailure;\n}\n\nexport interface DriverTransfer {\n /** Deterministic within the transaction, e.g. `native`, `log:3`, `vout:1`, `ix:0.2`. */\n readonly locator: string;\n readonly from: readonly string[];\n readonly to: string;\n readonly asset: AssetRef;\n readonly amount: bigint;\n readonly source: TransferSource;\n readonly memo?: string;\n}\n\nexport interface DriverTransaction {\n readonly id: string;\n readonly observation: DriverTxObservation;\n readonly fee?: readonly { readonly asset: AssetRef; readonly amount: bigint }[];\n readonly transfers: readonly DriverTransfer[];\n readonly decoding: Decoding;\n readonly raw?: RawTx;\n readonly timestamp?: number;\n readonly details: Readonly<Record<string, unknown>>;\n}\n\nexport interface DriverBlock {\n readonly height: bigint;\n readonly hash: string;\n readonly parentHash: string;\n readonly timestamp?: number;\n readonly transactionIds?: readonly string[];\n}\n\nexport interface AddressCodec {\n validate(address: string): boolean;\n /**\n * Throws `ValidationError('INVALID_ADDRESS')`. The returned `variant` is part of the\n * intent hash: it must hold only JSON scalars (strings, finite numbers, booleans, `null`)\n * and should contain only semantic fields that change what the transfer does (for example\n * TON's `bounceable`), never encoding-only choices, so two spellings of one recipient\n * with the same meaning hash the same.\n */\n normalize(address: string): NormalizedAddress;\n fromPublicKey(publicKey: Uint8Array, wallet?: WalletOptions): NormalizedAddress;\n readonly format?: AddressFormatter;\n}\n\nexport interface ChainReader {\n getBalance(address: string, asset: AssetRef): Promise<bigint>;\n getBlockHeight(): Promise<bigint>;\n /** Highest block satisfying the network's finality policy. */\n getFinalizedHeight(): Promise<bigint>;\n getBlock(ref: bigint | string): Promise<DriverBlock | null>;\n getTransaction(id: string): Promise<DriverTransaction | null>;\n /**\n * Current view of an Attempt (uses `purpose: 'monitor'` reads). `ordering` and `from` are\n * `undefined` for a transaction the library does not manage (a status lookup by id).\n */\n observe(\n ref: AttemptRef,\n ordering: OrderingData | undefined,\n from: string | undefined,\n ): Promise<DriverTxObservation>;\n getTokenMetadata?(ref: TokenRef): Promise<AssetMetadata>;\n /** Canonicalizes a token contract (e.g. EIP-55); identity for asset ids. */\n normalizeTokenRef?(ref: TokenRef): TokenRef;\n}\n\nexport interface TxBuilder {\n estimateFee(intent: DriverIntent, ctx: BuildContext): Promise<FeeEstimateDraft>;\n checkFunds(\n intent: DriverIntent,\n fee: FeeEstimateDraft,\n ctx: BuildContext,\n ): Promise<FundsCheck>;\n build(\n intent: DriverIntent,\n fee: FeeEstimateDraft,\n ctx: BuildContext,\n ): Promise<UnsignedTx>;\n assemble(\n unsigned: UnsignedTx,\n signatures: readonly SignatureBundle[],\n ): Promise<SignedTx>;\n /**\n * The signatures a payload signed elsewhere carries for `unsigned`'s requests,\n * e.g. a PSBT a cold signer returned. No I/O. Throws `ValidationError('INVALID_INTENT')`\n * when `signed` is not the prepared transaction; one it does not tell apart still fails\n * the core's check with `SIGNATURE_MISMATCH`. Only signature bytes are taken from it: the\n * core verifies each one against its stored request, as for any bundle. A request\n * without a signature in `signed` is left out (a partial set).\n */\n signaturesFrom?(unsigned: UnsignedTx, signed: RawTx): readonly SignatureBundle[];\n}\n\nexport interface Broadcaster {\n /**\n * Throws (ambiguous) on transport failure; returns a classified result otherwise.\n * `signed.ref.id` is empty for bare broadcasts (`Blockchain.broadcast`); never rely on it.\n */\n broadcast(\n signed: SignedTx,\n options?: { readonly fanout?: number; readonly signal?: AbortSignal },\n ): Promise<BroadcastResult>;\n}\n\nexport type FinalityLevel = 'latest' | 'finalized';\n\n/**\n * Finalized-state checks behind `proven` verdicts; implementations use quorum reads.\n * Only a definitive negative proof answers \"no\". Every other RPC error (state or\n * history not available, pruned data, indexing in progress, a non-definitive error) throws\n * a retryable `ProviderError('PROVIDER_UNAVAILABLE')`, which decides nothing.\n */\nexport interface ProofSource {\n finalizedHead(): Promise<{\n readonly height: bigint;\n readonly hash: string;\n readonly timestamp?: number;\n }>;\n includedFinal(\n ref: AttemptRef,\n ordering: OrderingData,\n from: string,\n ): Promise<\n | { readonly included: false }\n | {\n readonly included: true;\n readonly success: boolean;\n readonly blockHeight: bigint;\n readonly blockHash: string;\n readonly txHash: string;\n /**\n * With `success: false`, a short fixed text, never node text. It is recorded as\n * proven.\n */\n readonly reason?: string;\n /** With `success: false`, what failed, as `DriverTxObservation.failure`. */\n readonly failure?: TxFailure;\n }\n >;\n /** Whether the ordering slot (nonce/seqno/an input) is consumed by ANY transaction at `level`. */\n slotConsumed(\n ordering: OrderingData,\n from: string,\n level: FinalityLevel,\n ): Promise<boolean>;\n /** Whether expiry has passed per finalized state (expiry/seqno models; false otherwise). */\n expired(ordering: OrderingData): Promise<boolean>;\n /**\n * The hash of the block at `height` on the chain at `level`, or `null` when there is\n * none yet (above the head, or above the finalized height for `'finalized'`). Confirms\n * the monitor's orphan decisions and the scanner's rollback and TOO_DEEP verdicts.\n */\n blockHash(height: bigint, level: FinalityLevel): Promise<string | null>;\n}\n\nexport interface SequenceSource {\n /** Next nonce/seqno including pending transactions. */\n pending(address: string): Promise<bigint>;\n /** Next nonce/seqno per the latest block. */\n latest(address: string): Promise<bigint>;\n}\n\nexport interface ReplacementPolicy {\n readonly replace: boolean;\n readonly cancel: boolean;\n buildReplacement?(\n previous: UnsignedTx,\n fee: FeeSpeed | FeeOverride,\n ctx: BuildContext,\n ): Promise<UnsignedTx>;\n /**\n * A transaction for `previous`'s slot that does not execute the transfer (e.g. a\n * self-transfer). Without `fee` it pays the network's minimum bump over `previous`; with\n * one, that fee, refused (FEE_TOO_LOW) below the bump. `previous` may itself be a cancel\n * (a repeat cancel bumps a stuck one).\n */\n buildCancel?(\n previous: UnsignedTx,\n ctx: BuildContext,\n fee?: FeeSpeed | FeeOverride,\n ): Promise<UnsignedTx>;\n /**\n * Orders two transactions of one slot by the price a node compares when one replaces\n * the other: negative when `a` pays less, positive when it pays more, `0` when neither\n * does. A repeat cancel bumps from the highest earlier cancel by this order; without it,\n * the core compares their total charges, which a gas limit can skew.\n */\n comparePrice?(a: UnsignedTx, b: UnsignedTx): number;\n}\n\nexport interface ScanFilter {\n readonly addresses?: readonly string[];\n readonly assets?: readonly AssetRef[];\n}\n\nexport interface BlockSource {\n header(height: bigint): Promise<DriverBlock | null>;\n transactions(\n block: DriverBlock,\n filter?: ScanFilter,\n ): Promise<readonly DriverTransaction[]>;\n}\n\nexport interface AddressHistorySource {\n list(\n address: string,\n options: { readonly cursor?: string; readonly limit: number },\n ): Promise<{ readonly items: readonly DriverTransaction[]; readonly next?: string }>;\n}\n\nexport interface DriverLimits {\n readonly maxOutputs: number;\n}\n\n/**\n * A native SDK client for `crypto-aio/native` and how to release it. `close` frees\n * what the client holds (sockets, timers, workers); the root container's `close()` runs it\n * once, before closing its pooled drivers.\n */\nexport interface DisposableNativeClient {\n readonly client: unknown;\n close?(): void | Promise<void>;\n}\n\n/**\n * The driver port: every method's contract, as the core relies on it. Purpose, retry\n * class and quorum are the `CallOptions` a driver passes to its `Transport` (defaults:\n * purpose `read`, retry `safe`, no quorum). A `monitor` or `proof` read only goes to\n * endpoints that are not lagging.\n *\n * | Method | Purpose | Retry | Quorum | Returns / throws |\n * | --- | --- | --- | --- | --- |\n * | `reader.getBalance`, `getBlock`, `getTransaction` | `read` | `safe` | none | `null` when not found; provider errors propagate |\n * | `reader.getTokenMetadata` | `read` | `safe` | none (a driver may use a quorum) | A token's own unusable metadata (no contract, a reverting or malformed `decimals`/`symbol`) throws `ValidationError('ASSET_RESOLUTION')`, which the core caches per container (only a non-retryable `ASSET_RESOLUTION` is cached); every other failure, e.g. a transient provider failure (propagated retryable) or any other provider error, is not cached and the next lookup queries again. Stricter than this minimum, the EVM driver reads `decimals()` and `symbol()` under `quorum: 'proof'`: the metadata is cached for the container's life, and one endpoint's wrong `decimals` would mis-scale every amount; endpoints that disagree throw retryable `PROVIDER_INCONSISTENT`, which is not cached |\n * | `reader.getBlockHeight`, `getFinalizedHeight` | `monitor` | `safe` | none | propagate; they feed the stale-view guards and confirmation depths |\n * | `reader.observe(ref, ordering, from)` | `monitor` | `safe` | none | `{ seen: 'none' }` when not visible; `ordering` and `from` are `undefined` for a transaction the library does not manage |\n * | `sequence.pending`, `sequence.latest` | `monitor` | `safe` | none | propagate |\n * | `proofs.*` (`finalizedHead`, `includedFinal`, `slotConsumed`, `expired`, `blockHash`) | `proof` | `safe` | `'proof'` | endpoints that disagree throw retryable `PROVIDER_INCONSISTENT`, and the core then decides nothing. Only a definitive negative proof answers \"no\"; every other RPC error throws retryable `PROVIDER_UNAVAILABLE`, which decides nothing (see below). Only `slotConsumed(…, 'latest')` may be a single `monitor` read: the core records it as observed evidence |\n * | `broadcaster.broadcast` | `broadcast` | `ambiguous-on-failure` | none (passes `fanout` and `signal` through) | classifies a definitive `RPC_ERROR` into a `BroadcastResult`; rethrows an ambiguous one (`error.ambiguous`) and every other failure unclassified |\n * | `builder.estimateFee`, `checkFunds`, `build` | `read` | `safe` | none | `ValidationError` / `UnsupportedCapabilityError` for an intent it cannot build |\n * | `builder.assemble` | no I/O | – | – | `SigningError('SIGNING_FAILED')` when a signature is missing |\n * | `builder.signaturesFrom` (optional) | no I/O | – | – | `ValidationError('INVALID_INTENT')` when the signed payload is not the prepared transaction |\n * | `replacement.buildReplacement`, `buildCancel` | `read` | `safe` | none | `ChainError('FEE_TOO_LOW')` below the network's bump; `buildCancel` honours a given `fee` and never substitutes its own |\n * | `blocks.header` | `monitor` | `safe` | none | `null` while the height is not visible |\n * | `blocks.transactions` | `monitor` | `safe` | none | retryable `PROVIDER_INCONSISTENT` when the block at `block.height` no longer has `block.hash` |\n * | `history.list` | `read` (indexer transport when configured) | `safe` | none | propagate |\n * | `createNativeClient` | no I/O | – | – | a fresh SDK instance on every call, never the pooled one |\n * | `signingSchemes` (optional) | no I/O | – | – | `ConfigError('CONFIG_INVALID')` for wallet options it refuses |\n *\n * Further rules:\n * - On a proof path (`proofs.*`), only a definitive negative proof may\n * answer \"no\" (`included: false`, a slot not consumed, a `null` block hash). Every other\n * RPC error, including state or history not available, pruned data, an index still being\n * built (\"transaction indexing is in progress\"), or an endpoint's non-definitive error,\n * must surface as a retryable `ProviderError('PROVIDER_UNAVAILABLE')`, which decides\n * nothing: the core looks again later and never takes it for an answer.\n * - `BlockSource` heights are dense: every height up to the head has one block, and\n * `header(h)` is `null` only while `h` is not visible, never for a skipped slot.\n * - A provider must serve headers at least about 2 × `reorgWindow` below the head. A new\n * cursor loads `reorgWindow` blocks below its start, and a rollback refills its window\n * below the common ancestor.\n * - `ScanFilter.addresses`: when non-empty, return at least every transaction with a transfer\n * from or to one of them; empty (`[]`) or absent means no filter. `ScanFilter.assets` is a\n * hint only: a driver may narrow by it or ignore it, and the core does not filter again.\n * - `fee.details.requestedFee` is reserved. On replacements the core records the requested\n * fee spec there, so a driver never sets or reads it.\n * - `DriverContext` has no asset resolver and `DriverIntent` carries no decimals. Amounts\n * reach drivers in base units only; a driver that needs a token's decimals (Solana's\n * `transferChecked`) reads them from the chain itself.\n */\nexport interface ChainDriver {\n readonly ordering: OrderingKind;\n readonly capabilities: ReadonlySet<Capability>;\n readonly address: AddressCodec;\n readonly reader: ChainReader;\n readonly builder: TxBuilder;\n readonly broadcaster: Broadcaster;\n readonly proofs: ProofSource;\n readonly sequence?: SequenceSource;\n readonly replacement?: ReplacementPolicy;\n readonly blocks?: BlockSource;\n readonly history?: AddressHistorySource;\n /** Two-level, capability-gated family API: `ext.<family>.<method>(...) → Promise`. */\n readonly ext?: Readonly<\n Record<string, Readonly<Record<string, (...args: never[]) => Promise<unknown>>>>\n >;\n limits?(wallet: WalletOptions): DriverLimits;\n /**\n * The signature schemes a wallet with these options signs with, when its options narrow\n * the chain's `schemes` (a Bitcoin `p2tr` wallet signs with `secp256k1-schnorr` only). No\n * I/O; it throws `CONFIG_INVALID` for options the driver refuses. When the core resolves\n * a wallet that has a signer, it refuses (`CONFIG_INVALID`) one that does not declare each\n * of them, before reading any key: the transfer would otherwise be built, reserved and\n * fail only at signing. Without this method, a signer needs one of the chain's schemes.\n * A watch-only wallet is not checked.\n */\n signingSchemes?(wallet: WalletOptions): readonly string[];\n /**\n * A fresh, caller-owned SDK client for `crypto-aio/native`: a new SDK instance on every\n * call, never the pooled one.\n */\n createNativeClient?(): DisposableNativeClient;\n close?(): Promise<void>;\n}\n\n/**\n * A factory's `create()` must call `transport.setProbes(...)` exactly once, before any\n * other traffic, on every `Transport` it receives here — including `indexer`, when present.\n * `setProbes` resets health/identity state, so calling it again later, or skipping it on one\n * of the two transports, leaves that transport's health checks silently unconfigured.\n *\n * There is no asset resolver here, and `DriverIntent` carries no decimals: drivers work\n * in base units only.\n */\nexport interface DriverContext {\n readonly chain: ChainInfo;\n readonly network: NetworkInfo;\n readonly library: string;\n readonly transport: Transport;\n readonly indexer?: Transport;\n readonly clock: Clock;\n readonly log: Logger;\n readonly options: Readonly<Record<string, unknown>>;\n}\n\nexport interface DriverFactory {\n create(ctx: DriverContext): Promise<ChainDriver>;\n}\n\nexport interface PeerDependency {\n readonly name: string;\n readonly range: string;\n}\n\n/** Static metadata (no SDK import) plus a lazy `load()` that `require()`s the driver module. */\nexport interface AdapterManifest {\n readonly family: string;\n readonly library: string;\n readonly chains: readonly string[];\n readonly capabilities: readonly Capability[];\n readonly indexerCapabilities?: readonly Capability[];\n readonly requiresIndexer?: boolean;\n readonly peerDependencies: readonly PeerDependency[];\n load(): Promise<DriverFactory>;\n}\n"]}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
export type ErrorCategory = 'config' | 'unsupported' | 'validation' | 'provider' | 'chain' | 'signing' | 'state' | 'timeout';
|
|
2
|
+
/** Frozen, with every entry: the table is shared by every error and every caller. */
|
|
3
|
+
export declare const ERROR_CODES: {
|
|
4
|
+
readonly CONFIG_INVALID: {
|
|
5
|
+
readonly category: "config";
|
|
6
|
+
readonly retryable: false;
|
|
7
|
+
};
|
|
8
|
+
readonly DEPENDENCY_MISSING: {
|
|
9
|
+
readonly category: "config";
|
|
10
|
+
readonly retryable: false;
|
|
11
|
+
};
|
|
12
|
+
readonly INCOMPATIBLE_SELECTION: {
|
|
13
|
+
readonly category: "config";
|
|
14
|
+
readonly retryable: false;
|
|
15
|
+
};
|
|
16
|
+
readonly UNSUPPORTED_CAPABILITY: {
|
|
17
|
+
readonly category: "unsupported";
|
|
18
|
+
readonly retryable: false;
|
|
19
|
+
};
|
|
20
|
+
readonly INVALID_ADDRESS: {
|
|
21
|
+
readonly category: "validation";
|
|
22
|
+
readonly retryable: false;
|
|
23
|
+
};
|
|
24
|
+
readonly INVALID_AMOUNT: {
|
|
25
|
+
readonly category: "validation";
|
|
26
|
+
readonly retryable: false;
|
|
27
|
+
};
|
|
28
|
+
readonly ASSET_RESOLUTION: {
|
|
29
|
+
readonly category: "validation";
|
|
30
|
+
readonly retryable: false;
|
|
31
|
+
};
|
|
32
|
+
readonly INVALID_INTENT: {
|
|
33
|
+
readonly category: "validation";
|
|
34
|
+
readonly retryable: false;
|
|
35
|
+
};
|
|
36
|
+
readonly PROVIDER_UNAVAILABLE: {
|
|
37
|
+
readonly category: "provider";
|
|
38
|
+
readonly retryable: true;
|
|
39
|
+
};
|
|
40
|
+
readonly RATE_LIMITED: {
|
|
41
|
+
readonly category: "provider";
|
|
42
|
+
readonly retryable: true;
|
|
43
|
+
};
|
|
44
|
+
readonly PROVIDER_MISCONFIGURED: {
|
|
45
|
+
readonly category: "provider";
|
|
46
|
+
readonly retryable: false;
|
|
47
|
+
};
|
|
48
|
+
readonly PROVIDER_INCONSISTENT: {
|
|
49
|
+
readonly category: "provider";
|
|
50
|
+
readonly retryable: true;
|
|
51
|
+
};
|
|
52
|
+
readonly RPC_ERROR: {
|
|
53
|
+
readonly category: "provider";
|
|
54
|
+
readonly retryable: false;
|
|
55
|
+
};
|
|
56
|
+
readonly INSUFFICIENT_FUNDS: {
|
|
57
|
+
readonly category: "chain";
|
|
58
|
+
readonly retryable: false;
|
|
59
|
+
};
|
|
60
|
+
readonly NONCE_CONFLICT: {
|
|
61
|
+
readonly category: "chain";
|
|
62
|
+
readonly retryable: false;
|
|
63
|
+
};
|
|
64
|
+
readonly NONCE_TOO_HIGH: {
|
|
65
|
+
readonly category: "chain";
|
|
66
|
+
readonly retryable: false;
|
|
67
|
+
};
|
|
68
|
+
readonly FEE_TOO_LOW: {
|
|
69
|
+
readonly category: "chain";
|
|
70
|
+
readonly retryable: false;
|
|
71
|
+
};
|
|
72
|
+
readonly TX_REFUSED: {
|
|
73
|
+
readonly category: "chain";
|
|
74
|
+
readonly retryable: false;
|
|
75
|
+
};
|
|
76
|
+
readonly TX_REJECTED: {
|
|
77
|
+
readonly category: "chain";
|
|
78
|
+
readonly retryable: false;
|
|
79
|
+
};
|
|
80
|
+
readonly TX_REVERTED: {
|
|
81
|
+
readonly category: "chain";
|
|
82
|
+
readonly retryable: false;
|
|
83
|
+
};
|
|
84
|
+
/** Included and executed, but no transfer to the recipient shows: value may have moved. */
|
|
85
|
+
readonly TX_UNEVIDENCED: {
|
|
86
|
+
readonly category: "chain";
|
|
87
|
+
readonly retryable: false;
|
|
88
|
+
};
|
|
89
|
+
readonly TX_EXPIRED: {
|
|
90
|
+
readonly category: "chain";
|
|
91
|
+
readonly retryable: false;
|
|
92
|
+
};
|
|
93
|
+
readonly TX_REPLACED: {
|
|
94
|
+
readonly category: "chain";
|
|
95
|
+
readonly retryable: false;
|
|
96
|
+
};
|
|
97
|
+
readonly SIGNER_UNAVAILABLE: {
|
|
98
|
+
readonly category: "signing";
|
|
99
|
+
readonly retryable: false;
|
|
100
|
+
};
|
|
101
|
+
readonly SIGNING_FAILED: {
|
|
102
|
+
readonly category: "signing";
|
|
103
|
+
readonly retryable: false;
|
|
104
|
+
};
|
|
105
|
+
readonly SIGNATURE_MISMATCH: {
|
|
106
|
+
readonly category: "signing";
|
|
107
|
+
readonly retryable: false;
|
|
108
|
+
};
|
|
109
|
+
readonly POLICY_REJECTED: {
|
|
110
|
+
readonly category: "signing";
|
|
111
|
+
readonly retryable: false;
|
|
112
|
+
};
|
|
113
|
+
readonly KEY_NOT_EXPORTABLE: {
|
|
114
|
+
readonly category: "signing";
|
|
115
|
+
readonly retryable: false;
|
|
116
|
+
};
|
|
117
|
+
readonly IDEMPOTENCY_CONFLICT: {
|
|
118
|
+
readonly category: "state";
|
|
119
|
+
readonly retryable: false;
|
|
120
|
+
};
|
|
121
|
+
readonly FENCING: {
|
|
122
|
+
readonly category: "state";
|
|
123
|
+
readonly retryable: false;
|
|
124
|
+
};
|
|
125
|
+
readonly VERSION_CONFLICT: {
|
|
126
|
+
readonly category: "state";
|
|
127
|
+
readonly retryable: true;
|
|
128
|
+
};
|
|
129
|
+
readonly INVALID_TRANSITION: {
|
|
130
|
+
readonly category: "state";
|
|
131
|
+
readonly retryable: false;
|
|
132
|
+
};
|
|
133
|
+
readonly NOT_FOUND: {
|
|
134
|
+
readonly category: "state";
|
|
135
|
+
readonly retryable: false;
|
|
136
|
+
};
|
|
137
|
+
readonly SEQUENCE_BUSY: {
|
|
138
|
+
readonly category: "state";
|
|
139
|
+
readonly retryable: true;
|
|
140
|
+
};
|
|
141
|
+
/** The outcome may have happened (e.g. a delivered broadcast) but was not recorded. */
|
|
142
|
+
readonly STATE_UNRECORDED: {
|
|
143
|
+
readonly category: "state";
|
|
144
|
+
readonly retryable: true;
|
|
145
|
+
};
|
|
146
|
+
readonly SCANNER_REORG_TOO_DEEP: {
|
|
147
|
+
readonly category: "state";
|
|
148
|
+
readonly retryable: false;
|
|
149
|
+
};
|
|
150
|
+
/** A stored Operation's record format is newer than this version reads. */
|
|
151
|
+
readonly RECORD_FORMAT_UNSUPPORTED: {
|
|
152
|
+
readonly category: "state";
|
|
153
|
+
readonly retryable: false;
|
|
154
|
+
};
|
|
155
|
+
readonly TIMEOUT: {
|
|
156
|
+
readonly category: "timeout";
|
|
157
|
+
readonly retryable: true;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
export type ErrorCode = keyof typeof ERROR_CODES;
|
|
161
|
+
export type CodesOf<C extends ErrorCategory> = {
|
|
162
|
+
[K in ErrorCode]: (typeof ERROR_CODES)[K]['category'] extends C ? K : never;
|
|
163
|
+
}[ErrorCode];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERROR_CODES = void 0;
|
|
4
|
+
/** Frozen, with every entry: the table is shared by every error and every caller. */
|
|
5
|
+
exports.ERROR_CODES = deepFreezeCodes({
|
|
6
|
+
CONFIG_INVALID: { category: 'config', retryable: false },
|
|
7
|
+
DEPENDENCY_MISSING: { category: 'config', retryable: false },
|
|
8
|
+
INCOMPATIBLE_SELECTION: { category: 'config', retryable: false },
|
|
9
|
+
UNSUPPORTED_CAPABILITY: { category: 'unsupported', retryable: false },
|
|
10
|
+
INVALID_ADDRESS: { category: 'validation', retryable: false },
|
|
11
|
+
INVALID_AMOUNT: { category: 'validation', retryable: false },
|
|
12
|
+
ASSET_RESOLUTION: { category: 'validation', retryable: false },
|
|
13
|
+
INVALID_INTENT: { category: 'validation', retryable: false },
|
|
14
|
+
PROVIDER_UNAVAILABLE: { category: 'provider', retryable: true },
|
|
15
|
+
RATE_LIMITED: { category: 'provider', retryable: true },
|
|
16
|
+
PROVIDER_MISCONFIGURED: { category: 'provider', retryable: false },
|
|
17
|
+
PROVIDER_INCONSISTENT: { category: 'provider', retryable: true },
|
|
18
|
+
RPC_ERROR: { category: 'provider', retryable: false },
|
|
19
|
+
INSUFFICIENT_FUNDS: { category: 'chain', retryable: false },
|
|
20
|
+
NONCE_CONFLICT: { category: 'chain', retryable: false },
|
|
21
|
+
NONCE_TOO_HIGH: { category: 'chain', retryable: false },
|
|
22
|
+
FEE_TOO_LOW: { category: 'chain', retryable: false },
|
|
23
|
+
TX_REFUSED: { category: 'chain', retryable: false },
|
|
24
|
+
TX_REJECTED: { category: 'chain', retryable: false },
|
|
25
|
+
TX_REVERTED: { category: 'chain', retryable: false },
|
|
26
|
+
/** Included and executed, but no transfer to the recipient shows: value may have moved. */
|
|
27
|
+
TX_UNEVIDENCED: { category: 'chain', retryable: false },
|
|
28
|
+
TX_EXPIRED: { category: 'chain', retryable: false },
|
|
29
|
+
TX_REPLACED: { category: 'chain', retryable: false },
|
|
30
|
+
SIGNER_UNAVAILABLE: { category: 'signing', retryable: false },
|
|
31
|
+
SIGNING_FAILED: { category: 'signing', retryable: false },
|
|
32
|
+
SIGNATURE_MISMATCH: { category: 'signing', retryable: false },
|
|
33
|
+
POLICY_REJECTED: { category: 'signing', retryable: false },
|
|
34
|
+
KEY_NOT_EXPORTABLE: { category: 'signing', retryable: false },
|
|
35
|
+
IDEMPOTENCY_CONFLICT: { category: 'state', retryable: false },
|
|
36
|
+
FENCING: { category: 'state', retryable: false },
|
|
37
|
+
VERSION_CONFLICT: { category: 'state', retryable: true },
|
|
38
|
+
INVALID_TRANSITION: { category: 'state', retryable: false },
|
|
39
|
+
NOT_FOUND: { category: 'state', retryable: false },
|
|
40
|
+
SEQUENCE_BUSY: { category: 'state', retryable: true },
|
|
41
|
+
/** The outcome may have happened (e.g. a delivered broadcast) but was not recorded. */
|
|
42
|
+
STATE_UNRECORDED: { category: 'state', retryable: true },
|
|
43
|
+
SCANNER_REORG_TOO_DEEP: { category: 'state', retryable: false },
|
|
44
|
+
/** A stored Operation's record format is newer than this version reads. */
|
|
45
|
+
RECORD_FORMAT_UNSUPPORTED: { category: 'state', retryable: false },
|
|
46
|
+
TIMEOUT: { category: 'timeout', retryable: true },
|
|
47
|
+
});
|
|
48
|
+
function deepFreezeCodes(codes) {
|
|
49
|
+
for (const definition of Object.values(codes))
|
|
50
|
+
Object.freeze(definition);
|
|
51
|
+
return Object.freeze(codes);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=codes.js.map
|