@bigmi/core 0.4.0 → 0.4.3
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 +16 -0
- package/dist/cjs/clients/decorators/public.d.ts +2 -2
- package/dist/cjs/clients/decorators/public.js +1 -1
- package/dist/cjs/clients/decorators/public.js.map +1 -1
- package/dist/cjs/errors/request.d.ts +2 -1
- package/dist/cjs/errors/request.js +2 -2
- package/dist/cjs/errors/request.js.map +1 -1
- package/dist/cjs/errors/rpc.d.ts +2 -1
- package/dist/cjs/errors/rpc.js +1 -0
- package/dist/cjs/errors/rpc.js.map +1 -1
- package/dist/cjs/factories/createClient.d.ts +2 -2
- package/dist/cjs/factories/createClient.js.map +1 -1
- package/dist/cjs/index.d.ts +42 -43
- package/dist/cjs/index.js +75 -75
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/transports/ankr/ankr.js +1 -0
- package/dist/cjs/transports/ankr/ankr.js.map +1 -1
- package/dist/cjs/transports/ankr/getBalance.js +2 -1
- package/dist/cjs/transports/ankr/getBalance.js.map +1 -1
- package/dist/cjs/transports/blockchair/blockchair.js +1 -0
- package/dist/cjs/transports/blockchair/blockchair.js.map +1 -1
- package/dist/cjs/transports/blockchair/getBalance.js +7 -2
- package/dist/cjs/transports/blockchair/getBalance.js.map +1 -1
- package/dist/cjs/transports/blockchair/getTransactionFee.js +7 -2
- package/dist/cjs/transports/blockchair/getTransactionFee.js.map +1 -1
- package/dist/cjs/transports/blockchair/getUTXOs.js +4 -1
- package/dist/cjs/transports/blockchair/getUTXOs.js.map +1 -1
- package/dist/cjs/transports/blockcypher/blockcypher.js +1 -0
- package/dist/cjs/transports/blockcypher/blockcypher.js.map +1 -1
- package/dist/cjs/transports/blockcypher/getBalance.js +5 -1
- package/dist/cjs/transports/blockcypher/getBalance.js.map +1 -1
- package/dist/cjs/transports/blockcypher/getTransactionFee.js +2 -1
- package/dist/cjs/transports/blockcypher/getTransactionFee.js.map +1 -1
- package/dist/cjs/transports/blockcypher/getUTXOs.js +3 -2
- package/dist/cjs/transports/blockcypher/getUTXOs.js.map +1 -1
- package/dist/cjs/transports/blockcypher/utils.d.ts +2 -0
- package/dist/cjs/transports/blockcypher/utils.js +11 -0
- package/dist/cjs/transports/blockcypher/utils.js.map +1 -0
- package/dist/cjs/transports/getHttpRpcClient.js +5 -1
- package/dist/cjs/transports/getHttpRpcClient.js.map +1 -1
- package/dist/cjs/transports/mempool/mempool.js +1 -0
- package/dist/cjs/transports/mempool/mempool.js.map +1 -1
- package/dist/cjs/utils/deepEqual.js +1 -1
- package/dist/cjs/utils/deepEqual.js.map +1 -1
- package/dist/cjs/utils/getAction.d.ts +2 -2
- package/dist/cjs/utils/getAction.js.map +1 -1
- package/dist/cjs/utils/poll.js +1 -1
- package/dist/cjs/utils/poll.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/esm/actions/waitForTransaction.js +1 -1
- package/dist/esm/actions/waitForTransaction.js.map +1 -1
- package/dist/esm/clients/decorators/public.d.ts +2 -2
- package/dist/esm/clients/decorators/public.js +1 -1
- package/dist/esm/clients/decorators/public.js.map +1 -1
- package/dist/esm/errors/request.d.ts +2 -1
- package/dist/esm/errors/request.js +2 -2
- package/dist/esm/errors/request.js.map +1 -1
- package/dist/esm/errors/rpc.d.ts +5 -1
- package/dist/esm/errors/rpc.js +4 -0
- package/dist/esm/errors/rpc.js.map +1 -1
- package/dist/esm/factories/createClient.d.ts +2 -2
- package/dist/esm/factories/createClient.js.map +1 -1
- package/dist/esm/index.d.ts +42 -43
- package/dist/esm/index.js +29 -29
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/transports/ankr/ankr.js +1 -0
- package/dist/esm/transports/ankr/ankr.js.map +1 -1
- package/dist/esm/transports/ankr/getBalance.js +2 -1
- package/dist/esm/transports/ankr/getBalance.js.map +1 -1
- package/dist/esm/transports/blockchair/blockchair.js +1 -0
- package/dist/esm/transports/blockchair/blockchair.js.map +1 -1
- package/dist/esm/transports/blockchair/getBalance.js +7 -2
- package/dist/esm/transports/blockchair/getBalance.js.map +1 -1
- package/dist/esm/transports/blockchair/getTransactionFee.js +7 -2
- package/dist/esm/transports/blockchair/getTransactionFee.js.map +1 -1
- package/dist/esm/transports/blockchair/getUTXOs.js +4 -1
- package/dist/esm/transports/blockchair/getUTXOs.js.map +1 -1
- package/dist/esm/transports/blockcypher/blockcypher.js +1 -0
- package/dist/esm/transports/blockcypher/blockcypher.js.map +1 -1
- package/dist/esm/transports/blockcypher/getBalance.js +5 -1
- package/dist/esm/transports/blockcypher/getBalance.js.map +1 -1
- package/dist/esm/transports/blockcypher/getTransactionFee.js +2 -1
- package/dist/esm/transports/blockcypher/getTransactionFee.js.map +1 -1
- package/dist/esm/transports/blockcypher/getUTXOs.js +3 -2
- package/dist/esm/transports/blockcypher/getUTXOs.js.map +1 -1
- package/dist/esm/transports/blockcypher/utils.d.ts +2 -0
- package/dist/esm/transports/blockcypher/utils.js +8 -0
- package/dist/esm/transports/blockcypher/utils.js.map +1 -0
- package/dist/esm/transports/getHttpRpcClient.js +5 -1
- package/dist/esm/transports/getHttpRpcClient.js.map +1 -1
- package/dist/esm/transports/http.js.map +1 -1
- package/dist/esm/transports/mempool/mempool.js +1 -0
- package/dist/esm/transports/mempool/mempool.js.map +1 -1
- package/dist/esm/utils/cancelTransaction.js +1 -1
- package/dist/esm/utils/cancelTransaction.js.map +1 -1
- package/dist/esm/utils/deepEqual.js +2 -2
- package/dist/esm/utils/deepEqual.js.map +1 -1
- package/dist/esm/utils/getAction.d.ts +2 -2
- package/dist/esm/utils/getAction.js.map +1 -1
- package/dist/esm/utils/getAddressInfo.js.map +1 -1
- package/dist/esm/utils/modifyFee.js +1 -1
- package/dist/esm/utils/modifyFee.js.map +1 -1
- package/dist/esm/utils/poll.js +1 -1
- package/dist/esm/utils/poll.js.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/types/actions/waitForTransaction.d.ts.map +1 -1
- package/dist/types/clients/decorators/public.d.ts +2 -2
- package/dist/types/clients/decorators/public.d.ts.map +1 -1
- package/dist/types/errors/request.d.ts +2 -1
- package/dist/types/errors/request.d.ts.map +1 -1
- package/dist/types/errors/rpc.d.ts +5 -1
- package/dist/types/errors/rpc.d.ts.map +1 -1
- package/dist/types/factories/createClient.d.ts +2 -2
- package/dist/types/factories/createClient.d.ts.map +1 -1
- package/dist/types/index.d.ts +42 -43
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/transports/ankr/ankr.d.ts.map +1 -1
- package/dist/types/transports/ankr/getBalance.d.ts.map +1 -1
- package/dist/types/transports/blockchair/blockchair.d.ts.map +1 -1
- package/dist/types/transports/blockchair/getBalance.d.ts.map +1 -1
- package/dist/types/transports/blockchair/getTransactionFee.d.ts.map +1 -1
- package/dist/types/transports/blockchair/getUTXOs.d.ts.map +1 -1
- package/dist/types/transports/blockcypher/blockcypher.d.ts.map +1 -1
- package/dist/types/transports/blockcypher/getBalance.d.ts.map +1 -1
- package/dist/types/transports/blockcypher/getTransactionFee.d.ts.map +1 -1
- package/dist/types/transports/blockcypher/getUTXOs.d.ts.map +1 -1
- package/dist/types/transports/blockcypher/utils.d.ts +3 -0
- package/dist/types/transports/blockcypher/utils.d.ts.map +1 -0
- package/dist/types/transports/fallback.d.ts.map +1 -1
- package/dist/types/transports/getHttpRpcClient.d.ts.map +1 -1
- package/dist/types/transports/http.d.ts.map +1 -1
- package/dist/types/transports/mempool/mempool.d.ts.map +1 -1
- package/dist/types/utils/cancelTransaction.d.ts.map +1 -1
- package/dist/types/utils/getAction.d.ts +2 -2
- package/dist/types/utils/getAction.d.ts.map +1 -1
- package/dist/types/utils/modifyFee.d.ts.map +1 -1
- package/dist/types/utils/withTimeout.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/package.json.tmp +7 -3
- package/src/actions/waitForTransaction.ts +1 -1
- package/src/clients/decorators/public.ts +6 -7
- package/src/errors/request.ts +3 -1
- package/src/errors/rpc.ts +4 -0
- package/src/factories/createClient.ts +2 -4
- package/src/index.ts +103 -114
- package/src/transports/ankr/ankr.ts +2 -1
- package/src/transports/ankr/getBalance.ts +2 -1
- package/src/transports/blockchair/blockchair.spec.ts +85 -61
- package/src/transports/blockchair/blockchair.ts +1 -1
- package/src/transports/blockchair/getBalance.ts +10 -2
- package/src/transports/blockchair/getTransactionFee.ts +10 -2
- package/src/transports/blockchair/getUTXOs.ts +5 -1
- package/src/transports/blockcypher/blockcypher.ts +1 -0
- package/src/transports/blockcypher/getBalance.ts +5 -1
- package/src/transports/blockcypher/getTransactionFee.ts +2 -1
- package/src/transports/blockcypher/getUTXOs.ts +3 -2
- package/src/transports/blockcypher/utils.ts +8 -0
- package/src/transports/custom.ts +1 -1
- package/src/transports/fallback.ts +3 -3
- package/src/transports/getHttpRpcClient.ts +5 -1
- package/src/transports/http.ts +1 -1
- package/src/transports/mempool/mempool.spec.ts +3 -4
- package/src/transports/mempool/mempool.ts +1 -0
- package/src/utils/cancelTransaction.ts +1 -1
- package/src/utils/deepEqual.ts +2 -2
- package/src/utils/getAction.ts +2 -3
- package/src/utils/getAddressInfo.ts +1 -1
- package/src/utils/modifyFee.ts +1 -1
- package/src/utils/poll.ts +1 -1
- package/src/utils/withTimeout.ts +3 -1
- package/src/version.ts +1 -1
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,41 +1,58 @@
|
|
|
1
1
|
export { getBalance } from './actions/getBalance.js';
|
|
2
|
-
export { getBlock } from './actions/getBlock.js';
|
|
3
2
|
export type { GetBlockParameters, GetBlockReturnType, } from './actions/getBlock.js';
|
|
4
|
-
export {
|
|
3
|
+
export { getBlock } from './actions/getBlock.js';
|
|
5
4
|
export type { GetBlockCountReturnType } from './actions/getBlockCount.js';
|
|
6
|
-
export {
|
|
5
|
+
export { getBlockCount } from './actions/getBlockCount.js';
|
|
7
6
|
export type { GetBlockStatsParameters, GetBlockStatsReturnType, } from './actions/getBlockStats.js';
|
|
8
|
-
export {
|
|
7
|
+
export { getBlockStats } from './actions/getBlockStats.js';
|
|
9
8
|
export type { GetTransactionFeeParameters, GetTransactionFeeReturnType, } from './actions/getTransactionFee.js';
|
|
10
|
-
export {
|
|
9
|
+
export { getTransactionFee } from './actions/getTransactionFee.js';
|
|
10
|
+
export type { GetTransactionsParameters, GetTransactionsReturnType, } from './actions/getTransactions.js';
|
|
11
|
+
export { getTransactions } from './actions/getTransactions.js';
|
|
12
|
+
export type { GetUTXOsParameters, GetUTXOsReturnType, } from './actions/getUTXOs.js';
|
|
13
|
+
export { getUTXOs } from './actions/getUTXOs.js';
|
|
11
14
|
export type { GetUTXOTransactionParameters, GetUTXOTransactionReturnType, } from './actions/getUTXOTransaction.js';
|
|
12
|
-
export {
|
|
15
|
+
export { getUTXOTransaction } from './actions/getUTXOTransaction.js';
|
|
13
16
|
export type { SendUTXOTransactionParameters, SendUTXOTransactionReturnType, } from './actions/sendUTXOTransaction.js';
|
|
17
|
+
export { sendUTXOTransaction } from './actions/sendUTXOTransaction.js';
|
|
14
18
|
export { signPsbt } from './actions/signPsbt.js';
|
|
15
|
-
export { waitForTransaction } from './actions/waitForTransaction.js';
|
|
16
19
|
export type { ReplacementReason, ReplacementReturnType, WaitForTransactionReceiptParameters, WaitForTransactionReceiptReturnType, WithRetryParameters, } from './actions/waitForTransaction.js';
|
|
17
|
-
export {
|
|
20
|
+
export { waitForTransaction } from './actions/waitForTransaction.js';
|
|
18
21
|
export type { OnBlockNumberFn, OnBlockNumberParameter, WatchBlockNumberParameters, WatchBlockNumberReturnType, } from './actions/watchBlockNumber.js';
|
|
19
|
-
export {
|
|
20
|
-
export
|
|
21
|
-
export {
|
|
22
|
-
export type { GetTransactionsParameters, GetTransactionsReturnType, } from './actions/getTransactions.js';
|
|
22
|
+
export { watchBlockNumber } from './actions/watchBlockNumber.js';
|
|
23
|
+
export { bitcoin } from './chains/bitcoin.js';
|
|
24
|
+
export { defineChain } from './chains/defineChain.js';
|
|
23
25
|
export { type PublicActions, publicActions, } from './clients/decorators/public.js';
|
|
24
26
|
export { type WalletActions, walletActions, } from './clients/decorators/wallet.js';
|
|
27
|
+
export { InvalidAddressError, type InvalidAddressErrorType, } from './errors/address.js';
|
|
28
|
+
export { BaseError, type BaseErrorType } from './errors/base.js';
|
|
29
|
+
export { BlockNotFoundError } from './errors/block.js';
|
|
30
|
+
export { ChainNotConfiguredError, ConnectorAccountNotFoundError, ConnectorAlreadyConnectedError, ConnectorChainMismatchError, ConnectorNotConnectedError, ConnectorNotFoundError, } from './errors/config.js';
|
|
31
|
+
export { ProviderNotFoundError } from './errors/provider.js';
|
|
32
|
+
export { HttpRequestError, RpcRequestError, SocketClosedError, TimeoutError, } from './errors/request.js';
|
|
33
|
+
export { MethodNotSupportedRpcError, ParseError, RpcErrorCode, UserRejectedRequestError, } from './errors/rpc.js';
|
|
34
|
+
export { TransactionNotFoundError, TransactionReceiptNotFoundError, WaitForTransactionReceiptTimeoutError, } from './errors/transaction.js';
|
|
35
|
+
export type { AllTransportsFailedErrorType, TransportMethodNotSupportedErrorType, UrlRequiredErrorType, } from './errors/transport.js';
|
|
36
|
+
export { AllTransportsFailedError, UrlRequiredError, } from './errors/transport.js';
|
|
37
|
+
export type { ErrorType } from './errors/utils.js';
|
|
38
|
+
export { InsufficientUTXOBalanceError, type InsufficientUTXOBalanceErrorType, } from './errors/utxo.js';
|
|
39
|
+
export { createClient, rpcSchema } from './factories/createClient.js';
|
|
40
|
+
export { ankr } from './transports/ankr/ankr.js';
|
|
25
41
|
export { ankrMethods } from './transports/ankr/methods.js';
|
|
42
|
+
export { blockchair } from './transports/blockchair/blockchair.js';
|
|
26
43
|
export { blockchairMethods } from './transports/blockchair/methods.js';
|
|
44
|
+
export { blockcypher } from './transports/blockcypher/blockcypher.js';
|
|
27
45
|
export { blockcypherMethods } from './transports/blockcypher/methods.js';
|
|
28
|
-
export {
|
|
46
|
+
export { custom } from './transports/custom.js';
|
|
47
|
+
export { type FallbackTransport, type FallbackTransportConfig, type FallbackTransportErrorType, fallback, } from './transports/fallback.js';
|
|
29
48
|
export type { HttpRequestParameters, HttpRpcClient, RpcRequest, } from './transports/getHttpRpcClient.js';
|
|
49
|
+
export { getHttpRpcClient } from './transports/getHttpRpcClient.js';
|
|
30
50
|
export { getRpcProviderMethods } from './transports/getRpcProviderMethods.js';
|
|
51
|
+
export { type HttpTransport, type HttpTransportConfig, type HttpTransportErrorType, http, } from './transports/http.js';
|
|
52
|
+
export { mempool } from './transports/mempool/mempool.js';
|
|
31
53
|
export { mempoolMethods } from './transports/mempool/methods.js';
|
|
32
|
-
export type { ErrorResult, RpcMethodHandler, RpcMethods, RpcResponse,
|
|
54
|
+
export type { ErrorResult, RpcMethodHandler, RpcMethods, RpcResponse, SignPsbtParameters, SignPsbtReturnType, SuccessResult, UTXOSchema, UTXOWalletSchema, } from './transports/types.js';
|
|
33
55
|
export { utxo } from './transports/utxo.js';
|
|
34
|
-
export { custom } from './transports/custom.js';
|
|
35
|
-
export { ankr } from './transports/ankr/ankr.js';
|
|
36
|
-
export { blockchair } from './transports/blockchair/blockchair.js';
|
|
37
|
-
export { blockcypher } from './transports/blockcypher/blockcypher.js';
|
|
38
|
-
export { mempool } from './transports/mempool/mempool.js';
|
|
39
56
|
export type { Account } from './types/account.js';
|
|
40
57
|
export { type Address, type AddressInfo, type AddressPurpose, AddressType, Network, } from './types/address.js';
|
|
41
58
|
export type { BlockTag } from './types/block.js';
|
|
@@ -46,36 +63,18 @@ export type { Hash } from './types/hash.js';
|
|
|
46
63
|
export type { BtcRpcRequestFn, BtcRpcRequestOptions, RpcParameters, RpcSchema, RpcSchemaOverride, } from './types/request.js';
|
|
47
64
|
export type { BitcoinRpcMethods, WalletRpcSchema, } from './types/rpc.js';
|
|
48
65
|
export type { UTXOTransaction } from './types/transaction.js';
|
|
49
|
-
export type {
|
|
66
|
+
export type { Transport } from './types/transport.js';
|
|
67
|
+
export type { Assign, Compute, ExactPartial, IsNarrowable, IsNever, IsUnknown, LooseOmit, OneOf, RemoveUndefined, UnionStrictOmit, } from './types/utils.js';
|
|
50
68
|
export { cancelTransaction } from './utils/cancelTransaction.js';
|
|
69
|
+
export { base64ToHex, base64urlEncode, hexToBase64, hexToUnit8Array, stringToHex, } from './utils/converter.js';
|
|
70
|
+
export { deepEqual } from './utils/deepEqual.js';
|
|
51
71
|
export { getAddressInfo } from './utils/getAddressInfo.js';
|
|
52
72
|
export { isAddress as isUTXOAddress } from './utils/isAddress.js';
|
|
53
73
|
export { modifyFee } from './utils/modifyFee.js';
|
|
54
74
|
export { cleanupCache, listenersCache, observe } from './utils/observe.js';
|
|
75
|
+
export { parseAccount } from './utils/parseAccount.js';
|
|
55
76
|
export { poll } from './utils/poll.js';
|
|
56
|
-
export {
|
|
77
|
+
export { uid } from './utils/uid.js';
|
|
57
78
|
export { withRetry } from './utils/withRetry.js';
|
|
58
|
-
export { parseAccount } from './utils/parseAccount.js';
|
|
59
|
-
export { deepEqual } from './utils/deepEqual.js';
|
|
60
79
|
export { withTimeout } from './utils/withTimeout.js';
|
|
61
|
-
export { createClient, rpcSchema } from './factories/createClient.js';
|
|
62
|
-
export { bitcoin } from './chains/bitcoin.js';
|
|
63
|
-
export { defineChain } from './chains/defineChain.js';
|
|
64
|
-
export { InvalidAddressError, type InvalidAddressErrorType, } from './errors/address.js';
|
|
65
|
-
export { BaseError, type BaseErrorType } from './errors/base.js';
|
|
66
|
-
export { BlockNotFoundError } from './errors/block.js';
|
|
67
|
-
export { ChainNotConfiguredError, ConnectorAccountNotFoundError, ConnectorAlreadyConnectedError, ConnectorChainMismatchError, ConnectorNotConnectedError, ConnectorNotFoundError, } from './errors/config.js';
|
|
68
|
-
export { ProviderNotFoundError } from './errors/provider.js';
|
|
69
|
-
export { HttpRequestError, RpcRequestError, SocketClosedError, TimeoutError, } from './errors/request.js';
|
|
70
|
-
export { MethodNotSupportedRpcError, ParseError, RpcErrorCode, UserRejectedRequestError, } from './errors/rpc.js';
|
|
71
|
-
export { TransactionNotFoundError, TransactionReceiptNotFoundError, WaitForTransactionReceiptTimeoutError, } from './errors/transaction.js';
|
|
72
|
-
export { InsufficientUTXOBalanceError, type InsufficientUTXOBalanceErrorType, } from './errors/utxo.js';
|
|
73
|
-
export { UrlRequiredError, AllTransportsFailedError, } from './errors/transport.js';
|
|
74
|
-
export type { UrlRequiredErrorType, AllTransportsFailedErrorType, TransportMethodNotSupportedErrorType, } from './errors/transport.js';
|
|
75
|
-
export type { ErrorType } from './errors/utils.js';
|
|
76
|
-
export { http, type HttpTransport, type HttpTransportConfig, type HttpTransportErrorType, } from './transports/http.js';
|
|
77
|
-
export { fallback, type FallbackTransport, type FallbackTransportConfig, type FallbackTransportErrorType, } from './transports/fallback.js';
|
|
78
|
-
export type { Transport } from './types/transport.js';
|
|
79
|
-
export type { OneOf, RemoveUndefined } from './types/utils.js';
|
|
80
|
-
export { uid } from './utils/uid.js';
|
|
81
80
|
export { version } from './version.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -4,60 +4,60 @@ export { getBlock } from './actions/getBlock.js';
|
|
|
4
4
|
export { getBlockCount } from './actions/getBlockCount.js';
|
|
5
5
|
export { getBlockStats } from './actions/getBlockStats.js';
|
|
6
6
|
export { getTransactionFee } from './actions/getTransactionFee.js';
|
|
7
|
+
export { getTransactions } from './actions/getTransactions.js';
|
|
8
|
+
export { getUTXOs } from './actions/getUTXOs.js';
|
|
7
9
|
export { getUTXOTransaction } from './actions/getUTXOTransaction.js';
|
|
8
10
|
export { sendUTXOTransaction } from './actions/sendUTXOTransaction.js';
|
|
9
11
|
export { signPsbt } from './actions/signPsbt.js';
|
|
10
12
|
export { waitForTransaction } from './actions/waitForTransaction.js';
|
|
11
13
|
export { watchBlockNumber } from './actions/watchBlockNumber.js';
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
+
// Exporting chains
|
|
15
|
+
export { bitcoin } from './chains/bitcoin.js';
|
|
16
|
+
export { defineChain } from './chains/defineChain.js';
|
|
14
17
|
// Exporting clients
|
|
15
18
|
export { publicActions, } from './clients/decorators/public.js';
|
|
16
19
|
export { walletActions, } from './clients/decorators/wallet.js';
|
|
20
|
+
// Exporting errors
|
|
21
|
+
export { InvalidAddressError, } from './errors/address.js';
|
|
22
|
+
export { BaseError } from './errors/base.js';
|
|
23
|
+
export { BlockNotFoundError } from './errors/block.js';
|
|
24
|
+
export { ChainNotConfiguredError, ConnectorAccountNotFoundError, ConnectorAlreadyConnectedError, ConnectorChainMismatchError, ConnectorNotConnectedError, ConnectorNotFoundError, } from './errors/config.js';
|
|
25
|
+
export { ProviderNotFoundError } from './errors/provider.js';
|
|
26
|
+
export { HttpRequestError, RpcRequestError, SocketClosedError, TimeoutError, } from './errors/request.js';
|
|
27
|
+
export { MethodNotSupportedRpcError, ParseError, RpcErrorCode, UserRejectedRequestError, } from './errors/rpc.js';
|
|
28
|
+
export { TransactionNotFoundError, TransactionReceiptNotFoundError, WaitForTransactionReceiptTimeoutError, } from './errors/transaction.js';
|
|
29
|
+
export { AllTransportsFailedError, UrlRequiredError, } from './errors/transport.js';
|
|
30
|
+
export { InsufficientUTXOBalanceError, } from './errors/utxo.js';
|
|
31
|
+
// Exporting factories
|
|
32
|
+
export { createClient, rpcSchema } from './factories/createClient.js';
|
|
33
|
+
export { ankr } from './transports/ankr/ankr.js';
|
|
17
34
|
// Exporting transports
|
|
18
35
|
export { ankrMethods } from './transports/ankr/methods.js';
|
|
36
|
+
export { blockchair } from './transports/blockchair/blockchair.js';
|
|
19
37
|
export { blockchairMethods } from './transports/blockchair/methods.js';
|
|
38
|
+
export { blockcypher } from './transports/blockcypher/blockcypher.js';
|
|
20
39
|
export { blockcypherMethods } from './transports/blockcypher/methods.js';
|
|
40
|
+
export { custom } from './transports/custom.js';
|
|
41
|
+
export { fallback, } from './transports/fallback.js';
|
|
21
42
|
export { getHttpRpcClient } from './transports/getHttpRpcClient.js';
|
|
22
43
|
export { getRpcProviderMethods } from './transports/getRpcProviderMethods.js';
|
|
44
|
+
export { http, } from './transports/http.js';
|
|
45
|
+
export { mempool } from './transports/mempool/mempool.js';
|
|
23
46
|
export { mempoolMethods } from './transports/mempool/methods.js';
|
|
24
47
|
export { utxo } from './transports/utxo.js';
|
|
25
|
-
export { custom } from './transports/custom.js';
|
|
26
|
-
export { ankr } from './transports/ankr/ankr.js';
|
|
27
|
-
export { blockchair } from './transports/blockchair/blockchair.js';
|
|
28
|
-
export { blockcypher } from './transports/blockcypher/blockcypher.js';
|
|
29
|
-
export { mempool } from './transports/mempool/mempool.js';
|
|
30
48
|
export { AddressType, Network, } from './types/address.js';
|
|
31
49
|
// Exporting utils
|
|
32
50
|
export { cancelTransaction } from './utils/cancelTransaction.js';
|
|
51
|
+
export { base64ToHex, base64urlEncode, hexToBase64, hexToUnit8Array, stringToHex, } from './utils/converter.js';
|
|
52
|
+
export { deepEqual } from './utils/deepEqual.js';
|
|
33
53
|
export { getAddressInfo } from './utils/getAddressInfo.js';
|
|
34
54
|
export { isAddress as isUTXOAddress } from './utils/isAddress.js';
|
|
35
55
|
export { modifyFee } from './utils/modifyFee.js';
|
|
36
56
|
export { cleanupCache, listenersCache, observe } from './utils/observe.js';
|
|
57
|
+
export { parseAccount } from './utils/parseAccount.js';
|
|
37
58
|
export { poll } from './utils/poll.js';
|
|
38
|
-
export {
|
|
59
|
+
export { uid } from './utils/uid.js';
|
|
39
60
|
export { withRetry } from './utils/withRetry.js';
|
|
40
|
-
export { parseAccount } from './utils/parseAccount.js';
|
|
41
|
-
export { deepEqual } from './utils/deepEqual.js';
|
|
42
61
|
export { withTimeout } from './utils/withTimeout.js';
|
|
43
|
-
// Exporting factories
|
|
44
|
-
export { createClient, rpcSchema } from './factories/createClient.js';
|
|
45
|
-
// Exporting chains
|
|
46
|
-
export { bitcoin } from './chains/bitcoin.js';
|
|
47
|
-
export { defineChain } from './chains/defineChain.js';
|
|
48
|
-
// Exporting errors
|
|
49
|
-
export { InvalidAddressError, } from './errors/address.js';
|
|
50
|
-
export { BaseError } from './errors/base.js';
|
|
51
|
-
export { BlockNotFoundError } from './errors/block.js';
|
|
52
|
-
export { ChainNotConfiguredError, ConnectorAccountNotFoundError, ConnectorAlreadyConnectedError, ConnectorChainMismatchError, ConnectorNotConnectedError, ConnectorNotFoundError, } from './errors/config.js';
|
|
53
|
-
export { ProviderNotFoundError } from './errors/provider.js';
|
|
54
|
-
export { HttpRequestError, RpcRequestError, SocketClosedError, TimeoutError, } from './errors/request.js';
|
|
55
|
-
export { MethodNotSupportedRpcError, ParseError, RpcErrorCode, UserRejectedRequestError, } from './errors/rpc.js';
|
|
56
|
-
export { TransactionNotFoundError, TransactionReceiptNotFoundError, WaitForTransactionReceiptTimeoutError, } from './errors/transaction.js';
|
|
57
|
-
export { InsufficientUTXOBalanceError, } from './errors/utxo.js';
|
|
58
|
-
export { UrlRequiredError, AllTransportsFailedError, } from './errors/transport.js';
|
|
59
|
-
export { http, } from './transports/http.js';
|
|
60
|
-
export { fallback, } from './transports/fallback.js';
|
|
61
|
-
export { uid } from './utils/uid.js';
|
|
62
62
|
export { version } from './version.js';
|
|
63
63
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAKpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAK1D,OAAO,EAAE,aAAa,EAAE,MAAM,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AI,CACT,mDAAmD,MAAM,CAAC,MAAM,SAAS,EACzE;QACE,GAAG,EAAE,MAAM;QACX,OAAO;QACP,GAAG,MAAM;KACV,CACF,CAAA;AACH,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"ankr.js","sourceRoot":"","sources":["../../../../src/transports/ankr/ankr.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAI1C,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,MAAmB,EAAE,EAAE;IAC1C,MAAM,OAAO,GAA+B;QAC1C,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAiB;KAClD,CAAA;IACD,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IAClE,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QACpB,MAAM,KAAK,CAAC,0BAA0B,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,IAAI,CACT,mDAAmD,MAAM,CAAC,MAAM,SAAS,EACzE;QACE,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,MAAM;QACX,OAAO;QACP,GAAG,MAAM;KACV,CACF,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RpcErrorCode } from '../../errors/rpc.js';
|
|
1
2
|
export const getBalance = async (client, { baseUrl }, { address }) => {
|
|
2
3
|
const apiUrl = `${baseUrl}/address/${address}?details=basic`;
|
|
3
4
|
const response = (await client.request({
|
|
@@ -8,7 +9,7 @@ export const getBalance = async (client, { baseUrl }, { address }) => {
|
|
|
8
9
|
}));
|
|
9
10
|
if (response.error) {
|
|
10
11
|
return {
|
|
11
|
-
error: { code:
|
|
12
|
+
error: { code: RpcErrorCode.MISC_ERROR, message: response.error },
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBalance.js","sourceRoot":"","sources":["../../../../src/transports/ankr/getBalance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBalance.js","sourceRoot":"","sources":["../../../../src/transports/ankr/getBalance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAIlD,MAAM,CAAC,MAAM,UAAU,GAAmC,KAAK,EAC7D,MAAM,EACN,EAAE,OAAO,EAAE,EACX,EAAE,OAAO,EAAE,EACX,EAAE;IACF,MAAM,MAAM,GAAG,GAAG,OAAO,YAAY,OAAO,gBAAgB,CAAA;IAE5D,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC;QACrC,GAAG,EAAE,MAAM;QACX,YAAY,EAAE;YACZ,MAAM,EAAE,KAAK;SACd;KACF,CAAC,CAAmC,CAAA;IACrC,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO;YACL,KAAK,EAAE,EAAE,IAAI,EAAE,YAAY,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,EAAE;SAClE,CAAA;IACH,CAAC;IACD,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;KACjC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { utxo } from '../utxo.js';
|
|
2
2
|
import { blockchairMethods } from './methods.js';
|
|
3
3
|
export const blockchair = (config) => utxo(config?.baseUrl || 'https://api.blockchair.com', {
|
|
4
|
+
name: 'Blockchair API',
|
|
4
5
|
key: 'blockchair',
|
|
5
6
|
includeChainToURL: true,
|
|
6
7
|
methods: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockchair.js","sourceRoot":"","sources":["../../../../src/transports/blockchair/blockchair.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blockchair.js","sourceRoot":"","sources":["../../../../src/transports/blockchair/blockchair.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAOhD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAyB,EAAE,EAAE,CACtD,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,4BAA4B,EAAE;IACpD,IAAI,EAAE,gBAAgB;IACtB,GAAG,EAAE,YAAY;IACjB,iBAAiB,EAAE,IAAI;IACvB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAiB;KACxD;IACD,GAAG,MAAM;CACV,CAAC,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RpcErrorCode } from '../../errors/rpc.js';
|
|
1
2
|
import { urlWithParams } from '../../utils/url.js';
|
|
2
3
|
export const getBalance = async (client, { baseUrl, apiKey }, { address }) => {
|
|
3
4
|
const apiUrl = urlWithParams(`${baseUrl}/addresses/balances`, {
|
|
@@ -8,10 +9,14 @@ export const getBalance = async (client, { baseUrl, apiKey }, { address }) => {
|
|
|
8
9
|
url: apiUrl,
|
|
9
10
|
fetchOptions: { method: 'GET' },
|
|
10
11
|
}));
|
|
11
|
-
if (response.
|
|
12
|
+
if (response.data[address] === undefined ||
|
|
13
|
+
response.context.error ||
|
|
14
|
+
response.context?.code !== 200) {
|
|
12
15
|
return {
|
|
13
16
|
error: {
|
|
14
|
-
code: response.context
|
|
17
|
+
code: response.context.code === 429
|
|
18
|
+
? RpcErrorCode.ACCESS_DENIED
|
|
19
|
+
: RpcErrorCode.MISC_ERROR,
|
|
15
20
|
message: response.context?.error,
|
|
16
21
|
},
|
|
17
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBalance.js","sourceRoot":"","sources":["../../../../src/transports/blockchair/getBalance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAOlD,MAAM,CAAC,MAAM,UAAU,GAAmC,KAAK,EAC7D,MAAM,EACN,EAAE,OAAO,EAAE,MAAM,EAAE,EACnB,EAAE,OAAO,EAAE,EACX,EAAE;IACF,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,OAAO,qBAAqB,EAAE;QAC5D,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,OAAO;KACnB,CAAC,CAAA;IACF,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC;QACrC,GAAG,EAAE,MAAM;QACX,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;KAChC,CAAC,CAAgE,CAAA;IAClE,IAAI,QAAQ,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"getBalance.js","sourceRoot":"","sources":["../../../../src/transports/blockchair/getBalance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAOlD,MAAM,CAAC,MAAM,UAAU,GAAmC,KAAK,EAC7D,MAAM,EACN,EAAE,OAAO,EAAE,MAAM,EAAE,EACnB,EAAE,OAAO,EAAE,EACX,EAAE;IACF,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,OAAO,qBAAqB,EAAE;QAC5D,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,OAAO;KACnB,CAAC,CAAA;IACF,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC;QACrC,GAAG,EAAE,MAAM;QACX,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;KAChC,CAAC,CAAgE,CAAA;IAClE,IACE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,SAAS;QACpC,QAAQ,CAAC,OAAO,CAAC,KAAK;QACtB,QAAQ,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG,EAC9B,CAAC;QACD,OAAO;YACL,KAAK,EAAE;gBACL,IAAI,EACF,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,GAAG;oBAC3B,CAAC,CAAC,YAAY,CAAC,aAAa;oBAC5B,CAAC,CAAC,YAAY,CAAC,UAAU;gBAC7B,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,KAAK;aACjC;SACF,CAAA;IACH,CAAC;IACD,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KACvC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RpcErrorCode } from '../../errors/rpc.js';
|
|
1
2
|
import { urlWithParams } from '../../utils/url.js';
|
|
2
3
|
export const getTransactionFee = async (client, { baseUrl, apiKey }, { txId }) => {
|
|
3
4
|
const apiUrl = urlWithParams(`${baseUrl}/dashboards/transaction/${txId}`, {
|
|
@@ -9,10 +10,14 @@ export const getTransactionFee = async (client, { baseUrl, apiKey }, { txId }) =
|
|
|
9
10
|
method: 'GET',
|
|
10
11
|
},
|
|
11
12
|
}));
|
|
12
|
-
if (response.
|
|
13
|
+
if (!response.data[txId] ||
|
|
14
|
+
response.context.error ||
|
|
15
|
+
response.context?.code !== 200) {
|
|
13
16
|
return {
|
|
14
17
|
error: {
|
|
15
|
-
code: response.context
|
|
18
|
+
code: response.context.code === 429
|
|
19
|
+
? RpcErrorCode.ACCESS_DENIED
|
|
20
|
+
: RpcErrorCode.MISC_ERROR,
|
|
16
21
|
message: response.context?.error,
|
|
17
22
|
},
|
|
18
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTransactionFee.js","sourceRoot":"","sources":["../../../../src/transports/blockchair/getTransactionFee.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIlD,MAAM,CAAC,MAAM,iBAAiB,GAA0C,KAAK,EAC3E,MAAM,EACN,EAAE,OAAO,EAAE,MAAM,EAAE,EACnB,EAAE,IAAI,EAAE,EACR,EAAE;IACF,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,OAAO,2BAA2B,IAAI,EAAE,EAAE;QACxE,GAAG,EAAE,MAAM;KACZ,CAAC,CAAA;IACF,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC;QACrC,GAAG,EAAE,MAAM;QACX,YAAY,EAAE;YACZ,MAAM,EAAE,KAAK;SACd;KACF,CAAC,CAA6C,CAAA;IAE/C,IAAI,QAAQ,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"getTransactionFee.js","sourceRoot":"","sources":["../../../../src/transports/blockchair/getTransactionFee.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIlD,MAAM,CAAC,MAAM,iBAAiB,GAA0C,KAAK,EAC3E,MAAM,EACN,EAAE,OAAO,EAAE,MAAM,EAAE,EACnB,EAAE,IAAI,EAAE,EACR,EAAE;IACF,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,OAAO,2BAA2B,IAAI,EAAE,EAAE;QACxE,GAAG,EAAE,MAAM;KACZ,CAAC,CAAA;IACF,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC;QACrC,GAAG,EAAE,MAAM;QACX,YAAY,EAAE;YACZ,MAAM,EAAE,KAAK;SACd;KACF,CAAC,CAA6C,CAAA;IAE/C,IACE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QACpB,QAAQ,CAAC,OAAO,CAAC,KAAK;QACtB,QAAQ,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG,EAC9B,CAAC;QACD,OAAO;YACL,KAAK,EAAE;gBACL,IAAI,EACF,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,GAAG;oBAC3B,CAAC,CAAC,YAAY,CAAC,aAAa;oBAC5B,CAAC,CAAC,YAAY,CAAC,UAAU;gBAC7B,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,KAAK;aACjC;SACF,CAAA;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC;KACpD,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RpcRequestError } from '../../errors/request.js';
|
|
2
|
+
import { RpcErrorCode } from '../../errors/rpc.js';
|
|
2
3
|
import { InsufficientUTXOBalanceError } from '../../errors/utxo.js';
|
|
3
4
|
import { urlWithParams } from '../../utils/url.js';
|
|
4
5
|
import { getBalance } from './getBalance.js';
|
|
@@ -35,7 +36,9 @@ export const getUTXOs = async (client, { baseUrl, apiKey }, { address, minValue
|
|
|
35
36
|
},
|
|
36
37
|
},
|
|
37
38
|
error: {
|
|
38
|
-
code: response.context.code
|
|
39
|
+
code: response.context.code === 429
|
|
40
|
+
? RpcErrorCode.ACCESS_DENIED
|
|
41
|
+
: RpcErrorCode.MISC_ERROR,
|
|
39
42
|
message: response.context.error || 'Error fetching utxos',
|
|
40
43
|
},
|
|
41
44
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUTXOs.js","sourceRoot":"","sources":["../../../../src/transports/blockchair/getUTXOs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAA;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAOlD,O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AAE,CAAA;AAC1B,CAAC,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { utxo } from '../utxo.js';
|
|
2
2
|
import { blockcypherMethods } from './methods.js';
|
|
3
3
|
export const blockcypher = (config) => utxo(config?.baseUrl || 'https://api.blockcypher.com/v1/btc/main', {
|
|
4
|
+
name: 'Blockcypher API',
|
|
4
5
|
key: 'blockcypher',
|
|
5
6
|
methods: {
|
|
6
7
|
include: Object.keys(blockcypherMethods),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockcypher.js","sourceRoot":"","sources":["../../../../src/transports/blockcypher/blockcypher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAOjD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAA0B,EAAE,EAAE,CACxD,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,yCAAyC,EAAE;IACjE,GAAG,EAAE,aAAa;IAClB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAiB;KACzD;IACD,GAAG,MAAM;CACV,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"blockcypher.js","sourceRoot":"","sources":["../../../../src/transports/blockcypher/blockcypher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAOjD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAA0B,EAAE,EAAE,CACxD,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,yCAAyC,EAAE;IACjE,IAAI,EAAE,iBAAiB;IACvB,GAAG,EAAE,aAAa;IAClB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAiB;KACzD;IACD,GAAG,MAAM;CACV,CAAC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { urlWithParams } from '../../utils/url.js';
|
|
2
|
+
import { getRpcErrorCode } from './utils.js';
|
|
2
3
|
export const getBalance = async (client, { baseUrl, apiKey }, { address }) => {
|
|
3
4
|
const apiUrl = urlWithParams(`${baseUrl}/addrs/${address}`, {
|
|
4
5
|
token: apiKey,
|
|
@@ -9,7 +10,10 @@ export const getBalance = async (client, { baseUrl, apiKey }, { address }) => {
|
|
|
9
10
|
}));
|
|
10
11
|
if (response.error) {
|
|
11
12
|
return {
|
|
12
|
-
error: {
|
|
13
|
+
error: {
|
|
14
|
+
code: getRpcErrorCode(response.error),
|
|
15
|
+
message: response.error,
|
|
16
|
+
},
|
|
13
17
|
};
|
|
14
18
|
}
|
|
15
19
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBalance.js","sourceRoot":"","sources":["../../../../src/transports/blockcypher/getBalance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"getBalance.js","sourceRoot":"","sources":["../../../../src/transports/blockcypher/getBalance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGlD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,CAAC,MAAM,UAAU,GAAmC,KAAK,EAC7D,MAAM,EACN,EAAE,OAAO,EAAE,MAAM,EAAE,EACnB,EAAE,OAAO,EAAE,EACX,EAAE;IACF,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,OAAO,UAAU,OAAO,EAAE,EAAE;QAC1D,KAAK,EAAE,MAAM;KACd,CAAC,CAAA;IACF,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC;QACrC,GAAG,EAAE,MAAM;QACX,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;KAChC,CAAC,CAA0C,CAAA;IAC5C,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO;YACL,KAAK,EAAE;gBACL,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC;gBACrC,OAAO,EAAE,QAAQ,CAAC,KAAK;aACxB;SACF,CAAA;IACH,CAAC;IACD,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;KACjC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { urlWithParams } from '../../utils/url.js';
|
|
2
|
+
import { getRpcErrorCode } from './utils.js';
|
|
2
3
|
export const getTransactionFee = async (client, { baseUrl, apiKey }, { txId }) => {
|
|
3
4
|
const apiUrl = urlWithParams(`${baseUrl}/txs/${txId}`, {
|
|
4
5
|
token: apiKey,
|
|
@@ -9,7 +10,7 @@ export const getTransactionFee = async (client, { baseUrl, apiKey }, { txId }) =
|
|
|
9
10
|
}));
|
|
10
11
|
if (response.error) {
|
|
11
12
|
return {
|
|
12
|
-
error: { code:
|
|
13
|
+
error: { code: getRpcErrorCode(response.error), message: response.error },
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
16
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTransactionFee.js","sourceRoot":"","sources":["../../../../src/transports/blockcypher/getTransactionFee.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"getTransactionFee.js","sourceRoot":"","sources":["../../../../src/transports/blockcypher/getTransactionFee.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGlD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,CAAC,MAAM,iBAAiB,GAA0C,KAAK,EAC3E,MAAM,EACN,EAAE,OAAO,EAAE,MAAM,EAAE,EACnB,EAAE,IAAI,EAAE,EACR,EAAE;IACF,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,OAAO,QAAQ,IAAI,EAAE,EAAE;QACrD,KAAK,EAAE,MAAM;KACd,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC;QACrC,GAAG,EAAE,MAAM;QACX,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;KAChC,CAAC,CAA6C,CAAA;IAE/C,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO;YACL,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,EAAE;SAC1E,CAAA;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;KAC9B,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RpcRequestError } from '../../errors/request.js';
|
|
2
2
|
import { InsufficientUTXOBalanceError } from '../../errors/utxo.js';
|
|
3
3
|
import { urlWithParams } from '../../utils/url.js';
|
|
4
|
+
import { getRpcErrorCode } from './utils.js';
|
|
4
5
|
const blockcypherUTXOTransformer = (utxo) => ({
|
|
5
6
|
blockHeight: utxo.block_height,
|
|
6
7
|
isConfirmed: Boolean(utxo.confirmations),
|
|
@@ -14,7 +15,7 @@ const MAX_API_LIMIT = 2000;
|
|
|
14
15
|
export const getUTXOs = async (client, { baseUrl, apiKey }, { address, minValue }) => {
|
|
15
16
|
async function* fetchUTXOs() {
|
|
16
17
|
let hasMore = true;
|
|
17
|
-
let beforeBlock
|
|
18
|
+
let beforeBlock;
|
|
18
19
|
while (hasMore) {
|
|
19
20
|
const apiUrl = urlWithParams(`${baseUrl}/addrs/${address}`, {
|
|
20
21
|
token: apiKey,
|
|
@@ -38,7 +39,7 @@ export const getUTXOs = async (client, { baseUrl, apiKey }, { address, minValue
|
|
|
38
39
|
},
|
|
39
40
|
},
|
|
40
41
|
error: {
|
|
41
|
-
code:
|
|
42
|
+
code: getRpcErrorCode(response.error),
|
|
42
43
|
message: response.error,
|
|
43
44
|
},
|
|
44
45
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUTXOs.js","sourceRoot":"","sources":["../../../../src/transports/blockcypher/getUTXOs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAA;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"getUTXOs.js","sourceRoot":"","sources":["../../../../src/transports/blockcypher/getUTXOs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAA;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAMlD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,0BAA0B,GAAG,CAAC,IAAqB,EAAQ,EAAE,CAAC,CAAC;IACnE,WAAW,EAAE,IAAI,CAAC,YAAY;IAC9B,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC;IACxC,aAAa,EAAE,IAAI,CAAC,aAAa;IACjC,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,IAAI,EAAE,IAAI,CAAC,WAAW;IACtB,IAAI,EAAE,IAAI,CAAC,OAAO;IAClB,SAAS,EAAE,IAAI,CAAC,MAAM;CACvB,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,IAAI,CAAA;AAE1B,MAAM,CAAC,MAAM,QAAQ,GAAiC,KAAK,EACzD,MAAM,EACN,EAAE,OAAO,EAAE,MAAM,EAAE,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,SAAQ;YACV,CAAC;YAED,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAA;YAExC,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;YAC7B,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY,CAAA;YAEtE,MAAM,QAAQ,CAAC,MAAM,CAAA;QACvB,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAW,EAAE,CAAA;IACxB,IAAI,UAAU,GAAG,CAAC,CAAA;IAElB,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,UAAU,EAAE,EAAE,CAAC;QACvC,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;QACvD,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAA;QAExB,IAAI,QAAQ,EAAE,CAAC;YACb,UAAU,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;YAClE,IAAI,UAAU,IAAI,QAAQ,EAAE,CAAC;gBAC3B,MAAK;YACP,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;AAC1B,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RpcErrorCode } from '../../errors/rpc.js';
|
|
2
|
+
export function getRpcErrorCode(error) {
|
|
3
|
+
if (error.toLowerCase().startsWith('rate limit exceeded')) {
|
|
4
|
+
return RpcErrorCode.ACCESS_DENIED;
|
|
5
|
+
}
|
|
6
|
+
return RpcErrorCode.MISC_ERROR;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/transports/blockcypher/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC,EAAE,CAAC;QAC1D,OAAO,YAAY,CAAC,aAAa,CAAA;IACnC,CAAC;IACD,OAAO,YAAY,CAAC,UAAU,CAAA;AAChC,CAAC"}
|
|
@@ -31,7 +31,11 @@ export function getHttpRpcClient(url, options = {}) {
|
|
|
31
31
|
const response = await fetch(params.url ?? url, init);
|
|
32
32
|
return response;
|
|
33
33
|
}, {
|
|
34
|
-
errorInstance: new TimeoutError({
|
|
34
|
+
errorInstance: new TimeoutError({
|
|
35
|
+
body: body ?? {},
|
|
36
|
+
url: params.url ?? url,
|
|
37
|
+
timeout,
|
|
38
|
+
}),
|
|
35
39
|
timeout,
|
|
36
40
|
signal: true,
|
|
37
41
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHttpRpcClient.js","sourceRoot":"","sources":["../../../src/transports/getHttpRpcClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGrE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAqDrD,MAAM,UAAU,gBAAgB,CAC9B,GAAW,EACX,UAAgC,EAAE;IAElC,OAAO;QACL,KAAK,CAAC,OAAO,CAAC,MAAM;YAClB,MAAM,EACJ,IAAI,EACJ,SAAS,GAAG,OAAO,CAAC,SAAS,EAC7B,UAAU,GAAG,OAAO,CAAC,UAAU,EAC/B,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,KAAM,GACpC,GAAG,MAAM,CAAA;YAEV,MAAM,YAAY,GAAG;gBACnB,GAAG,CAAC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BACvB,GAAG;qBACJ,CAAC,CAAA;gBACJ,CAAC;gBACD,OAAO,IAAI,CAAA;YACb,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,GAAG,YAAY,gBAAgB,EAAE,CAAC;oBACpC,MAAM,GAAG,CAAA;gBACX,CAAC;gBACD,IAAI,GAAG,YAAY,YAAY,EAAE,CAAC;oBAChC,MAAM,GAAG,CAAA;gBACX,CAAC;gBACD,MAAM,IAAI,gBAAgB,CAAC;oBACzB,IAAI;oBACJ,KAAK,EAAE,GAAY;oBACnB,GAAG;iBACJ,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/transports/http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EACL,gBAAgB,GAEjB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAOjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/transports/http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EACL,gBAAgB,GAEjB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAOjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,EACL,gBAAgB,GAGjB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AA+DjD;;GAEG;AACH,MAAM,UAAU,IAAI;AAIlB,uEAAuE;AACvE,GAAwB,EACxB,SAA8C,EAAE;IAEhD,MAAM,EACJ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AAG,SAAS,CAAA;oBACpC,CAAC;oBACD,EAAE,EAAE,CAAC,IAAkB,EAAE,EAAE,CACzB,SAAS,CAAC,OAAO,CAAC;wBAChB,IAAI;qBACL,CAAC;oBACJ,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;iBAC5B,CAAC,CAAA;gBAEF,MAAM,EAAE,GAAG,KAAK,EAAE,IAAgB,EAAE,EAAE,CACpC,KAAK;oBACH,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;oBAChB,CAAC,CAAC;wBACE,MAAM,SAAS,CAAC,OAAO,CAAC;4BACtB,IAAI;yBACL,CAAC;qBACH,CAAA;gBAEP,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,CAAA;gBAE1C,IAAI,GAAG,EAAE,CAAC;oBACR,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;gBAC1B,CAAC;gBACD,IAAI,KAAK,EAAE,CAAC;oBACV,MAAM,IAAI,eAAe,CAAC;wBACxB,IAAI;wBACJ,KAAK;wBACL,GAAG,EAAE,IAAI;qBACV,CAAC,CAAA;gBACJ,CAAC;gBACD,OAAO,MAAM,CAAA;YACf,CAAC;YACD,UAAU;YACV,UAAU;YACV,OAAO;YACP,IAAI,EAAE,MAAM;SACb,EACD;YACE,YAAY;YACZ,GAAG,EAAE,IAAI;SACV,CACF,CAAA;IACH,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { utxo } from '../utxo.js';
|
|
2
2
|
import { mempoolMethods } from './methods.js';
|
|
3
3
|
export const mempool = (config) => utxo(config?.baseUrl || 'https://mempool.space/api', {
|
|
4
|
+
name: 'Mempool.space API',
|
|
4
5
|
key: 'mempool',
|
|
5
6
|
methods: {
|
|
6
7
|
include: Object.keys(mempoolMethods),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mempool.js","sourceRoot":"","sources":["../../../../src/transports/mempool/mempool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAM7C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,MAAsB,EAAE,EAAE,CAChD,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,2BAA2B,EAAE;IACnD,GAAG,EAAE,SAAS;IACd,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAiB;KACrD;IACD,GAAG,MAAM;CACV,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"mempool.js","sourceRoot":"","sources":["../../../../src/transports/mempool/mempool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAM7C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,MAAsB,EAAE,EAAE,CAChD,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,2BAA2B,EAAE;IACnD,IAAI,EAAE,mBAAmB;IACzB,GAAG,EAAE,SAAS;IACd,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAiB;KACrD;IACD,GAAG,MAAM;CACV,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancelTransaction.js","sourceRoot":"","sources":["../../../src/utils/cancelTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cancelTransaction.js","sourceRoot":"","sources":["../../../src/utils/cancelTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAc7C,MAAM,UAAU,iBAAiB,CAAC,IAAU,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