@bigmi/core 0.8.1 → 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 +22 -0
- package/README.md +2 -2
- package/dist/cjs/_virtual/_rolldown/runtime.js +1 -1
- package/dist/cjs/actions/getBalance.d.ts +5 -6
- package/dist/cjs/actions/getBlock.d.ts +3 -8
- package/dist/cjs/actions/getBlockCount.d.ts +2 -4
- package/dist/cjs/actions/getBlockStats.d.ts +3 -9
- package/dist/cjs/actions/getTransactionFee.d.ts +3 -7
- package/dist/cjs/actions/getTransactions.d.ts +3 -10
- package/dist/cjs/actions/getUTXOTransaction.d.ts +6 -9
- package/dist/cjs/actions/getUTXOs.d.ts +3 -8
- package/dist/cjs/actions/getXPubAddresses.d.ts +25 -26
- package/dist/cjs/actions/sendUTXOTransaction.d.ts +6 -9
- package/dist/cjs/actions/signPsbt.d.ts +1 -3
- package/dist/cjs/actions/waitForTransaction.d.ts +48 -55
- package/dist/cjs/actions/waitForTransaction.js.map +1 -1
- package/dist/cjs/actions/watchBlockNumber.d.ts +18 -21
- 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 -3
- package/dist/cjs/chains/bitcoin.js.map +1 -1
- package/dist/cjs/chains/defineChain.d.ts +1 -3
- package/dist/cjs/chains/signet.d.ts +1 -3
- package/dist/cjs/chains/signet.js.map +1 -1
- package/dist/cjs/clients/decorators/public.d.ts +2 -4
- package/dist/cjs/clients/decorators/wallet.d.ts +4 -6
- package/dist/cjs/errors/address.d.ts +3 -7
- 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 +3 -8
- package/dist/cjs/errors/provider.d.ts +1 -3
- package/dist/cjs/errors/request.d.ts +15 -39
- package/dist/cjs/errors/request.js.map +1 -1
- package/dist/cjs/errors/rpc.d.ts +28 -30
- package/dist/cjs/errors/transaction.d.ts +9 -21
- package/dist/cjs/errors/transport.d.ts +8 -17
- package/dist/cjs/errors/transport.js.map +1 -1
- package/dist/cjs/errors/utils.d.ts +3 -5
- package/dist/cjs/errors/utxo.d.ts +3 -9
- package/dist/cjs/factories/createClient.d.ts +55 -37
- package/dist/cjs/factories/createClient.js.map +1 -1
- package/dist/cjs/factories/createTransport.d.ts +3 -14
- package/dist/cjs/test/utils.d.ts +1 -2
- package/dist/cjs/transports/ankr/ankr.d.ts +1 -3
- package/dist/cjs/transports/ankr/ankr.types.d.ts +7 -8
- package/dist/cjs/transports/ankr/getBalance.d.ts +1 -3
- package/dist/cjs/transports/ankr/getTransactionFee.d.ts +1 -3
- package/dist/cjs/transports/ankr/getTransactions.d.ts +1 -3
- package/dist/cjs/transports/ankr/methods.d.ts +1 -3
- package/dist/cjs/transports/ankr/utils.d.ts +1 -3
- package/dist/cjs/transports/blockchair/blockchair.d.ts +1 -3
- package/dist/cjs/transports/blockchair/blockchair.types.d.ts +13 -14
- package/dist/cjs/transports/blockchair/getBalance.d.ts +1 -3
- package/dist/cjs/transports/blockchair/getTransactionFee.d.ts +1 -3
- package/dist/cjs/transports/blockchair/getTransactionFee.js.map +1 -1
- package/dist/cjs/transports/blockchair/getUTXOs.d.ts +1 -3
- package/dist/cjs/transports/blockchair/getUTXOs.js.map +1 -1
- package/dist/cjs/transports/blockchair/getXPubAddresses.d.ts +1 -3
- package/dist/cjs/transports/blockchair/getXPubAddresses.js.map +1 -1
- package/dist/cjs/transports/blockchair/methods.d.ts +1 -3
- package/dist/cjs/transports/blockcypher/blockcypher.d.ts +1 -3
- package/dist/cjs/transports/blockcypher/blockcypher.types.d.ts +8 -9
- package/dist/cjs/transports/blockcypher/getBalance.d.ts +1 -3
- package/dist/cjs/transports/blockcypher/getTransactionFee.d.ts +1 -3
- package/dist/cjs/transports/blockcypher/getUTXOs.d.ts +1 -3
- package/dist/cjs/transports/blockcypher/getUTXOs.js.map +1 -1
- package/dist/cjs/transports/blockcypher/methods.d.ts +1 -3
- package/dist/cjs/transports/blockcypher/utils.d.ts +1 -3
- package/dist/cjs/transports/blockcypher/utils.js.map +1 -1
- package/dist/cjs/transports/custom.d.ts +15 -12
- package/dist/cjs/transports/fallback.d.ts +38 -43
- package/dist/cjs/transports/fallback.js.map +1 -1
- package/dist/cjs/transports/getHttpRpcClient.d.ts +23 -16
- package/dist/cjs/transports/getHttpRpcClient.js.map +1 -1
- package/dist/cjs/transports/getRpcProviderMethods.d.ts +1 -3
- package/dist/cjs/transports/http.d.ts +35 -25
- package/dist/cjs/transports/mempool/getBalance.d.ts +1 -3
- package/dist/cjs/transports/mempool/getTransactionFee.d.ts +1 -3
- package/dist/cjs/transports/mempool/getTransactions.d.ts +1 -3
- package/dist/cjs/transports/mempool/getTransactions.js.map +1 -1
- package/dist/cjs/transports/mempool/mempool.d.ts +1 -3
- package/dist/cjs/transports/mempool/mempool.types.d.ts +7 -8
- package/dist/cjs/transports/mempool/methods.d.ts +1 -3
- package/dist/cjs/transports/mempool/utils.d.ts +1 -3
- package/dist/cjs/transports/types.d.ts +28 -27
- package/dist/cjs/transports/utxo.d.ts +1 -3
- package/dist/cjs/transports/utxo.js.map +1 -1
- package/dist/cjs/types/account.d.ts +1 -3
- package/dist/cjs/types/address.d.ts +4 -6
- package/dist/cjs/types/block.d.ts +18 -19
- package/dist/cjs/types/blockStats.d.ts +2 -3
- package/dist/cjs/types/chain.d.ts +26 -16
- package/dist/cjs/types/client.d.ts +43 -29
- package/dist/cjs/types/hash.d.ts +1 -2
- package/dist/cjs/types/request.d.ts +16 -13
- 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 +18 -14
- package/dist/cjs/types/utils.d.ts +43 -44
- package/dist/cjs/types/xpub.d.ts +1 -3
- package/dist/cjs/utils/buildRequest.d.ts +3 -5
- 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 -3
- package/dist/cjs/utils/converter.d.ts +5 -6
- package/dist/cjs/utils/converter.js.map +1 -1
- package/dist/cjs/utils/createBatchScheduler.d.ts +2 -10
- package/dist/cjs/utils/createBatchScheduler.js.map +1 -1
- package/dist/cjs/utils/deepEqual.d.ts +1 -2
- package/dist/cjs/utils/deepEqual.js.map +1 -1
- package/dist/cjs/utils/getAction.d.ts +7 -9
- package/dist/cjs/utils/getAddressInfo.d.ts +2 -4
- 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 -3
- package/dist/cjs/utils/lru.d.ts +5 -6
- package/dist/cjs/utils/lru.js.map +1 -1
- package/dist/cjs/utils/modifyFee.d.ts +1 -3
- package/dist/cjs/utils/modifyFee.js.map +1 -1
- package/dist/cjs/utils/observe.d.ts +7 -9
- package/dist/cjs/utils/observe.js.map +1 -1
- package/dist/cjs/utils/parseAccount.d.ts +2 -4
- package/dist/cjs/utils/poll.d.ts +4 -11
- package/dist/cjs/utils/poll.js +2 -1
- package/dist/cjs/utils/poll.js.map +1 -1
- package/dist/cjs/utils/retryUntil.d.ts +18 -17
- package/dist/cjs/utils/retryUntil.js.map +1 -1
- package/dist/cjs/utils/sleep.d.ts +1 -2
- package/dist/cjs/utils/stringify.d.ts +2 -4
- package/dist/cjs/utils/uid.d.ts +1 -2
- package/dist/cjs/utils/uid.js.map +1 -1
- package/dist/cjs/utils/url.d.ts +1 -2
- package/dist/cjs/utils/url.js.map +1 -1
- package/dist/cjs/utils/wait.d.ts +1 -2
- package/dist/cjs/utils/withDedupe.d.ts +2 -7
- package/dist/cjs/utils/withDedupe.js.map +1 -1
- package/dist/cjs/utils/withResolvers.d.ts +2 -3
- package/dist/cjs/utils/withRetry.d.ts +4 -13
- package/dist/cjs/utils/withTimeout.d.ts +3 -11
- package/dist/cjs/utils/withTimeout.js.map +1 -1
- 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 +5 -6
- package/dist/esm/actions/getBalance.d.ts.map +1 -1
- package/dist/esm/actions/getBlock.d.ts +3 -8
- package/dist/esm/actions/getBlock.d.ts.map +1 -1
- package/dist/esm/actions/getBlockCount.d.ts +2 -4
- package/dist/esm/actions/getBlockCount.d.ts.map +1 -1
- package/dist/esm/actions/getBlockStats.d.ts +3 -9
- package/dist/esm/actions/getBlockStats.d.ts.map +1 -1
- package/dist/esm/actions/getTransactionFee.d.ts +3 -7
- package/dist/esm/actions/getTransactionFee.d.ts.map +1 -1
- package/dist/esm/actions/getTransactions.d.ts +3 -10
- package/dist/esm/actions/getTransactions.d.ts.map +1 -1
- package/dist/esm/actions/getUTXOTransaction.d.ts +6 -9
- package/dist/esm/actions/getUTXOTransaction.d.ts.map +1 -1
- package/dist/esm/actions/getUTXOs.d.ts +3 -8
- package/dist/esm/actions/getUTXOs.d.ts.map +1 -1
- package/dist/esm/actions/getXPubAddresses.d.ts +25 -26
- package/dist/esm/actions/getXPubAddresses.d.ts.map +1 -1
- package/dist/esm/actions/sendUTXOTransaction.d.ts +6 -9
- package/dist/esm/actions/sendUTXOTransaction.d.ts.map +1 -1
- package/dist/esm/actions/signPsbt.d.ts +1 -3
- package/dist/esm/actions/signPsbt.d.ts.map +1 -1
- package/dist/esm/actions/waitForTransaction.d.ts +48 -55
- package/dist/esm/actions/waitForTransaction.d.ts.map +1 -1
- package/dist/esm/actions/waitForTransaction.js.map +1 -1
- package/dist/esm/actions/watchBlockNumber.d.ts +18 -21
- 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 -3
- package/dist/esm/chains/bitcoin.d.ts.map +1 -1
- package/dist/esm/chains/defineChain.d.ts +1 -3
- package/dist/esm/chains/defineChain.d.ts.map +1 -1
- package/dist/esm/chains/signet.d.ts +1 -3
- package/dist/esm/chains/signet.d.ts.map +1 -1
- package/dist/esm/clients/decorators/public.d.ts +2 -4
- package/dist/esm/clients/decorators/public.d.ts.map +1 -1
- package/dist/esm/clients/decorators/wallet.d.ts +4 -6
- package/dist/esm/clients/decorators/wallet.d.ts.map +1 -1
- package/dist/esm/errors/address.d.ts +3 -7
- 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 +3 -8
- package/dist/esm/errors/block.d.ts.map +1 -1
- package/dist/esm/errors/provider.d.ts +1 -3
- package/dist/esm/errors/provider.d.ts.map +1 -1
- package/dist/esm/errors/request.d.ts +15 -39
- package/dist/esm/errors/request.d.ts.map +1 -1
- package/dist/esm/errors/request.js.map +1 -1
- package/dist/esm/errors/rpc.d.ts +28 -30
- package/dist/esm/errors/rpc.d.ts.map +1 -1
- package/dist/esm/errors/transaction.d.ts +9 -21
- package/dist/esm/errors/transaction.d.ts.map +1 -1
- package/dist/esm/errors/transport.d.ts +8 -17
- package/dist/esm/errors/transport.d.ts.map +1 -1
- package/dist/esm/errors/transport.js.map +1 -1
- package/dist/esm/errors/utils.d.ts +3 -5
- package/dist/esm/errors/utils.d.ts.map +1 -1
- package/dist/esm/errors/utxo.d.ts +3 -9
- package/dist/esm/errors/utxo.d.ts.map +1 -1
- package/dist/esm/factories/createClient.d.ts +55 -37
- 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 +3 -14
- 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 -3
- 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 -3
- package/dist/esm/transports/ankr/getBalance.d.ts.map +1 -1
- package/dist/esm/transports/ankr/getTransactionFee.d.ts +1 -3
- package/dist/esm/transports/ankr/getTransactionFee.d.ts.map +1 -1
- package/dist/esm/transports/ankr/getTransactions.d.ts +1 -3
- package/dist/esm/transports/ankr/getTransactions.d.ts.map +1 -1
- package/dist/esm/transports/ankr/methods.d.ts +1 -3
- package/dist/esm/transports/ankr/methods.d.ts.map +1 -1
- package/dist/esm/transports/ankr/utils.d.ts +1 -3
- package/dist/esm/transports/ankr/utils.d.ts.map +1 -1
- package/dist/esm/transports/blockchair/blockchair.d.ts +1 -3
- 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 -3
- package/dist/esm/transports/blockchair/getBalance.d.ts.map +1 -1
- package/dist/esm/transports/blockchair/getTransactionFee.d.ts +1 -3
- package/dist/esm/transports/blockchair/getTransactionFee.d.ts.map +1 -1
- package/dist/esm/transports/blockchair/getTransactionFee.js.map +1 -1
- package/dist/esm/transports/blockchair/getUTXOs.d.ts +1 -3
- package/dist/esm/transports/blockchair/getUTXOs.d.ts.map +1 -1
- package/dist/esm/transports/blockchair/getUTXOs.js.map +1 -1
- package/dist/esm/transports/blockchair/getXPubAddresses.d.ts +1 -3
- package/dist/esm/transports/blockchair/getXPubAddresses.d.ts.map +1 -1
- package/dist/esm/transports/blockchair/getXPubAddresses.js.map +1 -1
- package/dist/esm/transports/blockchair/methods.d.ts +1 -3
- package/dist/esm/transports/blockchair/methods.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/blockcypher.d.ts +1 -3
- 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 -3
- package/dist/esm/transports/blockcypher/getBalance.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/getTransactionFee.d.ts +1 -3
- package/dist/esm/transports/blockcypher/getTransactionFee.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/getUTXOs.d.ts +1 -3
- package/dist/esm/transports/blockcypher/getUTXOs.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/getUTXOs.js.map +1 -1
- package/dist/esm/transports/blockcypher/methods.d.ts +1 -3
- package/dist/esm/transports/blockcypher/methods.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/utils.d.ts +1 -3
- package/dist/esm/transports/blockcypher/utils.d.ts.map +1 -1
- package/dist/esm/transports/blockcypher/utils.js.map +1 -1
- package/dist/esm/transports/custom.d.ts +15 -12
- package/dist/esm/transports/custom.d.ts.map +1 -1
- package/dist/esm/transports/fallback.d.ts +38 -43
- 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 +23 -16
- package/dist/esm/transports/getHttpRpcClient.d.ts.map +1 -1
- package/dist/esm/transports/getHttpRpcClient.js.map +1 -1
- package/dist/esm/transports/getRpcProviderMethods.d.ts +1 -3
- package/dist/esm/transports/getRpcProviderMethods.d.ts.map +1 -1
- package/dist/esm/transports/http.d.ts +35 -25
- package/dist/esm/transports/http.d.ts.map +1 -1
- package/dist/esm/transports/mempool/getBalance.d.ts +1 -3
- package/dist/esm/transports/mempool/getBalance.d.ts.map +1 -1
- package/dist/esm/transports/mempool/getTransactionFee.d.ts +1 -3
- package/dist/esm/transports/mempool/getTransactionFee.d.ts.map +1 -1
- package/dist/esm/transports/mempool/getTransactions.d.ts +1 -3
- package/dist/esm/transports/mempool/getTransactions.d.ts.map +1 -1
- package/dist/esm/transports/mempool/getTransactions.js.map +1 -1
- package/dist/esm/transports/mempool/mempool.d.ts +1 -3
- 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 -3
- package/dist/esm/transports/mempool/methods.d.ts.map +1 -1
- package/dist/esm/transports/mempool/utils.d.ts +1 -3
- package/dist/esm/transports/mempool/utils.d.ts.map +1 -1
- package/dist/esm/transports/types.d.ts +28 -27
- package/dist/esm/transports/types.d.ts.map +1 -1
- package/dist/esm/transports/utxo.d.ts +1 -3
- package/dist/esm/transports/utxo.d.ts.map +1 -1
- package/dist/esm/transports/utxo.js.map +1 -1
- package/dist/esm/types/account.d.ts +1 -3
- package/dist/esm/types/account.d.ts.map +1 -1
- package/dist/esm/types/address.d.ts +4 -6
- package/dist/esm/types/address.d.ts.map +1 -1
- package/dist/esm/types/block.d.ts +18 -19
- 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 +26 -16
- package/dist/esm/types/chain.d.ts.map +1 -1
- package/dist/esm/types/client.d.ts +43 -29
- 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 +16 -13
- 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 +18 -14
- package/dist/esm/types/transport.d.ts.map +1 -1
- package/dist/esm/types/utils.d.ts +43 -44
- package/dist/esm/types/utils.d.ts.map +1 -1
- package/dist/esm/types/xpub.d.ts +1 -3
- package/dist/esm/types/xpub.d.ts.map +1 -1
- package/dist/esm/utils/buildRequest.d.ts +3 -5
- 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 -3
- 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/converter.js.map +1 -1
- package/dist/esm/utils/createBatchScheduler.d.ts +2 -10
- package/dist/esm/utils/createBatchScheduler.d.ts.map +1 -1
- package/dist/esm/utils/createBatchScheduler.js.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/deepEqual.js.map +1 -1
- package/dist/esm/utils/getAction.d.ts +7 -9
- package/dist/esm/utils/getAction.d.ts.map +1 -1
- package/dist/esm/utils/getAddressInfo.d.ts +2 -4
- 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 -3
- package/dist/esm/utils/isAddress.d.ts.map +1 -1
- package/dist/esm/utils/lru.d.ts +5 -6
- package/dist/esm/utils/lru.d.ts.map +1 -1
- package/dist/esm/utils/lru.js.map +1 -1
- package/dist/esm/utils/modifyFee.d.ts +1 -3
- package/dist/esm/utils/modifyFee.d.ts.map +1 -1
- package/dist/esm/utils/modifyFee.js.map +1 -1
- package/dist/esm/utils/observe.d.ts +7 -9
- package/dist/esm/utils/observe.d.ts.map +1 -1
- package/dist/esm/utils/observe.js.map +1 -1
- package/dist/esm/utils/parseAccount.d.ts +2 -4
- package/dist/esm/utils/parseAccount.d.ts.map +1 -1
- package/dist/esm/utils/poll.d.ts +4 -11
- 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 +18 -17
- package/dist/esm/utils/retryUntil.d.ts.map +1 -1
- package/dist/esm/utils/retryUntil.js.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 -4
- 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/uid.js.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/url.js.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 -7
- package/dist/esm/utils/withDedupe.d.ts.map +1 -1
- package/dist/esm/utils/withDedupe.js.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 +4 -13
- package/dist/esm/utils/withRetry.d.ts.map +1 -1
- package/dist/esm/utils/withTimeout.d.ts +3 -11
- package/dist/esm/utils/withTimeout.d.ts.map +1 -1
- package/dist/esm/utils/withTimeout.js.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
package/dist/esm/test/utils.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/test/utils.d.ts
|
|
2
|
-
declare const createMockResponse: <T>(data: T, options?: Partial<Response>) => Response;
|
|
2
|
+
export declare const createMockResponse: <T>(data: T, options?: Partial<Response>) => Response;
|
|
3
3
|
//#endregion
|
|
4
|
-
export { createMockResponse };
|
|
5
4
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../../src/test/utils.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../../src/test/utils.ts"],"mappings":";qBAAa,qBAAsB,GACjC,MAAM,GACN,UAAU,QAAQ,cACjB"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { HttpTransport, HttpTransportConfig } from "../http.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/ankr/ankr.d.ts
|
|
4
3
|
type AnkrConfig = {
|
|
5
4
|
baseUrl?: string;
|
|
6
5
|
apiKey?: string;
|
|
7
6
|
} & HttpTransportConfig;
|
|
8
|
-
declare const ankr: (config?: AnkrConfig) => HttpTransport;
|
|
7
|
+
export declare const ankr: (config?: AnkrConfig) => HttpTransport;
|
|
9
8
|
//#endregion
|
|
10
|
-
export { ankr };
|
|
11
9
|
//# sourceMappingURL=ankr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ankr.d.ts","names":[],"sources":["../../../../src/transports/ankr/ankr.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ankr.d.ts","names":[],"sources":["../../../../src/transports/ankr/ankr.ts"],"mappings":";;KAMK;EAAe;EAAkB;IAAoB;qBAE7C,OAAQ,SAAS,eAAa"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/transports/ankr/ankr.types.d.ts
|
|
2
|
-
type AnkrBalanceResponse = {
|
|
2
|
+
export type AnkrBalanceResponse = {
|
|
3
3
|
address: string;
|
|
4
4
|
balance: string;
|
|
5
5
|
totalReceived: string;
|
|
@@ -9,7 +9,7 @@ type AnkrBalanceResponse = {
|
|
|
9
9
|
txs: number;
|
|
10
10
|
error: string;
|
|
11
11
|
};
|
|
12
|
-
type AnkrUTXOResponse = {
|
|
12
|
+
export type AnkrUTXOResponse = {
|
|
13
13
|
txid: string;
|
|
14
14
|
vout: number;
|
|
15
15
|
value: string;
|
|
@@ -17,7 +17,7 @@ type AnkrUTXOResponse = {
|
|
|
17
17
|
confirmations: number;
|
|
18
18
|
coinbase: boolean;
|
|
19
19
|
}[];
|
|
20
|
-
type AnkrVin = {
|
|
20
|
+
export type AnkrVin = {
|
|
21
21
|
txid: string;
|
|
22
22
|
vout: number;
|
|
23
23
|
sequence: number;
|
|
@@ -31,7 +31,7 @@ type AnkrVin = {
|
|
|
31
31
|
hex: string;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
type AnkrVout = {
|
|
34
|
+
export type AnkrVout = {
|
|
35
35
|
value: number;
|
|
36
36
|
n: number;
|
|
37
37
|
spent: boolean;
|
|
@@ -49,7 +49,7 @@ type AnkrVout = {
|
|
|
49
49
|
type: string;
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
-
type AnkrTransaction = {
|
|
52
|
+
export type AnkrTransaction = {
|
|
53
53
|
txid: string;
|
|
54
54
|
version: number;
|
|
55
55
|
vin: AnkrVin[];
|
|
@@ -74,12 +74,11 @@ type AnkrTransaction = {
|
|
|
74
74
|
version: number;
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
|
-
type AnkrAddressWithTxnsResponse = {
|
|
77
|
+
export type AnkrAddressWithTxnsResponse = {
|
|
78
78
|
transactions: AnkrTransaction[];
|
|
79
79
|
} & AnkrBalanceResponse;
|
|
80
|
-
type AnkrTxnResponse = {
|
|
80
|
+
export type AnkrTxnResponse = {
|
|
81
81
|
error?: string;
|
|
82
82
|
} & AnkrTransaction;
|
|
83
83
|
//#endregion
|
|
84
|
-
export { AnkrAddressWithTxnsResponse, AnkrBalanceResponse, AnkrTransaction, AnkrTxnResponse, AnkrUTXOResponse, AnkrVin, AnkrVout };
|
|
85
84
|
//# sourceMappingURL=ankr.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ankr.types.d.ts","names":[],"sources":["../../../../src/transports/ankr/ankr.types.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"ankr.types.d.ts","names":[],"sources":["../../../../src/transports/ankr/ankr.types.ts"],"mappings":";YAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU;EACV;EACA;EACA;EACA;EACA;EACA;;YAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IACE;IACA;;;YAIQ;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IACE;IACA;IACA;IACA;IACA;;;YAIQ;EACV;EACA;EACA,KAAK;EACL,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IACE;IACA;IACA;IACA;IACA;IACA;;;YAIQ;EACV,cAAc;IACZ;YAEQ;EACV;IACE"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcMethodHandler } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/ankr/getBalance.d.ts
|
|
4
|
-
declare const getBalance: RpcMethodHandler<"getBalance">;
|
|
3
|
+
export declare const getBalance: RpcMethodHandler<"getBalance">;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { getBalance };
|
|
7
5
|
//# sourceMappingURL=getBalance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBalance.d.ts","names":[],"sources":["../../../../src/transports/ankr/getBalance.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBalance.d.ts","names":[],"sources":["../../../../src/transports/ankr/getBalance.ts"],"mappings":";;qBAIa,YAAY"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcMethodHandler } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/ankr/getTransactionFee.d.ts
|
|
4
|
-
declare const getTransactionFee: RpcMethodHandler<"getTransactionFee">;
|
|
3
|
+
export declare const getTransactionFee: RpcMethodHandler<"getTransactionFee">;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { getTransactionFee };
|
|
7
5
|
//# sourceMappingURL=getTransactionFee.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTransactionFee.d.ts","names":[],"sources":["../../../../src/transports/ankr/getTransactionFee.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTransactionFee.d.ts","names":[],"sources":["../../../../src/transports/ankr/getTransactionFee.ts"],"mappings":";;qBAGa,mBAAmB"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcMethodHandler } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/ankr/getTransactions.d.ts
|
|
4
|
-
declare const getTransactions: RpcMethodHandler<"getTransactions">;
|
|
3
|
+
export declare const getTransactions: RpcMethodHandler<"getTransactions">;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { getTransactions };
|
|
7
5
|
//# sourceMappingURL=getTransactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTransactions.d.ts","names":[],"sources":["../../../../src/transports/ankr/getTransactions.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTransactions.d.ts","names":[],"sources":["../../../../src/transports/ankr/getTransactions.ts"],"mappings":";;qBAKa,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.d.ts","names":[],"sources":["../../../../src/transports/ankr/methods.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"methods.d.ts","names":[],"sources":["../../../../src/transports/ankr/methods.ts"],"mappings":";;qBAKa,aAAa"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { UTXOTransaction } from "../../types/transaction.js";
|
|
2
2
|
import { AnkrTransaction } from "./ankr.types.js";
|
|
3
|
-
|
|
4
3
|
//#region src/transports/ankr/utils.d.ts
|
|
5
|
-
declare const ankrTransactionTransformer: (txn: AnkrTransaction) => Partial<UTXOTransaction>;
|
|
4
|
+
export declare const ankrTransactionTransformer: (txn: AnkrTransaction) => Partial<UTXOTransaction>;
|
|
6
5
|
//#endregion
|
|
7
|
-
export { ankrTransactionTransformer };
|
|
8
6
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../../../src/transports/ankr/utils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../../../src/transports/ankr/utils.ts"],"mappings":";;;qBAGa,6BACX,KAAK,oBACJ,QAAQ"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { HttpTransport, HttpTransportConfig } from "../http.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/blockchair/blockchair.d.ts
|
|
4
3
|
type BlockchairConfig = {
|
|
5
4
|
baseUrl?: string;
|
|
6
5
|
apiKey?: string;
|
|
7
6
|
} & HttpTransportConfig;
|
|
8
|
-
declare const blockchair: (config?: BlockchairConfig) => HttpTransport;
|
|
7
|
+
export declare const blockchair: (config?: BlockchairConfig) => HttpTransport;
|
|
9
8
|
//#endregion
|
|
10
|
-
export { blockchair };
|
|
11
9
|
//# sourceMappingURL=blockchair.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockchair.d.ts","names":[],"sources":["../../../../src/transports/blockchair/blockchair.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"blockchair.d.ts","names":[],"sources":["../../../../src/transports/blockchair/blockchair.ts"],"mappings":";;KAKK;EACH;EACA;IACE;qBAES,aAAc,SAAS,qBAAmB"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
//#region src/transports/blockchair/blockchair.types.d.ts
|
|
2
|
-
type BlockchairUTXO = {
|
|
2
|
+
export type BlockchairUTXO = {
|
|
3
3
|
block_id: number;
|
|
4
4
|
transaction_hash: string;
|
|
5
5
|
index: number;
|
|
6
6
|
value: number;
|
|
7
7
|
address: string;
|
|
8
8
|
};
|
|
9
|
-
type BlockChairDashboardAddressResponse = {
|
|
9
|
+
export type BlockChairDashboardAddressResponse = {
|
|
10
10
|
set: BlockChairDashboardSet;
|
|
11
11
|
addresses: Record<string, BlockchairDashboardAddress>;
|
|
12
12
|
transactions: Array<string>;
|
|
13
13
|
utxo: Array<BlockchairUTXO>;
|
|
14
14
|
};
|
|
15
|
-
type BlockChairDashboardSet = {
|
|
15
|
+
export type BlockChairDashboardSet = {
|
|
16
16
|
address_count: number;
|
|
17
17
|
balance: number;
|
|
18
18
|
balance_usd: number;
|
|
@@ -26,7 +26,7 @@ type BlockChairDashboardSet = {
|
|
|
26
26
|
last_seen_spending: string;
|
|
27
27
|
transaction_count: number;
|
|
28
28
|
};
|
|
29
|
-
type BlockchairDashboardAddress = {
|
|
29
|
+
export type BlockchairDashboardAddress = {
|
|
30
30
|
type: string;
|
|
31
31
|
script_hex: string;
|
|
32
32
|
balance: number;
|
|
@@ -42,8 +42,8 @@ type BlockchairDashboardAddress = {
|
|
|
42
42
|
first_seen_spending: string;
|
|
43
43
|
last_seen_spending: string;
|
|
44
44
|
};
|
|
45
|
-
type BlockchairAddressBalanceData<T = any> = Record<string, T>;
|
|
46
|
-
type BlockchairResponse<T = any> = {
|
|
45
|
+
export type BlockchairAddressBalanceData<T = any> = Record<string, T>;
|
|
46
|
+
export type BlockchairResponse<T = any> = {
|
|
47
47
|
data: T;
|
|
48
48
|
context: {
|
|
49
49
|
code: number;
|
|
@@ -53,10 +53,10 @@ type BlockchairResponse<T = any> = {
|
|
|
53
53
|
total_rows?: number;
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
|
-
type BlockchairXpubDashboardAddressResponse = BlockchairDashboardAddress & {
|
|
56
|
+
export type BlockchairXpubDashboardAddressResponse = BlockchairDashboardAddress & {
|
|
57
57
|
path: string;
|
|
58
58
|
};
|
|
59
|
-
type BlockchairXpubData = {
|
|
59
|
+
export type BlockchairXpubData = {
|
|
60
60
|
address_count: number;
|
|
61
61
|
balance: number;
|
|
62
62
|
balance_usd: number;
|
|
@@ -70,12 +70,12 @@ type BlockchairXpubData = {
|
|
|
70
70
|
last_seen_spending: string;
|
|
71
71
|
transaction_count: number;
|
|
72
72
|
};
|
|
73
|
-
type BlockchairXpubResponse = Record<string, {
|
|
73
|
+
export type BlockchairXpubResponse = Record<string, {
|
|
74
74
|
xpub: BlockchairXpubData;
|
|
75
75
|
addresses: Record<string, BlockchairXpubDashboardAddressResponse>;
|
|
76
76
|
}>;
|
|
77
|
-
type BlockchairTransactionResponse = BlockchairResponse<Record<string, BlockchairTransaction>>;
|
|
78
|
-
type BlockchairTransaction = {
|
|
77
|
+
export type BlockchairTransactionResponse = BlockchairResponse<Record<string, BlockchairTransaction>>;
|
|
78
|
+
export type BlockchairTransaction = {
|
|
79
79
|
transaction: {
|
|
80
80
|
block_id: number;
|
|
81
81
|
id: number;
|
|
@@ -106,7 +106,7 @@ type BlockchairTransaction = {
|
|
|
106
106
|
inputs: Array<BlockchairVin>;
|
|
107
107
|
outputs: Array<BlockchairVout>;
|
|
108
108
|
};
|
|
109
|
-
type BlockchairVin = {
|
|
109
|
+
export type BlockchairVin = {
|
|
110
110
|
block_id: number;
|
|
111
111
|
transaction_id: number;
|
|
112
112
|
index: number;
|
|
@@ -134,7 +134,6 @@ type BlockchairVin = {
|
|
|
134
134
|
lifespan: number | null;
|
|
135
135
|
cdd: number | null;
|
|
136
136
|
};
|
|
137
|
-
type BlockchairVout = BlockchairVin;
|
|
137
|
+
export type BlockchairVout = BlockchairVin;
|
|
138
138
|
//#endregion
|
|
139
|
-
export { BlockChairDashboardAddressResponse, BlockChairDashboardSet, BlockchairAddressBalanceData, BlockchairDashboardAddress, BlockchairResponse, BlockchairTransaction, BlockchairTransactionResponse, BlockchairUTXO, BlockchairVin, BlockchairVout, BlockchairXpubDashboardAddressResponse, BlockchairXpubData, BlockchairXpubResponse };
|
|
140
139
|
//# sourceMappingURL=blockchair.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockchair.types.d.ts","names":[],"sources":["../../../../src/transports/blockchair/blockchair.types.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"blockchair.types.d.ts","names":[],"sources":["../../../../src/transports/blockchair/blockchair.types.ts"],"mappings":";YAAY;EACV;EACA;EACA;EACA;EACA;;YAGU;EACV,KAAK;EACL,WAAW,eAAe;EAC1B,cAAc;EACd,MAAM,MAAM;;YAGF;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU,6BAA6B,WAAW,eAAe;YAEvD,mBAAmB;EAC7B,MAAM;EACN;IACE;IACA;IACA;IACA;IACA;;;YAIQ,yCACV;EACE;;YAGQ;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU,yBAAyB;EAGjC,MAAM;EACN,WAAW,eAAe;;YAIlB,gCAAgC,mBAC1C,eAAe;YAGL;EACV;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,QAAQ,MAAM;EACd,SAAS,MAAM;;YAGL;EACV;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,iBAAiB"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcMethodHandler } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/blockchair/getBalance.d.ts
|
|
4
|
-
declare const getBalance: RpcMethodHandler<"getBalance">;
|
|
3
|
+
export declare const getBalance: RpcMethodHandler<"getBalance">;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { getBalance };
|
|
7
5
|
//# sourceMappingURL=getBalance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBalance.d.ts","names":[],"sources":["../../../../src/transports/blockchair/getBalance.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBalance.d.ts","names":[],"sources":["../../../../src/transports/blockchair/getBalance.ts"],"mappings":";;qBAQa,YAAY"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcMethodHandler } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/blockchair/getTransactionFee.d.ts
|
|
4
|
-
declare const getTransactionFee: RpcMethodHandler<"getTransactionFee">;
|
|
3
|
+
export declare const getTransactionFee: RpcMethodHandler<"getTransactionFee">;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { getTransactionFee };
|
|
7
5
|
//# sourceMappingURL=getTransactionFee.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTransactionFee.d.ts","names":[],"sources":["../../../../src/transports/blockchair/getTransactionFee.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTransactionFee.d.ts","names":[],"sources":["../../../../src/transports/blockchair/getTransactionFee.ts"],"mappings":";;qBAKa,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTransactionFee.js","names":[],"sources":["../../../../src/transports/blockchair/getTransactionFee.ts"],"sourcesContent":["import { RpcErrorCode } from '../../errors/rpc.js'\nimport { urlWithParams } from '../../utils/url.js'\nimport type { RpcMethodHandler } from '../types.js'\nimport type { BlockchairTransactionResponse } from './blockchair.types.js'\n\nexport const getTransactionFee: RpcMethodHandler<'getTransactionFee'> = async (\n client,\n { baseUrl, apiKey },\n { txId }\n) => {\n const apiUrl = urlWithParams(`${baseUrl}/dashboards/transaction/${txId}`, {\n key: apiKey,\n })\n const response = (await client.request({\n url: apiUrl,\n fetchOptions: {\n method: 'GET',\n },\n })) as unknown as BlockchairTransactionResponse\n\n if (\n !response.data[txId] ||\n response.context.error ||\n response.context?.code !== 200\n ) {\n return {\n error: {\n code:\n response.context.code === 429\n ? RpcErrorCode.ACCESS_DENIED\n : RpcErrorCode.MISC_ERROR,\n message: response.context?.error,\n },\n }\n }\n\n return {\n result: BigInt(response.data[txId].transaction.fee),\n }\n}\n"],"mappings":";;;AAKA,MAAa,oBAA2D,OACtE,QACA,EAAE,SAAS,UACX,EAAE,WACC;CACH,MAAM,SAAS,cAAc,GAAG,QAAQ,0BAA0B,QAAQ,EACxE,KAAK,OACP,CAAC;CACD,MAAM,WAAY,MAAM,OAAO,QAAQ;EACrC,KAAK;EACL,cAAc,EACZ,QAAQ,MACV;CACF,CAAC;CAED,IACE,CAAC,SAAS,KAAK,SACf,SAAS,QAAQ,SACjB,SAAS,SAAS,SAAS,KAE3B,OAAO,EACL,OAAO;EACL,MACE,SAAS,QAAQ,SAAS,MAAA,SAAA;EAG5B,SAAS,SAAS,SAAS;CAC7B,EACF;CAGF,OAAO,EACL,QAAQ,OAAO,SAAS,KAAK,
|
|
1
|
+
{"version":3,"file":"getTransactionFee.js","names":[],"sources":["../../../../src/transports/blockchair/getTransactionFee.ts"],"sourcesContent":["import { RpcErrorCode } from '../../errors/rpc.js'\nimport { urlWithParams } from '../../utils/url.js'\nimport type { RpcMethodHandler } from '../types.js'\nimport type { BlockchairTransactionResponse } from './blockchair.types.js'\n\nexport const getTransactionFee: RpcMethodHandler<'getTransactionFee'> = async (\n client,\n { baseUrl, apiKey },\n { txId }\n) => {\n const apiUrl = urlWithParams(`${baseUrl}/dashboards/transaction/${txId}`, {\n key: apiKey,\n })\n const response = (await client.request({\n url: apiUrl,\n fetchOptions: {\n method: 'GET',\n },\n })) as unknown as BlockchairTransactionResponse\n\n if (\n !response.data[txId] ||\n response.context.error ||\n response.context?.code !== 200\n ) {\n return {\n error: {\n code:\n response.context.code === 429\n ? RpcErrorCode.ACCESS_DENIED\n : RpcErrorCode.MISC_ERROR,\n message: response.context?.error,\n },\n }\n }\n\n return {\n result: BigInt(response.data[txId].transaction.fee),\n }\n}\n"],"mappings":";;;AAKA,MAAa,oBAA2D,OACtE,QACA,EAAE,SAAS,UACX,EAAE,WACC;CACH,MAAM,SAAS,cAAc,GAAG,QAAQ,0BAA0B,QAAQ,EACxE,KAAK,OACP,CAAC;CACD,MAAM,WAAY,MAAM,OAAO,QAAQ;EACrC,KAAK;EACL,cAAc,EACZ,QAAQ,MACV;CACF,CAAC;CAED,IACE,CAAC,SAAS,KAAK,SACf,SAAS,QAAQ,SACjB,SAAS,SAAS,SAAS,KAE3B,OAAO,EACL,OAAO;EACL,MACE,SAAS,QAAQ,SAAS,MAAA,SAAA;EAG5B,SAAS,SAAS,SAAS;CAC7B,EACF;CAGF,OAAO,EACL,QAAQ,OAAO,SAAS,KAAK,KAAK,CAAC,YAAY,GAAG,EACpD;AACF"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcMethodHandler } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/blockchair/getUTXOs.d.ts
|
|
4
|
-
declare const getUTXOs: RpcMethodHandler<"getUTXOs">;
|
|
3
|
+
export declare const getUTXOs: RpcMethodHandler<"getUTXOs">;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { getUTXOs };
|
|
7
5
|
//# sourceMappingURL=getUTXOs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUTXOs.d.ts","names":[],"sources":["../../../../src/transports/blockchair/getUTXOs.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getUTXOs.d.ts","names":[],"sources":["../../../../src/transports/blockchair/getUTXOs.ts"],"mappings":";;qBA2Ba,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUTXOs.js","names":[],"sources":["../../../../src/transports/blockchair/getUTXOs.ts"],"sourcesContent":["import { BaseError } from '../../errors/base.js'\nimport { RpcRequestError } from '../../errors/request.js'\nimport { RpcErrorCode } from '../../errors/rpc.js'\nimport { InsufficientUTXOBalanceError } from '../../errors/utxo.js'\nimport type { UTXO } from '../../types/transaction.js'\n\nimport { urlWithParams } from '../../utils/url.js'\nimport type { RpcMethodHandler } from '../types.js'\nimport type {\n BlockChairDashboardAddressResponse,\n BlockchairResponse,\n BlockchairUTXO,\n} from './blockchair.types.js'\nimport { getBalance } from './getBalance.js'\n\nconst blockChairUTXOTransformer =\n (scriptHex: string) =>\n (data: BlockchairUTXO): UTXO => ({\n blockHeight: data.block_id,\n scriptHex,\n txId: data.transaction_hash,\n value: data.value,\n vout: data.index,\n })\n\nconst MAX_API_LIMIT = '100,100'\n\nexport const getUTXOs: RpcMethodHandler<'getUTXOs'> = async (\n client,\n { baseUrl, apiKey },\n { address, minValue }\n) => {\n async function* fetchUTXOs() {\n let offset = 0\n let hasMore = true\n\n while (hasMore) {\n const apiUrl = urlWithParams(\n `${baseUrl}/dashboards/addresses/${address}`,\n {\n key: apiKey,\n offset: `0,${offset}`,\n limit: MAX_API_LIMIT,\n }\n )\n const response = (await client.request({\n url: apiUrl,\n fetchOptions: { method: 'GET' },\n })) as unknown as BlockchairResponse<BlockChairDashboardAddressResponse>\n\n if (response.context?.code !== 200 && response.context?.code !== 404) {\n throw new RpcRequestError({\n url: apiUrl,\n body: {\n method: 'fetchUTXOs',\n params: {\n address,\n minValue,\n },\n },\n error: {\n code:\n response.context.code === 429\n ? RpcErrorCode.ACCESS_DENIED\n : RpcErrorCode.MISC_ERROR,\n message: response.context.error || 'Error fetching utxos',\n },\n })\n }\n\n if (!response.data || response.data.utxo.length === 0) {\n hasMore = false\n continue\n }\n\n const { limit } = response.context\n const totalRows = response.data.addresses[address].unspent_output_count\n if (limit && totalRows) {\n const [, utxoLimit] = String(limit)\n .split(',')\n .map((val) => Number(val))\n hasMore = offset + utxoLimit < totalRows\n offset += utxoLimit\n } else {\n hasMore = false\n offset += 0\n }\n\n yield response.data\n }\n }\n\n if (minValue) {\n const { error, result: balance } = await getBalance(\n client,\n { baseUrl, apiKey },\n { address }\n )\n\n if (error) {\n throw new BaseError('Error fetching balance', {\n cause: error,\n })\n }\n\n if (balance === undefined) {\n throw new BaseError('Balance is undefined', {\n cause: new Error('Unable to determine balance'),\n })\n }\n\n if (minValue > Number(balance)) {\n throw new InsufficientUTXOBalanceError({\n minValue,\n address,\n balance: Number(balance),\n })\n }\n }\n const utxos: UTXO[] = []\n let valueCount = 0\n\n for await (const batch of fetchUTXOs()) {\n const addressScriptHex = batch.addresses[address].script_hex\n const utxoBatch = batch.utxo.map(\n blockChairUTXOTransformer(addressScriptHex)\n )\n utxos.push(...utxoBatch)\n\n if (minValue) {\n valueCount += utxoBatch.reduce((sum, utxo) => sum + utxo.value, 0)\n if (valueCount >= minValue) {\n break\n }\n }\n }\n\n return { result: utxos }\n}\n"],"mappings":";;;;;;;AAeA,MAAM,6BACH,eACA,UAAgC;CAC/B,aAAa,KAAK;CAClB;CACA,MAAM,KAAK;CACX,OAAO,KAAK;CACZ,MAAM,KAAK;AACb;AAEF,MAAM,gBAAgB;AAEtB,MAAa,WAAyC,OACpD,QACA,EAAE,SAAS,UACX,EAAE,SAAS,eACR;CACH,gBAAgB,aAAa;EAC3B,IAAI,SAAS;EACb,IAAI,UAAU;EAEd,OAAO,SAAS;GACd,MAAM,SAAS,cACb,GAAG,QAAQ,wBAAwB,WACnC;IACE,KAAK;IACL,QAAQ,KAAK;IACb,OAAO;GACT,CACF;GACA,MAAM,WAAY,MAAM,OAAO,QAAQ;IACrC,KAAK;IACL,cAAc,EAAE,QAAQ,MAAM;GAChC,CAAC;GAED,IAAI,SAAS,SAAS,SAAS,OAAO,SAAS,SAAS,SAAS,KAC/D,MAAM,IAAI,gBAAgB;IACxB,KAAK;IACL,MAAM;KACJ,QAAQ;KACR,QAAQ;MACN;MACA;KACF;IACF;IACA,OAAO;KACL,MACE,SAAS,QAAQ,SAAS,MAAA,SAAA;KAG5B,SAAS,SAAS,QAAQ,SAAS;IACrC;GACF,CAAC;GAGH,IAAI,CAAC,SAAS,QAAQ,SAAS,KAAK,KAAK,WAAW,GAAG;IACrD,UAAU;IACV;GACF;GAEA,MAAM,EAAE,UAAU,SAAS;GAC3B,MAAM,YAAY,SAAS,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"getUTXOs.js","names":[],"sources":["../../../../src/transports/blockchair/getUTXOs.ts"],"sourcesContent":["import { BaseError } from '../../errors/base.js'\nimport { RpcRequestError } from '../../errors/request.js'\nimport { RpcErrorCode } from '../../errors/rpc.js'\nimport { InsufficientUTXOBalanceError } from '../../errors/utxo.js'\nimport type { UTXO } from '../../types/transaction.js'\n\nimport { urlWithParams } from '../../utils/url.js'\nimport type { RpcMethodHandler } from '../types.js'\nimport type {\n BlockChairDashboardAddressResponse,\n BlockchairResponse,\n BlockchairUTXO,\n} from './blockchair.types.js'\nimport { getBalance } from './getBalance.js'\n\nconst blockChairUTXOTransformer =\n (scriptHex: string) =>\n (data: BlockchairUTXO): UTXO => ({\n blockHeight: data.block_id,\n scriptHex,\n txId: data.transaction_hash,\n value: data.value,\n vout: data.index,\n })\n\nconst MAX_API_LIMIT = '100,100'\n\nexport const getUTXOs: RpcMethodHandler<'getUTXOs'> = async (\n client,\n { baseUrl, apiKey },\n { address, minValue }\n) => {\n async function* fetchUTXOs() {\n let offset = 0\n let hasMore = true\n\n while (hasMore) {\n const apiUrl = urlWithParams(\n `${baseUrl}/dashboards/addresses/${address}`,\n {\n key: apiKey,\n offset: `0,${offset}`,\n limit: MAX_API_LIMIT,\n }\n )\n const response = (await client.request({\n url: apiUrl,\n fetchOptions: { method: 'GET' },\n })) as unknown as BlockchairResponse<BlockChairDashboardAddressResponse>\n\n if (response.context?.code !== 200 && response.context?.code !== 404) {\n throw new RpcRequestError({\n url: apiUrl,\n body: {\n method: 'fetchUTXOs',\n params: {\n address,\n minValue,\n },\n },\n error: {\n code:\n response.context.code === 429\n ? RpcErrorCode.ACCESS_DENIED\n : RpcErrorCode.MISC_ERROR,\n message: response.context.error || 'Error fetching utxos',\n },\n })\n }\n\n if (!response.data || response.data.utxo.length === 0) {\n hasMore = false\n continue\n }\n\n const { limit } = response.context\n const totalRows = response.data.addresses[address].unspent_output_count\n if (limit && totalRows) {\n const [, utxoLimit] = String(limit)\n .split(',')\n .map((val) => Number(val))\n hasMore = offset + utxoLimit < totalRows\n offset += utxoLimit\n } else {\n hasMore = false\n offset += 0\n }\n\n yield response.data\n }\n }\n\n if (minValue) {\n const { error, result: balance } = await getBalance(\n client,\n { baseUrl, apiKey },\n { address }\n )\n\n if (error) {\n throw new BaseError('Error fetching balance', {\n cause: error,\n })\n }\n\n if (balance === undefined) {\n throw new BaseError('Balance is undefined', {\n cause: new Error('Unable to determine balance'),\n })\n }\n\n if (minValue > Number(balance)) {\n throw new InsufficientUTXOBalanceError({\n minValue,\n address,\n balance: Number(balance),\n })\n }\n }\n const utxos: UTXO[] = []\n let valueCount = 0\n\n for await (const batch of fetchUTXOs()) {\n const addressScriptHex = batch.addresses[address].script_hex\n const utxoBatch = batch.utxo.map(\n blockChairUTXOTransformer(addressScriptHex)\n )\n utxos.push(...utxoBatch)\n\n if (minValue) {\n valueCount += utxoBatch.reduce((sum, utxo) => sum + utxo.value, 0)\n if (valueCount >= minValue) {\n break\n }\n }\n }\n\n return { result: utxos }\n}\n"],"mappings":";;;;;;;AAeA,MAAM,6BACH,eACA,UAAgC;CAC/B,aAAa,KAAK;CAClB;CACA,MAAM,KAAK;CACX,OAAO,KAAK;CACZ,MAAM,KAAK;AACb;AAEF,MAAM,gBAAgB;AAEtB,MAAa,WAAyC,OACpD,QACA,EAAE,SAAS,UACX,EAAE,SAAS,eACR;CACH,gBAAgB,aAAa;EAC3B,IAAI,SAAS;EACb,IAAI,UAAU;EAEd,OAAO,SAAS;GACd,MAAM,SAAS,cACb,GAAG,QAAQ,wBAAwB,WACnC;IACE,KAAK;IACL,QAAQ,KAAK;IACb,OAAO;GACT,CACF;GACA,MAAM,WAAY,MAAM,OAAO,QAAQ;IACrC,KAAK;IACL,cAAc,EAAE,QAAQ,MAAM;GAChC,CAAC;GAED,IAAI,SAAS,SAAS,SAAS,OAAO,SAAS,SAAS,SAAS,KAC/D,MAAM,IAAI,gBAAgB;IACxB,KAAK;IACL,MAAM;KACJ,QAAQ;KACR,QAAQ;MACN;MACA;KACF;IACF;IACA,OAAO;KACL,MACE,SAAS,QAAQ,SAAS,MAAA,SAAA;KAG5B,SAAS,SAAS,QAAQ,SAAS;IACrC;GACF,CAAC;GAGH,IAAI,CAAC,SAAS,QAAQ,SAAS,KAAK,KAAK,WAAW,GAAG;IACrD,UAAU;IACV;GACF;GAEA,MAAM,EAAE,UAAU,SAAS;GAC3B,MAAM,YAAY,SAAS,KAAK,UAAU,QAAQ,CAAC;GACnD,IAAI,SAAS,WAAW;IACtB,MAAM,GAAG,aAAa,OAAO,KAAK,CAAC,CAChC,MAAM,GAAG,CAAC,CACV,KAAK,QAAQ,OAAO,GAAG,CAAC;IAC3B,UAAU,SAAS,YAAY;IAC/B,UAAU;GACZ,OAAO;IACL,UAAU;IACV,UAAU;GACZ;GAEA,MAAM,SAAS;EACjB;CACF;CAEA,IAAI,UAAU;EACZ,MAAM,EAAE,OAAO,QAAQ,YAAY,MAAM,WACvC,QACA;GAAE;GAAS;EAAO,GAClB,EAAE,QAAQ,CACZ;EAEA,IAAI,OACF,MAAM,IAAI,UAAU,0BAA0B,EAC5C,OAAO,MACT,CAAC;EAGH,IAAI,YAAY,KAAA,GACd,MAAM,IAAI,UAAU,wBAAwB,EAC1C,uBAAO,IAAI,MAAM,6BAA6B,EAChD,CAAC;EAGH,IAAI,WAAW,OAAO,OAAO,GAC3B,MAAM,IAAI,6BAA6B;GACrC;GACA;GACA,SAAS,OAAO,OAAO;EACzB,CAAC;CAEL;CACA,MAAM,QAAgB,CAAC;CACvB,IAAI,aAAa;CAEjB,WAAW,MAAM,SAAS,WAAW,GAAG;EACtC,MAAM,mBAAmB,MAAM,UAAU,QAAQ,CAAC;EAClD,MAAM,YAAY,MAAM,KAAK,IAC3B,0BAA0B,gBAAgB,CAC5C;EACA,MAAM,KAAK,GAAG,SAAS;EAEvB,IAAI,UAAU;GACZ,cAAc,UAAU,QAAQ,KAAK,SAAS,MAAM,KAAK,OAAO,CAAC;GACjE,IAAI,cAAc,UAChB;EAEJ;CACF;CAEA,OAAO,EAAE,QAAQ,MAAM;AACzB"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcMethodHandler } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/blockchair/getXPubAddresses.d.ts
|
|
4
|
-
declare const getXPubAddresses: RpcMethodHandler<"getXPubAddresses">;
|
|
3
|
+
export declare const getXPubAddresses: RpcMethodHandler<"getXPubAddresses">;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { getXPubAddresses };
|
|
7
5
|
//# sourceMappingURL=getXPubAddresses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getXPubAddresses.d.ts","names":[],"sources":["../../../../src/transports/blockchair/getXPubAddresses.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getXPubAddresses.d.ts","names":[],"sources":["../../../../src/transports/blockchair/getXPubAddresses.ts"],"mappings":";;qBAQa,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getXPubAddresses.js","names":[],"sources":["../../../../src/transports/blockchair/getXPubAddresses.ts"],"sourcesContent":["import { RpcErrorCode } from '../../errors/rpc.js'\nimport { urlWithParams } from '../../utils/url.js'\nimport type { RpcMethodHandler } from '../types.js'\nimport type {\n BlockchairResponse,\n BlockchairXpubResponse,\n} from './blockchair.types.js'\n\nexport const getXPubAddresses: RpcMethodHandler<'getXPubAddresses'> = async (\n client,\n { baseUrl, apiKey },\n { xPubKey }\n) => {\n const apiUrl = urlWithParams(`${baseUrl}/dashboards/xpub/${xPubKey}`, {\n key: apiKey,\n })\n const response = (await client.request({\n url: apiUrl,\n fetchOptions: { method: 'GET' },\n })) as unknown as BlockchairResponse<BlockchairXpubResponse>\n\n if (response.context.error || response.context?.code !== 200) {\n return {\n error: {\n code:\n response.context.code === 429\n ? RpcErrorCode.ACCESS_DENIED\n : RpcErrorCode.MISC_ERROR,\n message: response.context?.error,\n },\n }\n }\n\n if (response.data[xPubKey] === undefined) {\n return {\n result: {\n balance: 0n,\n addresses: [],\n },\n }\n }\n\n const xpubData = response.data[xPubKey]\n\n const result = {\n balance: BigInt(xpubData.xpub.balance),\n addresses: Object.entries(xpubData.addresses).map(([address, data]) => ({\n address,\n balance: BigInt(data.balance),\n path: data.path,\n scriptHex: data.script_hex,\n })),\n }\n\n return {\n result,\n }\n}\n"],"mappings":";;;AAQA,MAAa,mBAAyD,OACpE,QACA,EAAE,SAAS,UACX,EAAE,cACC;CACH,MAAM,SAAS,cAAc,GAAG,QAAQ,mBAAmB,WAAW,EACpE,KAAK,OACP,CAAC;CACD,MAAM,WAAY,MAAM,OAAO,QAAQ;EACrC,KAAK;EACL,cAAc,EAAE,QAAQ,MAAM;CAChC,CAAC;CAED,IAAI,SAAS,QAAQ,SAAS,SAAS,SAAS,SAAS,KACvD,OAAO,EACL,OAAO;EACL,MACE,SAAS,QAAQ,SAAS,MAAA,SAAA;EAG5B,SAAS,SAAS,SAAS;CAC7B,EACF;CAGF,IAAI,SAAS,KAAK,aAAa,KAAA,GAC7B,OAAO,EACL,QAAQ;EACN,SAAS;EACT,WAAW,CAAC;CACd,EACF;CAGF,MAAM,WAAW,SAAS,KAAK;CAY/B,OAAO,EACL,QAAA;EAVA,SAAS,OAAO,SAAS,KAAK,OAAO;EACrC,WAAW,OAAO,QAAQ,SAAS,SAAS,
|
|
1
|
+
{"version":3,"file":"getXPubAddresses.js","names":[],"sources":["../../../../src/transports/blockchair/getXPubAddresses.ts"],"sourcesContent":["import { RpcErrorCode } from '../../errors/rpc.js'\nimport { urlWithParams } from '../../utils/url.js'\nimport type { RpcMethodHandler } from '../types.js'\nimport type {\n BlockchairResponse,\n BlockchairXpubResponse,\n} from './blockchair.types.js'\n\nexport const getXPubAddresses: RpcMethodHandler<'getXPubAddresses'> = async (\n client,\n { baseUrl, apiKey },\n { xPubKey }\n) => {\n const apiUrl = urlWithParams(`${baseUrl}/dashboards/xpub/${xPubKey}`, {\n key: apiKey,\n })\n const response = (await client.request({\n url: apiUrl,\n fetchOptions: { method: 'GET' },\n })) as unknown as BlockchairResponse<BlockchairXpubResponse>\n\n if (response.context.error || response.context?.code !== 200) {\n return {\n error: {\n code:\n response.context.code === 429\n ? RpcErrorCode.ACCESS_DENIED\n : RpcErrorCode.MISC_ERROR,\n message: response.context?.error,\n },\n }\n }\n\n if (response.data[xPubKey] === undefined) {\n return {\n result: {\n balance: 0n,\n addresses: [],\n },\n }\n }\n\n const xpubData = response.data[xPubKey]\n\n const result = {\n balance: BigInt(xpubData.xpub.balance),\n addresses: Object.entries(xpubData.addresses).map(([address, data]) => ({\n address,\n balance: BigInt(data.balance),\n path: data.path,\n scriptHex: data.script_hex,\n })),\n }\n\n return {\n result,\n }\n}\n"],"mappings":";;;AAQA,MAAa,mBAAyD,OACpE,QACA,EAAE,SAAS,UACX,EAAE,cACC;CACH,MAAM,SAAS,cAAc,GAAG,QAAQ,mBAAmB,WAAW,EACpE,KAAK,OACP,CAAC;CACD,MAAM,WAAY,MAAM,OAAO,QAAQ;EACrC,KAAK;EACL,cAAc,EAAE,QAAQ,MAAM;CAChC,CAAC;CAED,IAAI,SAAS,QAAQ,SAAS,SAAS,SAAS,SAAS,KACvD,OAAO,EACL,OAAO;EACL,MACE,SAAS,QAAQ,SAAS,MAAA,SAAA;EAG5B,SAAS,SAAS,SAAS;CAC7B,EACF;CAGF,IAAI,SAAS,KAAK,aAAa,KAAA,GAC7B,OAAO,EACL,QAAQ;EACN,SAAS;EACT,WAAW,CAAC;CACd,EACF;CAGF,MAAM,WAAW,SAAS,KAAK;CAY/B,OAAO,EACL,QAAA;EAVA,SAAS,OAAO,SAAS,KAAK,OAAO;EACrC,WAAW,OAAO,QAAQ,SAAS,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,WAAW;GACtE;GACA,SAAS,OAAO,KAAK,OAAO;GAC5B,MAAM,KAAK;GACX,WAAW,KAAK;EAClB,EAAE;CAIG,EACP;AACF"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcMethods } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/blockchair/methods.d.ts
|
|
4
|
-
declare const blockchairMethods: RpcMethods;
|
|
3
|
+
export declare const blockchairMethods: RpcMethods;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { blockchairMethods };
|
|
7
5
|
//# sourceMappingURL=methods.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.d.ts","names":[],"sources":["../../../../src/transports/blockchair/methods.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"methods.d.ts","names":[],"sources":["../../../../src/transports/blockchair/methods.ts"],"mappings":";;qBAMa,mBAAmB"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { HttpTransport, HttpTransportConfig } from "../http.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/blockcypher/blockcypher.d.ts
|
|
4
3
|
type BlockcypherConfig = {
|
|
5
4
|
baseUrl?: string;
|
|
6
5
|
apiKey?: string;
|
|
7
6
|
} & HttpTransportConfig;
|
|
8
|
-
declare const blockcypher: (config?: BlockcypherConfig) => HttpTransport;
|
|
7
|
+
export declare const blockcypher: (config?: BlockcypherConfig) => HttpTransport;
|
|
9
8
|
//#endregion
|
|
10
|
-
export { blockcypher };
|
|
11
9
|
//# sourceMappingURL=blockcypher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockcypher.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/blockcypher.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"blockcypher.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/blockcypher.ts"],"mappings":";;KAKK;EACH;EACA;IACE;qBAES,cAAe,SAAS,sBAAoB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
//#region src/transports/blockcypher/blockcypher.types.d.ts
|
|
2
|
-
type BlockcypherErrorResponse = {
|
|
2
|
+
export type BlockcypherErrorResponse = {
|
|
3
3
|
error: string;
|
|
4
4
|
};
|
|
5
|
-
type BlockcypherBalanceResponse = {
|
|
5
|
+
export type BlockcypherBalanceResponse = {
|
|
6
6
|
address: string;
|
|
7
7
|
total_received: number;
|
|
8
8
|
total_sent: number;
|
|
@@ -15,7 +15,7 @@ type BlockcypherBalanceResponse = {
|
|
|
15
15
|
error?: string;
|
|
16
16
|
hasMore?: boolean;
|
|
17
17
|
};
|
|
18
|
-
type BlockcypherUTXO = {
|
|
18
|
+
export type BlockcypherUTXO = {
|
|
19
19
|
tx_hash: string;
|
|
20
20
|
block_height: number;
|
|
21
21
|
tx_input_n: number;
|
|
@@ -28,10 +28,10 @@ type BlockcypherUTXO = {
|
|
|
28
28
|
double_spend: boolean;
|
|
29
29
|
script: string;
|
|
30
30
|
};
|
|
31
|
-
type BlockcypherUTXOsResponse = BlockcypherBalanceResponse & {
|
|
31
|
+
export type BlockcypherUTXOsResponse = BlockcypherBalanceResponse & {
|
|
32
32
|
txrefs: BlockcypherUTXO[];
|
|
33
33
|
};
|
|
34
|
-
type BlockcypherTransactionInput = {
|
|
34
|
+
export type BlockcypherTransactionInput = {
|
|
35
35
|
prev_hash: string;
|
|
36
36
|
output_index: number;
|
|
37
37
|
script: string;
|
|
@@ -40,14 +40,14 @@ type BlockcypherTransactionInput = {
|
|
|
40
40
|
addresses: string[];
|
|
41
41
|
script_type: string;
|
|
42
42
|
};
|
|
43
|
-
type BlockcypherTransactionOutput = {
|
|
43
|
+
export type BlockcypherTransactionOutput = {
|
|
44
44
|
value: number;
|
|
45
45
|
script: string;
|
|
46
46
|
spent_by: string;
|
|
47
47
|
addresses: string[];
|
|
48
48
|
script_type: string;
|
|
49
49
|
};
|
|
50
|
-
type BlockcypherTransaction = {
|
|
50
|
+
export type BlockcypherTransaction = {
|
|
51
51
|
block_hash: string;
|
|
52
52
|
block_height: number;
|
|
53
53
|
hash: string;
|
|
@@ -69,9 +69,8 @@ type BlockcypherTransaction = {
|
|
|
69
69
|
inputs: BlockcypherTransactionInput[];
|
|
70
70
|
outputs: BlockcypherTransactionOutput[];
|
|
71
71
|
};
|
|
72
|
-
type BlockcypherTransactionReponse = BlockcypherTransaction & {
|
|
72
|
+
export type BlockcypherTransactionReponse = BlockcypherTransaction & {
|
|
73
73
|
error?: string;
|
|
74
74
|
};
|
|
75
75
|
//#endregion
|
|
76
|
-
export { BlockcypherBalanceResponse, BlockcypherErrorResponse, BlockcypherTransaction, BlockcypherTransactionInput, BlockcypherTransactionOutput, BlockcypherTransactionReponse, BlockcypherUTXO, BlockcypherUTXOsResponse };
|
|
77
76
|
//# sourceMappingURL=blockcypher.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockcypher.types.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/blockcypher.types.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"blockcypher.types.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/blockcypher.types.ts"],"mappings":";YAAY;EACV;;YAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU,2BAA2B;EACrC,QAAQ;;YAGE;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU;EACV;EACA;EACA;EACA;EACA;;YAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR,SAAS;;YAGC,gCAAgC;EAC1C"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcMethodHandler } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/blockcypher/getBalance.d.ts
|
|
4
|
-
declare const getBalance: RpcMethodHandler<"getBalance">;
|
|
3
|
+
export declare const getBalance: RpcMethodHandler<"getBalance">;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { getBalance };
|
|
7
5
|
//# sourceMappingURL=getBalance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBalance.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/getBalance.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBalance.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/getBalance.ts"],"mappings":";;qBAKa,YAAY"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcMethodHandler } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/blockcypher/getTransactionFee.d.ts
|
|
4
|
-
declare const getTransactionFee: RpcMethodHandler<"getTransactionFee">;
|
|
3
|
+
export declare const getTransactionFee: RpcMethodHandler<"getTransactionFee">;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { getTransactionFee };
|
|
7
5
|
//# sourceMappingURL=getTransactionFee.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTransactionFee.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/getTransactionFee.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTransactionFee.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/getTransactionFee.ts"],"mappings":";;qBAKa,mBAAmB"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcMethodHandler } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/blockcypher/getUTXOs.d.ts
|
|
4
|
-
declare const getUTXOs: RpcMethodHandler<"getUTXOs">;
|
|
3
|
+
export declare const getUTXOs: RpcMethodHandler<"getUTXOs">;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { getUTXOs };
|
|
7
5
|
//# sourceMappingURL=getUTXOs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUTXOs.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/getUTXOs.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getUTXOs.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/getUTXOs.ts"],"mappings":";;qBAuBa,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUTXOs.js","names":[],"sources":["../../../../src/transports/blockcypher/getUTXOs.ts"],"sourcesContent":["import { RpcRequestError } from '../../errors/request.js'\nimport { InsufficientUTXOBalanceError } from '../../errors/utxo.js'\nimport type { UTXO } from '../../types/transaction.js'\nimport { urlWithParams } from '../../utils/url.js'\nimport type { RpcMethodHandler } from '../types.js'\nimport type {\n BlockcypherUTXO,\n BlockcypherUTXOsResponse,\n} from './blockcypher.types.js'\nimport { getRpcErrorCode } from './utils.js'\n\nconst blockcypherUTXOTransformer = (utxo: BlockcypherUTXO): UTXO => ({\n blockHeight: utxo.block_height,\n isConfirmed: Boolean(utxo.confirmations),\n confirmations: utxo.confirmations,\n value: utxo.value,\n vout: utxo.tx_output_n,\n txId: utxo.tx_hash,\n scriptHex: utxo.script,\n})\n\nconst MAX_API_LIMIT = 2000\n\nexport const getUTXOs: RpcMethodHandler<'getUTXOs'> = async (\n client,\n { baseUrl, apiKey },\n { address, minValue }\n) => {\n async function* fetchUTXOs() {\n let hasMore = true\n let beforeBlock: number | undefined\n\n while (hasMore) {\n const apiUrl = urlWithParams(`${baseUrl}/addrs/${address}`, {\n token: apiKey,\n unspentOnly: 'true',\n includeScript: 'true',\n before: beforeBlock,\n limit: MAX_API_LIMIT,\n })\n const response = (await client.request({\n url: apiUrl,\n fetchOptions: { method: 'GET' },\n })) as unknown as BlockcypherUTXOsResponse\n\n if (response.error) {\n throw new RpcRequestError({\n url: apiUrl,\n body: {\n method: 'fetchUTXOs',\n params: {\n address,\n minValue,\n },\n },\n error: {\n code: getRpcErrorCode(response.error),\n message: response.error,\n },\n })\n }\n\n if (minValue && minValue > response.final_balance) {\n throw new InsufficientUTXOBalanceError({\n minValue,\n address,\n balance: response.final_balance,\n })\n }\n\n if (!response.txrefs || response.txrefs.length === 0) {\n hasMore = false\n continue\n }\n\n const { hasMore: apiHasMore } = response\n\n hasMore = Boolean(apiHasMore)\n beforeBlock = response.txrefs[response.txrefs.length - 1].block_height\n\n yield response.txrefs\n }\n }\n\n const utxos: UTXO[] = []\n let valueCount = 0\n\n for await (const batch of fetchUTXOs()) {\n const utxoBatch = batch.map(blockcypherUTXOTransformer)\n utxos.push(...utxoBatch)\n\n if (minValue) {\n valueCount += utxoBatch.reduce((sum, utxo) => sum + utxo.value, 0)\n if (valueCount >= minValue) {\n break\n }\n }\n }\n\n return { result: utxos }\n}\n"],"mappings":";;;;;AAWA,MAAM,8BAA8B,UAAiC;CACnE,aAAa,KAAK;CAClB,aAAa,QAAQ,KAAK,aAAa;CACvC,eAAe,KAAK;CACpB,OAAO,KAAK;CACZ,MAAM,KAAK;CACX,MAAM,KAAK;CACX,WAAW,KAAK;AAClB;AAEA,MAAM,gBAAgB;AAEtB,MAAa,WAAyC,OACpD,QACA,EAAE,SAAS,UACX,EAAE,SAAS,eACR;CACH,gBAAgB,aAAa;EAC3B,IAAI,UAAU;EACd,IAAI;EAEJ,OAAO,SAAS;GACd,MAAM,SAAS,cAAc,GAAG,QAAQ,SAAS,WAAW;IAC1D,OAAO;IACP,aAAa;IACb,eAAe;IACf,QAAQ;IACR,OAAO;GACT,CAAC;GACD,MAAM,WAAY,MAAM,OAAO,QAAQ;IACrC,KAAK;IACL,cAAc,EAAE,QAAQ,MAAM;GAChC,CAAC;GAED,IAAI,SAAS,OACX,MAAM,IAAI,gBAAgB;IACxB,KAAK;IACL,MAAM;KACJ,QAAQ;KACR,QAAQ;MACN;MACA;KACF;IACF;IACA,OAAO;KACL,MAAM,gBAAgB,SAAS,KAAK;KACpC,SAAS,SAAS;IACpB;GACF,CAAC;GAGH,IAAI,YAAY,WAAW,SAAS,eAClC,MAAM,IAAI,6BAA6B;IACrC;IACA;IACA,SAAS,SAAS;GACpB,CAAC;GAGH,IAAI,CAAC,SAAS,UAAU,SAAS,OAAO,WAAW,GAAG;IACpD,UAAU;IACV;GACF;GAEA,MAAM,EAAE,SAAS,eAAe;GAEhC,UAAU,QAAQ,UAAU;GAC5B,cAAc,SAAS,OAAO,SAAS,OAAO,SAAS,
|
|
1
|
+
{"version":3,"file":"getUTXOs.js","names":[],"sources":["../../../../src/transports/blockcypher/getUTXOs.ts"],"sourcesContent":["import { RpcRequestError } from '../../errors/request.js'\nimport { InsufficientUTXOBalanceError } from '../../errors/utxo.js'\nimport type { UTXO } from '../../types/transaction.js'\nimport { urlWithParams } from '../../utils/url.js'\nimport type { RpcMethodHandler } from '../types.js'\nimport type {\n BlockcypherUTXO,\n BlockcypherUTXOsResponse,\n} from './blockcypher.types.js'\nimport { getRpcErrorCode } from './utils.js'\n\nconst blockcypherUTXOTransformer = (utxo: BlockcypherUTXO): UTXO => ({\n blockHeight: utxo.block_height,\n isConfirmed: Boolean(utxo.confirmations),\n confirmations: utxo.confirmations,\n value: utxo.value,\n vout: utxo.tx_output_n,\n txId: utxo.tx_hash,\n scriptHex: utxo.script,\n})\n\nconst MAX_API_LIMIT = 2000\n\nexport const getUTXOs: RpcMethodHandler<'getUTXOs'> = async (\n client,\n { baseUrl, apiKey },\n { address, minValue }\n) => {\n async function* fetchUTXOs() {\n let hasMore = true\n let beforeBlock: number | undefined\n\n while (hasMore) {\n const apiUrl = urlWithParams(`${baseUrl}/addrs/${address}`, {\n token: apiKey,\n unspentOnly: 'true',\n includeScript: 'true',\n before: beforeBlock,\n limit: MAX_API_LIMIT,\n })\n const response = (await client.request({\n url: apiUrl,\n fetchOptions: { method: 'GET' },\n })) as unknown as BlockcypherUTXOsResponse\n\n if (response.error) {\n throw new RpcRequestError({\n url: apiUrl,\n body: {\n method: 'fetchUTXOs',\n params: {\n address,\n minValue,\n },\n },\n error: {\n code: getRpcErrorCode(response.error),\n message: response.error,\n },\n })\n }\n\n if (minValue && minValue > response.final_balance) {\n throw new InsufficientUTXOBalanceError({\n minValue,\n address,\n balance: response.final_balance,\n })\n }\n\n if (!response.txrefs || response.txrefs.length === 0) {\n hasMore = false\n continue\n }\n\n const { hasMore: apiHasMore } = response\n\n hasMore = Boolean(apiHasMore)\n beforeBlock = response.txrefs[response.txrefs.length - 1].block_height\n\n yield response.txrefs\n }\n }\n\n const utxos: UTXO[] = []\n let valueCount = 0\n\n for await (const batch of fetchUTXOs()) {\n const utxoBatch = batch.map(blockcypherUTXOTransformer)\n utxos.push(...utxoBatch)\n\n if (minValue) {\n valueCount += utxoBatch.reduce((sum, utxo) => sum + utxo.value, 0)\n if (valueCount >= minValue) {\n break\n }\n }\n }\n\n return { result: utxos }\n}\n"],"mappings":";;;;;AAWA,MAAM,8BAA8B,UAAiC;CACnE,aAAa,KAAK;CAClB,aAAa,QAAQ,KAAK,aAAa;CACvC,eAAe,KAAK;CACpB,OAAO,KAAK;CACZ,MAAM,KAAK;CACX,MAAM,KAAK;CACX,WAAW,KAAK;AAClB;AAEA,MAAM,gBAAgB;AAEtB,MAAa,WAAyC,OACpD,QACA,EAAE,SAAS,UACX,EAAE,SAAS,eACR;CACH,gBAAgB,aAAa;EAC3B,IAAI,UAAU;EACd,IAAI;EAEJ,OAAO,SAAS;GACd,MAAM,SAAS,cAAc,GAAG,QAAQ,SAAS,WAAW;IAC1D,OAAO;IACP,aAAa;IACb,eAAe;IACf,QAAQ;IACR,OAAO;GACT,CAAC;GACD,MAAM,WAAY,MAAM,OAAO,QAAQ;IACrC,KAAK;IACL,cAAc,EAAE,QAAQ,MAAM;GAChC,CAAC;GAED,IAAI,SAAS,OACX,MAAM,IAAI,gBAAgB;IACxB,KAAK;IACL,MAAM;KACJ,QAAQ;KACR,QAAQ;MACN;MACA;KACF;IACF;IACA,OAAO;KACL,MAAM,gBAAgB,SAAS,KAAK;KACpC,SAAS,SAAS;IACpB;GACF,CAAC;GAGH,IAAI,YAAY,WAAW,SAAS,eAClC,MAAM,IAAI,6BAA6B;IACrC;IACA;IACA,SAAS,SAAS;GACpB,CAAC;GAGH,IAAI,CAAC,SAAS,UAAU,SAAS,OAAO,WAAW,GAAG;IACpD,UAAU;IACV;GACF;GAEA,MAAM,EAAE,SAAS,eAAe;GAEhC,UAAU,QAAQ,UAAU;GAC5B,cAAc,SAAS,OAAO,SAAS,OAAO,SAAS,EAAE,CAAC;GAE1D,MAAM,SAAS;EACjB;CACF;CAEA,MAAM,QAAgB,CAAC;CACvB,IAAI,aAAa;CAEjB,WAAW,MAAM,SAAS,WAAW,GAAG;EACtC,MAAM,YAAY,MAAM,IAAI,0BAA0B;EACtD,MAAM,KAAK,GAAG,SAAS;EAEvB,IAAI,UAAU;GACZ,cAAc,UAAU,QAAQ,KAAK,SAAS,MAAM,KAAK,OAAO,CAAC;GACjE,IAAI,cAAc,UAChB;EAEJ;CACF;CAEA,OAAO,EAAE,QAAQ,MAAM;AACzB"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcMethods } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/blockcypher/methods.d.ts
|
|
4
|
-
declare const blockcypherMethods: RpcMethods;
|
|
3
|
+
export declare const blockcypherMethods: RpcMethods;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { blockcypherMethods };
|
|
7
5
|
//# sourceMappingURL=methods.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/methods.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"methods.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/methods.ts"],"mappings":";;qBAKa,oBAAoB"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RpcErrorCode } from "../../errors/rpc.js";
|
|
2
|
-
|
|
3
2
|
//#region src/transports/blockcypher/utils.d.ts
|
|
4
|
-
declare function getRpcErrorCode(error: string): RpcErrorCode;
|
|
3
|
+
export declare function getRpcErrorCode(error: string): RpcErrorCode;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { getRpcErrorCode };
|
|
7
5
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/utils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../../../src/transports/blockcypher/utils.ts"],"mappings":";;wBAEgB,gBAAgB,gBAAgB"}
|