@bigmi/core 0.9.0 → 0.9.1
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 +12 -0
- package/dist/cjs/_virtual/_rolldown/runtime.js +1 -1
- package/dist/cjs/actions/getBalance.d.ts +3 -4
- package/dist/cjs/actions/getBlock.d.ts +3 -4
- package/dist/cjs/actions/getBlockCount.d.ts +2 -3
- package/dist/cjs/actions/getBlockStats.d.ts +3 -4
- package/dist/cjs/actions/getTransactionFee.d.ts +3 -4
- package/dist/cjs/actions/getTransactions.d.ts +3 -4
- package/dist/cjs/actions/getUTXOTransaction.d.ts +3 -4
- package/dist/cjs/actions/getUTXOs.d.ts +3 -4
- package/dist/cjs/actions/getXPubAddresses.d.ts +3 -4
- package/dist/cjs/actions/sendUTXOTransaction.d.ts +3 -4
- package/dist/cjs/actions/signPsbt.d.ts +1 -2
- package/dist/cjs/actions/waitForTransaction.d.ts +6 -7
- package/dist/cjs/actions/watchBlockNumber.d.ts +5 -6
- package/dist/cjs/actions/watchBlockNumber.js +3 -2
- package/dist/cjs/actions/watchBlockNumber.js.map +1 -1
- package/dist/cjs/chains/bitcoin.d.ts +1 -2
- package/dist/cjs/chains/defineChain.d.ts +1 -2
- package/dist/cjs/chains/signet.d.ts +1 -2
- package/dist/cjs/clients/decorators/public.d.ts +2 -3
- package/dist/cjs/clients/decorators/wallet.d.ts +2 -3
- package/dist/cjs/errors/address.d.ts +2 -3
- package/dist/cjs/errors/base.d.ts +3 -4
- package/dist/cjs/errors/base.js.map +1 -1
- package/dist/cjs/errors/block.d.ts +2 -3
- package/dist/cjs/errors/provider.d.ts +1 -2
- package/dist/cjs/errors/request.d.ts +10 -11
- package/dist/cjs/errors/rpc.d.ts +4 -5
- package/dist/cjs/errors/transaction.d.ts +6 -7
- package/dist/cjs/errors/transport.d.ts +6 -7
- package/dist/cjs/errors/utils.d.ts +3 -4
- package/dist/cjs/errors/utxo.d.ts +2 -3
- package/dist/cjs/factories/createClient.d.ts +6 -7
- package/dist/cjs/factories/createClient.js.map +1 -1
- package/dist/cjs/factories/createTransport.d.ts +1 -2
- package/dist/cjs/test/utils.d.ts +1 -2
- package/dist/cjs/transports/ankr/ankr.d.ts +1 -2
- package/dist/cjs/transports/ankr/ankr.types.d.ts +7 -8
- package/dist/cjs/transports/ankr/getBalance.d.ts +1 -2
- package/dist/cjs/transports/ankr/getTransactionFee.d.ts +1 -2
- package/dist/cjs/transports/ankr/getTransactions.d.ts +1 -2
- package/dist/cjs/transports/ankr/methods.d.ts +1 -2
- package/dist/cjs/transports/ankr/utils.d.ts +1 -2
- package/dist/cjs/transports/blockchair/blockchair.d.ts +1 -2
- package/dist/cjs/transports/blockchair/blockchair.types.d.ts +13 -14
- package/dist/cjs/transports/blockchair/getBalance.d.ts +1 -2
- package/dist/cjs/transports/blockchair/getTransactionFee.d.ts +1 -2
- package/dist/cjs/transports/blockchair/getUTXOs.d.ts +1 -2
- package/dist/cjs/transports/blockchair/getXPubAddresses.d.ts +1 -2
- package/dist/cjs/transports/blockchair/methods.d.ts +1 -2
- package/dist/cjs/transports/blockcypher/blockcypher.d.ts +1 -2
- package/dist/cjs/transports/blockcypher/blockcypher.types.d.ts +8 -9
- package/dist/cjs/transports/blockcypher/getBalance.d.ts +1 -2
- package/dist/cjs/transports/blockcypher/getTransactionFee.d.ts +1 -2
- package/dist/cjs/transports/blockcypher/getUTXOs.d.ts +1 -2
- package/dist/cjs/transports/blockcypher/methods.d.ts +1 -2
- package/dist/cjs/transports/blockcypher/utils.d.ts +1 -2
- package/dist/cjs/transports/custom.d.ts +4 -5
- package/dist/cjs/transports/fallback.d.ts +7 -8
- package/dist/cjs/transports/fallback.js.map +1 -1
- package/dist/cjs/transports/getHttpRpcClient.d.ts +6 -7
- package/dist/cjs/transports/getRpcProviderMethods.d.ts +1 -2
- package/dist/cjs/transports/http.d.ts +4 -5
- package/dist/cjs/transports/mempool/getBalance.d.ts +1 -2
- package/dist/cjs/transports/mempool/getTransactionFee.d.ts +1 -2
- package/dist/cjs/transports/mempool/getTransactions.d.ts +1 -2
- package/dist/cjs/transports/mempool/mempool.d.ts +1 -2
- package/dist/cjs/transports/mempool/mempool.types.d.ts +7 -8
- package/dist/cjs/transports/mempool/methods.d.ts +1 -2
- package/dist/cjs/transports/mempool/utils.d.ts +1 -2
- package/dist/cjs/transports/types.d.ts +12 -13
- package/dist/cjs/transports/utxo.d.ts +1 -2
- package/dist/cjs/types/account.d.ts +1 -2
- package/dist/cjs/types/address.d.ts +4 -5
- package/dist/cjs/types/block.d.ts +1 -2
- package/dist/cjs/types/blockStats.d.ts +2 -3
- package/dist/cjs/types/chain.d.ts +6 -7
- package/dist/cjs/types/client.d.ts +3 -4
- package/dist/cjs/types/hash.d.ts +1 -2
- package/dist/cjs/types/request.d.ts +5 -6
- package/dist/cjs/types/rpc.d.ts +4 -5
- package/dist/cjs/types/transaction.d.ts +2 -3
- package/dist/cjs/types/transport.d.ts +3 -4
- package/dist/cjs/types/utils.d.ts +19 -20
- package/dist/cjs/types/xpub.d.ts +1 -2
- package/dist/cjs/utils/buildRequest.d.ts +3 -4
- package/dist/cjs/utils/buildRequest.js +2 -1
- package/dist/cjs/utils/buildRequest.js.map +1 -1
- package/dist/cjs/utils/cancelTransaction.d.ts +1 -2
- package/dist/cjs/utils/converter.d.ts +5 -6
- package/dist/cjs/utils/createBatchScheduler.d.ts +2 -3
- package/dist/cjs/utils/deepEqual.d.ts +1 -2
- package/dist/cjs/utils/getAction.d.ts +1 -2
- package/dist/cjs/utils/getAddressInfo.d.ts +2 -3
- package/dist/cjs/utils/getAddressInfo.js +2 -1
- package/dist/cjs/utils/getAddressInfo.js.map +1 -1
- package/dist/cjs/utils/idCache.d.ts +1 -2
- package/dist/cjs/utils/isAddress.d.ts +1 -2
- package/dist/cjs/utils/lru.d.ts +1 -2
- package/dist/cjs/utils/modifyFee.d.ts +1 -2
- package/dist/cjs/utils/observe.d.ts +3 -4
- package/dist/cjs/utils/parseAccount.d.ts +2 -3
- package/dist/cjs/utils/poll.d.ts +1 -2
- package/dist/cjs/utils/poll.js +2 -1
- package/dist/cjs/utils/poll.js.map +1 -1
- package/dist/cjs/utils/retryUntil.d.ts +1 -2
- package/dist/cjs/utils/sleep.d.ts +1 -2
- package/dist/cjs/utils/stringify.d.ts +2 -3
- package/dist/cjs/utils/uid.d.ts +1 -2
- package/dist/cjs/utils/url.d.ts +1 -2
- package/dist/cjs/utils/wait.d.ts +1 -2
- package/dist/cjs/utils/withDedupe.d.ts +2 -3
- package/dist/cjs/utils/withResolvers.d.ts +2 -3
- package/dist/cjs/utils/withRetry.d.ts +3 -4
- package/dist/cjs/utils/withTimeout.d.ts +2 -3
- package/dist/cjs/version.d.ts +2 -3
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/cjs/vite-env.d.ts +1 -1
- package/dist/esm/actions/getBalance.d.ts +3 -4
- package/dist/esm/actions/getBalance.d.ts.map +1 -1
- package/dist/esm/actions/getBlock.d.ts +3 -4
- package/dist/esm/actions/getBlock.d.ts.map +1 -1
- package/dist/esm/actions/getBlockCount.d.ts +2 -3
- package/dist/esm/actions/getBlockCount.d.ts.map +1 -1
- package/dist/esm/actions/getBlockStats.d.ts +3 -4
- package/dist/esm/actions/getBlockStats.d.ts.map +1 -1
- package/dist/esm/actions/getTransactionFee.d.ts +3 -4
- package/dist/esm/actions/getTransactionFee.d.ts.map +1 -1
- package/dist/esm/actions/getTransactions.d.ts +3 -4
- package/dist/esm/actions/getTransactions.d.ts.map +1 -1
- package/dist/esm/actions/getUTXOTransaction.d.ts +3 -4
- package/dist/esm/actions/getUTXOTransaction.d.ts.map +1 -1
- package/dist/esm/actions/getUTXOs.d.ts +3 -4
- package/dist/esm/actions/getUTXOs.d.ts.map +1 -1
- package/dist/esm/actions/getXPubAddresses.d.ts +3 -4
- package/dist/esm/actions/getXPubAddresses.d.ts.map +1 -1
- package/dist/esm/actions/sendUTXOTransaction.d.ts +3 -4
- package/dist/esm/actions/sendUTXOTransaction.d.ts.map +1 -1
- package/dist/esm/actions/signPsbt.d.ts +1 -2
- package/dist/esm/actions/signPsbt.d.ts.map +1 -1
- package/dist/esm/actions/waitForTransaction.d.ts +6 -7
- package/dist/esm/actions/waitForTransaction.d.ts.map +1 -1
- package/dist/esm/actions/watchBlockNumber.d.ts +5 -6
- package/dist/esm/actions/watchBlockNumber.d.ts.map +1 -1
- package/dist/esm/actions/watchBlockNumber.js +3 -2
- package/dist/esm/actions/watchBlockNumber.js.map +1 -1
- package/dist/esm/chains/bitcoin.d.ts +1 -2
- package/dist/esm/chains/bitcoin.d.ts.map +1 -1
- package/dist/esm/chains/defineChain.d.ts +1 -2
- package/dist/esm/chains/defineChain.d.ts.map +1 -1
- package/dist/esm/chains/signet.d.ts +1 -2
- package/dist/esm/chains/signet.d.ts.map +1 -1
- package/dist/esm/clients/decorators/public.d.ts +2 -3
- package/dist/esm/clients/decorators/public.d.ts.map +1 -1
- package/dist/esm/clients/decorators/wallet.d.ts +2 -3
- package/dist/esm/clients/decorators/wallet.d.ts.map +1 -1
- package/dist/esm/errors/address.d.ts +2 -3
- package/dist/esm/errors/address.d.ts.map +1 -1
- package/dist/esm/errors/base.d.ts +3 -4
- package/dist/esm/errors/base.d.ts.map +1 -1
- package/dist/esm/errors/base.js.map +1 -1
- package/dist/esm/errors/block.d.ts +2 -3
- package/dist/esm/errors/block.d.ts.map +1 -1
- package/dist/esm/errors/provider.d.ts +1 -2
- package/dist/esm/errors/provider.d.ts.map +1 -1
- package/dist/esm/errors/request.d.ts +10 -11
- package/dist/esm/errors/request.d.ts.map +1 -1
- package/dist/esm/errors/rpc.d.ts +4 -5
- package/dist/esm/errors/rpc.d.ts.map +1 -1
- package/dist/esm/errors/transaction.d.ts +6 -7
- package/dist/esm/errors/transaction.d.ts.map +1 -1
- package/dist/esm/errors/transport.d.ts +6 -7
- package/dist/esm/errors/transport.d.ts.map +1 -1
- package/dist/esm/errors/utils.d.ts +3 -4
- package/dist/esm/errors/utils.d.ts.map +1 -1
- package/dist/esm/errors/utxo.d.ts +2 -3
- package/dist/esm/errors/utxo.d.ts.map +1 -1
- package/dist/esm/factories/createClient.d.ts +6 -7
- package/dist/esm/factories/createClient.d.ts.map +1 -1
- package/dist/esm/factories/createClient.js.map +1 -1
- package/dist/esm/factories/createTransport.d.ts +1 -2
- package/dist/esm/factories/createTransport.d.ts.map +1 -1
- package/dist/esm/test/utils.d.ts +1 -2
- package/dist/esm/test/utils.d.ts.map +1 -1
- package/dist/esm/transports/ankr/ankr.d.ts +1 -2
- package/dist/esm/transports/ankr/ankr.d.ts.map +1 -1
- package/dist/esm/transports/ankr/ankr.types.d.ts +7 -8
- package/dist/esm/transports/ankr/ankr.types.d.ts.map +1 -1
- package/dist/esm/transports/ankr/getBalance.d.ts +1 -2
- package/dist/esm/transports/ankr/getBalance.d.ts.map +1 -1
- package/dist/esm/transports/ankr/getTransactionFee.d.ts +1 -2
- package/dist/esm/transports/ankr/getTransactionFee.d.ts.map +1 -1
- package/dist/esm/transports/ankr/getTransactions.d.ts +1 -2
- package/dist/esm/transports/ankr/getTransactions.d.ts.map +1 -1
- package/dist/esm/transports/ankr/methods.d.ts +1 -2
- package/dist/esm/transports/ankr/methods.d.ts.map +1 -1
- package/dist/esm/transports/ankr/utils.d.ts +1 -2
- package/dist/esm/transports/ankr/utils.d.ts.map +1 -1
- package/dist/esm/transports/blockchair/blockchair.d.ts +1 -2
- package/dist/esm/transports/blockchair/blockchair.d.ts.map +1 -1
- package/dist/esm/transports/blockchair/blockchair.types.d.ts +13 -14
- package/dist/esm/transports/blockchair/blockchair.types.d.ts.map +1 -1
- package/dist/esm/transports/blockchair/getBalance.d.ts +1 -2
- package/dist/esm/transports/blockchair/getBalance.d.ts.map +1 -1
- package/dist/esm/transports/blockchair/getTransactionFee.d.ts +1 -2
- package/dist/esm/transports/blockchair/getTransactionFee.d.ts.map +1 -1
- package/dist/esm/transports/blockchair/getUTXOs.d.ts +1 -2
- package/dist/esm/transports/blockchair/getUTXOs.d.ts.map +1 -1
- package/dist/esm/transports/blockchair/getXPubAddresses.d.ts +1 -2
- package/dist/esm/transports/blockchair/getXPubAddresses.d.ts.map +1 -1
- package/dist/esm/transports/blockchair/methods.d.ts +1 -2
- package/dist/esm/transports/blockchair/methods.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/blockcypher.d.ts +1 -2
- package/dist/esm/transports/blockcypher/blockcypher.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/blockcypher.types.d.ts +8 -9
- package/dist/esm/transports/blockcypher/blockcypher.types.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/getBalance.d.ts +1 -2
- package/dist/esm/transports/blockcypher/getBalance.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/getTransactionFee.d.ts +1 -2
- package/dist/esm/transports/blockcypher/getTransactionFee.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/getUTXOs.d.ts +1 -2
- package/dist/esm/transports/blockcypher/getUTXOs.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/methods.d.ts +1 -2
- package/dist/esm/transports/blockcypher/methods.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/utils.d.ts +1 -2
- package/dist/esm/transports/blockcypher/utils.d.ts.map +1 -1
- package/dist/esm/transports/custom.d.ts +4 -5
- package/dist/esm/transports/custom.d.ts.map +1 -1
- package/dist/esm/transports/fallback.d.ts +7 -8
- package/dist/esm/transports/fallback.d.ts.map +1 -1
- package/dist/esm/transports/fallback.js.map +1 -1
- package/dist/esm/transports/getHttpRpcClient.d.ts +6 -7
- package/dist/esm/transports/getHttpRpcClient.d.ts.map +1 -1
- package/dist/esm/transports/getRpcProviderMethods.d.ts +1 -2
- package/dist/esm/transports/getRpcProviderMethods.d.ts.map +1 -1
- package/dist/esm/transports/http.d.ts +4 -5
- package/dist/esm/transports/http.d.ts.map +1 -1
- package/dist/esm/transports/mempool/getBalance.d.ts +1 -2
- package/dist/esm/transports/mempool/getBalance.d.ts.map +1 -1
- package/dist/esm/transports/mempool/getTransactionFee.d.ts +1 -2
- package/dist/esm/transports/mempool/getTransactionFee.d.ts.map +1 -1
- package/dist/esm/transports/mempool/getTransactions.d.ts +1 -2
- package/dist/esm/transports/mempool/getTransactions.d.ts.map +1 -1
- package/dist/esm/transports/mempool/mempool.d.ts +1 -2
- package/dist/esm/transports/mempool/mempool.d.ts.map +1 -1
- package/dist/esm/transports/mempool/mempool.types.d.ts +7 -8
- package/dist/esm/transports/mempool/mempool.types.d.ts.map +1 -1
- package/dist/esm/transports/mempool/methods.d.ts +1 -2
- package/dist/esm/transports/mempool/methods.d.ts.map +1 -1
- package/dist/esm/transports/mempool/utils.d.ts +1 -2
- package/dist/esm/transports/mempool/utils.d.ts.map +1 -1
- package/dist/esm/transports/types.d.ts +12 -13
- package/dist/esm/transports/types.d.ts.map +1 -1
- package/dist/esm/transports/utxo.d.ts +1 -2
- package/dist/esm/transports/utxo.d.ts.map +1 -1
- package/dist/esm/types/account.d.ts +1 -2
- package/dist/esm/types/account.d.ts.map +1 -1
- package/dist/esm/types/address.d.ts +4 -5
- package/dist/esm/types/address.d.ts.map +1 -1
- package/dist/esm/types/block.d.ts +1 -2
- package/dist/esm/types/block.d.ts.map +1 -1
- package/dist/esm/types/blockStats.d.ts +2 -3
- package/dist/esm/types/blockStats.d.ts.map +1 -1
- package/dist/esm/types/chain.d.ts +6 -7
- package/dist/esm/types/chain.d.ts.map +1 -1
- package/dist/esm/types/client.d.ts +3 -4
- package/dist/esm/types/client.d.ts.map +1 -1
- package/dist/esm/types/hash.d.ts +1 -2
- package/dist/esm/types/hash.d.ts.map +1 -1
- package/dist/esm/types/request.d.ts +5 -6
- package/dist/esm/types/request.d.ts.map +1 -1
- package/dist/esm/types/rpc.d.ts +4 -5
- package/dist/esm/types/rpc.d.ts.map +1 -1
- package/dist/esm/types/transaction.d.ts +2 -3
- package/dist/esm/types/transaction.d.ts.map +1 -1
- package/dist/esm/types/transport.d.ts +3 -4
- package/dist/esm/types/transport.d.ts.map +1 -1
- package/dist/esm/types/utils.d.ts +19 -20
- package/dist/esm/types/utils.d.ts.map +1 -1
- package/dist/esm/types/xpub.d.ts +1 -2
- package/dist/esm/types/xpub.d.ts.map +1 -1
- package/dist/esm/utils/buildRequest.d.ts +3 -4
- package/dist/esm/utils/buildRequest.d.ts.map +1 -1
- package/dist/esm/utils/buildRequest.js +2 -1
- package/dist/esm/utils/buildRequest.js.map +1 -1
- package/dist/esm/utils/cancelTransaction.d.ts +1 -2
- package/dist/esm/utils/cancelTransaction.d.ts.map +1 -1
- package/dist/esm/utils/converter.d.ts +5 -6
- package/dist/esm/utils/converter.d.ts.map +1 -1
- package/dist/esm/utils/createBatchScheduler.d.ts +2 -3
- package/dist/esm/utils/createBatchScheduler.d.ts.map +1 -1
- package/dist/esm/utils/deepEqual.d.ts +1 -2
- package/dist/esm/utils/deepEqual.d.ts.map +1 -1
- package/dist/esm/utils/getAction.d.ts +1 -2
- package/dist/esm/utils/getAction.d.ts.map +1 -1
- package/dist/esm/utils/getAddressInfo.d.ts +2 -3
- package/dist/esm/utils/getAddressInfo.d.ts.map +1 -1
- package/dist/esm/utils/getAddressInfo.js +2 -1
- package/dist/esm/utils/getAddressInfo.js.map +1 -1
- package/dist/esm/utils/idCache.d.ts +1 -2
- package/dist/esm/utils/idCache.d.ts.map +1 -1
- package/dist/esm/utils/isAddress.d.ts +1 -2
- package/dist/esm/utils/isAddress.d.ts.map +1 -1
- package/dist/esm/utils/lru.d.ts +1 -2
- package/dist/esm/utils/lru.d.ts.map +1 -1
- package/dist/esm/utils/modifyFee.d.ts +1 -2
- package/dist/esm/utils/modifyFee.d.ts.map +1 -1
- package/dist/esm/utils/observe.d.ts +3 -4
- package/dist/esm/utils/observe.d.ts.map +1 -1
- package/dist/esm/utils/parseAccount.d.ts +2 -3
- package/dist/esm/utils/parseAccount.d.ts.map +1 -1
- package/dist/esm/utils/poll.d.ts +1 -2
- package/dist/esm/utils/poll.d.ts.map +1 -1
- package/dist/esm/utils/poll.js +2 -1
- package/dist/esm/utils/poll.js.map +1 -1
- package/dist/esm/utils/retryUntil.d.ts +1 -2
- package/dist/esm/utils/retryUntil.d.ts.map +1 -1
- package/dist/esm/utils/sleep.d.ts +1 -2
- package/dist/esm/utils/sleep.d.ts.map +1 -1
- package/dist/esm/utils/stringify.d.ts +2 -3
- package/dist/esm/utils/stringify.d.ts.map +1 -1
- package/dist/esm/utils/uid.d.ts +1 -2
- package/dist/esm/utils/uid.d.ts.map +1 -1
- package/dist/esm/utils/url.d.ts +1 -2
- package/dist/esm/utils/url.d.ts.map +1 -1
- package/dist/esm/utils/wait.d.ts +1 -2
- package/dist/esm/utils/wait.d.ts.map +1 -1
- package/dist/esm/utils/withDedupe.d.ts +2 -3
- package/dist/esm/utils/withDedupe.d.ts.map +1 -1
- package/dist/esm/utils/withResolvers.d.ts +2 -3
- package/dist/esm/utils/withResolvers.d.ts.map +1 -1
- package/dist/esm/utils/withRetry.d.ts +3 -4
- package/dist/esm/utils/withRetry.d.ts.map +1 -1
- package/dist/esm/utils/withTimeout.d.ts +2 -3
- package/dist/esm/utils/withTimeout.d.ts.map +1 -1
- package/dist/esm/version.d.ts +2 -3
- package/dist/esm/version.d.ts.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esm/vite-env.d.ts +1 -1
- package/package.json +3 -3
- package/src/factories/createClient.ts +1 -2
- package/src/types/client.ts +1 -2
- package/src/version.ts +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { UTXOTransaction } from "../../types/transaction.js";
|
|
2
2
|
import { MempoolTransaction } from "./mempool.types.js";
|
|
3
3
|
//#region src/transports/mempool/utils.d.ts
|
|
4
|
-
declare const mempoolTransactionTransformer: (txn: MempoolTransaction) => Partial<UTXOTransaction>;
|
|
4
|
+
export declare const mempoolTransactionTransformer: (txn: MempoolTransaction) => Partial<UTXOTransaction>;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { mempoolTransactionTransformer };
|
|
7
6
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../../../src/transports/mempool/utils.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../../../src/transports/mempool/utils.ts"],"mappings":";;;qBAGa,gCACX,KAAK,uBACJ,QAAQ"}
|
|
@@ -3,8 +3,8 @@ import { UTXO, UTXOTransaction } from "../types/transaction.js";
|
|
|
3
3
|
import { xPubAccount } from "../types/xpub.js";
|
|
4
4
|
import { HttpRpcClient } from "./getHttpRpcClient.js";
|
|
5
5
|
//#region src/transports/types.d.ts
|
|
6
|
-
declare const UTXOAPISchemaMethods: UTXOMethod[];
|
|
7
|
-
type UTXOAPISchema = [{
|
|
6
|
+
export declare const UTXOAPISchemaMethods: UTXOMethod[];
|
|
7
|
+
export type UTXOAPISchema = [{
|
|
8
8
|
Method: "getBalance";
|
|
9
9
|
Parameters: {
|
|
10
10
|
address: string;
|
|
@@ -44,7 +44,7 @@ type UTXOAPISchema = [{
|
|
|
44
44
|
};
|
|
45
45
|
ReturnType: xPubAccount;
|
|
46
46
|
}];
|
|
47
|
-
type UTXOSchema = [{
|
|
47
|
+
export type UTXOSchema = [{
|
|
48
48
|
Method: "getblockcount";
|
|
49
49
|
Parameters: [];
|
|
50
50
|
ReturnType: number;
|
|
@@ -69,8 +69,8 @@ type UTXOSchema = [{
|
|
|
69
69
|
Parameters: [string, boolean, string?];
|
|
70
70
|
ReturnType: UTXOTransaction;
|
|
71
71
|
}, ...UTXOAPISchema];
|
|
72
|
-
type UTXOMethod = UTXOSchema[number]["Method"];
|
|
73
|
-
type SignPsbtParameters = {
|
|
72
|
+
export type UTXOMethod = UTXOSchema[number]["Method"];
|
|
73
|
+
export type SignPsbtParameters = {
|
|
74
74
|
/** The PSBT encoded as a hexadecimal string */
|
|
75
75
|
psbt: string;
|
|
76
76
|
/**
|
|
@@ -95,24 +95,24 @@ type SignPsbtParameters = {
|
|
|
95
95
|
*/
|
|
96
96
|
finalize?: boolean;
|
|
97
97
|
};
|
|
98
|
-
type SignPsbtReturnType = string;
|
|
99
|
-
type UTXOWalletSchema = readonly [{
|
|
98
|
+
export type SignPsbtReturnType = string;
|
|
99
|
+
export type UTXOWalletSchema = readonly [{
|
|
100
100
|
Method: "signPsbt";
|
|
101
101
|
Parameters: SignPsbtParameters;
|
|
102
102
|
ReturnType: SignPsbtReturnType;
|
|
103
103
|
}];
|
|
104
|
-
type SuccessResult<result> = {
|
|
104
|
+
export type SuccessResult<result> = {
|
|
105
105
|
method?: undefined;
|
|
106
106
|
result: result;
|
|
107
107
|
error?: undefined;
|
|
108
108
|
};
|
|
109
|
-
type ErrorResult<error> = {
|
|
109
|
+
export type ErrorResult<error> = {
|
|
110
110
|
method?: undefined;
|
|
111
111
|
result?: undefined;
|
|
112
112
|
error: error;
|
|
113
113
|
};
|
|
114
|
-
type RpcResponse<result = any, error = any> = SuccessResult<result> | ErrorResult<error>;
|
|
115
|
-
type RpcMethodHandler<M extends UTXOMethod = UTXOMethod> = (client: HttpRpcClient, config: {
|
|
114
|
+
export type RpcResponse<result = any, error = any> = SuccessResult<result> | ErrorResult<error>;
|
|
115
|
+
export type RpcMethodHandler<M extends UTXOMethod = UTXOMethod> = (client: HttpRpcClient, config: {
|
|
116
116
|
baseUrl: string;
|
|
117
117
|
apiKey?: string;
|
|
118
118
|
}, params: Extract<UTXOSchema[number], {
|
|
@@ -120,7 +120,6 @@ type RpcMethodHandler<M extends UTXOMethod = UTXOMethod> = (client: HttpRpcClien
|
|
|
120
120
|
}>["Parameters"]) => Promise<RpcResponse<Extract<UTXOSchema[number], {
|
|
121
121
|
Method: M;
|
|
122
122
|
}>["ReturnType"]>>;
|
|
123
|
-
type RpcMethods = { [key in UTXOMethod]?: RpcMethodHandler<key>; };
|
|
123
|
+
export type RpcMethods = { [key in UTXOMethod]?: RpcMethodHandler<key>; };
|
|
124
124
|
//#endregion
|
|
125
|
-
export { ErrorResult, RpcMethodHandler, RpcMethods, RpcResponse, SignPsbtParameters, SignPsbtReturnType, SuccessResult, UTXOAPISchema, UTXOAPISchemaMethods, UTXOMethod, UTXOSchema, UTXOWalletSchema };
|
|
126
125
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/transports/types.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/transports/types.ts"],"mappings":";;;;;qBAKa,sBAAsB;YAQvB;EAER;EACA;IAAc;;EACd;;EAGA;EACA;IACE;IACA;IACA;IACA;IACA;;EAEF;IACE,cAAc,MAAM,QAAQ;IAC5B;IACA;;;EAIF;EACA;IACE;;EAEF;;EAGA;EACA;IACE;IACA;;EAEF,YAAY,MAAM;;EAGlB;EACA;IACE;;EAEF,YAAY;;YAIJ;EAER;EACA;EACA;;EAGA;EACA;EACA;;EAGA;EACA;EACA;;EAGA;EACA,8BAA8B,MAAM;EACpC,YAAY;;EAGZ;EACA;EACA;;EAGA;EACA;EACA,YAAY;MAEX;YAGO,aAAa;YAEb;;EAEV;;;;EAIA;;;;;IAKE;;IAEA;;IAEA;;;;;;;;EAQF;;YAGU;YAEA;EAER;EACA,YAAY;EACZ,YAAY;;YAIJ,cAAc;EACxB;EACA,QAAQ;EACR;;YAEU,YAAY;EACtB;EACA;EACA,OAAO;;YAGG,YAAY,cAAc,eAClC,cAAc,UACd,YAAY;YAEJ,iBAAiB,UAAU,aAAa,eAClD,QAAQ,eACR;EAAU;EAAiB;GAC3B,QAAQ,QAAQ;EAAsB,QAAQ;qBAC3C,QACH,YAAY,QAAQ;EAAsB,QAAQ;;YAGxC,gBACT,OAAO,cAAc,iBAAiB"}
|
|
@@ -4,7 +4,6 @@ type UTXOHttpTransportConfig = HttpTransportConfig & {
|
|
|
4
4
|
includeChainToURL?: boolean;
|
|
5
5
|
apiKey?: string;
|
|
6
6
|
};
|
|
7
|
-
declare function utxo(url?: string, config?: UTXOHttpTransportConfig): HttpTransport;
|
|
7
|
+
export declare function utxo(url?: string, config?: UTXOHttpTransportConfig): HttpTransport;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { utxo };
|
|
10
9
|
//# sourceMappingURL=utxo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utxo.d.ts","names":[],"sources":["../../../src/transports/utxo.ts"],"mappings":";;KASK,0BAA0B;EAC7B;EACA;;
|
|
1
|
+
{"version":3,"file":"utxo.d.ts","names":[],"sources":["../../../src/transports/utxo.ts"],"mappings":";;KASK,0BAA0B;EAC7B;EACA;;wBAGc,KACd,cACA,SAAQ,0BACP"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Address, AddressPurpose, AddressType } from "./address.js";
|
|
2
2
|
//#region src/types/account.d.ts
|
|
3
|
-
interface Account {
|
|
3
|
+
export interface Account {
|
|
4
4
|
address: Address;
|
|
5
5
|
addressType: AddressType;
|
|
6
6
|
publicKey: string;
|
|
7
7
|
purpose: AddressPurpose;
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
|
-
export { Account };
|
|
11
10
|
//# sourceMappingURL=account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","names":[],"sources":["../../../src/types/account.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"account.d.ts","names":[],"sources":["../../../src/types/account.ts"],"mappings":";;iBAEiB;EACf,SAAS;EACT,aAAa;EACb;EACA,SAAS"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Network } from "./chain.js";
|
|
2
2
|
//#region src/types/address.d.ts
|
|
3
|
-
type Address = string;
|
|
4
|
-
type AddressPurpose = "payment" | "ordinals" | "stacks";
|
|
5
|
-
declare enum AddressType {
|
|
3
|
+
export type Address = string;
|
|
4
|
+
export type AddressPurpose = "payment" | "ordinals" | "stacks";
|
|
5
|
+
export declare enum AddressType {
|
|
6
6
|
p2pkh = "p2pkh",
|
|
7
7
|
p2sh = "p2sh",
|
|
8
8
|
p2wpkh = "p2wpkh",
|
|
9
9
|
p2wsh = "p2wsh",
|
|
10
10
|
p2tr = "p2tr"
|
|
11
11
|
}
|
|
12
|
-
type AddressInfo = {
|
|
12
|
+
export type AddressInfo = {
|
|
13
13
|
bech32: boolean;
|
|
14
14
|
network: Network;
|
|
15
15
|
address: Address;
|
|
@@ -17,5 +17,4 @@ type AddressInfo = {
|
|
|
17
17
|
purpose: AddressPurpose;
|
|
18
18
|
};
|
|
19
19
|
//#endregion
|
|
20
|
-
export { Address, AddressInfo, AddressPurpose, AddressType };
|
|
21
20
|
//# sourceMappingURL=address.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.d.ts","names":[],"sources":["../../../src/types/address.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"address.d.ts","names":[],"sources":["../../../src/types/address.ts"],"mappings":";;YAEY;YAEA;oBAEA;EACV;EACA;EACA;EACA;EACA;;YAGU;EACV;EACA,SAAS;EACT,SAAS;EACT,MAAM;EACN,SAAS"}
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
* the usage of `pending` may lead to inconsistencies as a result of an
|
|
18
18
|
* overly aggressive cache system. This may cause downstream errors/invalid states.
|
|
19
19
|
*/
|
|
20
|
-
type BlockTag = "latest" | "earliest" | "pending" | "safe" | "finalized";
|
|
20
|
+
export type BlockTag = "latest" | "earliest" | "pending" | "safe" | "finalized";
|
|
21
21
|
//#endregion
|
|
22
|
-
export { BlockTag };
|
|
23
22
|
//# sourceMappingURL=block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.d.ts","names":[],"sources":["../../../src/types/block.ts"],"mappings":";;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"block.d.ts","names":[],"sources":["../../../src/types/block.ts"],"mappings":";;;;;;;;;;;;;;;;;;;YAkBY"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/types/blockStats.d.ts
|
|
2
|
-
type BlockStats = Partial<{
|
|
2
|
+
export type BlockStats = Partial<{
|
|
3
3
|
avgfee: number;
|
|
4
4
|
avgfeerate: number;
|
|
5
5
|
avgtxsize: number;
|
|
@@ -32,7 +32,6 @@ type BlockStats = Partial<{
|
|
|
32
32
|
utxo_increase_actual: number;
|
|
33
33
|
utxo_size_inc_actual: number;
|
|
34
34
|
}>;
|
|
35
|
-
type BlockStatsKeys = keyof BlockStats;
|
|
35
|
+
export type BlockStatsKeys = keyof BlockStats;
|
|
36
36
|
//#endregion
|
|
37
|
-
export { BlockStats, BlockStatsKeys };
|
|
38
37
|
//# sourceMappingURL=blockStats.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockStats.d.ts","names":[],"sources":["../../../src/types/blockStats.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"blockStats.d.ts","names":[],"sources":["../../../src/types/blockStats.ts"],"mappings":";YAAY,aAAa;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU,uBAAuB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/types/chain.d.ts
|
|
2
|
-
declare enum ChainId {
|
|
2
|
+
export declare enum ChainId {
|
|
3
3
|
BITCOIN_MAINNET = "bitcoin:mainnet",
|
|
4
4
|
BITCOIN_TESTNET = "bitcoin:testnet",
|
|
5
5
|
BITCOIN_TESTNET4 = "bitcoin:testnet4",
|
|
@@ -9,12 +9,12 @@ declare enum ChainId {
|
|
|
9
9
|
STACKS_MAINNET = "stacks:mainnet",
|
|
10
10
|
STACKS_TESTNET = "stacks:testnet"
|
|
11
11
|
}
|
|
12
|
-
declare enum Network {
|
|
12
|
+
export declare enum Network {
|
|
13
13
|
Mainnet = "mainnet",
|
|
14
14
|
Testnet = "testnet",
|
|
15
15
|
Regtest = "regtest"
|
|
16
16
|
}
|
|
17
|
-
type Chain<formatters extends ChainFormatters | undefined = ChainFormatters | undefined, custom extends Record<string, unknown> | undefined = Record<string, unknown> | undefined> = {
|
|
17
|
+
export type Chain<formatters extends ChainFormatters | undefined = ChainFormatters | undefined, custom extends Record<string, unknown> | undefined = Record<string, unknown> | undefined> = {
|
|
18
18
|
/** Collection of block explorers */
|
|
19
19
|
blockExplorers?: {
|
|
20
20
|
[key: string]: ChainBlockExplorer;
|
|
@@ -32,13 +32,13 @@ type Chain<formatters extends ChainFormatters | undefined = ChainFormatters | un
|
|
|
32
32
|
/** Flag for test networks */
|
|
33
33
|
testnet?: boolean | undefined;
|
|
34
34
|
} & ChainConfig<formatters, custom>;
|
|
35
|
-
type ChainConfig<formatters extends ChainFormatters | undefined = ChainFormatters | undefined, custom extends Record<string, unknown> | undefined = Record<string, unknown> | undefined> = {
|
|
35
|
+
export type ChainConfig<formatters extends ChainFormatters | undefined = ChainFormatters | undefined, custom extends Record<string, unknown> | undefined = Record<string, unknown> | undefined> = {
|
|
36
36
|
/** Custom chain data. */
|
|
37
37
|
custom?: custom | undefined;
|
|
38
38
|
/** Modifies how data is formatted and typed (e.g. blocks and transactions) */
|
|
39
39
|
formatters?: formatters | undefined;
|
|
40
40
|
};
|
|
41
|
-
type ChainFormatters = {
|
|
41
|
+
export type ChainFormatters = {
|
|
42
42
|
/** Modifies how the Block structure is formatted & typed. */
|
|
43
43
|
block?: ChainFormatter<"block"> | undefined;
|
|
44
44
|
/** Modifies how the Transaction structure is formatted & typed. */
|
|
@@ -48,7 +48,7 @@ type ChainFormatters = {
|
|
|
48
48
|
/** Modifies how the TransactionRequest structure is formatted & typed. */
|
|
49
49
|
transactionRequest?: ChainFormatter<"transactionRequest"> | undefined;
|
|
50
50
|
};
|
|
51
|
-
type ChainFormatter<type extends string = string> = {
|
|
51
|
+
export type ChainFormatter<type extends string = string> = {
|
|
52
52
|
format: (args: any) => any;
|
|
53
53
|
type: type;
|
|
54
54
|
};
|
|
@@ -62,5 +62,4 @@ type ChainRpcUrls = {
|
|
|
62
62
|
webSocket?: readonly string[] | undefined;
|
|
63
63
|
};
|
|
64
64
|
//#endregion
|
|
65
|
-
export { Chain, ChainConfig, ChainFormatter, ChainFormatters, ChainId, Network };
|
|
66
65
|
//# sourceMappingURL=chain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.d.ts","names":[],"sources":["../../../src/types/chain.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"chain.d.ts","names":[],"sources":["../../../src/types/chain.ts"],"mappings":";oBAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;oBAGU;EACV;EACA;EACA;;YAGU,MACV,mBAAmB,8BAA8B,6BACjD,eAAe,sCACX;;EAIJ;KAEqB,cAAA;IACf,SAAS;;;EAIf,IAAI;;EAEJ;;EAEA;KACiB,cAAA;IACf,SAAS;;;EAGX;IACE,YAAY,YAAY;YAEhB,YACV,mBAAmB,8BAA8B,6BACjD,eAAe,sCACX;;EAIJ,SAAS;;EAET,aAAa;;YAOH;;EAEV,QAAQ;;EAER,cAAc;;EAEd,qBAAqB;;EAErB,qBAAqB;;YAGX,eAAe;EACzB,SAAS;EACT,MAAM;;KAOH;EACH;EACA;EACA;;KAGG;EACH;EACA"}
|
|
@@ -7,7 +7,7 @@ import { ErrorType } from "../errors/utils.js";
|
|
|
7
7
|
import { BtcRpcRequestFn, RpcSchema } from "./request.js";
|
|
8
8
|
import { Transport } from "./transport.js";
|
|
9
9
|
//#region src/types/client.d.ts
|
|
10
|
-
type ClientConfig<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, accountOrAddress extends Account | Address | undefined = Account | Address | undefined, rpcSchema extends RpcSchema | undefined = undefined> = {
|
|
10
|
+
export type ClientConfig<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, accountOrAddress extends Account | Address | undefined = Account | Address | undefined, rpcSchema extends RpcSchema | undefined = undefined> = {
|
|
11
11
|
/** The Account to use for the Client. This will be used for Actions that require an account as an argument. */
|
|
12
12
|
account?: accountOrAddress | Account | Address | undefined;
|
|
13
13
|
/**
|
|
@@ -35,7 +35,7 @@ type ClientConfig<transport extends Transport = Transport, chain extends Chain |
|
|
|
35
35
|
/** The type of client. */
|
|
36
36
|
type?: string | undefined;
|
|
37
37
|
};
|
|
38
|
-
type Client<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined, rpcSchema extends RpcSchema | undefined = undefined, extended extends Extended | undefined = Extended | undefined> = Client_Base<transport, chain, account, rpcSchema> & (extended extends Extended ? extended : unknown) & {
|
|
38
|
+
export type Client<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined, rpcSchema extends RpcSchema | undefined = undefined, extended extends Extended | undefined = Extended | undefined> = Client_Base<transport, chain, account, rpcSchema> & (extended extends Extended ? extended : unknown) & {
|
|
39
39
|
extend: <const client extends Extended>(fn: (client: Client<transport, chain, account, rpcSchema, extended>) => client) => Client<transport, chain, account, rpcSchema, Prettify<client> & (extended extends Extended ? extended : unknown)>;
|
|
40
40
|
};
|
|
41
41
|
type Client_Base<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined, rpcSchema extends RpcSchema | undefined = undefined> = {
|
|
@@ -63,7 +63,6 @@ type Client_Base<transport extends Transport = Transport, chain extends Chain |
|
|
|
63
63
|
type Extended = Prettify<{ [_ in keyof Client_Base]?: undefined; } & {
|
|
64
64
|
[key: string]: unknown;
|
|
65
65
|
}>;
|
|
66
|
-
type CreateClientErrorType = ErrorType;
|
|
66
|
+
export type CreateClientErrorType = ErrorType;
|
|
67
67
|
//#endregion
|
|
68
|
-
export { Client, ClientConfig, CreateClientErrorType };
|
|
69
68
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","names":[],"sources":["../../../src/types/client.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"client.d.ts","names":[],"sources":["../../../src/types/client.ts"],"mappings":";;;;;;;;;YAUY,aACV,kBAAkB,YAAY,WAC9B,cAAc,oBAAoB,mBAClC,yBAAyB,UAAU,sBAC/B,UACA,qBAEJ,kBAAkB;;EAGlB,UAAU,mBAAmB,UAAU;;;;;EAKvC;;EAEA,QAAQ,oBAAoB;;EAE5B;;EAEA;;;;;EAKA;;;;EAIA,YAAY;;EAEZ,WAAW;;EAEX;;YAKU,OACV,kBAAkB,YAAY,WAC9B,cAAc,oBAAoB,mBAClC,gBAAgB,sBAAsB,qBACtC,kBAAkB,mCAClB,iBAAiB,uBAAuB,wBACtC,YAAY,WAAW,OAAO,SAAS,cACxC,iBAAiB,WAAW;EAC3B,eAAe,eAAe,UAC5B,KACE,QAAQ,OAAO,WAAW,OAAO,SAAS,WAAW,cAClD,WACF,OACH,WACA,OACA,SACA,WACA,SAAS,WAAW,iBAAiB,WAAW;;KAIjD,YACH,kBAAkB,YAAY,WAC9B,cAAc,oBAAoB,mBAClC,gBAAgB,sBAAsB,qBACtC,kBAAkB;;EAGlB,SAAS;;EAET;;EAEA,OAAO;;EAEP;;EAEA;;EAEA;;EAEA,SAAS,gBACP,8BAA8B,oBAAoB;;EAGpD,WAAW,WAAW,uBAAuB,WAAW;;EAExD;;EAEA;;KAGG,WAAW,YAEX,WAAW;;;YAIJ,wBAAwB"}
|
package/dist/esm/types/hash.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.d.ts","names":[],"sources":["../../../src/types/hash.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"hash.d.ts","names":[],"sources":["../../../src/types/hash.ts"],"mappings":";YAAY"}
|
|
@@ -2,21 +2,21 @@ import { OneOf } from "./utils.js";
|
|
|
2
2
|
import { UTXOMethod } from "../transports/types.js";
|
|
3
3
|
import { ErrorType } from "../errors/utils.js";
|
|
4
4
|
//#region src/types/request.d.ts
|
|
5
|
-
type RpcSchema = readonly {
|
|
5
|
+
export type RpcSchema = readonly {
|
|
6
6
|
Method: string;
|
|
7
7
|
Parameters?: unknown | undefined;
|
|
8
8
|
ReturnType: unknown;
|
|
9
9
|
}[];
|
|
10
|
-
type RpcSchemaOverride = Omit<RpcSchema[number], "Method">;
|
|
10
|
+
export type RpcSchemaOverride = Omit<RpcSchema[number], "Method">;
|
|
11
11
|
type DerivedRpcSchema<rpcSchema extends RpcSchema | undefined> = rpcSchema extends RpcSchema ? rpcSchema : never;
|
|
12
|
-
type RpcParameters<rpcSchema extends RpcSchema | undefined = undefined> = rpcSchema extends RpcSchema ? { [K in keyof rpcSchema]: rpcSchema[K] extends RpcSchema[number] ? {
|
|
12
|
+
export type RpcParameters<rpcSchema extends RpcSchema | undefined = undefined> = rpcSchema extends RpcSchema ? { [K in keyof rpcSchema]: rpcSchema[K] extends RpcSchema[number] ? {
|
|
13
13
|
method: rpcSchema[K]["Method"];
|
|
14
14
|
params: rpcSchema[K]["Parameters"];
|
|
15
15
|
} : never; }[number] : {
|
|
16
16
|
method: string;
|
|
17
17
|
params?: unknown | undefined;
|
|
18
18
|
};
|
|
19
|
-
type BtcRpcRequestOptions = {
|
|
19
|
+
export type BtcRpcRequestOptions = {
|
|
20
20
|
/** Deduplicate in-flight requests. */
|
|
21
21
|
dedupe?: boolean | undefined;
|
|
22
22
|
/** Methods to include or exclude from executing RPC requests. */
|
|
@@ -32,7 +32,7 @@ type BtcRpcRequestOptions = {
|
|
|
32
32
|
/** Unique identifier for the request. */
|
|
33
33
|
uid?: string | undefined;
|
|
34
34
|
};
|
|
35
|
-
type BtcRpcRequestFn<rpcSchema extends RpcSchema | undefined = undefined, raw extends boolean = false> = <_parameters extends RpcParameters<DerivedRpcSchema<rpcSchema>> = RpcParameters<DerivedRpcSchema<rpcSchema>>, _returnType = DerivedRpcSchema<rpcSchema> extends RpcSchema ? raw extends true ? OneOf<{
|
|
35
|
+
export type BtcRpcRequestFn<rpcSchema extends RpcSchema | undefined = undefined, raw extends boolean = false> = <_parameters extends RpcParameters<DerivedRpcSchema<rpcSchema>> = RpcParameters<DerivedRpcSchema<rpcSchema>>, _returnType = DerivedRpcSchema<rpcSchema> extends RpcSchema ? raw extends true ? OneOf<{
|
|
36
36
|
result: Extract<DerivedRpcSchema<rpcSchema>[number], {
|
|
37
37
|
Method: _parameters["method"];
|
|
38
38
|
}>["ReturnType"];
|
|
@@ -46,5 +46,4 @@ type BtcRpcRequestFn<rpcSchema extends RpcSchema | undefined = undefined, raw ex
|
|
|
46
46
|
error: ErrorType;
|
|
47
47
|
}> : unknown>(args: _parameters, options?: BtcRpcRequestOptions | undefined) => Promise<_returnType>;
|
|
48
48
|
//#endregion
|
|
49
|
-
export { BtcRpcRequestFn, BtcRpcRequestOptions, RpcParameters, RpcSchema, RpcSchemaOverride };
|
|
50
49
|
//# sourceMappingURL=request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","names":[],"sources":["../../../src/types/request.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"request.d.ts","names":[],"sources":["../../../src/types/request.ts"],"mappings":";;;;YAIY;EACV;EACA;EACA;;YAGU,oBAAoB,KAAK;KAEhC,iBAAiB,kBAAkB,yBACtC,kBAAkB,YAAY;YAEpB,cAAc,kBAAkB,qCAC1C,kBAAkB,eAEX,WAAW,YAAY,UAAU,WAAW;EAEvC,QAAQ,UAAU;EAClB,QAAQ,UAAU;;EAKxB;EACA;;YAGI;;EAEV;;EAEA,UACI;IAEM,UAAU;;IAGV,UAAU;;;EAKpB;;EAEA;;EAEA;;YAGU,gBACV,kBAAkB,mCAClB,gCAEA,oBAAoB,cAClB,iBAAiB,cACf,cAAc,iBAAiB,aACnC,cAAc,iBAAiB,mBAAmB,YAC9C,mBACE;EAEM,QAAQ,QACN,iBAAiB;IACf,QAAQ;;;EAGZ,OAAO;KAEb,QACE,iBAAiB;EACf,QAAQ;mBAEd,mBACE;EAEM;;EAGA,OAAO;cAKnB,MAAM,aACN,UAAU,qCACP,QAAQ"}
|
package/dist/esm/types/rpc.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
//#region src/types/rpc.d.ts
|
|
2
|
-
type RpcRequest = {
|
|
2
|
+
export type RpcRequest = {
|
|
3
3
|
jsonrpc?: "2.0" | undefined;
|
|
4
4
|
method: string;
|
|
5
5
|
params?: any | undefined;
|
|
6
6
|
id?: number | undefined;
|
|
7
7
|
};
|
|
8
|
-
type RpcResponse<result = any, error = any> = {
|
|
8
|
+
export type RpcResponse<result = any, error = any> = {
|
|
9
9
|
jsonrpc: `${number}`;
|
|
10
10
|
id: number;
|
|
11
11
|
} & (SuccessResult<result> | ErrorResult<error>);
|
|
@@ -19,8 +19,8 @@ type ErrorResult<error> = {
|
|
|
19
19
|
result?: undefined;
|
|
20
20
|
error: error;
|
|
21
21
|
};
|
|
22
|
-
type BitcoinRpcMethods = [...WalletRpcSchema];
|
|
23
|
-
type WalletRpcSchema = [{
|
|
22
|
+
export type BitcoinRpcMethods = [...WalletRpcSchema];
|
|
23
|
+
export type WalletRpcSchema = [{
|
|
24
24
|
Method: "getAddressInfo";
|
|
25
25
|
Parameters?: undefined;
|
|
26
26
|
ReturnType: string;
|
|
@@ -30,5 +30,4 @@ type WalletRpcSchema = [{
|
|
|
30
30
|
ReturnType: bigint;
|
|
31
31
|
}];
|
|
32
32
|
//#endregion
|
|
33
|
-
export { BitcoinRpcMethods, RpcRequest, RpcResponse, WalletRpcSchema };
|
|
34
33
|
//# sourceMappingURL=rpc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc.d.ts","names":[],"sources":["../../../src/types/rpc.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"rpc.d.ts","names":[],"sources":["../../../src/types/rpc.ts"],"mappings":";YAAY;EACV;EACA;EACA;EACA;;YAGU,YAAY,cAAc;EACpC;EACA;KACG,cAAc,UAAU,YAAY;KAEpC,cAAc;EACjB;EACA,QAAQ;EACR;;KAEG,YAAY;EACf;EACA;EACA,OAAO;;YAGG,wBAAwB;YAExB;EAER;EACA;EACA;;EAGA;EACA;EACA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/types/transaction.d.ts
|
|
2
|
-
type UTXOTransaction = {
|
|
2
|
+
export type UTXOTransaction = {
|
|
3
3
|
blockhash?: string;
|
|
4
4
|
blocktime?: number;
|
|
5
5
|
confirmations?: number;
|
|
@@ -39,7 +39,7 @@ type UTXOTransaction = {
|
|
|
39
39
|
};
|
|
40
40
|
}[];
|
|
41
41
|
};
|
|
42
|
-
type UTXO = {
|
|
42
|
+
export type UTXO = {
|
|
43
43
|
txId: string;
|
|
44
44
|
vout: number;
|
|
45
45
|
value: number;
|
|
@@ -49,5 +49,4 @@ type UTXO = {
|
|
|
49
49
|
scriptHex: string;
|
|
50
50
|
};
|
|
51
51
|
//#endregion
|
|
52
|
-
export { UTXO, UTXOTransaction };
|
|
53
52
|
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","names":[],"sources":["../../../src/types/transaction.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","names":[],"sources":["../../../src/types/transaction.ts"],"mappings":";YAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IAEM;IACA;IACA;;IAGA;IACA;IACA;MACE;MACA;;IAEF;IACA;;EAGN;IACE;IACA;IACA;MACE;MACA;MACA;MACA;MACA;;;;YAKM;EACV;EACA;EACA;EACA;EACA;EACA;EACA"}
|
|
@@ -4,7 +4,7 @@ import { UTXOMethod } from "../transports/types.js";
|
|
|
4
4
|
import { ErrorType } from "../errors/utils.js";
|
|
5
5
|
import { BtcRpcRequestFn, RpcSchema } from "./request.js";
|
|
6
6
|
//#region src/types/transport.d.ts
|
|
7
|
-
type TransportConfig<type extends string = string, rpcRequestFn extends BtcRpcRequestFn = BtcRpcRequestFn> = {
|
|
7
|
+
export type TransportConfig<type extends string = string, rpcRequestFn extends BtcRpcRequestFn = BtcRpcRequestFn> = {
|
|
8
8
|
/** The name of the transport. */
|
|
9
9
|
name: string;
|
|
10
10
|
/** The key of the transport. */
|
|
@@ -26,7 +26,7 @@ type TransportConfig<type extends string = string, rpcRequestFn extends BtcRpcRe
|
|
|
26
26
|
/** The type of the transport. */
|
|
27
27
|
type: type;
|
|
28
28
|
};
|
|
29
|
-
type Transport<type extends string = string, rpcAttributes = Record<string, any>, rpcRequestFn extends BtcRpcRequestFn = BtcRpcRequestFn<RpcSchema>> = <chain extends Chain | undefined = Chain>({ chain }: {
|
|
29
|
+
export type Transport<type extends string = string, rpcAttributes = Record<string, any>, rpcRequestFn extends BtcRpcRequestFn = BtcRpcRequestFn<RpcSchema>> = <chain extends Chain | undefined = Chain>({ chain }: {
|
|
30
30
|
chain?: chain | undefined;
|
|
31
31
|
pollingInterval?: number | undefined;
|
|
32
32
|
retryCount?: TransportConfig["retryCount"] | undefined;
|
|
@@ -36,7 +36,6 @@ type Transport<type extends string = string, rpcAttributes = Record<string, any>
|
|
|
36
36
|
request: rpcRequestFn;
|
|
37
37
|
value?: rpcAttributes | undefined;
|
|
38
38
|
};
|
|
39
|
-
type CreateTransportErrorType = ErrorType;
|
|
39
|
+
export type CreateTransportErrorType = ErrorType;
|
|
40
40
|
//#endregion
|
|
41
|
-
export { CreateTransportErrorType, Transport, TransportConfig };
|
|
42
41
|
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","names":[],"sources":["../../../src/types/transport.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"transport.d.ts","names":[],"sources":["../../../src/types/transport.ts"],"mappings":";;;;;;YAMY,gBACV,8BACA,qBAAqB,kBAAkB;;EAGvC;;EAEA;;EAEA,UACI;IAEM,UAAU;;IAGV,UAAU;;;EAKpB,SAAS;;EAET;;EAEA;;EAEA;;EAEA,MAAM;;YAGI,UACV,8BACA,gBAAgB,qBAChB,qBAAqB,kBAAkB,gBAAgB,eACpD,cAAc,oBAAoB,SACrC;EAEA,QAAQ;EACR;EACA,aAAa;EACb,UAAU;;EAEV,QAAQ,gBAAgB;EACxB,SAAS;EACT,QAAQ;;YAGE,2BAA2B"}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
//#region src/types/utils.d.ts
|
|
2
2
|
/** Combines members of an intersection into a readable type. */
|
|
3
|
-
type Compute<type> = { [key in keyof type]: type[key]; } & unknown;
|
|
3
|
+
export type Compute<type> = { [key in keyof type]: type[key]; } & unknown;
|
|
4
4
|
/**
|
|
5
5
|
* Makes all properties of an object optional.
|
|
6
6
|
*
|
|
7
7
|
* Compatible with [`exactOptionalPropertyTypes`](https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes).
|
|
8
8
|
*/
|
|
9
|
-
type ExactPartial<type> = { [key in keyof type]?: type[key] | undefined; };
|
|
9
|
+
export type ExactPartial<type> = { [key in keyof type]?: type[key] | undefined; };
|
|
10
10
|
/** Checks if {@link type} can be narrowed further than {@link type2} */
|
|
11
|
-
type IsNarrowable<type, type2> = IsUnknown<type> extends true ? false : undefined extends type ? false : IsNever<(type extends type2 ? true : false) & (type2 extends type ? false : true)> extends true ? false : true;
|
|
11
|
+
export type IsNarrowable<type, type2> = IsUnknown<type> extends true ? false : undefined extends type ? false : IsNever<(type extends type2 ? true : false) & (type2 extends type ? false : true)> extends true ? false : true;
|
|
12
12
|
/**
|
|
13
13
|
* @internal
|
|
14
14
|
* Checks if {@link type} is `never`
|
|
15
15
|
*/
|
|
16
|
-
type IsNever<type> = [type] extends [never] ? true : false;
|
|
16
|
+
export type IsNever<type> = [type] extends [never] ? true : false;
|
|
17
17
|
/**
|
|
18
18
|
* @internal
|
|
19
19
|
* Checks if {@link type} is `unknown`
|
|
20
20
|
*/
|
|
21
|
-
type IsUnknown<type> = unknown extends type ? true : false;
|
|
21
|
+
export type IsUnknown<type> = unknown extends type ? true : false;
|
|
22
22
|
/** Merges two object types into new type */
|
|
23
|
-
type Merge<obj1, obj2> = Compute<LooseOmit<obj1, keyof obj2 extends (infer key extends string) ? key : never> & obj2>;
|
|
23
|
+
export type Merge<obj1, obj2> = Compute<LooseOmit<obj1, keyof obj2 extends (infer key extends string) ? key : never> & obj2>;
|
|
24
24
|
/** Removes `readonly` from all properties of an object. */
|
|
25
|
-
type Mutable<type extends object> = { -readonly [key in keyof type]: type[key]; };
|
|
25
|
+
export type Mutable<type extends object> = { -readonly [key in keyof type]: type[key]; };
|
|
26
26
|
/** Strict version of built-in Omit type */
|
|
27
|
-
type StrictOmit<type, keys extends keyof type> = Pick<type, Exclude<keyof type, keys>>;
|
|
27
|
+
export type StrictOmit<type, keys extends keyof type> = Pick<type, Exclude<keyof type, keys>>;
|
|
28
28
|
/** Makes objects destructurable. */
|
|
29
|
-
type OneOf<union extends object, keys extends KeyofUnion<union> = KeyofUnion<union>> = union extends (infer Item) ? Compute<Item & { [K in Exclude<keys, keyof Item>]?: undefined; }> : never;
|
|
29
|
+
export type OneOf<union extends object, keys extends KeyofUnion<union> = KeyofUnion<union>> = union extends (infer Item) ? Compute<Item & { [K in Exclude<keys, keyof Item>]?: undefined; }> : never;
|
|
30
30
|
type KeyofUnion<type> = type extends type ? keyof type : never;
|
|
31
31
|
/** Makes {@link key} optional in {@link type} while preserving type inference. */
|
|
32
|
-
type PartialBy<type, key extends keyof type> = ExactPartial<Pick<type, key>> & StrictOmit<type, key>;
|
|
33
|
-
type RemoveUndefined<type> = { [key in keyof type]: NonNullable<type[key]>; };
|
|
32
|
+
export type PartialBy<type, key extends keyof type> = ExactPartial<Pick<type, key>> & StrictOmit<type, key>;
|
|
33
|
+
export type RemoveUndefined<type> = { [key in keyof type]: NonNullable<type[key]>; };
|
|
34
34
|
/** Loose version of {@link StrictOmit} */
|
|
35
|
-
type LooseOmit<type, keys extends string> = Pick<type, Exclude<keyof type, keys>>;
|
|
36
|
-
type UnionCompute<type> = type extends object ? Compute<type> : type;
|
|
37
|
-
type UnionLooseOmit<type, keys extends string> = type extends any ? LooseOmit<type, keys> : never;
|
|
38
|
-
type UnionStrictOmit<type, keys extends keyof type> = type extends any ? StrictOmit<type, keys> : never;
|
|
39
|
-
type UnionExactPartial<type> = type extends object ? ExactPartial<type> : type;
|
|
35
|
+
export type LooseOmit<type, keys extends string> = Pick<type, Exclude<keyof type, keys>>;
|
|
36
|
+
export type UnionCompute<type> = type extends object ? Compute<type> : type;
|
|
37
|
+
export type UnionLooseOmit<type, keys extends string> = type extends any ? LooseOmit<type, keys> : never;
|
|
38
|
+
export type UnionStrictOmit<type, keys extends keyof type> = type extends any ? StrictOmit<type, keys> : never;
|
|
39
|
+
export type UnionExactPartial<type> = type extends object ? ExactPartial<type> : type;
|
|
40
40
|
/**
|
|
41
41
|
* @description Combines members of an intersection into a readable type.
|
|
42
42
|
*
|
|
@@ -45,7 +45,7 @@ type UnionExactPartial<type> = type extends object ? ExactPartial<type> : type;
|
|
|
45
45
|
* Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>
|
|
46
46
|
* => { a: string, b: string, c: number, d: bigint }
|
|
47
47
|
*/
|
|
48
|
-
type Prettify<T> = { [K in keyof T]: T[K]; } & {};
|
|
48
|
+
export type Prettify<T> = { [K in keyof T]: T[K]; } & {};
|
|
49
49
|
/**
|
|
50
50
|
* @description Assigns the properties of U onto T.
|
|
51
51
|
*
|
|
@@ -53,9 +53,8 @@ type Prettify<T> = { [K in keyof T]: T[K]; } & {};
|
|
|
53
53
|
* Assign<{ a: string, b: number }, { a: undefined, c: boolean }>
|
|
54
54
|
* => { a: undefined, b: number, c: boolean }
|
|
55
55
|
*/
|
|
56
|
-
type Assign<T, U> = Assign_<T, U> & U;
|
|
56
|
+
export type Assign<T, U> = Assign_<T, U> & U;
|
|
57
57
|
type Assign_<T, U> = { [K in keyof T as K extends keyof U ? U[K] extends void ? never : K : K]: K extends keyof U ? U[K] : T[K]; };
|
|
58
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
58
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
59
59
|
//#endregion
|
|
60
|
-
export { Assign, Compute, ExactPartial, IsNarrowable, IsNever, IsUnknown, LooseOmit, MaybePromise, Merge, Mutable, OneOf, PartialBy, Prettify, RemoveUndefined, StrictOmit, UnionCompute, UnionExactPartial, UnionLooseOmit, UnionStrictOmit };
|
|
61
60
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../../src/types/utils.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../../src/types/utils.ts"],"mappings":";;YAEY,QAAQ,WAAW,aAAa,OAAO,KAAK;;;;;;YAO5C,aAAa,WACtB,aAAa,QAAQ,KAAK;;YAIjB,aAAa,MAAM,SAC7B,UAAU,+CAEY,eAEhB,SACK,aAAa,yBACX,cAAc;;;;;YASjB,QAAQ,SAAS;;;;;YAMjB,UAAU,wBAAwB;;YAGlC,MAAM,MAAM,QAAQ,QAC9B,UAAU,YAAY,oBAAmB,sBAAqB,eAC5D;;YAIQ,QAAQ,oCACP,aAAa,OAAO,KAAK;;YAI1B,WAAW,MAAM,mBAAmB,QAAQ,KACtD,MACA,cAAc,MAAM;;YAIV,MACV,sBAEA,aAAa,WAAW,SAAS,WAAW,UAC1C,qBAAoB,QACpB,QAAQ,UAAU,KAAK,QAAQ,YAAY;KAE1C,WAAW,QAAQ,aAAa,aAAa;;YAItC,UAAU,MAAM,kBAAkB,QAAQ,aACpD,KAAK,MAAM,QAEX,WAAW,MAAM;YAGP,gBAAgB,WACzB,aAAa,OAAO,YAAY,KAAK;;YAO5B,UAAU,MAAM,uBAAuB,KACjD,MACA,cAAc,MAAM;YAMV,aAAa,QAAQ,sBAAsB,QAAQ,QAAQ;YAE3D,eAAe,MAAM,uBAAuB,mBACpD,UAAU,MAAM;YAGR,gBAAgB,MAAM,mBAAmB,QAAQ,mBACzD,WAAW,MAAM;YAGT,kBAAkB,QAAQ,sBAClC,aAAa,QACb;;;;;;;;;YAUQ,SAAS,QAClB,WAAW,IAAI,EAAE;;;;;;;;YAUR,OAAO,GAAG,KAAK,QAAQ,GAAG,KAAK;KACtC,QAAQ,GAAG,QACb,WAAW,KAAK,gBAAgB,IAC7B,EAAE,0BAEA,IACF,IAAI,gBAAgB,IAAI,EAAE,KAAK,EAAE;YAG3B,aAAa,KAAK,IAAI,QAAQ"}
|
package/dist/esm/types/xpub.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address } from "./address.js";
|
|
2
2
|
//#region src/types/xpub.d.ts
|
|
3
|
-
type xPubAccount = {
|
|
3
|
+
export type xPubAccount = {
|
|
4
4
|
balance: bigint;
|
|
5
5
|
addresses: Array<{
|
|
6
6
|
address: Address;
|
|
@@ -10,5 +10,4 @@ type xPubAccount = {
|
|
|
10
10
|
}>;
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
|
13
|
-
export { xPubAccount };
|
|
14
13
|
//# sourceMappingURL=xpub.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xpub.d.ts","names":[],"sources":["../../../src/types/xpub.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"xpub.d.ts","names":[],"sources":["../../../src/types/xpub.ts"],"mappings":";;YAEY;EACV;EACA,WAAW;IACT,SAAS;IACT;IACA;IACA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ErrorType } from "../errors/utils.js";
|
|
2
2
|
import { BtcRpcRequestFn, BtcRpcRequestOptions, RpcSchema } from "../types/request.js";
|
|
3
3
|
//#region src/utils/buildRequest.d.ts
|
|
4
|
-
type RequestErrorType = ErrorType;
|
|
5
|
-
declare function buildRequest<request extends BtcRpcRequestFn<RpcSchema>>(request: request, options?: BtcRpcRequestOptions): BtcRpcRequestFn;
|
|
4
|
+
export type RequestErrorType = ErrorType;
|
|
5
|
+
export declare function buildRequest<request extends BtcRpcRequestFn<RpcSchema>>(request: request, options?: BtcRpcRequestOptions): BtcRpcRequestFn;
|
|
6
6
|
/** @internal */
|
|
7
|
-
declare function shouldRetry(error: Error): boolean;
|
|
7
|
+
export declare function shouldRetry(error: Error): boolean;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { RequestErrorType, buildRequest, shouldRetry };
|
|
10
9
|
//# sourceMappingURL=buildRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildRequest.d.ts","names":[],"sources":["../../../src/utils/buildRequest.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"buildRequest.d.ts","names":[],"sources":["../../../src/utils/buildRequest.ts"],"mappings":";;;YAkBY,mBAAmB;wBAEf,aAAa,gBAAgB,gBAAgB,YAC3D,SAAS,SACT,UAAS,uBACR;;wBA2Ea,YAAY,OAAO"}
|
|
@@ -15,6 +15,7 @@ function buildRequest(request, options = {}) {
|
|
|
15
15
|
const { method } = args;
|
|
16
16
|
if (methods?.exclude?.includes(method)) throw new MethodNotSupportedRpcError(method);
|
|
17
17
|
if (methods?.include && !methods.include.includes(method)) throw new MethodNotSupportedRpcError(method);
|
|
18
|
+
const requestId = dedupe ? stringToHex(`${uid}.${stringify(args)}`) : void 0;
|
|
18
19
|
return withDedupe(() => withRetry(async () => {
|
|
19
20
|
try {
|
|
20
21
|
return await request(args);
|
|
@@ -41,7 +42,7 @@ function buildRequest(request, options = {}) {
|
|
|
41
42
|
shouldRetry: ({ error }) => shouldRetry(error)
|
|
42
43
|
}), {
|
|
43
44
|
enabled: dedupe,
|
|
44
|
-
id:
|
|
45
|
+
id: requestId
|
|
45
46
|
});
|
|
46
47
|
};
|
|
47
48
|
}
|