@bigmi/core 0.8.0 → 0.8.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 +7 -0
- package/dist/cjs/actions/getBalance.js.map +1 -1
- package/dist/cjs/actions/getBlock.js +0 -1
- package/dist/cjs/actions/getBlock.js.map +1 -1
- package/dist/cjs/actions/getBlockCount.js.map +1 -1
- package/dist/cjs/actions/getBlockStats.js.map +1 -1
- package/dist/cjs/actions/getTransactionFee.js.map +1 -1
- package/dist/cjs/actions/getTransactions.js.map +1 -1
- package/dist/cjs/actions/getUTXOTransaction.js.map +1 -1
- package/dist/cjs/actions/getUTXOs.js.map +1 -1
- package/dist/cjs/actions/getXPubAddresses.js.map +1 -1
- package/dist/cjs/actions/sendUTXOTransaction.js.map +1 -1
- package/dist/cjs/actions/signPsbt.js.map +1 -1
- package/dist/cjs/actions/waitForTransaction.js +0 -1
- package/dist/cjs/actions/waitForTransaction.js.map +1 -1
- package/dist/cjs/actions/watchBlockNumber.js.map +1 -1
- package/dist/cjs/chains/bitcoin.js +3 -3
- package/dist/cjs/chains/bitcoin.js.map +1 -1
- package/dist/cjs/chains/defineChain.js.map +1 -1
- package/dist/cjs/chains/signet.js +3 -3
- package/dist/cjs/chains/signet.js.map +1 -1
- package/dist/cjs/clients/decorators/public.js.map +1 -1
- package/dist/cjs/clients/decorators/wallet.js.map +1 -1
- package/dist/cjs/errors/address.js.map +1 -1
- package/dist/cjs/errors/base.js.map +1 -1
- package/dist/cjs/errors/block.js.map +1 -1
- package/dist/cjs/errors/provider.js.map +1 -1
- package/dist/cjs/errors/request.js.map +1 -1
- package/dist/cjs/errors/rpc.js +3 -3
- package/dist/cjs/errors/rpc.js.map +1 -1
- package/dist/cjs/errors/transaction.js.map +1 -1
- package/dist/cjs/errors/transport.js.map +1 -1
- package/dist/cjs/errors/utxo.js.map +1 -1
- package/dist/cjs/factories/createClient.js.map +1 -1
- package/dist/cjs/factories/createTransport.js.map +1 -1
- package/dist/cjs/test/utils.js.map +1 -1
- package/dist/cjs/transports/ankr/ankr.js.map +1 -1
- package/dist/cjs/transports/ankr/getBalance.js +2 -2
- package/dist/cjs/transports/ankr/getBalance.js.map +1 -1
- package/dist/cjs/transports/ankr/getTransactionFee.js.map +1 -1
- package/dist/cjs/transports/ankr/getTransactions.js.map +1 -1
- package/dist/cjs/transports/ankr/methods.js.map +1 -1
- package/dist/cjs/transports/ankr/utils.js.map +1 -1
- package/dist/cjs/transports/blockchair/blockchair.js.map +1 -1
- package/dist/cjs/transports/blockchair/getBalance.js +2 -2
- package/dist/cjs/transports/blockchair/getBalance.js.map +1 -1
- package/dist/cjs/transports/blockchair/getTransactionFee.js +2 -2
- package/dist/cjs/transports/blockchair/getTransactionFee.js.map +1 -1
- package/dist/cjs/transports/blockchair/getUTXOs.js +2 -2
- package/dist/cjs/transports/blockchair/getUTXOs.js.map +1 -1
- package/dist/cjs/transports/blockchair/getXPubAddresses.js +2 -2
- package/dist/cjs/transports/blockchair/getXPubAddresses.js.map +1 -1
- package/dist/cjs/transports/blockchair/methods.js.map +1 -1
- package/dist/cjs/transports/blockcypher/blockcypher.js.map +1 -1
- package/dist/cjs/transports/blockcypher/getBalance.js.map +1 -1
- package/dist/cjs/transports/blockcypher/getTransactionFee.js.map +1 -1
- package/dist/cjs/transports/blockcypher/getUTXOs.js.map +1 -1
- package/dist/cjs/transports/blockcypher/methods.js.map +1 -1
- package/dist/cjs/transports/blockcypher/utils.js +3 -3
- package/dist/cjs/transports/blockcypher/utils.js.map +1 -1
- package/dist/cjs/transports/custom.js.map +1 -1
- package/dist/cjs/transports/fallback.js +2 -2
- package/dist/cjs/transports/fallback.js.map +1 -1
- package/dist/cjs/transports/getHttpRpcClient.js.map +1 -1
- package/dist/cjs/transports/getRpcProviderMethods.js.map +1 -1
- package/dist/cjs/transports/http.js.map +1 -1
- package/dist/cjs/transports/mempool/getBalance.js.map +1 -1
- package/dist/cjs/transports/mempool/getTransactionFee.js.map +1 -1
- package/dist/cjs/transports/mempool/getTransactions.js.map +1 -1
- package/dist/cjs/transports/mempool/mempool.js.map +1 -1
- package/dist/cjs/transports/mempool/methods.js.map +1 -1
- package/dist/cjs/transports/mempool/utils.js.map +1 -1
- package/dist/cjs/transports/types.js.map +1 -1
- package/dist/cjs/transports/utxo.js.map +1 -1
- package/dist/cjs/types/address.js.map +1 -1
- package/dist/cjs/types/chain.js.map +1 -1
- package/dist/cjs/utils/buildRequest.js +3 -3
- package/dist/cjs/utils/buildRequest.js.map +1 -1
- package/dist/cjs/utils/cancelTransaction.js +0 -1
- package/dist/cjs/utils/cancelTransaction.js.map +1 -1
- package/dist/cjs/utils/converter.js.map +1 -1
- package/dist/cjs/utils/createBatchScheduler.js +1 -1
- package/dist/cjs/utils/createBatchScheduler.js.map +1 -1
- package/dist/cjs/utils/deepEqual.js.map +1 -1
- package/dist/cjs/utils/getAction.js.map +1 -1
- package/dist/cjs/utils/getAddressInfo.js +26 -26
- package/dist/cjs/utils/getAddressInfo.js.map +1 -1
- package/dist/cjs/utils/idCache.js.map +1 -1
- package/dist/cjs/utils/isAddress.js.map +1 -1
- package/dist/cjs/utils/lru.js.map +1 -1
- package/dist/cjs/utils/modifyFee.js +0 -1
- package/dist/cjs/utils/modifyFee.js.map +1 -1
- package/dist/cjs/utils/observe.js +2 -2
- package/dist/cjs/utils/observe.js.map +1 -1
- package/dist/cjs/utils/parseAccount.js.map +1 -1
- package/dist/cjs/utils/poll.js.map +1 -1
- package/dist/cjs/utils/retryUntil.js.map +1 -1
- package/dist/cjs/utils/sleep.js.map +1 -1
- package/dist/cjs/utils/stringify.js.map +1 -1
- package/dist/cjs/utils/uid.js.map +1 -1
- package/dist/cjs/utils/url.js.map +1 -1
- package/dist/cjs/utils/wait.js.map +1 -1
- package/dist/cjs/utils/withDedupe.js +1 -1
- package/dist/cjs/utils/withDedupe.js.map +1 -1
- package/dist/cjs/utils/withResolvers.js.map +1 -1
- package/dist/cjs/utils/withRetry.js.map +1 -1
- package/dist/cjs/utils/withTimeout.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/actions/getBalance.d.ts.map +1 -1
- package/dist/esm/actions/getBalance.js.map +1 -1
- package/dist/esm/actions/getBlock.d.ts.map +1 -1
- package/dist/esm/actions/getBlock.js.map +1 -1
- package/dist/esm/actions/getBlockCount.d.ts.map +1 -1
- package/dist/esm/actions/getBlockCount.js.map +1 -1
- package/dist/esm/actions/getBlockStats.d.ts.map +1 -1
- package/dist/esm/actions/getBlockStats.js.map +1 -1
- package/dist/esm/actions/getTransactionFee.d.ts.map +1 -1
- package/dist/esm/actions/getTransactionFee.js.map +1 -1
- package/dist/esm/actions/getTransactions.d.ts.map +1 -1
- package/dist/esm/actions/getTransactions.js.map +1 -1
- package/dist/esm/actions/getUTXOTransaction.d.ts.map +1 -1
- package/dist/esm/actions/getUTXOTransaction.js.map +1 -1
- package/dist/esm/actions/getUTXOs.d.ts.map +1 -1
- package/dist/esm/actions/getUTXOs.js.map +1 -1
- package/dist/esm/actions/getXPubAddresses.d.ts.map +1 -1
- package/dist/esm/actions/getXPubAddresses.js.map +1 -1
- package/dist/esm/actions/sendUTXOTransaction.d.ts.map +1 -1
- package/dist/esm/actions/sendUTXOTransaction.js.map +1 -1
- package/dist/esm/actions/signPsbt.d.ts.map +1 -1
- package/dist/esm/actions/signPsbt.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/actions/watchBlockNumber.js.map +1 -1
- package/dist/esm/chains/bitcoin.js +3 -3
- package/dist/esm/chains/bitcoin.js.map +1 -1
- package/dist/esm/chains/defineChain.d.ts.map +1 -1
- package/dist/esm/chains/defineChain.js.map +1 -1
- package/dist/esm/chains/signet.js +3 -3
- package/dist/esm/chains/signet.js.map +1 -1
- package/dist/esm/clients/decorators/public.d.ts.map +1 -1
- package/dist/esm/clients/decorators/public.js.map +1 -1
- package/dist/esm/clients/decorators/wallet.d.ts.map +1 -1
- package/dist/esm/clients/decorators/wallet.js.map +1 -1
- package/dist/esm/errors/address.d.ts.map +1 -1
- package/dist/esm/errors/address.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/errors/block.js.map +1 -1
- package/dist/esm/errors/provider.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/errors/rpc.js +3 -3
- package/dist/esm/errors/rpc.js.map +1 -1
- package/dist/esm/errors/transaction.d.ts.map +1 -1
- package/dist/esm/errors/transaction.js.map +1 -1
- package/dist/esm/errors/transport.d.ts.map +1 -1
- package/dist/esm/errors/transport.js.map +1 -1
- package/dist/esm/errors/utxo.d.ts.map +1 -1
- package/dist/esm/errors/utxo.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/factories/createTransport.js.map +1 -1
- package/dist/esm/test/utils.js.map +1 -1
- package/dist/esm/transports/ankr/ankr.js.map +1 -1
- package/dist/esm/transports/ankr/getBalance.js +2 -2
- package/dist/esm/transports/ankr/getBalance.js.map +1 -1
- package/dist/esm/transports/ankr/getTransactionFee.js.map +1 -1
- package/dist/esm/transports/ankr/getTransactions.js.map +1 -1
- package/dist/esm/transports/ankr/methods.js.map +1 -1
- package/dist/esm/transports/ankr/utils.js.map +1 -1
- package/dist/esm/transports/blockchair/blockchair.js.map +1 -1
- package/dist/esm/transports/blockchair/getBalance.js +2 -2
- package/dist/esm/transports/blockchair/getBalance.js.map +1 -1
- package/dist/esm/transports/blockchair/getTransactionFee.js +2 -2
- package/dist/esm/transports/blockchair/getTransactionFee.js.map +1 -1
- package/dist/esm/transports/blockchair/getUTXOs.js +2 -2
- package/dist/esm/transports/blockchair/getUTXOs.js.map +1 -1
- package/dist/esm/transports/blockchair/getXPubAddresses.js +2 -2
- package/dist/esm/transports/blockchair/getXPubAddresses.js.map +1 -1
- package/dist/esm/transports/blockchair/methods.js.map +1 -1
- package/dist/esm/transports/blockcypher/blockcypher.js.map +1 -1
- package/dist/esm/transports/blockcypher/getBalance.js.map +1 -1
- package/dist/esm/transports/blockcypher/getTransactionFee.js.map +1 -1
- package/dist/esm/transports/blockcypher/getUTXOs.js.map +1 -1
- package/dist/esm/transports/blockcypher/methods.js.map +1 -1
- package/dist/esm/transports/blockcypher/utils.js +3 -3
- package/dist/esm/transports/blockcypher/utils.js.map +1 -1
- package/dist/esm/transports/custom.d.ts.map +1 -1
- package/dist/esm/transports/custom.js.map +1 -1
- package/dist/esm/transports/fallback.d.ts.map +1 -1
- package/dist/esm/transports/fallback.js +2 -2
- package/dist/esm/transports/fallback.js.map +1 -1
- package/dist/esm/transports/getHttpRpcClient.d.ts.map +1 -1
- package/dist/esm/transports/getHttpRpcClient.js.map +1 -1
- package/dist/esm/transports/getRpcProviderMethods.js.map +1 -1
- package/dist/esm/transports/http.d.ts.map +1 -1
- package/dist/esm/transports/http.js.map +1 -1
- package/dist/esm/transports/mempool/getBalance.js.map +1 -1
- package/dist/esm/transports/mempool/getTransactionFee.js.map +1 -1
- package/dist/esm/transports/mempool/getTransactions.js.map +1 -1
- package/dist/esm/transports/mempool/mempool.js.map +1 -1
- package/dist/esm/transports/mempool/methods.js.map +1 -1
- package/dist/esm/transports/mempool/utils.js.map +1 -1
- package/dist/esm/transports/types.d.ts.map +1 -1
- package/dist/esm/transports/types.js.map +1 -1
- package/dist/esm/transports/utxo.js.map +1 -1
- package/dist/esm/types/address.js.map +1 -1
- package/dist/esm/types/block.d.ts.map +1 -1
- package/dist/esm/types/chain.js.map +1 -1
- package/dist/esm/types/client.d.ts.map +1 -1
- package/dist/esm/types/request.d.ts.map +1 -1
- package/dist/esm/types/utils.d.ts.map +1 -1
- package/dist/esm/utils/buildRequest.d.ts.map +1 -1
- package/dist/esm/utils/buildRequest.js +4 -4
- package/dist/esm/utils/buildRequest.js.map +1 -1
- package/dist/esm/utils/cancelTransaction.js.map +1 -1
- package/dist/esm/utils/converter.js.map +1 -1
- package/dist/esm/utils/createBatchScheduler.d.ts.map +1 -1
- package/dist/esm/utils/createBatchScheduler.js +1 -1
- package/dist/esm/utils/createBatchScheduler.js.map +1 -1
- package/dist/esm/utils/deepEqual.js.map +1 -1
- package/dist/esm/utils/getAction.d.ts.map +1 -1
- package/dist/esm/utils/getAction.js.map +1 -1
- package/dist/esm/utils/getAddressInfo.js +25 -25
- package/dist/esm/utils/getAddressInfo.js.map +1 -1
- package/dist/esm/utils/idCache.js.map +1 -1
- package/dist/esm/utils/isAddress.js.map +1 -1
- package/dist/esm/utils/lru.js.map +1 -1
- package/dist/esm/utils/modifyFee.js.map +1 -1
- package/dist/esm/utils/observe.d.ts.map +1 -1
- package/dist/esm/utils/observe.js +2 -2
- package/dist/esm/utils/observe.js.map +1 -1
- package/dist/esm/utils/parseAccount.d.ts.map +1 -1
- package/dist/esm/utils/parseAccount.js.map +1 -1
- package/dist/esm/utils/poll.d.ts.map +1 -1
- package/dist/esm/utils/poll.js.map +1 -1
- package/dist/esm/utils/retryUntil.d.ts.map +1 -1
- package/dist/esm/utils/retryUntil.js.map +1 -1
- package/dist/esm/utils/sleep.js.map +1 -1
- package/dist/esm/utils/stringify.js.map +1 -1
- package/dist/esm/utils/uid.js.map +1 -1
- package/dist/esm/utils/url.js.map +1 -1
- package/dist/esm/utils/wait.js.map +1 -1
- package/dist/esm/utils/withDedupe.d.ts.map +1 -1
- package/dist/esm/utils/withDedupe.js +1 -1
- package/dist/esm/utils/withDedupe.js.map +1 -1
- package/dist/esm/utils/withResolvers.d.ts.map +1 -1
- package/dist/esm/utils/withResolvers.js.map +1 -1
- package/dist/esm/utils/withRetry.d.ts.map +1 -1
- package/dist/esm/utils/withRetry.js.map +1 -1
- 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 +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/package.json +3 -2
- package/src/version.ts +1 -1
- package/dist/cjs/transports/__mocks__/getTransactionFee.d.ts +0 -7
- package/dist/cjs/transports/__mocks__/getTransactionFee.js +0 -11
- package/dist/cjs/transports/__mocks__/getTransactionFee.js.map +0 -1
- package/dist/esm/transports/__mocks__/getTransactionFee.d.ts +0 -7
- package/dist/esm/transports/__mocks__/getTransactionFee.d.ts.map +0 -1
- package/dist/esm/transports/__mocks__/getTransactionFee.js +0 -8
- package/dist/esm/transports/__mocks__/getTransactionFee.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @bigmi/core
|
|
2
|
+
|
|
3
|
+
## 0.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#55](https://github.com/lifinance/bigmi/pull/55) [`767fb0c`](https://github.com/lifinance/bigmi/commit/767fb0cba233decea140daf1b562c104f027a261) Thanks [@chybisov](https://github.com/chybisov)! - Update the `zustand` runtime dependency to `^5.0.14`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBalance.js","names":[],"sources":["../../../src/actions/getBalance.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetBalanceParameters = {\n /** The address of the account. */\n address: string\n}\n\nexport type GetBalanceReturnType = bigint\n\nexport async function getBalance<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n params: GetBalanceParameters\n): Promise<GetBalanceReturnType> {\n const data = await client.request(\n {\n method: 'getBalance',\n params,\n },\n { dedupe: true }\n )\n\n return data\n}\n"],"mappings":";;AAaA,eAAsB,WAIpB,QACA,QAC+B;
|
|
1
|
+
{"version":3,"file":"getBalance.js","names":[],"sources":["../../../src/actions/getBalance.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetBalanceParameters = {\n /** The address of the account. */\n address: string\n}\n\nexport type GetBalanceReturnType = bigint\n\nexport async function getBalance<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n params: GetBalanceParameters\n): Promise<GetBalanceReturnType> {\n const data = await client.request(\n {\n method: 'getBalance',\n params,\n },\n { dedupe: true }\n )\n\n return data\n}\n"],"mappings":";;AAaA,eAAsB,WAIpB,QACA,QAC+B;CAS/B,OAAO,MARY,OAAO,QACxB;EACE,QAAQ;EACR;CACF,GACA,EAAE,QAAQ,KAAK,CACjB;AAGF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBlock.js","names":["BlockNotFoundError","Block"],"sources":["../../../src/actions/getBlock.ts"],"sourcesContent":["import { Block } from 'bitcoinjs-lib'\nimport { BlockNotFoundError } from '../errors/block.js'\nimport type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetBlockParameters =\n | {\n blockHash: string\n blockNumber?: never\n }\n | {\n blockHash?: never\n blockNumber: number\n }\n\nexport type GetBlockReturnType = Block\n\nexport async function getBlock<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { blockHash, blockNumber }: GetBlockParameters\n): Promise<GetBlockReturnType> {\n let blockHex: string | undefined\n try {\n let _blockHash = blockHash\n if (!_blockHash && blockNumber) {\n _blockHash = await client.request(\n {\n method: 'getblockhash',\n params: [blockNumber],\n },\n { dedupe: true }\n )\n }\n if (_blockHash) {\n blockHex = await client.request(\n {\n method: 'getblock',\n params: [_blockHash, 0],\n },\n { dedupe: true }\n )\n }\n } catch (_error) {\n throw new BlockNotFoundError({ blockHash, blockNumber } as never)\n }\n if (!blockHex) {\n throw new BlockNotFoundError({ blockHash, blockNumber } as never)\n }\n return Block.fromHex(blockHex)\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBlock.js","names":["BlockNotFoundError","Block"],"sources":["../../../src/actions/getBlock.ts"],"sourcesContent":["import { Block } from 'bitcoinjs-lib'\nimport { BlockNotFoundError } from '../errors/block.js'\nimport type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetBlockParameters =\n | {\n blockHash: string\n blockNumber?: never\n }\n | {\n blockHash?: never\n blockNumber: number\n }\n\nexport type GetBlockReturnType = Block\n\nexport async function getBlock<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { blockHash, blockNumber }: GetBlockParameters\n): Promise<GetBlockReturnType> {\n let blockHex: string | undefined\n try {\n let _blockHash = blockHash\n if (!_blockHash && blockNumber) {\n _blockHash = await client.request(\n {\n method: 'getblockhash',\n params: [blockNumber],\n },\n { dedupe: true }\n )\n }\n if (_blockHash) {\n blockHex = await client.request(\n {\n method: 'getblock',\n params: [_blockHash, 0],\n },\n { dedupe: true }\n )\n }\n } catch (_error) {\n throw new BlockNotFoundError({ blockHash, blockNumber } as never)\n }\n if (!blockHex) {\n throw new BlockNotFoundError({ blockHash, blockNumber } as never)\n }\n return Block.fromHex(blockHex)\n}\n"],"mappings":";;;;AAoBA,eAAsB,SAIpB,QACA,EAAE,WAAW,eACgB;CAC7B,IAAI;CACJ,IAAI;EACF,IAAI,aAAa;EACjB,IAAI,CAAC,cAAc,aACjB,aAAa,MAAM,OAAO,QACxB;GACE,QAAQ;GACR,QAAQ,CAAC,WAAW;EACtB,GACA,EAAE,QAAQ,KAAK,CACjB;EAEF,IAAI,YACF,WAAW,MAAM,OAAO,QACtB;GACE,QAAQ;GACR,QAAQ,CAAC,YAAY,CAAC;EACxB,GACA,EAAE,QAAQ,KAAK,CACjB;CAEJ,SAAS,QAAQ;EACf,MAAM,IAAIA,qBAAAA,mBAAmB;GAAE;GAAW;EAAY,CAAU;CAClE;CACA,IAAI,CAAC,UACH,MAAM,IAAIA,qBAAAA,mBAAmB;EAAE;EAAW;CAAY,CAAU;CAElE,OAAOC,cAAAA,MAAM,QAAQ,QAAQ;AAC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBlockCount.js","names":[],"sources":["../../../src/actions/getBlockCount.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetBlockCountReturnType = number\n\nexport async function getBlockCount<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>\n): Promise<GetBlockCountReturnType> {\n const data = await client.request(\n {\n method: 'getblockcount',\n params: [],\n },\n { dedupe: true }\n )\n return data\n}\n"],"mappings":";;AAQA,eAAsB,cAIpB,QACkC;
|
|
1
|
+
{"version":3,"file":"getBlockCount.js","names":[],"sources":["../../../src/actions/getBlockCount.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetBlockCountReturnType = number\n\nexport async function getBlockCount<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>\n): Promise<GetBlockCountReturnType> {\n const data = await client.request(\n {\n method: 'getblockcount',\n params: [],\n },\n { dedupe: true }\n )\n return data\n}\n"],"mappings":";;AAQA,eAAsB,cAIpB,QACkC;CAQlC,OAAO,MAPY,OAAO,QACxB;EACE,QAAQ;EACR,QAAQ,CAAC;CACX,GACA,EAAE,QAAQ,KAAK,CACjB;AAEF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBlockStats.js","names":["BlockNotFoundError"],"sources":["../../../src/actions/getBlockStats.ts"],"sourcesContent":["import { BlockNotFoundError } from '../errors/block.js'\nimport type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { BlockStats, BlockStatsKeys } from '../types/blockStats.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetBlockStatsParameters = (\n | {\n blockHash: string\n blockNumber?: never\n }\n | {\n blockHash?: never\n blockNumber: number\n }\n) & {\n stats?: Array<BlockStatsKeys>\n}\n\nexport type GetBlockStatsReturnType = BlockStats\n\nexport async function getBlockStats<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { blockHash, blockNumber, stats }: GetBlockStatsParameters\n): Promise<GetBlockStatsReturnType> {\n const blockHashOrNumber = blockHash || blockNumber\n if (!blockHashOrNumber) {\n throw new BlockNotFoundError({ blockHash, blockNumber } as never)\n }\n try {\n const params: [string | number, Array<BlockStatsKeys>?] = [\n blockHashOrNumber,\n ]\n if (stats) {\n params.push(stats)\n }\n const data = await client.request(\n {\n method: 'getblockstats',\n params: params,\n },\n { dedupe: true }\n )\n return data\n } catch (_error) {\n throw new BlockNotFoundError({ blockHash, blockNumber } as never)\n }\n}\n"],"mappings":";;;AAuBA,eAAsB,cAIpB,QACA,EAAE,WAAW,aAAa,SACQ;CAClC,MAAM,oBAAoB,aAAa;
|
|
1
|
+
{"version":3,"file":"getBlockStats.js","names":["BlockNotFoundError"],"sources":["../../../src/actions/getBlockStats.ts"],"sourcesContent":["import { BlockNotFoundError } from '../errors/block.js'\nimport type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { BlockStats, BlockStatsKeys } from '../types/blockStats.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetBlockStatsParameters = (\n | {\n blockHash: string\n blockNumber?: never\n }\n | {\n blockHash?: never\n blockNumber: number\n }\n) & {\n stats?: Array<BlockStatsKeys>\n}\n\nexport type GetBlockStatsReturnType = BlockStats\n\nexport async function getBlockStats<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { blockHash, blockNumber, stats }: GetBlockStatsParameters\n): Promise<GetBlockStatsReturnType> {\n const blockHashOrNumber = blockHash || blockNumber\n if (!blockHashOrNumber) {\n throw new BlockNotFoundError({ blockHash, blockNumber } as never)\n }\n try {\n const params: [string | number, Array<BlockStatsKeys>?] = [\n blockHashOrNumber,\n ]\n if (stats) {\n params.push(stats)\n }\n const data = await client.request(\n {\n method: 'getblockstats',\n params: params,\n },\n { dedupe: true }\n )\n return data\n } catch (_error) {\n throw new BlockNotFoundError({ blockHash, blockNumber } as never)\n }\n}\n"],"mappings":";;;AAuBA,eAAsB,cAIpB,QACA,EAAE,WAAW,aAAa,SACQ;CAClC,MAAM,oBAAoB,aAAa;CACvC,IAAI,CAAC,mBACH,MAAM,IAAIA,qBAAAA,mBAAmB;EAAE;EAAW;CAAY,CAAU;CAElE,IAAI;EACF,MAAM,SAAoD,CACxD,iBACF;EACA,IAAI,OACF,OAAO,KAAK,KAAK;EASnB,OAAO,MAPY,OAAO,QACxB;GACE,QAAQ;GACA;EACV,GACA,EAAE,QAAQ,KAAK,CACjB;CAEF,SAAS,QAAQ;EACf,MAAM,IAAIA,qBAAAA,mBAAmB;GAAE;GAAW;EAAY,CAAU;CAClE;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTransactionFee.js","names":[],"sources":["../../../src/actions/getTransactionFee.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetTransactionFeeParameters = {\n txId: string\n}\n\nexport type GetTransactionFeeReturnType = bigint\n\nexport async function getTransactionFee<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { txId }: GetTransactionFeeParameters\n): Promise<GetTransactionFeeReturnType> {\n const data = await client.request({\n method: 'getTransactionFee',\n params: { txId },\n })\n\n return data\n}\n"],"mappings":";;AAYA,eAAsB,kBAIpB,QACA,EAAE,QACoC;
|
|
1
|
+
{"version":3,"file":"getTransactionFee.js","names":[],"sources":["../../../src/actions/getTransactionFee.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetTransactionFeeParameters = {\n txId: string\n}\n\nexport type GetTransactionFeeReturnType = bigint\n\nexport async function getTransactionFee<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { txId }: GetTransactionFeeParameters\n): Promise<GetTransactionFeeReturnType> {\n const data = await client.request({\n method: 'getTransactionFee',\n params: { txId },\n })\n\n return data\n}\n"],"mappings":";;AAYA,eAAsB,kBAIpB,QACA,EAAE,QACoC;CAMtC,OAAO,MALY,OAAO,QAAQ;EAChC,QAAQ;EACR,QAAQ,EAAE,KAAK;CACjB,CAAC;AAGH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTransactions.js","names":[],"sources":["../../../src/actions/getTransactions.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { UTXOTransaction } from '../types/transaction.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetTransactionsParameters = {\n address: string\n offset?: number\n limit?: number\n lastBlock?: string\n afterTxId?: string\n}\n\nexport type GetTransactionsReturnType = {\n transactions: Array<Partial<UTXOTransaction>>\n total: number\n hasMore?: boolean\n}\n\nexport async function getTransactions<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { address, offset, limit, lastBlock }: GetTransactionsParameters\n): Promise<GetTransactionsReturnType> {\n const data = await client.request({\n method: 'getTransactions',\n params: {\n address,\n offset,\n limit,\n lastBlock,\n },\n })\n\n return data\n}\n"],"mappings":";;AAqBA,eAAsB,gBAIpB,QACA,EAAE,SAAS,QAAQ,OAAO,aACU;
|
|
1
|
+
{"version":3,"file":"getTransactions.js","names":[],"sources":["../../../src/actions/getTransactions.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { UTXOTransaction } from '../types/transaction.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetTransactionsParameters = {\n address: string\n offset?: number\n limit?: number\n lastBlock?: string\n afterTxId?: string\n}\n\nexport type GetTransactionsReturnType = {\n transactions: Array<Partial<UTXOTransaction>>\n total: number\n hasMore?: boolean\n}\n\nexport async function getTransactions<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { address, offset, limit, lastBlock }: GetTransactionsParameters\n): Promise<GetTransactionsReturnType> {\n const data = await client.request({\n method: 'getTransactions',\n params: {\n address,\n offset,\n limit,\n lastBlock,\n },\n })\n\n return data\n}\n"],"mappings":";;AAqBA,eAAsB,gBAIpB,QACA,EAAE,SAAS,QAAQ,OAAO,aACU;CAWpC,OAAO,MAVY,OAAO,QAAQ;EAChC,QAAQ;EACR,QAAQ;GACN;GACA;GACA;GACA;EACF;CACF,CAAC;AAGH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUTXOTransaction.js","names":["TransactionNotFoundError"],"sources":["../../../src/actions/getUTXOTransaction.ts"],"sourcesContent":["import { TransactionNotFoundError } from '../errors/transaction.js'\nimport type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { UTXOTransaction } from '../types/transaction.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetUTXOTransactionParameters = {\n /** The Id of the transaction */\n txId: string\n /** The block in which to look for the transaction */\n blockHash?: string\n}\n\nexport type GetUTXOTransactionReturnType = UTXOTransaction\n\nexport async function getUTXOTransaction<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { txId, blockHash }: GetUTXOTransactionParameters\n): Promise<GetUTXOTransactionReturnType> {\n try {\n const params: [string, boolean, string?] = [txId, true]\n if (blockHash) {\n params.push(blockHash)\n }\n const data = await client.request({\n method: 'getrawtransaction',\n params: params,\n })\n return data\n } catch (_error) {\n throw new TransactionNotFoundError({\n blockHash: blockHash as never,\n hash: txId as never,\n })\n }\n}\n"],"mappings":";;;AAiBA,eAAsB,mBAIpB,QACA,EAAE,MAAM,aAC+B;
|
|
1
|
+
{"version":3,"file":"getUTXOTransaction.js","names":["TransactionNotFoundError"],"sources":["../../../src/actions/getUTXOTransaction.ts"],"sourcesContent":["import { TransactionNotFoundError } from '../errors/transaction.js'\nimport type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { UTXOTransaction } from '../types/transaction.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetUTXOTransactionParameters = {\n /** The Id of the transaction */\n txId: string\n /** The block in which to look for the transaction */\n blockHash?: string\n}\n\nexport type GetUTXOTransactionReturnType = UTXOTransaction\n\nexport async function getUTXOTransaction<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { txId, blockHash }: GetUTXOTransactionParameters\n): Promise<GetUTXOTransactionReturnType> {\n try {\n const params: [string, boolean, string?] = [txId, true]\n if (blockHash) {\n params.push(blockHash)\n }\n const data = await client.request({\n method: 'getrawtransaction',\n params: params,\n })\n return data\n } catch (_error) {\n throw new TransactionNotFoundError({\n blockHash: blockHash as never,\n hash: txId as never,\n })\n }\n}\n"],"mappings":";;;AAiBA,eAAsB,mBAIpB,QACA,EAAE,MAAM,aAC+B;CACvC,IAAI;EACF,MAAM,SAAqC,CAAC,MAAM,IAAI;EACtD,IAAI,WACF,OAAO,KAAK,SAAS;EAMvB,OAAO,MAJY,OAAO,QAAQ;GAChC,QAAQ;GACA;EACV,CAAC;CAEH,SAAS,QAAQ;EACf,MAAM,IAAIA,2BAAAA,yBAAyB;GACtB;GACX,MAAM;EACR,CAAC;CACH;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUTXOs.js","names":[],"sources":["../../../src/actions/getUTXOs.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { UTXO } from '../types/transaction.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetUTXOsParameters = {\n address: string\n minValue?: number // get utxos add up to this value\n}\n\nexport type GetUTXOsReturnType = Array<UTXO>\n\nexport async function getUTXOs<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { address, minValue }: GetUTXOsParameters\n): Promise<GetUTXOsReturnType> {\n const data = await client.request({\n method: 'getUTXOs',\n params: {\n address,\n minValue,\n },\n })\n return data\n}\n"],"mappings":";;AAcA,eAAsB,SAIpB,QACA,EAAE,SAAS,YACkB;
|
|
1
|
+
{"version":3,"file":"getUTXOs.js","names":[],"sources":["../../../src/actions/getUTXOs.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { UTXO } from '../types/transaction.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type GetUTXOsParameters = {\n address: string\n minValue?: number // get utxos add up to this value\n}\n\nexport type GetUTXOsReturnType = Array<UTXO>\n\nexport async function getUTXOs<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { address, minValue }: GetUTXOsParameters\n): Promise<GetUTXOsReturnType> {\n const data = await client.request({\n method: 'getUTXOs',\n params: {\n address,\n minValue,\n },\n })\n return data\n}\n"],"mappings":";;AAcA,eAAsB,SAIpB,QACA,EAAE,SAAS,YACkB;CAQ7B,OAAO,MAPY,OAAO,QAAQ;EAChC,QAAQ;EACR,QAAQ;GACN;GACA;EACF;CACF,CAAC;AAEH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getXPubAddresses.js","names":[],"sources":["../../../src/actions/getXPubAddresses.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\nimport type { xPubAccount } from '../types/xpub.js'\n\nexport type GetXPubAddressesParameters = {\n /** The public key you're trying to get addresses of. */\n xPubKey: string\n}\n\nexport type GetXPubAddressesReturnType = xPubAccount\n\n/**\n * Retrieves all addresses and their balances associated with an extended public key (xPub).\n *\n * An extended public key (xPub) is a Bitcoin public key that can be used to derive multiple\n * child addresses. This action fetches all derived addresses along with their individual balances\n * and the total balance across all addresses.\n *\n * @param client - Client instance configured with UTXO transport\n * @param params - {@link GetXPubAddressesParameters}\n * @returns The xPub account data including total balance and all derived addresses. {@link GetXPubAddressesReturnType}\n *\n * @example\n * ```typescript\n * const result = await getXPubAddresses(client, {\n * xPubKey: 'xpub6CcGTthbwnbxsMRuEF3sb...'\n * })\n *\n * console.log(result.balance) // Total balance across all addresses\n * console.log(result.addresses) // Array of derived addresses with individual balances\n * ```\n */\nexport async function getXPubAddresses<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n params: GetXPubAddressesParameters\n): Promise<GetXPubAddressesReturnType> {\n const data = await client.request(\n {\n method: 'getXPubAddresses',\n params,\n },\n { dedupe: true }\n )\n\n return data\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmCA,eAAsB,iBAIpB,QACA,QACqC;
|
|
1
|
+
{"version":3,"file":"getXPubAddresses.js","names":[],"sources":["../../../src/actions/getXPubAddresses.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\nimport type { xPubAccount } from '../types/xpub.js'\n\nexport type GetXPubAddressesParameters = {\n /** The public key you're trying to get addresses of. */\n xPubKey: string\n}\n\nexport type GetXPubAddressesReturnType = xPubAccount\n\n/**\n * Retrieves all addresses and their balances associated with an extended public key (xPub).\n *\n * An extended public key (xPub) is a Bitcoin public key that can be used to derive multiple\n * child addresses. This action fetches all derived addresses along with their individual balances\n * and the total balance across all addresses.\n *\n * @param client - Client instance configured with UTXO transport\n * @param params - {@link GetXPubAddressesParameters}\n * @returns The xPub account data including total balance and all derived addresses. {@link GetXPubAddressesReturnType}\n *\n * @example\n * ```typescript\n * const result = await getXPubAddresses(client, {\n * xPubKey: 'xpub6CcGTthbwnbxsMRuEF3sb...'\n * })\n *\n * console.log(result.balance) // Total balance across all addresses\n * console.log(result.addresses) // Array of derived addresses with individual balances\n * ```\n */\nexport async function getXPubAddresses<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n params: GetXPubAddressesParameters\n): Promise<GetXPubAddressesReturnType> {\n const data = await client.request(\n {\n method: 'getXPubAddresses',\n params,\n },\n { dedupe: true }\n )\n\n return data\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmCA,eAAsB,iBAIpB,QACA,QACqC;CASrC,OAAO,MARY,OAAO,QACxB;EACE,QAAQ;EACR;CACF,GACA,EAAE,QAAQ,KAAK,CACjB;AAGF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendUTXOTransaction.js","names":[],"sources":["../../../src/actions/sendUTXOTransaction.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type SendUTXOTransactionParameters = {\n /** The hex string of the raw transaction. */\n hex: string\n /** Rejects transactions whose fee rate is higher than the specified value, expressed in BTC/kB. Set to 0 to accept any fee rate. Default = 0.10 */\n maxFeeRate?: number\n}\n\nexport type SendUTXOTransactionReturnType = string\n\nexport async function sendUTXOTransaction<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { hex, maxFeeRate }: SendUTXOTransactionParameters\n): Promise<SendUTXOTransactionReturnType> {\n const params: [string, number?] = [hex]\n if (maxFeeRate) {\n params.push(maxFeeRate)\n }\n const data = await client.request({\n method: 'sendrawtransaction',\n params: params,\n })\n return data\n}\n"],"mappings":";;AAeA,eAAsB,oBAIpB,QACA,EAAE,KAAK,cACiC;CACxC,MAAM,SAA4B,CAAC,
|
|
1
|
+
{"version":3,"file":"sendUTXOTransaction.js","names":[],"sources":["../../../src/actions/sendUTXOTransaction.ts"],"sourcesContent":["import type { UTXOSchema } from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport type SendUTXOTransactionParameters = {\n /** The hex string of the raw transaction. */\n hex: string\n /** Rejects transactions whose fee rate is higher than the specified value, expressed in BTC/kB. Set to 0 to accept any fee rate. Default = 0.10 */\n maxFeeRate?: number\n}\n\nexport type SendUTXOTransactionReturnType = string\n\nexport async function sendUTXOTransaction<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOSchema>,\n { hex, maxFeeRate }: SendUTXOTransactionParameters\n): Promise<SendUTXOTransactionReturnType> {\n const params: [string, number?] = [hex]\n if (maxFeeRate) {\n params.push(maxFeeRate)\n }\n const data = await client.request({\n method: 'sendrawtransaction',\n params: params,\n })\n return data\n}\n"],"mappings":";;AAeA,eAAsB,oBAIpB,QACA,EAAE,KAAK,cACiC;CACxC,MAAM,SAA4B,CAAC,GAAG;CACtC,IAAI,YACF,OAAO,KAAK,UAAU;CAMxB,OAAO,MAJY,OAAO,QAAQ;EAChC,QAAQ;EACA;CACV,CAAC;AAEH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signPsbt.js","names":[],"sources":["../../../src/actions/signPsbt.ts"],"sourcesContent":["import type {\n SignPsbtParameters,\n SignPsbtReturnType,\n UTXOWalletSchema,\n} from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport async function signPsbt<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOWalletSchema>,\n params: SignPsbtParameters\n): Promise<SignPsbtReturnType> {\n const data = await client.request(\n {\n method: 'signPsbt',\n params: params,\n },\n { dedupe: true }\n )\n return data\n}\n"],"mappings":";;AAUA,eAAsB,SAIpB,QACA,QAC6B;
|
|
1
|
+
{"version":3,"file":"signPsbt.js","names":[],"sources":["../../../src/actions/signPsbt.ts"],"sourcesContent":["import type {\n SignPsbtParameters,\n SignPsbtReturnType,\n UTXOWalletSchema,\n} from '../transports/types.js'\nimport type { Account } from '../types/account.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\n\nexport async function signPsbt<\n C extends Chain | undefined,\n A extends Account | undefined = Account | undefined,\n>(\n client: Client<Transport, C, A, UTXOWalletSchema>,\n params: SignPsbtParameters\n): Promise<SignPsbtReturnType> {\n const data = await client.request(\n {\n method: 'signPsbt',\n params: params,\n },\n { dedupe: true }\n )\n return data\n}\n"],"mappings":";;AAUA,eAAsB,SAIpB,QACA,QAC6B;CAQ7B,OAAO,MAPY,OAAO,QACxB;EACE,QAAQ;EACA;CACV,GACA,EAAE,QAAQ,KAAK,CACjB;AAEF"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../_virtual/_rolldown/runtime.js");
|
|
3
2
|
const require_actions_getBlock = require("./getBlock.js");
|
|
4
3
|
const require_actions_getBlockStats = require("./getBlockStats.js");
|
|
5
4
|
const require_errors_transaction = require("../errors/transaction.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForTransaction.js","names":["stringify","WaitForTransactionReceiptTimeoutError","observe","getAction","watchBlockNumber","getBlockStats","withRetry","getUTXOTransaction","TransactionReceiptNotFoundError","TransactionNotFoundError","Transaction","getBlock","address"],"sources":["../../../src/actions/waitForTransaction.ts"],"sourcesContent":["import { address, Transaction } from 'bitcoinjs-lib'\nimport {\n TransactionNotFoundError,\n TransactionReceiptNotFoundError,\n WaitForTransactionReceiptTimeoutError,\n} from '../errors/transaction.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { UTXOTransaction } from '../types/transaction.js'\nimport type { Transport } from '../types/transport.js'\nimport { getAction } from '../utils/getAction.js'\nimport { observe } from '../utils/observe.js'\nimport { stringify } from '../utils/stringify.js'\nimport { withRetry } from '../utils/withRetry.js'\nimport { getBlock } from './getBlock.js'\nimport { getBlockStats } from './getBlockStats.js'\nimport { getUTXOTransaction } from './getUTXOTransaction.js'\nimport { watchBlockNumber } from './watchBlockNumber.js'\n\nexport type ReplacementReason = 'cancelled' | 'replaced' | 'repriced'\nexport type ReplacementReturnType = {\n reason: ReplacementReason\n replacedTransaction: Transaction\n transaction: UTXOTransaction\n}\n\nexport type WaitForTransactionReceiptReturnType = UTXOTransaction\n\nexport type WithRetryParameters = {\n // The delay (in ms) between retries.\n delay?:\n | ((config: { count: number; error: Error }) => number)\n | number\n | undefined\n // The max number of times to retry.\n retryCount?: number | undefined\n}\n\nexport type WaitForTransactionReceiptParameters = {\n /** The Id of the transaction. */\n txId: string\n /** The hex string of the raw transaction. */\n txHex: string\n /** The sender address of the transaction. */\n senderAddress?: string\n /**\n * The number of confirmations (blocks that have passed) to wait before resolving.\n * @default 1\n */\n confirmations?: number | undefined\n /** Optional callback to emit if the transaction has been replaced. */\n onReplaced?: ((response: ReplacementReturnType) => void) | undefined\n /**\n * Polling frequency (in ms). Defaults to the client's pollingInterval config.\n * @default client.pollingInterval\n */\n pollingInterval?: number | undefined\n /**\n * Number of times to retry if the transaction or block is not found.\n * @default 6 (exponential backoff)\n */\n retryCount?: number\n /**\n * Time to wait (in ms) between retries.\n */\n retryDelay?: ((config: { count: number; error: Error }) => number) | number\n /** Optional timeout (in milliseconds) to wait before stopping polling. */\n timeout?: number | undefined\n}\n\n/**\n * Waits for the transaction to be included on a block (one confirmation), and then returns the transaction.\n * - JSON-RPC Methods:\n * - Polls getrawtransaction on each block until it has been processed.\n * - If a transaction has been replaced:\n * - Calls getblock and extracts the transactions\n * - Checks if one of the transactions is a replacement\n * - If so, calls getrawtransaction.\n *\n * The `waitForTransaction` action additionally supports replacement detection (e.g. RBF - transactions replaced-by-fee ).\n *\n * Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel).\n * https://bitcoinops.org/en/topics/replace-by-fee/\n *\n * There are 3 types of Transaction Replacement reasons:\n *\n * - `repriced`: The fee has been modified (e.g. same outputs, different amounts)\n * - `cancelled`: The Transaction has been cancelled (e.g. output is sender address)\n * - `replaced`: The Transaction has been replaced (e.g. different outputs)\n * @param client - Client to use\n * @param parameters - {@link WaitForTransactionReceiptParameters}\n * @returns The UTXO transaction. {@link WaitForTransactionReceiptReturnType}\n */\nexport async function waitForTransaction<chain extends Chain | undefined>(\n client: Client<Transport, chain>,\n {\n confirmations = 1,\n txId,\n txHex,\n senderAddress,\n onReplaced,\n pollingInterval = client.pollingInterval,\n retryCount = 10,\n retryDelay = 3_000,\n timeout,\n }: WaitForTransactionReceiptParameters\n): Promise<WaitForTransactionReceiptReturnType> {\n const observerId = stringify(['waitForTransaction', client.uid, txId])\n\n let count = 0\n let transaction: UTXOTransaction | undefined\n let replacedTransaction: Transaction | undefined\n let retrying = false\n\n return new Promise((resolve, reject) => {\n if (timeout) {\n setTimeout(\n () =>\n reject(\n new WaitForTransactionReceiptTimeoutError({ hash: txId as never })\n ),\n timeout\n )\n }\n\n const _unobserve = observe(\n observerId,\n { onReplaced, resolve, reject },\n (emit) => {\n const _unwatch = getAction(\n client,\n watchBlockNumber,\n 'watchBlockNumber'\n )({\n emitMissed: true,\n emitOnBegin: true,\n pollingInterval,\n async onBlockNumber(blockNumber_) {\n const done = (fn: () => void) => {\n _unwatch()\n fn()\n _unobserve()\n }\n\n let blockNumber = blockNumber_\n\n if (retrying) {\n return\n }\n if (count > retryCount) {\n done(() =>\n emit.reject(\n new WaitForTransactionReceiptTimeoutError({\n hash: txId as never,\n })\n )\n )\n }\n\n try {\n // If we already have a valid receipt, let's check if we have enough\n // confirmations. If we do, then we can resolve.\n if (transaction?.blockhash) {\n const blockStats = await getAction(\n client,\n getBlockStats,\n 'getBlockStats'\n )({\n blockHash: transaction.blockhash,\n stats: ['height'],\n })\n if (\n confirmations > 1 &&\n (!blockStats.height ||\n blockNumber - blockStats.height + 1 < confirmations)\n ) {\n return\n }\n done(() => emit.resolve(transaction!))\n return\n }\n\n // Get the transaction to check if it's been replaced.\n // We need to retry as some RPC Providers may be slow to sync\n // up mined transactions.\n retrying = true\n transaction = await withRetry(\n () =>\n getAction(\n client,\n getUTXOTransaction,\n 'getUTXOTransaction'\n // If transaction exists it might be the replaced one with different txId\n )({ txId: transaction?.txid || txId }),\n {\n delay: retryDelay,\n retryCount,\n }\n )\n if (transaction.blockhash) {\n const blockStats = await getAction(\n client,\n getBlockStats,\n 'getBlockStats'\n )({\n blockHash: transaction.blockhash,\n stats: ['height'],\n })\n if (blockStats.height) {\n blockNumber = blockStats.height\n }\n }\n retrying = false\n\n // Check if transaction has been processed.\n if (!transaction?.confirmations) {\n throw new TransactionReceiptNotFoundError({\n hash: txId as never,\n })\n }\n\n // Check if we have enough confirmations. If not, continue polling.\n if (transaction.confirmations < confirmations) {\n return\n }\n\n done(() => emit.resolve(transaction!))\n } catch (err) {\n // If the receipt is not found, the transaction will be pending.\n // We need to check if it has potentially been replaced.\n if (\n err instanceof TransactionNotFoundError ||\n err instanceof TransactionReceiptNotFoundError\n ) {\n try {\n replacedTransaction = Transaction.fromHex(\n transaction?.hex || txHex\n )\n\n // Let's retrieve the transactions from the current block.\n // We need to retry as some RPC Providers may be slow to sync\n // up mined blocks.\n retrying = true\n const block = await withRetry(\n () =>\n getAction(\n client,\n getBlock,\n 'getBlock'\n )({\n blockNumber,\n }),\n {\n delay: retryDelay,\n retryCount,\n // shouldRetry: ({ error }) =>\n // error instanceof BlockNotFoundError,\n }\n )\n retrying = false\n\n // Create a set of input identifiers for mempool transaction\n const replacedTransactionInputs = new Set<string>()\n\n for (const input of replacedTransaction.ins) {\n const txid = Array.from(input.hash)\n .reverse()\n .map((byte) => `00${byte.toString(16)}`.slice(-2))\n .join('')\n const vout = input.index\n const inputId = `${txid}:${vout}`\n replacedTransactionInputs.add(inputId)\n }\n\n let replacementTransaction: Transaction | undefined\n\n for (const tx of block.transactions!) {\n if (tx.isCoinbase()) {\n continue\n }\n\n // Check if any input of this transaction matches an input of mempool transaction\n for (const input of tx.ins) {\n const txid = Array.from(input.hash)\n .reverse()\n .map((byte) => `00${byte.toString(16)}`.slice(-2))\n .join('')\n const vout = input.index\n const inputId = `${txid}:${vout}`\n if (replacedTransactionInputs.has(inputId)) {\n replacementTransaction = tx\n break\n }\n }\n if (replacementTransaction) {\n break\n }\n }\n\n // If we couldn't find a replacement transaction, continue polling.\n if (!replacementTransaction) {\n return\n }\n\n // If we found a replacement transaction, return it's receipt.\n transaction = await getAction(\n client,\n getUTXOTransaction,\n 'getUTXOTransaction'\n )({\n txId: replacementTransaction.getId(),\n })\n\n // Check if we have enough confirmations. If not, continue polling.\n if (\n transaction.confirmations &&\n transaction.confirmations < confirmations\n ) {\n return\n }\n\n let reason: ReplacementReason = 'replaced'\n\n // Function to get output addresses\n function getOutputAddresses(tx: Transaction): string[] {\n const addresses: string[] = []\n for (const output of tx.outs) {\n try {\n const outputAddress = address.fromOutputScript(\n output.script\n )\n addresses.push(outputAddress)\n } catch (_e) {\n // Handle non-standard scripts (e.g., OP_RETURN)\n }\n }\n return addresses\n }\n\n // Get the recipient addresses from the original transaction\n const originalOutputAddresses =\n getOutputAddresses(replacedTransaction)\n\n // Get the recipient addresses from the replacement transaction\n const replacementOutputAddresses = getOutputAddresses(\n replacementTransaction\n )\n\n if (\n originalOutputAddresses.length ===\n replacementOutputAddresses.length &&\n originalOutputAddresses.every((address) =>\n replacementOutputAddresses.includes(address)\n )\n ) {\n reason = 'repriced'\n } else if (\n senderAddress &&\n replacementOutputAddresses.length === 1 &&\n replacementOutputAddresses.includes(senderAddress)\n ) {\n reason = 'cancelled'\n }\n\n done(() => {\n emit.onReplaced?.({\n reason,\n replacedTransaction: replacedTransaction!,\n transaction: transaction!,\n })\n emit.resolve(transaction!)\n })\n } catch (err_) {\n done(() => emit.reject(err_))\n }\n } else {\n done(() => emit.reject(err))\n }\n } finally {\n count++\n }\n },\n })\n }\n )\n })\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"waitForTransaction.js","names":["stringify","WaitForTransactionReceiptTimeoutError","observe","getAction","watchBlockNumber","getBlockStats","withRetry","getUTXOTransaction","TransactionReceiptNotFoundError","TransactionNotFoundError","Transaction","getBlock","address"],"sources":["../../../src/actions/waitForTransaction.ts"],"sourcesContent":["import { address, Transaction } from 'bitcoinjs-lib'\nimport {\n TransactionNotFoundError,\n TransactionReceiptNotFoundError,\n WaitForTransactionReceiptTimeoutError,\n} from '../errors/transaction.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { UTXOTransaction } from '../types/transaction.js'\nimport type { Transport } from '../types/transport.js'\nimport { getAction } from '../utils/getAction.js'\nimport { observe } from '../utils/observe.js'\nimport { stringify } from '../utils/stringify.js'\nimport { withRetry } from '../utils/withRetry.js'\nimport { getBlock } from './getBlock.js'\nimport { getBlockStats } from './getBlockStats.js'\nimport { getUTXOTransaction } from './getUTXOTransaction.js'\nimport { watchBlockNumber } from './watchBlockNumber.js'\n\nexport type ReplacementReason = 'cancelled' | 'replaced' | 'repriced'\nexport type ReplacementReturnType = {\n reason: ReplacementReason\n replacedTransaction: Transaction\n transaction: UTXOTransaction\n}\n\nexport type WaitForTransactionReceiptReturnType = UTXOTransaction\n\nexport type WithRetryParameters = {\n // The delay (in ms) between retries.\n delay?:\n | ((config: { count: number; error: Error }) => number)\n | number\n | undefined\n // The max number of times to retry.\n retryCount?: number | undefined\n}\n\nexport type WaitForTransactionReceiptParameters = {\n /** The Id of the transaction. */\n txId: string\n /** The hex string of the raw transaction. */\n txHex: string\n /** The sender address of the transaction. */\n senderAddress?: string\n /**\n * The number of confirmations (blocks that have passed) to wait before resolving.\n * @default 1\n */\n confirmations?: number | undefined\n /** Optional callback to emit if the transaction has been replaced. */\n onReplaced?: ((response: ReplacementReturnType) => void) | undefined\n /**\n * Polling frequency (in ms). Defaults to the client's pollingInterval config.\n * @default client.pollingInterval\n */\n pollingInterval?: number | undefined\n /**\n * Number of times to retry if the transaction or block is not found.\n * @default 6 (exponential backoff)\n */\n retryCount?: number\n /**\n * Time to wait (in ms) between retries.\n */\n retryDelay?: ((config: { count: number; error: Error }) => number) | number\n /** Optional timeout (in milliseconds) to wait before stopping polling. */\n timeout?: number | undefined\n}\n\n/**\n * Waits for the transaction to be included on a block (one confirmation), and then returns the transaction.\n * - JSON-RPC Methods:\n * - Polls getrawtransaction on each block until it has been processed.\n * - If a transaction has been replaced:\n * - Calls getblock and extracts the transactions\n * - Checks if one of the transactions is a replacement\n * - If so, calls getrawtransaction.\n *\n * The `waitForTransaction` action additionally supports replacement detection (e.g. RBF - transactions replaced-by-fee ).\n *\n * Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel).\n * https://bitcoinops.org/en/topics/replace-by-fee/\n *\n * There are 3 types of Transaction Replacement reasons:\n *\n * - `repriced`: The fee has been modified (e.g. same outputs, different amounts)\n * - `cancelled`: The Transaction has been cancelled (e.g. output is sender address)\n * - `replaced`: The Transaction has been replaced (e.g. different outputs)\n * @param client - Client to use\n * @param parameters - {@link WaitForTransactionReceiptParameters}\n * @returns The UTXO transaction. {@link WaitForTransactionReceiptReturnType}\n */\nexport async function waitForTransaction<chain extends Chain | undefined>(\n client: Client<Transport, chain>,\n {\n confirmations = 1,\n txId,\n txHex,\n senderAddress,\n onReplaced,\n pollingInterval = client.pollingInterval,\n retryCount = 10,\n retryDelay = 3_000,\n timeout,\n }: WaitForTransactionReceiptParameters\n): Promise<WaitForTransactionReceiptReturnType> {\n const observerId = stringify(['waitForTransaction', client.uid, txId])\n\n let count = 0\n let transaction: UTXOTransaction | undefined\n let replacedTransaction: Transaction | undefined\n let retrying = false\n\n return new Promise((resolve, reject) => {\n if (timeout) {\n setTimeout(\n () =>\n reject(\n new WaitForTransactionReceiptTimeoutError({ hash: txId as never })\n ),\n timeout\n )\n }\n\n const _unobserve = observe(\n observerId,\n { onReplaced, resolve, reject },\n (emit) => {\n const _unwatch = getAction(\n client,\n watchBlockNumber,\n 'watchBlockNumber'\n )({\n emitMissed: true,\n emitOnBegin: true,\n pollingInterval,\n async onBlockNumber(blockNumber_) {\n const done = (fn: () => void) => {\n _unwatch()\n fn()\n _unobserve()\n }\n\n let blockNumber = blockNumber_\n\n if (retrying) {\n return\n }\n if (count > retryCount) {\n done(() =>\n emit.reject(\n new WaitForTransactionReceiptTimeoutError({\n hash: txId as never,\n })\n )\n )\n }\n\n try {\n // If we already have a valid receipt, let's check if we have enough\n // confirmations. If we do, then we can resolve.\n if (transaction?.blockhash) {\n const blockStats = await getAction(\n client,\n getBlockStats,\n 'getBlockStats'\n )({\n blockHash: transaction.blockhash,\n stats: ['height'],\n })\n if (\n confirmations > 1 &&\n (!blockStats.height ||\n blockNumber - blockStats.height + 1 < confirmations)\n ) {\n return\n }\n done(() => emit.resolve(transaction!))\n return\n }\n\n // Get the transaction to check if it's been replaced.\n // We need to retry as some RPC Providers may be slow to sync\n // up mined transactions.\n retrying = true\n transaction = await withRetry(\n () =>\n getAction(\n client,\n getUTXOTransaction,\n 'getUTXOTransaction'\n // If transaction exists it might be the replaced one with different txId\n )({ txId: transaction?.txid || txId }),\n {\n delay: retryDelay,\n retryCount,\n }\n )\n if (transaction.blockhash) {\n const blockStats = await getAction(\n client,\n getBlockStats,\n 'getBlockStats'\n )({\n blockHash: transaction.blockhash,\n stats: ['height'],\n })\n if (blockStats.height) {\n blockNumber = blockStats.height\n }\n }\n retrying = false\n\n // Check if transaction has been processed.\n if (!transaction?.confirmations) {\n throw new TransactionReceiptNotFoundError({\n hash: txId as never,\n })\n }\n\n // Check if we have enough confirmations. If not, continue polling.\n if (transaction.confirmations < confirmations) {\n return\n }\n\n done(() => emit.resolve(transaction!))\n } catch (err) {\n // If the receipt is not found, the transaction will be pending.\n // We need to check if it has potentially been replaced.\n if (\n err instanceof TransactionNotFoundError ||\n err instanceof TransactionReceiptNotFoundError\n ) {\n try {\n replacedTransaction = Transaction.fromHex(\n transaction?.hex || txHex\n )\n\n // Let's retrieve the transactions from the current block.\n // We need to retry as some RPC Providers may be slow to sync\n // up mined blocks.\n retrying = true\n const block = await withRetry(\n () =>\n getAction(\n client,\n getBlock,\n 'getBlock'\n )({\n blockNumber,\n }),\n {\n delay: retryDelay,\n retryCount,\n // shouldRetry: ({ error }) =>\n // error instanceof BlockNotFoundError,\n }\n )\n retrying = false\n\n // Create a set of input identifiers for mempool transaction\n const replacedTransactionInputs = new Set<string>()\n\n for (const input of replacedTransaction.ins) {\n const txid = Array.from(input.hash)\n .reverse()\n .map((byte) => `00${byte.toString(16)}`.slice(-2))\n .join('')\n const vout = input.index\n const inputId = `${txid}:${vout}`\n replacedTransactionInputs.add(inputId)\n }\n\n let replacementTransaction: Transaction | undefined\n\n for (const tx of block.transactions!) {\n if (tx.isCoinbase()) {\n continue\n }\n\n // Check if any input of this transaction matches an input of mempool transaction\n for (const input of tx.ins) {\n const txid = Array.from(input.hash)\n .reverse()\n .map((byte) => `00${byte.toString(16)}`.slice(-2))\n .join('')\n const vout = input.index\n const inputId = `${txid}:${vout}`\n if (replacedTransactionInputs.has(inputId)) {\n replacementTransaction = tx\n break\n }\n }\n if (replacementTransaction) {\n break\n }\n }\n\n // If we couldn't find a replacement transaction, continue polling.\n if (!replacementTransaction) {\n return\n }\n\n // If we found a replacement transaction, return it's receipt.\n transaction = await getAction(\n client,\n getUTXOTransaction,\n 'getUTXOTransaction'\n )({\n txId: replacementTransaction.getId(),\n })\n\n // Check if we have enough confirmations. If not, continue polling.\n if (\n transaction.confirmations &&\n transaction.confirmations < confirmations\n ) {\n return\n }\n\n let reason: ReplacementReason = 'replaced'\n\n // Function to get output addresses\n function getOutputAddresses(tx: Transaction): string[] {\n const addresses: string[] = []\n for (const output of tx.outs) {\n try {\n const outputAddress = address.fromOutputScript(\n output.script\n )\n addresses.push(outputAddress)\n } catch (_e) {\n // Handle non-standard scripts (e.g., OP_RETURN)\n }\n }\n return addresses\n }\n\n // Get the recipient addresses from the original transaction\n const originalOutputAddresses =\n getOutputAddresses(replacedTransaction)\n\n // Get the recipient addresses from the replacement transaction\n const replacementOutputAddresses = getOutputAddresses(\n replacementTransaction\n )\n\n if (\n originalOutputAddresses.length ===\n replacementOutputAddresses.length &&\n originalOutputAddresses.every((address) =>\n replacementOutputAddresses.includes(address)\n )\n ) {\n reason = 'repriced'\n } else if (\n senderAddress &&\n replacementOutputAddresses.length === 1 &&\n replacementOutputAddresses.includes(senderAddress)\n ) {\n reason = 'cancelled'\n }\n\n done(() => {\n emit.onReplaced?.({\n reason,\n replacedTransaction: replacedTransaction!,\n transaction: transaction!,\n })\n emit.resolve(transaction!)\n })\n } catch (err_) {\n done(() => emit.reject(err_))\n }\n } else {\n done(() => emit.reject(err))\n }\n } finally {\n count++\n }\n },\n })\n }\n )\n })\n}\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchBlockNumber.js","names":["observe","stringify","poll","getAction","getBlockCount"],"sources":["../../../src/actions/watchBlockNumber.ts"],"sourcesContent":["import type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\nimport { getAction } from '../utils/getAction.js'\nimport { observe } from '../utils/observe.js'\nimport { poll } from '../utils/poll.js'\nimport { stringify } from '../utils/stringify.js'\nimport { type GetBlockCountReturnType, getBlockCount } from './getBlockCount.js'\n\nexport type OnBlockNumberParameter = GetBlockCountReturnType\nexport type OnBlockNumberFn = (\n blockNumber: OnBlockNumberParameter,\n prevBlockNumber: OnBlockNumberParameter | undefined\n) => Promise<void>\n\nexport type WatchBlockNumberParameters = {\n /** The callback to call when a new block number is received. */\n onBlockNumber: OnBlockNumberFn\n /** The callback to call when an error occurred when trying to get for a new block. */\n onError?: ((error: Error) => void) | undefined\n} & {\n /** Whether or not to emit the missed block numbers to the callback. */\n emitMissed?: boolean | undefined\n /** Whether or not to emit the latest block number to the callback when the subscription opens. */\n emitOnBegin?: boolean | undefined\n /** Polling frequency (in ms). Defaults to Client's pollingInterval config. */\n pollingInterval?: number | undefined\n}\n\nexport type WatchBlockNumberReturnType = () => void\n\n/**\n * Watches and returns incoming block numbers.\n * @param client - Client to use\n * @param parameters - {@link WatchBlockNumberParameters}\n * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlockNumberReturnType}\n */\nexport function watchBlockNumber<\n chain extends Chain | undefined,\n transport extends Transport,\n>(\n client: Client<transport, chain>,\n {\n emitOnBegin = false,\n emitMissed = false,\n onBlockNumber,\n onError,\n pollingInterval = client.pollingInterval,\n }: WatchBlockNumberParameters\n): WatchBlockNumberReturnType {\n let prevBlockNumber: GetBlockCountReturnType | undefined\n\n const observerId = stringify([\n 'watchBlockNumber',\n client.uid,\n emitOnBegin,\n emitMissed,\n pollingInterval,\n ])\n\n // TODO (edge cases):\n // 1) Stop iterating block numbers if we are happy with the result of one onBlockNumber execution but there is more in the queue.\n // 2) If we missed some time - user closed the page and came back when the block is already mined.\n // In this case we probably want to save the block when we send the transaction and track the currently checked blocks until we find the relevant one.\n return observe(observerId, { onBlockNumber, onError }, (emit) =>\n poll(\n async () => {\n try {\n const blockNumber = await getAction(\n client,\n getBlockCount,\n 'getBlockCount'\n )({ cacheTime: 0 })\n\n if (prevBlockNumber) {\n // If the current block number is the same as the previous,\n // we can skip.\n if (blockNumber === prevBlockNumber) {\n return\n }\n\n // If we have missed out on some previous blocks, and the\n // `emitMissed` flag is truthy, let's emit those blocks.\n if (blockNumber - prevBlockNumber > 1 && emitMissed) {\n for (let i = prevBlockNumber + 1; i < blockNumber; i++) {\n await emit.onBlockNumber(i, prevBlockNumber)\n prevBlockNumber = i\n }\n }\n }\n\n // If the next block number is greater than the previous,\n // it is not in the past, and we can emit the new block number.\n if (!prevBlockNumber || blockNumber > prevBlockNumber) {\n await emit.onBlockNumber(blockNumber, prevBlockNumber)\n prevBlockNumber = blockNumber\n }\n } catch (err) {\n emit.onError?.(err as Error)\n }\n },\n {\n emitOnBegin,\n interval: pollingInterval,\n }\n )\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAqCA,SAAgB,iBAId,QACA,EACE,cAAc,OACd,aAAa,OACb,eACA,SACA,kBAAkB,OAAO,mBAEC;CAC5B,IAAI;
|
|
1
|
+
{"version":3,"file":"watchBlockNumber.js","names":["observe","stringify","poll","getAction","getBlockCount"],"sources":["../../../src/actions/watchBlockNumber.ts"],"sourcesContent":["import type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\nimport { getAction } from '../utils/getAction.js'\nimport { observe } from '../utils/observe.js'\nimport { poll } from '../utils/poll.js'\nimport { stringify } from '../utils/stringify.js'\nimport { type GetBlockCountReturnType, getBlockCount } from './getBlockCount.js'\n\nexport type OnBlockNumberParameter = GetBlockCountReturnType\nexport type OnBlockNumberFn = (\n blockNumber: OnBlockNumberParameter,\n prevBlockNumber: OnBlockNumberParameter | undefined\n) => Promise<void>\n\nexport type WatchBlockNumberParameters = {\n /** The callback to call when a new block number is received. */\n onBlockNumber: OnBlockNumberFn\n /** The callback to call when an error occurred when trying to get for a new block. */\n onError?: ((error: Error) => void) | undefined\n} & {\n /** Whether or not to emit the missed block numbers to the callback. */\n emitMissed?: boolean | undefined\n /** Whether or not to emit the latest block number to the callback when the subscription opens. */\n emitOnBegin?: boolean | undefined\n /** Polling frequency (in ms). Defaults to Client's pollingInterval config. */\n pollingInterval?: number | undefined\n}\n\nexport type WatchBlockNumberReturnType = () => void\n\n/**\n * Watches and returns incoming block numbers.\n * @param client - Client to use\n * @param parameters - {@link WatchBlockNumberParameters}\n * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlockNumberReturnType}\n */\nexport function watchBlockNumber<\n chain extends Chain | undefined,\n transport extends Transport,\n>(\n client: Client<transport, chain>,\n {\n emitOnBegin = false,\n emitMissed = false,\n onBlockNumber,\n onError,\n pollingInterval = client.pollingInterval,\n }: WatchBlockNumberParameters\n): WatchBlockNumberReturnType {\n let prevBlockNumber: GetBlockCountReturnType | undefined\n\n const observerId = stringify([\n 'watchBlockNumber',\n client.uid,\n emitOnBegin,\n emitMissed,\n pollingInterval,\n ])\n\n // TODO (edge cases):\n // 1) Stop iterating block numbers if we are happy with the result of one onBlockNumber execution but there is more in the queue.\n // 2) If we missed some time - user closed the page and came back when the block is already mined.\n // In this case we probably want to save the block when we send the transaction and track the currently checked blocks until we find the relevant one.\n return observe(observerId, { onBlockNumber, onError }, (emit) =>\n poll(\n async () => {\n try {\n const blockNumber = await getAction(\n client,\n getBlockCount,\n 'getBlockCount'\n )({ cacheTime: 0 })\n\n if (prevBlockNumber) {\n // If the current block number is the same as the previous,\n // we can skip.\n if (blockNumber === prevBlockNumber) {\n return\n }\n\n // If we have missed out on some previous blocks, and the\n // `emitMissed` flag is truthy, let's emit those blocks.\n if (blockNumber - prevBlockNumber > 1 && emitMissed) {\n for (let i = prevBlockNumber + 1; i < blockNumber; i++) {\n await emit.onBlockNumber(i, prevBlockNumber)\n prevBlockNumber = i\n }\n }\n }\n\n // If the next block number is greater than the previous,\n // it is not in the past, and we can emit the new block number.\n if (!prevBlockNumber || blockNumber > prevBlockNumber) {\n await emit.onBlockNumber(blockNumber, prevBlockNumber)\n prevBlockNumber = blockNumber\n }\n } catch (err) {\n emit.onError?.(err as Error)\n }\n },\n {\n emitOnBegin,\n interval: pollingInterval,\n }\n )\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAqCA,SAAgB,iBAId,QACA,EACE,cAAc,OACd,aAAa,OACb,eACA,SACA,kBAAkB,OAAO,mBAEC;CAC5B,IAAI;CAcJ,OAAOA,sBAAAA,QAZYC,wBAAAA,UAAU;EAC3B;EACA,OAAO;EACP;EACA;EACA;CACF,CAMwB,GAAG;EAAE;EAAe;CAAQ,IAAI,SACtDC,mBAAAA,KACE,YAAY;EACV,IAAI;GACF,MAAM,cAAc,MAAMC,wBAAAA,UACxB,QACAC,8BAAAA,eACA,eACF,EAAE,EAAE,WAAW,EAAE,CAAC;GAElB,IAAI,iBAAiB;IAGnB,IAAI,gBAAgB,iBAClB;IAKF,IAAI,cAAc,kBAAkB,KAAK,YACvC,KAAK,IAAI,IAAI,kBAAkB,GAAG,IAAI,aAAa,KAAK;KACtD,MAAM,KAAK,cAAc,GAAG,eAAe;KAC3C,kBAAkB;IACpB;GAEJ;GAIA,IAAI,CAAC,mBAAmB,cAAc,iBAAiB;IACrD,MAAM,KAAK,cAAc,aAAa,eAAe;IACrD,kBAAkB;GACpB;EACF,SAAS,KAAK;GACZ,KAAK,UAAU,GAAY;EAC7B;CACF,GACA;EACE;EACA,UAAU;CACZ,CACF,CACF;AACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
require("../types/chain.js");
|
|
3
3
|
//#region src/chains/bitcoin.ts
|
|
4
|
-
const bitcoin =
|
|
5
|
-
id:
|
|
4
|
+
const bitcoin = /*#__PURE__*/ require("./defineChain.js").defineChain({
|
|
5
|
+
id: "bitcoin:mainnet",
|
|
6
6
|
name: "Bitcoin",
|
|
7
7
|
nativeCurrency: {
|
|
8
8
|
name: "Bitcoin",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitcoin.js","names":[
|
|
1
|
+
{"version":3,"file":"bitcoin.js","names":[],"sources":["../../../src/chains/bitcoin.ts"],"sourcesContent":["import type { Chain } from '../types/chain.js'\nimport { ChainId } from '../types/chain.js'\nimport { defineChain } from './defineChain.js'\n\nexport const bitcoin: Chain = /*#__PURE__*/ defineChain({\n id: ChainId.BITCOIN_MAINNET,\n name: 'Bitcoin',\n nativeCurrency: { name: 'Bitcoin', symbol: 'BTC', decimals: 8 },\n rpcUrls: {\n default: {\n http: ['https://node-router.thorswap.net/bitcoin'],\n },\n },\n blockExplorers: {\n default: {\n name: 'Mempool',\n url: 'https://mempool.space/',\n },\n },\n})\n"],"mappings":";;;AAIA,MAAa,UAA+B,wCAAA,EAAA,YAAY;CACtD,IAAA;CACA,MAAM;CACN,gBAAgB;EAAE,MAAM;EAAW,QAAQ;EAAO,UAAU;CAAE;CAC9D,SAAS,EACP,SAAS,EACP,MAAM,CAAC,0CAA0C,EACnD,EACF;CACA,gBAAgB,EACd,SAAS;EACP,MAAM;EACN,KAAK;CACP,EACF;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineChain.js","names":[],"sources":["../../../src/chains/defineChain.ts"],"sourcesContent":["import type { Chain, ChainFormatters } from '../types/chain.js'\nimport type { Assign, Prettify } from '../types/utils.js'\n\nexport function defineChain<\n formatters extends ChainFormatters,\n const chain extends Chain<formatters>,\n>(chain: chain): Prettify<Assign<Chain<undefined>, chain>> {\n return {\n formatters: undefined,\n fees: undefined,\n serializers: undefined,\n ...chain,\n } as Assign<Chain<undefined>, chain>\n}\n"],"mappings":";;AAGA,SAAgB,YAGd,OAAyD;
|
|
1
|
+
{"version":3,"file":"defineChain.js","names":[],"sources":["../../../src/chains/defineChain.ts"],"sourcesContent":["import type { Chain, ChainFormatters } from '../types/chain.js'\nimport type { Assign, Prettify } from '../types/utils.js'\n\nexport function defineChain<\n formatters extends ChainFormatters,\n const chain extends Chain<formatters>,\n>(chain: chain): Prettify<Assign<Chain<undefined>, chain>> {\n return {\n formatters: undefined,\n fees: undefined,\n serializers: undefined,\n ...chain,\n } as Assign<Chain<undefined>, chain>\n}\n"],"mappings":";;AAGA,SAAgB,YAGd,OAAyD;CACzD,OAAO;EACL,YAAY,KAAA;EACZ,MAAM,KAAA;EACN,aAAa,KAAA;EACb,GAAG;CACL;AACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
require("../types/chain.js");
|
|
3
3
|
//#region src/chains/signet.ts
|
|
4
|
-
const bitcoinSignet =
|
|
5
|
-
id:
|
|
4
|
+
const bitcoinSignet = /*#__PURE__*/ require("./defineChain.js").defineChain({
|
|
5
|
+
id: "bitcoin:signet",
|
|
6
6
|
name: "Bitcoin Signet",
|
|
7
7
|
nativeCurrency: {
|
|
8
8
|
name: "Bitcoin",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet.js","names":[
|
|
1
|
+
{"version":3,"file":"signet.js","names":[],"sources":["../../../src/chains/signet.ts"],"sourcesContent":["import type { Chain } from '../types/chain.js'\nimport { ChainId } from '../types/chain.js'\nimport { defineChain } from './defineChain.js'\n\nexport const bitcoinSignet: Chain = /*#__PURE__*/ defineChain({\n id: ChainId.BITCOIN_SIGNET,\n name: 'Bitcoin Signet',\n nativeCurrency: { name: 'Bitcoin', symbol: 'BTC', decimals: 8 },\n rpcUrls: {\n default: {\n http: [\n 'https://rpc.ankr.com/btc_signet/c58ee1c627c5ad7cd69197c352aa51bdcebd87b86e0363c1e5133d5735cb3c69',\n ],\n },\n },\n blockExplorers: {\n default: {\n name: 'Mempool',\n url: 'https://mempool.space/signet',\n },\n },\n testnet: true,\n})\n"],"mappings":";;;AAIA,MAAa,gBAAqC,wCAAA,EAAA,YAAY;CAC5D,IAAA;CACA,MAAM;CACN,gBAAgB;EAAE,MAAM;EAAW,QAAQ;EAAO,UAAU;CAAE;CAC9D,SAAS,EACP,SAAS,EACP,MAAM,CACJ,kGACF,EACF,EACF;CACA,gBAAgB,EACd,SAAS;EACP,MAAM;EACN,KAAK;CACP,EACF;CACA,SAAS;AACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","names":["getBalance","getBlock","getBlockCount","getBlockStats","getTransactions","getUTXOTransaction","getUTXOs","getTransactionFee"],"sources":["../../../../src/clients/decorators/public.ts"],"sourcesContent":["import {\n type GetBalanceParameters,\n type GetBalanceReturnType,\n getBalance,\n} from '../../actions/getBalance.js'\nimport {\n type GetBlockParameters,\n type GetBlockReturnType,\n getBlock,\n} from '../../actions/getBlock.js'\nimport {\n type GetBlockCountReturnType,\n getBlockCount,\n} from '../../actions/getBlockCount.js'\nimport {\n type GetBlockStatsParameters,\n type GetBlockStatsReturnType,\n getBlockStats,\n} from '../../actions/getBlockStats.js'\nimport {\n type GetTransactionFeeParameters,\n type GetTransactionFeeReturnType,\n getTransactionFee,\n} from '../../actions/getTransactionFee.js'\nimport {\n type GetTransactionsParameters,\n type GetTransactionsReturnType,\n getTransactions,\n} from '../../actions/getTransactions.js'\nimport {\n type GetUTXOsParameters,\n type GetUTXOsReturnType,\n getUTXOs,\n} from '../../actions/getUTXOs.js'\nimport {\n type GetUTXOTransactionParameters,\n type GetUTXOTransactionReturnType,\n getUTXOTransaction,\n} from '../../actions/getUTXOTransaction.js'\n\nimport type { Client } from '../../factories/createClient.js'\nimport type { UTXOSchema } from '../../transports/types.js'\nimport type { Account } from '../../types/account.js'\nimport type { Chain } from '../../types/chain.js'\nimport type { Transport } from '../../types/transport.js'\n\nexport type PublicActions = {\n getBalance: (args: GetBalanceParameters) => Promise<GetBalanceReturnType>\n getBlock: (args: GetBlockParameters) => Promise<GetBlockReturnType>\n getBlockCount: () => Promise<GetBlockCountReturnType>\n getBlockStats: (\n args: GetBlockStatsParameters\n ) => Promise<GetBlockStatsReturnType>\n getTransactions: (\n args: GetTransactionsParameters\n ) => Promise<GetTransactionsReturnType>\n getUTXOTransaction: (\n args: GetUTXOTransactionParameters\n ) => Promise<GetUTXOTransactionReturnType>\n getUTXOs: (args: GetUTXOsParameters) => Promise<GetUTXOsReturnType>\n getTransactionFee: (\n args: GetTransactionFeeParameters\n ) => Promise<GetTransactionFeeReturnType>\n}\n\nexport function publicActions<\n transport extends Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends Account | undefined = Account | undefined,\n schema extends UTXOSchema = UTXOSchema,\n>(client: Client<transport, chain, account, schema>): PublicActions {\n return {\n getBalance: (args) => getBalance(client, args),\n getBlock: (args) => getBlock(client, args),\n getBlockCount: () => getBlockCount(client),\n getBlockStats: (args) => getBlockStats(client, args),\n getTransactions: (args) => getTransactions(client, args),\n getUTXOTransaction: (args) => getUTXOTransaction(client, args),\n getUTXOs: (args) => getUTXOs(client, args),\n getTransactionFee: (args) => getTransactionFee(client, args),\n }\n}\n"],"mappings":";;;;;;;;;;AAiEA,SAAgB,cAKd,QAAkE;
|
|
1
|
+
{"version":3,"file":"public.js","names":["getBalance","getBlock","getBlockCount","getBlockStats","getTransactions","getUTXOTransaction","getUTXOs","getTransactionFee"],"sources":["../../../../src/clients/decorators/public.ts"],"sourcesContent":["import {\n type GetBalanceParameters,\n type GetBalanceReturnType,\n getBalance,\n} from '../../actions/getBalance.js'\nimport {\n type GetBlockParameters,\n type GetBlockReturnType,\n getBlock,\n} from '../../actions/getBlock.js'\nimport {\n type GetBlockCountReturnType,\n getBlockCount,\n} from '../../actions/getBlockCount.js'\nimport {\n type GetBlockStatsParameters,\n type GetBlockStatsReturnType,\n getBlockStats,\n} from '../../actions/getBlockStats.js'\nimport {\n type GetTransactionFeeParameters,\n type GetTransactionFeeReturnType,\n getTransactionFee,\n} from '../../actions/getTransactionFee.js'\nimport {\n type GetTransactionsParameters,\n type GetTransactionsReturnType,\n getTransactions,\n} from '../../actions/getTransactions.js'\nimport {\n type GetUTXOsParameters,\n type GetUTXOsReturnType,\n getUTXOs,\n} from '../../actions/getUTXOs.js'\nimport {\n type GetUTXOTransactionParameters,\n type GetUTXOTransactionReturnType,\n getUTXOTransaction,\n} from '../../actions/getUTXOTransaction.js'\n\nimport type { Client } from '../../factories/createClient.js'\nimport type { UTXOSchema } from '../../transports/types.js'\nimport type { Account } from '../../types/account.js'\nimport type { Chain } from '../../types/chain.js'\nimport type { Transport } from '../../types/transport.js'\n\nexport type PublicActions = {\n getBalance: (args: GetBalanceParameters) => Promise<GetBalanceReturnType>\n getBlock: (args: GetBlockParameters) => Promise<GetBlockReturnType>\n getBlockCount: () => Promise<GetBlockCountReturnType>\n getBlockStats: (\n args: GetBlockStatsParameters\n ) => Promise<GetBlockStatsReturnType>\n getTransactions: (\n args: GetTransactionsParameters\n ) => Promise<GetTransactionsReturnType>\n getUTXOTransaction: (\n args: GetUTXOTransactionParameters\n ) => Promise<GetUTXOTransactionReturnType>\n getUTXOs: (args: GetUTXOsParameters) => Promise<GetUTXOsReturnType>\n getTransactionFee: (\n args: GetTransactionFeeParameters\n ) => Promise<GetTransactionFeeReturnType>\n}\n\nexport function publicActions<\n transport extends Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends Account | undefined = Account | undefined,\n schema extends UTXOSchema = UTXOSchema,\n>(client: Client<transport, chain, account, schema>): PublicActions {\n return {\n getBalance: (args) => getBalance(client, args),\n getBlock: (args) => getBlock(client, args),\n getBlockCount: () => getBlockCount(client),\n getBlockStats: (args) => getBlockStats(client, args),\n getTransactions: (args) => getTransactions(client, args),\n getUTXOTransaction: (args) => getUTXOTransaction(client, args),\n getUTXOs: (args) => getUTXOs(client, args),\n getTransactionFee: (args) => getTransactionFee(client, args),\n }\n}\n"],"mappings":";;;;;;;;;;AAiEA,SAAgB,cAKd,QAAkE;CAClE,OAAO;EACL,aAAa,SAASA,2BAAAA,WAAW,QAAQ,IAAI;EAC7C,WAAW,SAASC,yBAAAA,SAAS,QAAQ,IAAI;EACzC,qBAAqBC,8BAAAA,cAAc,MAAM;EACzC,gBAAgB,SAASC,8BAAAA,cAAc,QAAQ,IAAI;EACnD,kBAAkB,SAASC,gCAAAA,gBAAgB,QAAQ,IAAI;EACvD,qBAAqB,SAASC,mCAAAA,mBAAmB,QAAQ,IAAI;EAC7D,WAAW,SAASC,yBAAAA,SAAS,QAAQ,IAAI;EACzC,oBAAoB,SAASC,kCAAAA,kBAAkB,QAAQ,IAAI;CAC7D;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.js","names":["sendUTXOTransaction","signPsbt"],"sources":["../../../../src/clients/decorators/wallet.ts"],"sourcesContent":["import {\n type SendUTXOTransactionParameters,\n type SendUTXOTransactionReturnType,\n sendUTXOTransaction,\n} from '../../actions/sendUTXOTransaction.js'\nimport { signPsbt } from '../../actions/signPsbt.js'\nimport type {\n SignPsbtParameters,\n SignPsbtReturnType,\n} from '../../transports/types.js'\nimport type { Account } from '../../types/account.js'\nimport type { Chain } from '../../types/chain.js'\nimport type { Client } from '../../types/client.js'\nimport type { Transport } from '../../types/transport.js'\n\nexport type WalletActions = {\n /**\n * Creates, signs, and sends a new transaction to the network.\n */\n sendUTXOTransaction: (\n args: SendUTXOTransactionParameters\n ) => Promise<SendUTXOTransactionReturnType>\n\n signPbst: (args: SignPsbtParameters) => Promise<SignPsbtReturnType>\n}\n\nexport function walletActions<\n transport extends Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends Account | undefined = Account | undefined,\n>(client: Client<transport, chain, account>): WalletActions {\n return {\n sendUTXOTransaction: (args) => sendUTXOTransaction(client, args),\n signPbst: (args) => signPsbt(client, args),\n }\n}\n"],"mappings":";;;;AA0BA,SAAgB,cAId,QAA0D;
|
|
1
|
+
{"version":3,"file":"wallet.js","names":["sendUTXOTransaction","signPsbt"],"sources":["../../../../src/clients/decorators/wallet.ts"],"sourcesContent":["import {\n type SendUTXOTransactionParameters,\n type SendUTXOTransactionReturnType,\n sendUTXOTransaction,\n} from '../../actions/sendUTXOTransaction.js'\nimport { signPsbt } from '../../actions/signPsbt.js'\nimport type {\n SignPsbtParameters,\n SignPsbtReturnType,\n} from '../../transports/types.js'\nimport type { Account } from '../../types/account.js'\nimport type { Chain } from '../../types/chain.js'\nimport type { Client } from '../../types/client.js'\nimport type { Transport } from '../../types/transport.js'\n\nexport type WalletActions = {\n /**\n * Creates, signs, and sends a new transaction to the network.\n */\n sendUTXOTransaction: (\n args: SendUTXOTransactionParameters\n ) => Promise<SendUTXOTransactionReturnType>\n\n signPbst: (args: SignPsbtParameters) => Promise<SignPsbtReturnType>\n}\n\nexport function walletActions<\n transport extends Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends Account | undefined = Account | undefined,\n>(client: Client<transport, chain, account>): WalletActions {\n return {\n sendUTXOTransaction: (args) => sendUTXOTransaction(client, args),\n signPbst: (args) => signPsbt(client, args),\n }\n}\n"],"mappings":";;;;AA0BA,SAAgB,cAId,QAA0D;CAC1D,OAAO;EACL,sBAAsB,SAASA,oCAAAA,oBAAoB,QAAQ,IAAI;EAC/D,WAAW,SAASC,yBAAAA,SAAS,QAAQ,IAAI;CAC3C;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.js","names":["BaseError"],"sources":["../../../src/errors/address.ts"],"sourcesContent":["import { BaseError } from './base.js'\n\nexport type InvalidAddressErrorType = InvalidAddressError & {\n name: 'InvalidAddressError'\n}\nexport class InvalidAddressError extends BaseError {\n constructor({ address }: { address: string }) {\n super(`Address \"${address}\" is invalid.`, {\n metaMessages: [\n '- Address must be a hex value of 20 bytes (40 hex characters).',\n '- Address must match its checksum counterpart.',\n ],\n name: 'InvalidAddressError',\n })\n }\n}\n"],"mappings":";;;AAKA,IAAa,sBAAb,cAAyCA,oBAAAA,UAAU;CACjD,YAAY,EAAE,WAAgC;
|
|
1
|
+
{"version":3,"file":"address.js","names":["BaseError"],"sources":["../../../src/errors/address.ts"],"sourcesContent":["import { BaseError } from './base.js'\n\nexport type InvalidAddressErrorType = InvalidAddressError & {\n name: 'InvalidAddressError'\n}\nexport class InvalidAddressError extends BaseError {\n constructor({ address }: { address: string }) {\n super(`Address \"${address}\" is invalid.`, {\n metaMessages: [\n '- Address must be a hex value of 20 bytes (40 hex characters).',\n '- Address must match its checksum counterpart.',\n ],\n name: 'InvalidAddressError',\n })\n }\n}\n"],"mappings":";;;AAKA,IAAa,sBAAb,cAAyCA,oBAAAA,UAAU;CACjD,YAAY,EAAE,WAAgC;EAC5C,MAAM,YAAY,QAAQ,gBAAgB;GACxC,cAAc,CACZ,kEACA,gDACF;GACA,MAAM;EACR,CAAC;CACH;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","names":["version"],"sources":["../../../src/errors/base.ts"],"sourcesContent":["import { version } from '../version.js'\n\ntype ErrorConfig = {\n version?: string | undefined\n}\n\nlet errorConfig: ErrorConfig = {\n version: `bigmi@${version}`,\n}\n\nexport function setErrorConfig(config: ErrorConfig): void {\n errorConfig = config\n}\n\ntype BaseErrorParameters = {\n cause?: BaseError | Error | undefined\n details?: string | undefined\n docsSlug?: string | undefined\n metaMessages?: string[] | undefined\n name?: string | undefined\n}\n\nexport type BaseErrorType = BaseError & { name: 'BaseError' }\nexport class BaseError extends Error {\n code?: number\n details: string\n docsPath?: string | undefined\n metaMessages?: string[] | undefined\n shortMessage: string\n version: string\n\n override name: string = 'BaseError'\n\n constructor(shortMessage: string, args: BaseErrorParameters = {}) {\n const details = (() => {\n if (args.cause instanceof BaseError) {\n return args.cause.details\n }\n if (args.cause?.message) {\n return args.cause.message\n }\n return args.details!\n })()\n\n const message = [\n shortMessage || 'An error occurred.',\n '',\n ...(args.metaMessages ? [...args.metaMessages, ''] : []),\n ...(details ? [`Details: ${details}`] : []),\n ...(errorConfig.version ? [`Version: ${errorConfig.version}`] : []),\n ].join('\\n')\n\n super(message, args.cause ? { cause: args.cause } : undefined)\n\n this.details = details\n this.metaMessages = args.metaMessages\n this.name = args.name ?? this.name\n this.shortMessage = shortMessage\n this.version = version\n }\n\n walk(): Error\n walk(fn: (err: unknown) => boolean): Error | null\n walk(fn?: any): any {\n return walk(this, fn)\n }\n}\n\nfunction walk(\n err: unknown,\n fn?: ((err: unknown) => boolean) | undefined\n): unknown {\n if (fn?.(err)) {\n return err\n }\n if (\n err &&\n typeof err === 'object' &&\n 'cause' in err &&\n err.cause !== undefined\n ) {\n return walk(err.cause, fn)\n }\n return fn ? null : err\n}\n"],"mappings":";;;AAMA,IAAI,cAA2B,EAC7B,SAAS,SAASA,gBAAAA,
|
|
1
|
+
{"version":3,"file":"base.js","names":["version"],"sources":["../../../src/errors/base.ts"],"sourcesContent":["import { version } from '../version.js'\n\ntype ErrorConfig = {\n version?: string | undefined\n}\n\nlet errorConfig: ErrorConfig = {\n version: `bigmi@${version}`,\n}\n\nexport function setErrorConfig(config: ErrorConfig): void {\n errorConfig = config\n}\n\ntype BaseErrorParameters = {\n cause?: BaseError | Error | undefined\n details?: string | undefined\n docsSlug?: string | undefined\n metaMessages?: string[] | undefined\n name?: string | undefined\n}\n\nexport type BaseErrorType = BaseError & { name: 'BaseError' }\nexport class BaseError extends Error {\n code?: number\n details: string\n docsPath?: string | undefined\n metaMessages?: string[] | undefined\n shortMessage: string\n version: string\n\n override name: string = 'BaseError'\n\n constructor(shortMessage: string, args: BaseErrorParameters = {}) {\n const details = (() => {\n if (args.cause instanceof BaseError) {\n return args.cause.details\n }\n if (args.cause?.message) {\n return args.cause.message\n }\n return args.details!\n })()\n\n const message = [\n shortMessage || 'An error occurred.',\n '',\n ...(args.metaMessages ? [...args.metaMessages, ''] : []),\n ...(details ? [`Details: ${details}`] : []),\n ...(errorConfig.version ? [`Version: ${errorConfig.version}`] : []),\n ].join('\\n')\n\n super(message, args.cause ? { cause: args.cause } : undefined)\n\n this.details = details\n this.metaMessages = args.metaMessages\n this.name = args.name ?? this.name\n this.shortMessage = shortMessage\n this.version = version\n }\n\n walk(): Error\n walk(fn: (err: unknown) => boolean): Error | null\n walk(fn?: any): any {\n return walk(this, fn)\n }\n}\n\nfunction walk(\n err: unknown,\n fn?: ((err: unknown) => boolean) | undefined\n): unknown {\n if (fn?.(err)) {\n return err\n }\n if (\n err &&\n typeof err === 'object' &&\n 'cause' in err &&\n err.cause !== undefined\n ) {\n return walk(err.cause, fn)\n }\n return fn ? null : err\n}\n"],"mappings":";;;AAMA,IAAI,cAA2B,EAC7B,SAAS,SAASA,gBAAAA,UACpB;AAEA,SAAgB,eAAe,QAA2B;CACxD,cAAc;AAChB;AAWA,IAAa,YAAb,MAAa,kBAAkB,MAAM;CAUnC,YAAY,cAAsB,OAA4B,CAAC,GAAG;EAChE,MAAM,iBAAiB;GACrB,IAAI,KAAK,iBAAiB,WACxB,OAAO,KAAK,MAAM;GAEpB,IAAI,KAAK,OAAO,SACd,OAAO,KAAK,MAAM;GAEpB,OAAO,KAAK;EACd,GAAG;EAEH,MAAM,UAAU;GACd,gBAAgB;GAChB;GACA,GAAI,KAAK,eAAe,CAAC,GAAG,KAAK,cAAc,EAAE,IAAI,CAAC;GACtD,GAAI,UAAU,CAAC,YAAY,SAAS,IAAI,CAAC;GACzC,GAAI,YAAY,UAAU,CAAC,YAAY,YAAY,SAAS,IAAI,CAAC;EACnE,EAAE,KAAK,IAAI;EAEX,MAAM,SAAS,KAAK,QAAQ,EAAE,OAAO,KAAK,MAAM,IAAI,KAAA,CAAS;cArBvC;EAuBtB,KAAK,UAAU;EACf,KAAK,eAAe,KAAK;EACzB,KAAK,OAAO,KAAK,QAAQ,KAAK;EAC9B,KAAK,eAAe;EACpB,KAAK,UAAUA,gBAAAA;CACjB;CAIA,KAAK,IAAe;EAClB,OAAO,KAAK,MAAM,EAAE;CACtB;AACF;AAEA,SAAS,KACP,KACA,IACS;CACT,IAAI,KAAK,GAAG,GACV,OAAO;CAET,IACE,OACA,OAAO,QAAQ,YACf,WAAW,OACX,IAAI,UAAU,KAAA,GAEd,OAAO,KAAK,IAAI,OAAO,EAAE;CAE3B,OAAO,KAAK,OAAO;AACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.js","names":["BaseError"],"sources":["../../../src/errors/block.ts"],"sourcesContent":["import type { Hash } from '../types/hash.js'\nimport { BaseError } from './base.js'\n\nexport type BlockNotFoundErrorType = BlockNotFoundError & {\n name: 'BlockNotFoundError'\n}\nexport class BlockNotFoundError extends BaseError {\n constructor({\n blockHash,\n blockNumber,\n }: {\n blockHash?: Hash | undefined\n blockNumber?: bigint | undefined\n }) {\n let identifier = 'Block'\n if (blockHash) {\n identifier = `Block at hash \"${blockHash}\"`\n }\n if (blockNumber) {\n identifier = `Block at number \"${blockNumber}\"`\n }\n super(`${identifier} could not be found.`, { name: 'BlockNotFoundError' })\n }\n}\n"],"mappings":";;;AAMA,IAAa,qBAAb,cAAwCA,oBAAAA,UAAU;CAChD,YAAY,EACV,WACA,eAIC;EACD,IAAI,aAAa;
|
|
1
|
+
{"version":3,"file":"block.js","names":["BaseError"],"sources":["../../../src/errors/block.ts"],"sourcesContent":["import type { Hash } from '../types/hash.js'\nimport { BaseError } from './base.js'\n\nexport type BlockNotFoundErrorType = BlockNotFoundError & {\n name: 'BlockNotFoundError'\n}\nexport class BlockNotFoundError extends BaseError {\n constructor({\n blockHash,\n blockNumber,\n }: {\n blockHash?: Hash | undefined\n blockNumber?: bigint | undefined\n }) {\n let identifier = 'Block'\n if (blockHash) {\n identifier = `Block at hash \"${blockHash}\"`\n }\n if (blockNumber) {\n identifier = `Block at number \"${blockNumber}\"`\n }\n super(`${identifier} could not be found.`, { name: 'BlockNotFoundError' })\n }\n}\n"],"mappings":";;;AAMA,IAAa,qBAAb,cAAwCA,oBAAAA,UAAU;CAChD,YAAY,EACV,WACA,eAIC;EACD,IAAI,aAAa;EACjB,IAAI,WACF,aAAa,kBAAkB,UAAU;EAE3C,IAAI,aACF,aAAa,oBAAoB,YAAY;EAE/C,MAAM,GAAG,WAAW,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;CAC3E;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","names":["BaseError"],"sources":["../../../src/errors/provider.ts"],"sourcesContent":["import { BaseError } from './base.js'\n\nexport class ProviderNotFoundError extends BaseError {\n constructor(message?: string) {\n const name = 'ProviderNotFoundError'\n const defaultMessage = 'The provider for this connector was not found'\n super(`${name}: ${message || defaultMessage}`, {\n name,\n })\n }\n}\n"],"mappings":";;;AAEA,IAAa,wBAAb,cAA2CA,oBAAAA,UAAU;CACnD,YAAY,SAAkB;EAC5B,MAAM,OAAO;
|
|
1
|
+
{"version":3,"file":"provider.js","names":["BaseError"],"sources":["../../../src/errors/provider.ts"],"sourcesContent":["import { BaseError } from './base.js'\n\nexport class ProviderNotFoundError extends BaseError {\n constructor(message?: string) {\n const name = 'ProviderNotFoundError'\n const defaultMessage = 'The provider for this connector was not found'\n super(`${name}: ${message || defaultMessage}`, {\n name,\n })\n }\n}\n"],"mappings":";;;AAEA,IAAa,wBAAb,cAA2CA,oBAAAA,UAAU;CACnD,YAAY,SAAkB;EAC5B,MAAM,OAAO;EAEb,MAAM,GAAG,KAAK,IAAI,WAAW,mDAAkB,EAC7C,KACF,CAAC;CACH;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","names":["BaseError","getUrl","stringify"],"sources":["../../../src/errors/request.ts"],"sourcesContent":["import { stringify } from '../utils/stringify.js'\n\nimport { BaseError } from './base.js'\nimport { getUrl } from './utils.js'\n\nexport type HttpRequestErrorType = HttpRequestError & {\n name: 'HttpRequestError'\n}\nexport class HttpRequestError extends BaseError {\n body?: { [x: string]: unknown } | { [y: string]: unknown }[] | undefined\n headers?: Headers | undefined\n status?: number | undefined\n url: string\n\n constructor({\n body,\n cause,\n details,\n headers,\n status,\n url,\n }: {\n body?: { [x: string]: unknown } | { [y: string]: unknown }[] | undefined\n cause?: Error | undefined\n details?: string | undefined\n headers?: Headers | undefined\n status?: number | undefined\n url: string\n }) {\n super('HTTP request failed.', {\n cause,\n details,\n metaMessages: [\n status && `Status: ${status}`,\n `URL: ${getUrl(url)}`,\n body && `Request body: ${stringify(body)}`,\n ].filter(Boolean) as string[],\n name: 'HttpRequestError',\n })\n this.body = body\n this.headers = headers\n this.status = status\n this.url = url\n }\n}\n\nexport type WebSocketRequestErrorType = WebSocketRequestError & {\n name: 'WebSocketRequestError'\n}\nexport class WebSocketRequestError extends BaseError {\n constructor({\n body,\n cause,\n details,\n url,\n }: {\n body?: { [key: string]: unknown } | undefined\n cause?: Error | undefined\n details?: string | undefined\n url: string\n }) {\n super('WebSocket request failed.', {\n cause,\n details,\n metaMessages: [\n `URL: ${getUrl(url)}`,\n body && `Request body: ${stringify(body)}`,\n ].filter(Boolean) as string[],\n name: 'WebSocketRequestError',\n })\n }\n}\n\nexport type RpcRequestErrorType = RpcRequestError & {\n name: 'RpcRequestError'\n}\nexport class RpcRequestError extends BaseError {\n override code: number\n data?: unknown\n\n constructor({\n body,\n error,\n url,\n }: {\n body: { [x: string]: unknown } | { [y: string]: unknown }[]\n error: { code: number; data?: unknown; message: string }\n url: string\n }) {\n super('RPC Request failed.', {\n cause: error as any,\n details: error.message,\n metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],\n name: 'RpcRequestError',\n })\n this.code = error.code\n this.data = error.data\n }\n}\n\nexport type SocketClosedErrorType = SocketClosedError & {\n name: 'SocketClosedError'\n}\nexport class SocketClosedError extends BaseError {\n constructor({\n url,\n }: {\n url?: string | undefined\n } = {}) {\n super('The socket has been closed.', {\n metaMessages: [url && `URL: ${getUrl(url)}`].filter(Boolean) as string[],\n name: 'SocketClosedError',\n })\n }\n}\n\nexport type TimeoutErrorType = TimeoutError & {\n name: 'TimeoutError'\n}\nexport class TimeoutError extends BaseError {\n constructor({\n body,\n url,\n timeout,\n }: {\n body: { [x: string]: unknown } | { [y: string]: unknown }[]\n url: string\n timeout: number\n }) {\n super('The request took too long to respond.', {\n details: `The request timed out after ${timeout}ms.`,\n metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],\n name: 'TimeoutError',\n })\n }\n}\n"],"mappings":";;;;;AAQA,IAAa,mBAAb,cAAsCA,oBAAAA,UAAU;CAM9C,YAAY,EACV,MACA,OACA,SACA,SACA,QACA,OAQC;
|
|
1
|
+
{"version":3,"file":"request.js","names":["BaseError","getUrl","stringify"],"sources":["../../../src/errors/request.ts"],"sourcesContent":["import { stringify } from '../utils/stringify.js'\n\nimport { BaseError } from './base.js'\nimport { getUrl } from './utils.js'\n\nexport type HttpRequestErrorType = HttpRequestError & {\n name: 'HttpRequestError'\n}\nexport class HttpRequestError extends BaseError {\n body?: { [x: string]: unknown } | { [y: string]: unknown }[] | undefined\n headers?: Headers | undefined\n status?: number | undefined\n url: string\n\n constructor({\n body,\n cause,\n details,\n headers,\n status,\n url,\n }: {\n body?: { [x: string]: unknown } | { [y: string]: unknown }[] | undefined\n cause?: Error | undefined\n details?: string | undefined\n headers?: Headers | undefined\n status?: number | undefined\n url: string\n }) {\n super('HTTP request failed.', {\n cause,\n details,\n metaMessages: [\n status && `Status: ${status}`,\n `URL: ${getUrl(url)}`,\n body && `Request body: ${stringify(body)}`,\n ].filter(Boolean) as string[],\n name: 'HttpRequestError',\n })\n this.body = body\n this.headers = headers\n this.status = status\n this.url = url\n }\n}\n\nexport type WebSocketRequestErrorType = WebSocketRequestError & {\n name: 'WebSocketRequestError'\n}\nexport class WebSocketRequestError extends BaseError {\n constructor({\n body,\n cause,\n details,\n url,\n }: {\n body?: { [key: string]: unknown } | undefined\n cause?: Error | undefined\n details?: string | undefined\n url: string\n }) {\n super('WebSocket request failed.', {\n cause,\n details,\n metaMessages: [\n `URL: ${getUrl(url)}`,\n body && `Request body: ${stringify(body)}`,\n ].filter(Boolean) as string[],\n name: 'WebSocketRequestError',\n })\n }\n}\n\nexport type RpcRequestErrorType = RpcRequestError & {\n name: 'RpcRequestError'\n}\nexport class RpcRequestError extends BaseError {\n override code: number\n data?: unknown\n\n constructor({\n body,\n error,\n url,\n }: {\n body: { [x: string]: unknown } | { [y: string]: unknown }[]\n error: { code: number; data?: unknown; message: string }\n url: string\n }) {\n super('RPC Request failed.', {\n cause: error as any,\n details: error.message,\n metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],\n name: 'RpcRequestError',\n })\n this.code = error.code\n this.data = error.data\n }\n}\n\nexport type SocketClosedErrorType = SocketClosedError & {\n name: 'SocketClosedError'\n}\nexport class SocketClosedError extends BaseError {\n constructor({\n url,\n }: {\n url?: string | undefined\n } = {}) {\n super('The socket has been closed.', {\n metaMessages: [url && `URL: ${getUrl(url)}`].filter(Boolean) as string[],\n name: 'SocketClosedError',\n })\n }\n}\n\nexport type TimeoutErrorType = TimeoutError & {\n name: 'TimeoutError'\n}\nexport class TimeoutError extends BaseError {\n constructor({\n body,\n url,\n timeout,\n }: {\n body: { [x: string]: unknown } | { [y: string]: unknown }[]\n url: string\n timeout: number\n }) {\n super('The request took too long to respond.', {\n details: `The request timed out after ${timeout}ms.`,\n metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],\n name: 'TimeoutError',\n })\n }\n}\n"],"mappings":";;;;;AAQA,IAAa,mBAAb,cAAsCA,oBAAAA,UAAU;CAM9C,YAAY,EACV,MACA,OACA,SACA,SACA,QACA,OAQC;EACD,MAAM,wBAAwB;GAC5B;GACA;GACA,cAAc;IACZ,UAAU,WAAW;IACrB,QAAQC,qBAAAA,OAAO,GAAG;IAClB,QAAQ,iBAAiBC,wBAAAA,UAAU,IAAI;GACzC,EAAE,OAAO,OAAO;GAChB,MAAM;EACR,CAAC;EACD,KAAK,OAAO;EACZ,KAAK,UAAU;EACf,KAAK,SAAS;EACd,KAAK,MAAM;CACb;AACF;AAKA,IAAa,wBAAb,cAA2CF,oBAAAA,UAAU;CACnD,YAAY,EACV,MACA,OACA,SACA,OAMC;EACD,MAAM,6BAA6B;GACjC;GACA;GACA,cAAc,CACZ,QAAQC,qBAAAA,OAAO,GAAG,KAClB,QAAQ,iBAAiBC,wBAAAA,UAAU,IAAI,GACzC,EAAE,OAAO,OAAO;GAChB,MAAM;EACR,CAAC;CACH;AACF;AAKA,IAAa,kBAAb,cAAqCF,oBAAAA,UAAU;CAI7C,YAAY,EACV,MACA,OACA,OAKC;EACD,MAAM,uBAAuB;GAC3B,OAAO;GACP,SAAS,MAAM;GACf,cAAc,CAAC,QAAQC,qBAAAA,OAAO,GAAG,KAAK,iBAAiBC,wBAAAA,UAAU,IAAI,GAAG;GACxE,MAAM;EACR,CAAC;EACD,KAAK,OAAO,MAAM;EAClB,KAAK,OAAO,MAAM;CACpB;AACF;AAKA,IAAa,oBAAb,cAAuCF,oBAAAA,UAAU;CAC/C,YAAY,EACV,QAGE,CAAC,GAAG;EACN,MAAM,+BAA+B;GACnC,cAAc,CAAC,OAAO,QAAQC,qBAAAA,OAAO,GAAG,GAAG,EAAE,OAAO,OAAO;GAC3D,MAAM;EACR,CAAC;CACH;AACF;AAKA,IAAa,eAAb,cAAkCD,oBAAAA,UAAU;CAC1C,YAAY,EACV,MACA,KACA,WAKC;EACD,MAAM,yCAAyC;GAC7C,SAAS,+BAA+B,QAAQ;GAChD,cAAc,CAAC,QAAQC,qBAAAA,OAAO,GAAG,KAAK,iBAAiBC,wBAAAA,UAAU,IAAI,GAAG;GACxE,MAAM;EACR,CAAC;CACH;AACF"}
|
package/dist/cjs/errors/rpc.js
CHANGED
|
@@ -50,7 +50,7 @@ var UserRejectedRequestError = class extends require_errors_base.BaseError {
|
|
|
50
50
|
constructor(message) {
|
|
51
51
|
const name = "UserRejectedRequestError";
|
|
52
52
|
super(`${name}: ${message || "The user rejected your request, please try again"}`, { name });
|
|
53
|
-
this.code =
|
|
53
|
+
this.code = -32e3;
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
var MethodNotSupportedRpcError = class extends require_errors_base.BaseError {
|
|
@@ -58,14 +58,14 @@ var MethodNotSupportedRpcError = class extends require_errors_base.BaseError {
|
|
|
58
58
|
const name = "MethodNotSupportedError";
|
|
59
59
|
const message = `The method ${method} you are calling is not supported`;
|
|
60
60
|
super(`${name}: ${message}`, { name });
|
|
61
|
-
this.code =
|
|
61
|
+
this.code = -32001;
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
var ParseError = class extends require_errors_base.BaseError {
|
|
65
65
|
constructor(message) {
|
|
66
66
|
const name = "ParseError";
|
|
67
67
|
super(`${name}: ${message || "Invalid JSON, there was an error parsing your request."}`, { name });
|
|
68
|
-
this.code =
|
|
68
|
+
this.code = -32700;
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc.js","names":["BaseError"],"sources":["../../../src/errors/rpc.ts"],"sourcesContent":["import { BaseError } from './base.js'\n\n/**\n * @enum {number} RpcErrorCode\n * @description JSON-RPC error codes\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport enum RpcErrorCode {\n /**\n * Parse error Invalid JSON\n **/\n PARSE_ERROR = -32700,\n /**\n * The JSON sent is not a valid Request object.\n **/\n INVALID_REQUEST = -32600,\n /**\n * The method does not exist/is not available.\n **/\n METHOD_NOT_FOUND = -32601,\n /**\n * Invalid method parameter(s).\n */\n INVALID_PARAMS = -32602,\n /**\n * Internal JSON-RPC error.\n * This is a generic error, used when the server encounters an error in performing the request.\n **/\n INTERNAL_ERROR = -32603,\n /**\n * user rejected/canceled the request\n */\n USER_REJECTION = -32000,\n /**\n * method is not supported for the address provided\n */\n METHOD_NOT_SUPPORTED = -32001,\n /**\n * The client does not have permission to access the requested resource.\n */\n ACCESS_DENIED = -32002,\n /**\n * Unknown generic errors\n */\n MISC_ERROR = -1,\n}\n\nexport class UserRejectedRequestError extends BaseError {\n override code: number = RpcErrorCode.USER_REJECTION\n constructor(message?: string) {\n const name = 'UserRejectedRequestError'\n const errMessage =\n message || 'The user rejected your request, please try again'\n super(`${name}: ${errMessage}`, {\n name,\n })\n }\n}\n\nexport class MethodNotSupportedRpcError extends BaseError {\n override code: number = RpcErrorCode.METHOD_NOT_SUPPORTED\n constructor(method?: string) {\n const name = 'MethodNotSupportedError'\n const message = `The method ${method} you are calling is not supported`\n super(`${name}: ${message}`, {\n name,\n })\n }\n}\n\nexport class ParseError extends BaseError {\n override code: number = RpcErrorCode.PARSE_ERROR\n constructor(message?: string) {\n const name = 'ParseError'\n const errMessage =\n message || 'Invalid JSON, there was an error parsing your request.'\n super(`${name}: ${errMessage}`, {\n name,\n })\n }\n}\n"],"mappings":";;;;;;;;AAOA,IAAY,eAAL,yBAAA,cAAA;;;;
|
|
1
|
+
{"version":3,"file":"rpc.js","names":["BaseError"],"sources":["../../../src/errors/rpc.ts"],"sourcesContent":["import { BaseError } from './base.js'\n\n/**\n * @enum {number} RpcErrorCode\n * @description JSON-RPC error codes\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport enum RpcErrorCode {\n /**\n * Parse error Invalid JSON\n **/\n PARSE_ERROR = -32700,\n /**\n * The JSON sent is not a valid Request object.\n **/\n INVALID_REQUEST = -32600,\n /**\n * The method does not exist/is not available.\n **/\n METHOD_NOT_FOUND = -32601,\n /**\n * Invalid method parameter(s).\n */\n INVALID_PARAMS = -32602,\n /**\n * Internal JSON-RPC error.\n * This is a generic error, used when the server encounters an error in performing the request.\n **/\n INTERNAL_ERROR = -32603,\n /**\n * user rejected/canceled the request\n */\n USER_REJECTION = -32000,\n /**\n * method is not supported for the address provided\n */\n METHOD_NOT_SUPPORTED = -32001,\n /**\n * The client does not have permission to access the requested resource.\n */\n ACCESS_DENIED = -32002,\n /**\n * Unknown generic errors\n */\n MISC_ERROR = -1,\n}\n\nexport class UserRejectedRequestError extends BaseError {\n override code: number = RpcErrorCode.USER_REJECTION\n constructor(message?: string) {\n const name = 'UserRejectedRequestError'\n const errMessage =\n message || 'The user rejected your request, please try again'\n super(`${name}: ${errMessage}`, {\n name,\n })\n }\n}\n\nexport class MethodNotSupportedRpcError extends BaseError {\n override code: number = RpcErrorCode.METHOD_NOT_SUPPORTED\n constructor(method?: string) {\n const name = 'MethodNotSupportedError'\n const message = `The method ${method} you are calling is not supported`\n super(`${name}: ${message}`, {\n name,\n })\n }\n}\n\nexport class ParseError extends BaseError {\n override code: number = RpcErrorCode.PARSE_ERROR\n constructor(message?: string) {\n const name = 'ParseError'\n const errMessage =\n message || 'Invalid JSON, there was an error parsing your request.'\n super(`${name}: ${errMessage}`, {\n name,\n })\n }\n}\n"],"mappings":";;;;;;;;AAOA,IAAY,eAAL,yBAAA,cAAA;;;;CAIL,aAAA,aAAA,iBAAA,UAAA;;;;CAIA,aAAA,aAAA,qBAAA,UAAA;;;;CAIA,aAAA,aAAA,sBAAA,UAAA;;;;CAIA,aAAA,aAAA,oBAAA,UAAA;;;;;CAKA,aAAA,aAAA,oBAAA,UAAA;;;;CAIA,aAAA,aAAA,oBAAA,SAAA;;;;CAIA,aAAA,aAAA,0BAAA,UAAA;;;;CAIA,aAAA,aAAA,mBAAA,UAAA;;;;CAIA,aAAA,aAAA,gBAAA,MAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAa,2BAAb,cAA8CA,oBAAAA,UAAU;CAEtD,YAAY,SAAkB;EAC5B,MAAM,OAAO;EAGb,MAAM,GAAG,KAAK,KADZ,WAAW,sDACoB,EAC/B,KACF,CAAC;;CACH;AACF;AAEA,IAAa,6BAAb,cAAgDA,oBAAAA,UAAU;CAExD,YAAY,QAAiB;EAC3B,MAAM,OAAO;EACb,MAAM,UAAU,cAAc,OAAO;EACrC,MAAM,GAAG,KAAK,IAAI,WAAW,EAC3B,KACF,CAAC;;CACH;AACF;AAEA,IAAa,aAAb,cAAgCA,oBAAAA,UAAU;CAExC,YAAY,SAAkB;EAC5B,MAAM,OAAO;EAGb,MAAM,GAAG,KAAK,IADZ,WAAW,4DACmB,EAC9B,KACF,CAAC;;CACH;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.js","names":["BaseError"],"sources":["../../../src/errors/transaction.ts"],"sourcesContent":["import type { BlockTag } from '../types/block.js'\nimport type { Hash } from '../types/hash.js'\nimport { BaseError } from './base.js'\n\nexport type TransactionNotFoundErrorType = TransactionNotFoundError & {\n name: 'TransactionNotFoundError'\n}\nexport class TransactionNotFoundError extends BaseError {\n constructor({\n blockHash,\n blockNumber,\n blockTag,\n hash,\n index,\n }: {\n blockHash?: Hash | undefined\n blockNumber?: bigint | undefined\n blockTag?: BlockTag | undefined\n hash?: Hash | undefined\n index?: number | undefined\n }) {\n let identifier = 'Transaction'\n if (blockTag && index !== undefined) {\n identifier = `Transaction at block time \"${blockTag}\" at index \"${index}\"`\n }\n if (blockHash && index !== undefined) {\n identifier = `Transaction at block hash \"${blockHash}\" at index \"${index}\"`\n }\n if (blockNumber && index !== undefined) {\n identifier = `Transaction at block number \"${blockNumber}\" at index \"${index}\"`\n }\n if (hash) {\n identifier = `Transaction with hash \"${hash}\"`\n }\n super(`${identifier} could not be found.`, {\n name: 'TransactionNotFoundError',\n })\n }\n}\n\nexport type TransactionReceiptNotFoundErrorType =\n TransactionReceiptNotFoundError & {\n name: 'TransactionReceiptNotFoundError'\n }\nexport class TransactionReceiptNotFoundError extends BaseError {\n constructor({ hash }: { hash: Hash }) {\n super(\n `Transaction receipt with hash \"${hash}\" could not be found. The Transaction may not be processed on a block yet.`,\n {\n name: 'TransactionReceiptNotFoundError',\n }\n )\n }\n}\n\nexport type WaitForTransactionReceiptTimeoutErrorType =\n WaitForTransactionReceiptTimeoutError & {\n name: 'WaitForTransactionReceiptTimeoutError'\n }\nexport class WaitForTransactionReceiptTimeoutError extends BaseError {\n constructor({ hash }: { hash: Hash }) {\n super(\n `Timed out while waiting for transaction with hash \"${hash}\" to be confirmed.`,\n { name: 'WaitForTransactionReceiptTimeoutError' }\n )\n }\n}\n"],"mappings":";;;AAOA,IAAa,2BAAb,cAA8CA,oBAAAA,UAAU;CACtD,YAAY,EACV,WACA,aACA,UACA,MACA,SAOC;EACD,IAAI,aAAa;
|
|
1
|
+
{"version":3,"file":"transaction.js","names":["BaseError"],"sources":["../../../src/errors/transaction.ts"],"sourcesContent":["import type { BlockTag } from '../types/block.js'\nimport type { Hash } from '../types/hash.js'\nimport { BaseError } from './base.js'\n\nexport type TransactionNotFoundErrorType = TransactionNotFoundError & {\n name: 'TransactionNotFoundError'\n}\nexport class TransactionNotFoundError extends BaseError {\n constructor({\n blockHash,\n blockNumber,\n blockTag,\n hash,\n index,\n }: {\n blockHash?: Hash | undefined\n blockNumber?: bigint | undefined\n blockTag?: BlockTag | undefined\n hash?: Hash | undefined\n index?: number | undefined\n }) {\n let identifier = 'Transaction'\n if (blockTag && index !== undefined) {\n identifier = `Transaction at block time \"${blockTag}\" at index \"${index}\"`\n }\n if (blockHash && index !== undefined) {\n identifier = `Transaction at block hash \"${blockHash}\" at index \"${index}\"`\n }\n if (blockNumber && index !== undefined) {\n identifier = `Transaction at block number \"${blockNumber}\" at index \"${index}\"`\n }\n if (hash) {\n identifier = `Transaction with hash \"${hash}\"`\n }\n super(`${identifier} could not be found.`, {\n name: 'TransactionNotFoundError',\n })\n }\n}\n\nexport type TransactionReceiptNotFoundErrorType =\n TransactionReceiptNotFoundError & {\n name: 'TransactionReceiptNotFoundError'\n }\nexport class TransactionReceiptNotFoundError extends BaseError {\n constructor({ hash }: { hash: Hash }) {\n super(\n `Transaction receipt with hash \"${hash}\" could not be found. The Transaction may not be processed on a block yet.`,\n {\n name: 'TransactionReceiptNotFoundError',\n }\n )\n }\n}\n\nexport type WaitForTransactionReceiptTimeoutErrorType =\n WaitForTransactionReceiptTimeoutError & {\n name: 'WaitForTransactionReceiptTimeoutError'\n }\nexport class WaitForTransactionReceiptTimeoutError extends BaseError {\n constructor({ hash }: { hash: Hash }) {\n super(\n `Timed out while waiting for transaction with hash \"${hash}\" to be confirmed.`,\n { name: 'WaitForTransactionReceiptTimeoutError' }\n )\n }\n}\n"],"mappings":";;;AAOA,IAAa,2BAAb,cAA8CA,oBAAAA,UAAU;CACtD,YAAY,EACV,WACA,aACA,UACA,MACA,SAOC;EACD,IAAI,aAAa;EACjB,IAAI,YAAY,UAAU,KAAA,GACxB,aAAa,8BAA8B,SAAS,cAAc,MAAM;EAE1E,IAAI,aAAa,UAAU,KAAA,GACzB,aAAa,8BAA8B,UAAU,cAAc,MAAM;EAE3E,IAAI,eAAe,UAAU,KAAA,GAC3B,aAAa,gCAAgC,YAAY,cAAc,MAAM;EAE/E,IAAI,MACF,aAAa,0BAA0B,KAAK;EAE9C,MAAM,GAAG,WAAW,uBAAuB,EACzC,MAAM,2BACR,CAAC;CACH;AACF;AAMA,IAAa,kCAAb,cAAqDA,oBAAAA,UAAU;CAC7D,YAAY,EAAE,QAAwB;EACpC,MACE,kCAAkC,KAAK,6EACvC,EACE,MAAM,kCACR,CACF;CACF;AACF;AAMA,IAAa,wCAAb,cAA2DA,oBAAAA,UAAU;CACnE,YAAY,EAAE,QAAwB;EACpC,MACE,sDAAsD,KAAK,qBAC3D,EAAE,MAAM,wCAAwC,CAClD;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","names":["BaseError"],"sources":["../../../src/errors/transport.ts"],"sourcesContent":["import { BaseError } from './base.js'\n\nexport type UrlRequiredErrorType = UrlRequiredError & {\n name: 'UrlRequiredError'\n}\nexport class UrlRequiredError extends BaseError {\n constructor() {\n super(\n 'No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.',\n {\n name: 'UrlRequiredError',\n }\n )\n }\n}\n\nexport type TransportMethodNotSupportedErrorType =\n TransportMethodNotSupportedError & {\n name: 'TransportMethodNotSupportedError'\n }\nexport class TransportMethodNotSupportedError extends BaseError {\n constructor({ method }: { method: string }) {\n super(`No transport found that supports the method: ${method}`, {\n name: 'TransportMethodNotSupportedError',\n })\n }\n}\n\nexport type AllTransportsFailedErrorType = AllTransportsFailedError & {\n name: 'AllTransportsFailedError'\n}\nexport class AllTransportsFailedError extends BaseError {\n constructor({\n method,\n params,\n errors,\n totalAttempts,\n }: {\n method: string\n params: unknown\n errors: Array<{\n transport: string\n error: Error\n attempt: number\n }>\n totalAttempts: number\n }) {\n const errorMessages = errors\n .map(\n ({ transport, error, attempt }) =>\n `${attempt}. ${transport}: ${error.message}`\n )\n .join('\\n')\n\n super(\n `All ${totalAttempts} transports failed for method \"${method}\": \\n${errorMessages}`,\n {\n name: 'AllTransportsFailedError',\n metaMessages: [\n `Method: ${method}`,\n `Total attempts: ${totalAttempts}`,\n `Failed transports: ${errors.map((e) => e.transport).join(', ')}`,\n ],\n }\n )\n\n this.method = method\n this.params = params\n this.errors = errors\n this.totalAttempts = totalAttempts\n }\n\n method: string\n params: unknown\n errors: Array<{\n transport: string\n error: Error\n attempt: number\n }>\n totalAttempts: number\n}\n"],"mappings":";;;AAKA,IAAa,mBAAb,cAAsCA,oBAAAA,UAAU;CAC9C,cAAc;
|
|
1
|
+
{"version":3,"file":"transport.js","names":["BaseError"],"sources":["../../../src/errors/transport.ts"],"sourcesContent":["import { BaseError } from './base.js'\n\nexport type UrlRequiredErrorType = UrlRequiredError & {\n name: 'UrlRequiredError'\n}\nexport class UrlRequiredError extends BaseError {\n constructor() {\n super(\n 'No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.',\n {\n name: 'UrlRequiredError',\n }\n )\n }\n}\n\nexport type TransportMethodNotSupportedErrorType =\n TransportMethodNotSupportedError & {\n name: 'TransportMethodNotSupportedError'\n }\nexport class TransportMethodNotSupportedError extends BaseError {\n constructor({ method }: { method: string }) {\n super(`No transport found that supports the method: ${method}`, {\n name: 'TransportMethodNotSupportedError',\n })\n }\n}\n\nexport type AllTransportsFailedErrorType = AllTransportsFailedError & {\n name: 'AllTransportsFailedError'\n}\nexport class AllTransportsFailedError extends BaseError {\n constructor({\n method,\n params,\n errors,\n totalAttempts,\n }: {\n method: string\n params: unknown\n errors: Array<{\n transport: string\n error: Error\n attempt: number\n }>\n totalAttempts: number\n }) {\n const errorMessages = errors\n .map(\n ({ transport, error, attempt }) =>\n `${attempt}. ${transport}: ${error.message}`\n )\n .join('\\n')\n\n super(\n `All ${totalAttempts} transports failed for method \"${method}\": \\n${errorMessages}`,\n {\n name: 'AllTransportsFailedError',\n metaMessages: [\n `Method: ${method}`,\n `Total attempts: ${totalAttempts}`,\n `Failed transports: ${errors.map((e) => e.transport).join(', ')}`,\n ],\n }\n )\n\n this.method = method\n this.params = params\n this.errors = errors\n this.totalAttempts = totalAttempts\n }\n\n method: string\n params: unknown\n errors: Array<{\n transport: string\n error: Error\n attempt: number\n }>\n totalAttempts: number\n}\n"],"mappings":";;;AAKA,IAAa,mBAAb,cAAsCA,oBAAAA,UAAU;CAC9C,cAAc;EACZ,MACE,0FACA,EACE,MAAM,mBACR,CACF;CACF;AACF;AAMA,IAAa,mCAAb,cAAsDA,oBAAAA,UAAU;CAC9D,YAAY,EAAE,UAA8B;EAC1C,MAAM,gDAAgD,UAAU,EAC9D,MAAM,mCACR,CAAC;CACH;AACF;AAKA,IAAa,2BAAb,cAA8CA,oBAAAA,UAAU;CACtD,YAAY,EACV,QACA,QACA,QACA,iBAUC;EACD,MAAM,gBAAgB,OACnB,KACE,EAAE,WAAW,OAAO,cACnB,GAAG,QAAQ,IAAI,UAAU,IAAI,MAAM,SACvC,EACC,KAAK,IAAI;EAEZ,MACE,OAAO,cAAc,iCAAiC,OAAO,OAAO,iBACpE;GACE,MAAM;GACN,cAAc;IACZ,WAAW;IACX,mBAAmB;IACnB,sBAAsB,OAAO,KAAK,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI;GAChE;EACF,CACF;EAEA,KAAK,SAAS;EACd,KAAK,SAAS;EACd,KAAK,SAAS;EACd,KAAK,gBAAgB;CACvB;AAUF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utxo.js","names":["BaseError"],"sources":["../../../src/errors/utxo.ts"],"sourcesContent":["import { BaseError } from './base.js'\n\nexport type InsufficientUTXOBalanceErrorType = InsufficientUTXOBalanceError & {\n name: 'InsufficientUTXOBalanceError'\n}\n\nexport class InsufficientUTXOBalanceError extends BaseError {\n constructor({\n minValue,\n address,\n balance,\n }: { minValue: number; address?: string; balance?: number }) {\n super(`Not enough UTXOs required for ${minValue}`, {\n metaMessages: [\n `${address && balance && `Address ${address} has a balance of ${balance}.`}`,\n ],\n name: 'InsufficientUTXOBalanceError',\n })\n }\n}\n"],"mappings":";;;AAMA,IAAa,+BAAb,cAAkDA,oBAAAA,UAAU;CAC1D,YAAY,EACV,UACA,SACA,WAC2D;
|
|
1
|
+
{"version":3,"file":"utxo.js","names":["BaseError"],"sources":["../../../src/errors/utxo.ts"],"sourcesContent":["import { BaseError } from './base.js'\n\nexport type InsufficientUTXOBalanceErrorType = InsufficientUTXOBalanceError & {\n name: 'InsufficientUTXOBalanceError'\n}\n\nexport class InsufficientUTXOBalanceError extends BaseError {\n constructor({\n minValue,\n address,\n balance,\n }: { minValue: number; address?: string; balance?: number }) {\n super(`Not enough UTXOs required for ${minValue}`, {\n metaMessages: [\n `${address && balance && `Address ${address} has a balance of ${balance}.`}`,\n ],\n name: 'InsufficientUTXOBalanceError',\n })\n }\n}\n"],"mappings":";;;AAMA,IAAa,+BAAb,cAAkDA,oBAAAA,UAAU;CAC1D,YAAY,EACV,UACA,SACA,WAC2D;EAC3D,MAAM,iCAAiC,YAAY;GACjD,cAAc,CACZ,GAAG,WAAW,WAAW,WAAW,QAAQ,oBAAoB,QAAQ,IAC1E;GACA,MAAM;EACR,CAAC;CACH;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createClient.js","names":["parseAccount","uid"],"sources":["../../../src/factories/createClient.ts"],"sourcesContent":["import type { ErrorType } from '../errors/utils.js'\nimport type { Account } from '../types/account.js'\nimport type { Address } from '../types/address.js'\nimport type { Chain } from '../types/chain.js'\nimport type { BtcRpcRequestFn, RpcSchema } from '../types/request.js'\nimport type { BitcoinRpcMethods } from '../types/rpc.js'\nimport type { Transport } from '../types/transport.js'\nimport type { Prettify } from '../types/utils.js'\n\nimport { parseAccount } from '../utils/parseAccount.js'\nimport { uid } from '../utils/uid.js'\n\nexport type ClientConfig<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n accountOrAddress extends Account | Address | undefined =\n | Account\n | Address\n | undefined,\n rpcSchema extends RpcSchema | undefined = undefined,\n> = {\n /** The Account to use for the Client. This will be used for Actions that require an account as an argument. */\n account?: accountOrAddress | Account | Address | undefined\n /** Flags for batch settings. */\n batch?:\n | {\n /** Toggle to enable `eth_call` multicall aggregation. */\n multicall?: boolean | Prettify<MulticallBatchOptions> | undefined\n }\n | undefined\n /**\n * Time (in ms) that cached data will remain in memory.\n * @default 4_000\n */\n cacheTime?: number | undefined\n /** Chain for the client. */\n chain?: Chain | undefined | chain\n /** A key for the client. */\n key?: string | undefined\n /** A name for the client. */\n name?: string | undefined\n /**\n * Frequency (in ms) for polling enabled actions & events.\n * @default 4_000\n */\n pollingInterval?: number | undefined\n /**\n * Typed JSON-RPC schema for the client.\n */\n rpcSchema?: rpcSchema | undefined\n /** The RPC transport */\n transport: transport\n /** The type of client. */\n type?: string | undefined\n}\n\n// TODO: Move `transport` to slot index 2 since `chain` and `account` used more frequently.\n// Otherwise, we end up with a lot of `Client<Transport, chain, account>` in actions.\nexport type Client<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends Account | undefined = Account | undefined,\n rpcSchema extends RpcSchema | undefined = undefined,\n extended extends Extended | undefined = Extended | undefined,\n> = Client_Base<transport, chain, account, rpcSchema> &\n (extended extends Extended ? extended : unknown) & {\n extend: <const client extends Extended>(\n fn: (\n client: Client<transport, chain, account, rpcSchema, extended>\n ) => client\n ) => Client<\n transport,\n chain,\n account,\n rpcSchema,\n Prettify<client> & (extended extends Extended ? extended : unknown)\n >\n }\n\ntype Client_Base<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends Account | undefined = Account | undefined,\n rpcSchema extends RpcSchema | undefined = undefined,\n> = {\n /** The Account of the Client. */\n account: account\n /** Time (in ms) that cached data will remain in memory. */\n cacheTime: number\n /** Chain for the client. */\n chain: chain\n /** A key for the client. */\n key: string\n /** A name for the client. */\n name: string\n /** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */\n pollingInterval: number\n /** Request function wrapped with friendly error handling */\n request: BtcRpcRequestFn<\n rpcSchema extends undefined ? BitcoinRpcMethods : rpcSchema\n >\n /** The RPC transport */\n transport: ReturnType<transport>['config'] & ReturnType<transport>['value']\n /** The type of client. */\n type: string\n /** A unique ID for the client. */\n uid: string\n}\n\ntype Extended = Prettify<\n // disallow redefining base properties\n { [_ in keyof Client_Base]?: undefined } & {\n [key: string]: unknown\n }\n>\n\nexport type MulticallBatchOptions = {\n /** The maximum size (in bytes) for each calldata chunk. @default 1_024 */\n batchSize?: number | undefined\n /** The maximum number of milliseconds to wait before sending a batch. @default 0 */\n wait?: number | undefined\n}\n\nexport type CreateClientErrorType = ErrorType\n\nexport function createClient<\n transport extends Transport,\n chain extends Chain | undefined = undefined,\n accountOrAddress extends Account | Address | undefined = undefined,\n rpcSchema extends RpcSchema | undefined = undefined,\n>(\n parameters: ClientConfig<transport, chain, accountOrAddress, rpcSchema>\n): Prettify<\n Client<\n transport,\n chain,\n accountOrAddress extends Address ? Prettify<Account> : accountOrAddress,\n rpcSchema\n >\n>\n\nexport function createClient(parameters: ClientConfig): Client {\n const {\n cacheTime = parameters.pollingInterval ?? 4_000,\n\n key = 'base',\n name = 'Base Client',\n pollingInterval = 4_000,\n type = 'base',\n } = parameters\n\n const chain = parameters.chain\n const account = parameters.account\n ? parseAccount(parameters.account)\n : undefined\n const { config, request, value } = parameters.transport({\n chain,\n pollingInterval,\n })\n const transport = { ...config, ...value }\n\n const client = {\n account,\n cacheTime,\n\n chain,\n key,\n name,\n pollingInterval,\n request,\n transport,\n type,\n uid: uid(),\n }\n\n function extend(base: typeof client) {\n type ExtendFn = (base: typeof client) => unknown\n return (extendFn: ExtendFn) => {\n const extended = extendFn(base) as Extended\n for (const key in client) {\n delete extended[key]\n }\n const combined = { ...base, ...extended }\n return Object.assign(combined, { extend: extend(combined as any) })\n }\n }\n\n return Object.assign(client, { extend: extend(client) as any })\n}\n\n/**\n * Defines a typed JSON-RPC schema for the client.\n * Note: This is a runtime noop function.\n */\nexport function rpcSchema<rpcSchema extends RpcSchema>(): rpcSchema {\n return null as any\n}\n"],"mappings":";;;;AA6IA,SAAgB,aAAa,YAAkC;CAC7D,MAAM,EACJ,YAAY,WAAW,mBAAmB,KAE1C,MAAM,QACN,OAAO,eACP,kBAAkB,KAClB,OAAO,WACL;CAEJ,MAAM,QAAQ,WAAW;CACzB,MAAM,UAAU,WAAW,UACvBA,2BAAAA,aAAa,WAAW,
|
|
1
|
+
{"version":3,"file":"createClient.js","names":["parseAccount","uid"],"sources":["../../../src/factories/createClient.ts"],"sourcesContent":["import type { ErrorType } from '../errors/utils.js'\nimport type { Account } from '../types/account.js'\nimport type { Address } from '../types/address.js'\nimport type { Chain } from '../types/chain.js'\nimport type { BtcRpcRequestFn, RpcSchema } from '../types/request.js'\nimport type { BitcoinRpcMethods } from '../types/rpc.js'\nimport type { Transport } from '../types/transport.js'\nimport type { Prettify } from '../types/utils.js'\n\nimport { parseAccount } from '../utils/parseAccount.js'\nimport { uid } from '../utils/uid.js'\n\nexport type ClientConfig<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n accountOrAddress extends Account | Address | undefined =\n | Account\n | Address\n | undefined,\n rpcSchema extends RpcSchema | undefined = undefined,\n> = {\n /** The Account to use for the Client. This will be used for Actions that require an account as an argument. */\n account?: accountOrAddress | Account | Address | undefined\n /** Flags for batch settings. */\n batch?:\n | {\n /** Toggle to enable `eth_call` multicall aggregation. */\n multicall?: boolean | Prettify<MulticallBatchOptions> | undefined\n }\n | undefined\n /**\n * Time (in ms) that cached data will remain in memory.\n * @default 4_000\n */\n cacheTime?: number | undefined\n /** Chain for the client. */\n chain?: Chain | undefined | chain\n /** A key for the client. */\n key?: string | undefined\n /** A name for the client. */\n name?: string | undefined\n /**\n * Frequency (in ms) for polling enabled actions & events.\n * @default 4_000\n */\n pollingInterval?: number | undefined\n /**\n * Typed JSON-RPC schema for the client.\n */\n rpcSchema?: rpcSchema | undefined\n /** The RPC transport */\n transport: transport\n /** The type of client. */\n type?: string | undefined\n}\n\n// TODO: Move `transport` to slot index 2 since `chain` and `account` used more frequently.\n// Otherwise, we end up with a lot of `Client<Transport, chain, account>` in actions.\nexport type Client<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends Account | undefined = Account | undefined,\n rpcSchema extends RpcSchema | undefined = undefined,\n extended extends Extended | undefined = Extended | undefined,\n> = Client_Base<transport, chain, account, rpcSchema> &\n (extended extends Extended ? extended : unknown) & {\n extend: <const client extends Extended>(\n fn: (\n client: Client<transport, chain, account, rpcSchema, extended>\n ) => client\n ) => Client<\n transport,\n chain,\n account,\n rpcSchema,\n Prettify<client> & (extended extends Extended ? extended : unknown)\n >\n }\n\ntype Client_Base<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends Account | undefined = Account | undefined,\n rpcSchema extends RpcSchema | undefined = undefined,\n> = {\n /** The Account of the Client. */\n account: account\n /** Time (in ms) that cached data will remain in memory. */\n cacheTime: number\n /** Chain for the client. */\n chain: chain\n /** A key for the client. */\n key: string\n /** A name for the client. */\n name: string\n /** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */\n pollingInterval: number\n /** Request function wrapped with friendly error handling */\n request: BtcRpcRequestFn<\n rpcSchema extends undefined ? BitcoinRpcMethods : rpcSchema\n >\n /** The RPC transport */\n transport: ReturnType<transport>['config'] & ReturnType<transport>['value']\n /** The type of client. */\n type: string\n /** A unique ID for the client. */\n uid: string\n}\n\ntype Extended = Prettify<\n // disallow redefining base properties\n { [_ in keyof Client_Base]?: undefined } & {\n [key: string]: unknown\n }\n>\n\nexport type MulticallBatchOptions = {\n /** The maximum size (in bytes) for each calldata chunk. @default 1_024 */\n batchSize?: number | undefined\n /** The maximum number of milliseconds to wait before sending a batch. @default 0 */\n wait?: number | undefined\n}\n\nexport type CreateClientErrorType = ErrorType\n\nexport function createClient<\n transport extends Transport,\n chain extends Chain | undefined = undefined,\n accountOrAddress extends Account | Address | undefined = undefined,\n rpcSchema extends RpcSchema | undefined = undefined,\n>(\n parameters: ClientConfig<transport, chain, accountOrAddress, rpcSchema>\n): Prettify<\n Client<\n transport,\n chain,\n accountOrAddress extends Address ? Prettify<Account> : accountOrAddress,\n rpcSchema\n >\n>\n\nexport function createClient(parameters: ClientConfig): Client {\n const {\n cacheTime = parameters.pollingInterval ?? 4_000,\n\n key = 'base',\n name = 'Base Client',\n pollingInterval = 4_000,\n type = 'base',\n } = parameters\n\n const chain = parameters.chain\n const account = parameters.account\n ? parseAccount(parameters.account)\n : undefined\n const { config, request, value } = parameters.transport({\n chain,\n pollingInterval,\n })\n const transport = { ...config, ...value }\n\n const client = {\n account,\n cacheTime,\n\n chain,\n key,\n name,\n pollingInterval,\n request,\n transport,\n type,\n uid: uid(),\n }\n\n function extend(base: typeof client) {\n type ExtendFn = (base: typeof client) => unknown\n return (extendFn: ExtendFn) => {\n const extended = extendFn(base) as Extended\n for (const key in client) {\n delete extended[key]\n }\n const combined = { ...base, ...extended }\n return Object.assign(combined, { extend: extend(combined as any) })\n }\n }\n\n return Object.assign(client, { extend: extend(client) as any })\n}\n\n/**\n * Defines a typed JSON-RPC schema for the client.\n * Note: This is a runtime noop function.\n */\nexport function rpcSchema<rpcSchema extends RpcSchema>(): rpcSchema {\n return null as any\n}\n"],"mappings":";;;;AA6IA,SAAgB,aAAa,YAAkC;CAC7D,MAAM,EACJ,YAAY,WAAW,mBAAmB,KAE1C,MAAM,QACN,OAAO,eACP,kBAAkB,KAClB,OAAO,WACL;CAEJ,MAAM,QAAQ,WAAW;CACzB,MAAM,UAAU,WAAW,UACvBA,2BAAAA,aAAa,WAAW,OAAO,IAC/B,KAAA;CACJ,MAAM,EAAE,QAAQ,SAAS,UAAU,WAAW,UAAU;EACtD;EACA;CACF,CAAC;CAGD,MAAM,SAAS;EACb;EACA;EAEA;EACA;EACA;EACA;EACA;EACA,WAAA;GAXkB,GAAG;GAAQ,GAAG;EAWxB;EACR;EACA,KAAKC,kBAAAA,IAAI;CACX;CAEA,SAAS,OAAO,MAAqB;EAEnC,QAAQ,aAAuB;GAC7B,MAAM,WAAW,SAAS,IAAI;GAC9B,KAAK,MAAM,OAAO,QAChB,OAAO,SAAS;GAElB,MAAM,WAAW;IAAE,GAAG;IAAM,GAAG;GAAS;GACxC,OAAO,OAAO,OAAO,UAAU,EAAE,QAAQ,OAAO,QAAe,EAAE,CAAC;EACpE;CACF;CAEA,OAAO,OAAO,OAAO,QAAQ,EAAE,QAAQ,OAAO,MAAM,EAAS,CAAC;AAChE;;;;;AAMA,SAAgB,YAAoD;CAClE,OAAO;AACT"}
|