@bigmi/core 0.3.0-beta.3 → 0.3.0-beta.4
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/dist/cjs/actions/getBalance.d.ts +1 -1
- package/dist/cjs/actions/getBlock.d.ts +1 -1
- package/dist/cjs/actions/getBlock.js.map +1 -1
- package/dist/cjs/actions/getBlockCount.d.ts +1 -1
- package/dist/cjs/actions/getBlockStats.d.ts +1 -1
- package/dist/cjs/actions/getUTXOTransaction.d.ts +1 -1
- package/dist/cjs/actions/sendUTXOTransaction.d.ts +1 -1
- package/dist/cjs/actions/signPsbt.d.ts +1 -1
- package/dist/cjs/actions/waitForTransaction.d.ts +1 -1
- package/dist/cjs/actions/waitForTransaction.js.map +1 -1
- package/dist/cjs/actions/watchBlockNumber.d.ts +1 -1
- package/dist/cjs/clients/decorators/public.d.ts +1 -1
- package/dist/cjs/clients/decorators/wallet.d.ts +3 -3
- package/dist/cjs/clients/decorators/wallet.js.map +1 -1
- package/dist/cjs/factories/createClient.d.ts +1 -1
- package/dist/cjs/factories/createTransport.d.ts +1 -30
- package/dist/cjs/factories/createTransport.js.map +1 -1
- package/dist/cjs/transports/ankr/ankr.js +6 -1
- package/dist/cjs/transports/ankr/ankr.js.map +1 -1
- package/dist/cjs/transports/blockchair/blockchair.js +4 -0
- package/dist/cjs/transports/blockchair/blockchair.js.map +1 -1
- package/dist/cjs/transports/blockcypher/blockcypher.js +4 -0
- package/dist/cjs/transports/blockcypher/blockcypher.js.map +1 -1
- package/dist/cjs/transports/custom.d.ts +1 -1
- package/dist/cjs/transports/custom.js.map +1 -1
- package/dist/cjs/transports/fallback.js +7 -7
- package/dist/cjs/transports/fallback.js.map +1 -1
- package/dist/cjs/transports/http.d.ts +1 -1
- package/dist/cjs/transports/http.js.map +1 -1
- package/dist/cjs/transports/mempool/mempool.js +4 -0
- package/dist/cjs/transports/mempool/mempool.js.map +1 -1
- package/dist/cjs/transports/types.d.ts +1 -1
- package/dist/cjs/transports/types.js.map +1 -1
- package/dist/cjs/transports/utxo.js +2 -5
- package/dist/cjs/transports/utxo.js.map +1 -1
- package/dist/cjs/types/request.d.ts +3 -2
- package/dist/cjs/types/transport.d.ts +3 -2
- package/dist/cjs/utils/getAction.d.ts +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/actions/getBalance.d.ts +1 -1
- package/dist/esm/actions/getBlock.d.ts +1 -1
- package/dist/esm/actions/getBlock.js.map +1 -1
- package/dist/esm/actions/getBlockCount.d.ts +1 -1
- package/dist/esm/actions/getBlockStats.d.ts +1 -1
- package/dist/esm/actions/getUTXOTransaction.d.ts +1 -1
- package/dist/esm/actions/sendUTXOTransaction.d.ts +1 -1
- package/dist/esm/actions/signPsbt.d.ts +1 -1
- package/dist/esm/actions/waitForTransaction.d.ts +1 -1
- package/dist/esm/actions/waitForTransaction.js.map +1 -1
- package/dist/esm/actions/watchBlockNumber.d.ts +1 -1
- package/dist/esm/clients/decorators/public.d.ts +1 -1
- package/dist/esm/clients/decorators/wallet.d.ts +3 -3
- package/dist/esm/clients/decorators/wallet.js.map +1 -1
- package/dist/esm/factories/createClient.d.ts +1 -1
- package/dist/esm/factories/createTransport.d.ts +1 -38
- package/dist/esm/factories/createTransport.js.map +1 -1
- package/dist/esm/transports/ankr/ankr.js +6 -1
- package/dist/esm/transports/ankr/ankr.js.map +1 -1
- package/dist/esm/transports/blockchair/blockchair.js +4 -0
- package/dist/esm/transports/blockchair/blockchair.js.map +1 -1
- package/dist/esm/transports/blockcypher/blockcypher.js +4 -0
- package/dist/esm/transports/blockcypher/blockcypher.js.map +1 -1
- package/dist/esm/transports/custom.d.ts +1 -1
- package/dist/esm/transports/custom.js +1 -1
- package/dist/esm/transports/custom.js.map +1 -1
- package/dist/esm/transports/fallback.js +7 -7
- package/dist/esm/transports/fallback.js.map +1 -1
- package/dist/esm/transports/http.d.ts +1 -1
- package/dist/esm/transports/http.js +1 -1
- package/dist/esm/transports/http.js.map +1 -1
- package/dist/esm/transports/mempool/mempool.js +4 -0
- package/dist/esm/transports/mempool/mempool.js.map +1 -1
- package/dist/esm/transports/types.d.ts +1 -1
- package/dist/esm/transports/types.js.map +1 -1
- package/dist/esm/transports/utxo.js +2 -5
- package/dist/esm/transports/utxo.js.map +1 -1
- package/dist/esm/types/request.d.ts +3 -2
- package/dist/esm/types/transport.d.ts +3 -2
- package/dist/esm/utils/getAction.d.ts +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/actions/getBalance.d.ts +1 -1
- package/dist/types/actions/getBalance.d.ts.map +1 -1
- package/dist/types/actions/getBlock.d.ts +1 -1
- package/dist/types/actions/getBlock.d.ts.map +1 -1
- package/dist/types/actions/getBlockCount.d.ts +1 -1
- package/dist/types/actions/getBlockCount.d.ts.map +1 -1
- package/dist/types/actions/getBlockStats.d.ts +1 -1
- package/dist/types/actions/getBlockStats.d.ts.map +1 -1
- package/dist/types/actions/getUTXOTransaction.d.ts +1 -1
- package/dist/types/actions/getUTXOTransaction.d.ts.map +1 -1
- package/dist/types/actions/sendUTXOTransaction.d.ts +1 -1
- package/dist/types/actions/sendUTXOTransaction.d.ts.map +1 -1
- package/dist/types/actions/signPsbt.d.ts +1 -1
- package/dist/types/actions/signPsbt.d.ts.map +1 -1
- package/dist/types/actions/waitForTransaction.d.ts +1 -1
- package/dist/types/actions/waitForTransaction.d.ts.map +1 -1
- package/dist/types/actions/watchBlockNumber.d.ts +1 -1
- package/dist/types/actions/watchBlockNumber.d.ts.map +1 -1
- package/dist/types/clients/decorators/public.d.ts +1 -1
- package/dist/types/clients/decorators/public.d.ts.map +1 -1
- package/dist/types/clients/decorators/wallet.d.ts +3 -3
- package/dist/types/clients/decorators/wallet.d.ts.map +1 -1
- package/dist/types/factories/createClient.d.ts +1 -1
- package/dist/types/factories/createClient.d.ts.map +1 -1
- package/dist/types/factories/createTransport.d.ts +1 -38
- package/dist/types/factories/createTransport.d.ts.map +1 -1
- package/dist/types/transports/ankr/ankr.d.ts.map +1 -1
- package/dist/types/transports/blockchair/blockchair.d.ts.map +1 -1
- package/dist/types/transports/blockcypher/blockcypher.d.ts.map +1 -1
- package/dist/types/transports/custom.d.ts +1 -1
- package/dist/types/transports/custom.d.ts.map +1 -1
- package/dist/types/transports/http.d.ts +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/transports/types.d.ts +1 -1
- package/dist/types/transports/types.d.ts.map +1 -1
- package/dist/types/transports/utxo.d.ts.map +1 -1
- package/dist/types/types/request.d.ts +3 -2
- package/dist/types/types/request.d.ts.map +1 -1
- package/dist/types/types/transport.d.ts +3 -2
- package/dist/types/types/transport.d.ts.map +1 -1
- package/dist/types/utils/getAction.d.ts +1 -1
- package/dist/types/utils/getAction.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/package.json.tmp +1 -1
- package/src/actions/getBalance.ts +1 -1
- package/src/actions/getBlock.ts +1 -3
- package/src/actions/getBlockCount.ts +1 -1
- package/src/actions/getBlockStats.ts +1 -1
- package/src/actions/getUTXOTransaction.ts +1 -1
- package/src/actions/sendUTXOTransaction.ts +1 -1
- package/src/actions/signPsbt.ts +1 -1
- package/src/actions/waitForTransaction.ts +1 -3
- package/src/actions/watchBlockNumber.ts +1 -1
- package/src/clients/decorators/public.ts +1 -1
- package/src/clients/decorators/wallet.ts +3 -4
- package/src/factories/createClient.ts +1 -1
- package/src/factories/createTransport.ts +1 -55
- package/src/transports/ankr/ankr.ts +8 -1
- package/src/transports/blockchair/blockchair.ts +6 -0
- package/src/transports/blockcypher/blockcypher.ts +5 -0
- package/src/transports/custom.ts +6 -6
- package/src/transports/fallback.ts +7 -7
- package/src/transports/http.ts +6 -6
- package/src/transports/mempool/mempool.ts +5 -0
- package/src/transports/types.ts +1 -1
- package/src/transports/utxo.ts +3 -4
- package/src/types/request.ts +3 -2
- package/src/types/transport.ts +3 -2
- package/src/utils/getAction.ts +1 -1
- package/src/version.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
2
1
|
import type { UTXOSchema } from '../transports/types.js';
|
|
3
2
|
import type { Account } from '../types/account.js';
|
|
4
3
|
import type { Chain } from '../types/chain.js';
|
|
5
4
|
import type { Client } from '../types/client.js';
|
|
5
|
+
import type { Transport } from '../types/transport.js';
|
|
6
6
|
export type GetBalanceParameters = {
|
|
7
7
|
address: string;
|
|
8
8
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Block } from 'bitcoinjs-lib';
|
|
2
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
3
2
|
import type { UTXOSchema } from '../transports/types.js';
|
|
4
3
|
import type { Account } from '../types/account.js';
|
|
5
4
|
import type { Chain } from '../types/chain.js';
|
|
6
5
|
import type { Client } from '../types/client.js';
|
|
6
|
+
import type { Transport } from '../types/transport.js';
|
|
7
7
|
export type GetBlockParameters = {
|
|
8
8
|
blockHash: string;
|
|
9
9
|
blockNumber?: never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBlock.js","sourceRoot":"","sources":["../../../src/actions/getBlock.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"getBlock.js","sourceRoot":"","sources":["../../../src/actions/getBlock.ts"],"names":[],"mappings":";;AAoBA,4BAmCC;AAvDD,iDAAqC;AACrC,iDAAuD;AAmBhD,KAAK,UAAU,QAAQ,CAI5B,MAA2C,EAC3C,EAAE,SAAS,EAAE,WAAW,EAAsB;IAE9C,IAAI,QAA4B,CAAA;IAChC,IAAI,CAAC;QACH,IAAI,UAAU,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,UAAU,IAAI,WAAW,EAAE,CAAC;YAC/B,UAAU,GAAG,MAAM,MAAM,CAAC,OAAO,CAC/B;gBACE,MAAM,EAAE,cAAc;gBACtB,MAAM,EAAE,CAAC,WAAW,CAAC;aACtB,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB,CAAA;QACH,CAAC;QACD,IAAI,UAAU,EAAE,CAAC;YACf,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAC7B;gBACE,MAAM,EAAE,UAAU;gBAClB,MAAM,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;aACxB,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB,CAAA;QACH,CAAC;IACH,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,MAAM,IAAI,6BAAkB,CAAC,EAAE,SAAS,EAAE,WAAW,EAAW,CAAC,CAAA;IACnE,CAAC;IACD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,6BAAkB,CAAC,EAAE,SAAS,EAAE,WAAW,EAAW,CAAC,CAAA;IACnE,CAAC;IACD,OAAO,qBAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;AAChC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
2
1
|
import type { UTXOSchema } from '../transports/types.js';
|
|
3
2
|
import type { Account } from '../types/account.js';
|
|
4
3
|
import type { Chain } from '../types/chain.js';
|
|
5
4
|
import type { Client } from '../types/client.js';
|
|
5
|
+
import type { Transport } from '../types/transport.js';
|
|
6
6
|
export type GetBlockCountReturnType = number;
|
|
7
7
|
export declare function getBlockCount<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>): Promise<GetBlockCountReturnType>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
2
1
|
import type { UTXOSchema } from '../transports/types.js';
|
|
3
2
|
import type { Account } from '../types/account.js';
|
|
4
3
|
import type { BlockStats, BlockStatsKeys } from '../types/blockStats.js';
|
|
5
4
|
import type { Chain } from '../types/chain.js';
|
|
6
5
|
import type { Client } from '../types/client.js';
|
|
6
|
+
import type { Transport } from '../types/transport.js';
|
|
7
7
|
export type GetBlockStatsParameters = ({
|
|
8
8
|
blockHash: string;
|
|
9
9
|
blockNumber?: never;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
2
1
|
import type { UTXOSchema } from '../transports/types.js';
|
|
3
2
|
import type { Account } from '../types/account.js';
|
|
4
3
|
import type { Chain } from '../types/chain.js';
|
|
5
4
|
import type { Client } from '../types/client.js';
|
|
6
5
|
import type { UTXOTransaction } from '../types/transaction.js';
|
|
6
|
+
import type { Transport } from '../types/transport.js';
|
|
7
7
|
export type GetUTXOTransactionParameters = {
|
|
8
8
|
txId: string;
|
|
9
9
|
blockHash?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
2
1
|
import type { UTXOSchema } from '../transports/types.js';
|
|
3
2
|
import type { Account } from '../types/account.js';
|
|
4
3
|
import type { Chain } from '../types/chain.js';
|
|
5
4
|
import type { Client } from '../types/client.js';
|
|
5
|
+
import type { Transport } from '../types/transport.js';
|
|
6
6
|
export type SendUTXOTransactionParameters = {
|
|
7
7
|
hex: string;
|
|
8
8
|
maxFeeRate?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
2
1
|
import type { SignPsbtParameters, SignPsbtReturnType, UTXOWalletSchema } from '../transports/types.js';
|
|
3
2
|
import type { Account } from '../types/account.js';
|
|
4
3
|
import type { Chain } from '../types/chain.js';
|
|
5
4
|
import type { Client } from '../types/client.js';
|
|
5
|
+
import type { Transport } from '../types/transport.js';
|
|
6
6
|
export declare function signPsbt<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOWalletSchema>, params: SignPsbtParameters): Promise<SignPsbtReturnType>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Transaction } from 'bitcoinjs-lib';
|
|
2
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
3
2
|
import type { Chain } from '../types/chain.js';
|
|
4
3
|
import type { Client } from '../types/client.js';
|
|
5
4
|
import type { UTXOTransaction } from '../types/transaction.js';
|
|
5
|
+
import type { Transport } from '../types/transport.js';
|
|
6
6
|
export type ReplacementReason = 'cancelled' | 'replaced' | 'repriced';
|
|
7
7
|
export type ReplacementReturnType = {
|
|
8
8
|
reason: ReplacementReason;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForTransaction.js","sourceRoot":"","sources":["../../../src/actions/waitForTransaction.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"waitForTransaction.js","sourceRoot":"","sources":["../../../src/actions/waitForTransaction.ts"],"names":[],"mappings":";;AA6FA,gDAqSC;AAlYD,iDAAoD;AACpD,6DAIiC;AAKjC,wDAAiD;AACjD,oDAA6C;AAC7C,wDAAiD;AACjD,wDAAiD;AACjD,+CAAwC;AACxC,yDAAkD;AAClD,mEAA4D;AAC5D,+DAAwD;AA4EjD,KAAK,UAAU,kBAAkB,CACtC,MAAgC,EAChC,EACE,aAAa,GAAG,CAAC,EACjB,IAAI,EACJ,KAAK,EACL,aAAa,EACb,UAAU,EACV,eAAe,GAAG,MAAM,CAAC,eAAe,EACxC,UAAU,GAAG,EAAE,EACf,UAAU,GAAG,IAAK,EAClB,OAAO,GAC6B;IAEtC,MAAM,UAAU,GAAG,IAAA,wBAAS,EAAC,CAAC,oBAAoB,EAAE,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAA;IAEtE,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,WAAwC,CAAA;IAC5C,IAAI,mBAA4C,CAAA;IAChD,IAAI,QAAQ,GAAG,KAAK,CAAA;IAEpB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,OAAO,EAAE,CAAC;YACZ,UAAU,CACR,GAAG,EAAE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
1
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
2
1
|
import type { Chain } from '../types/chain.js';
|
|
3
2
|
import type { Client } from '../types/client.js';
|
|
3
|
+
import type { Transport } from '../types/transport.js';
|
|
4
4
|
import { type GetBlockCountReturnType } from './getBlockCount.js';
|
|
5
5
|
export type OnBlockNumberParameter = GetBlockCountReturnType;
|
|
6
6
|
export type OnBlockNumberFn = (blockNumber: OnBlockNumberParameter, prevBlockNumber: OnBlockNumberParameter | undefined) => Promise<void>;
|
|
@@ -6,9 +6,9 @@ import { type GetTransactionsParameters, type GetTransactionsReturnType } from '
|
|
|
6
6
|
import { type GetUTXOTransactionParameters, type GetUTXOTransactionReturnType } from '../../actions/getUTXOTransaction.js';
|
|
7
7
|
import { type GetUTXOsParameters, type GetUTXOsReturnType } from '../../actions/getUTXOs.js';
|
|
8
8
|
import type { Client } from '../../factories/createClient.js';
|
|
9
|
-
import type { Transport } from '../../factories/createTransport.js';
|
|
10
9
|
import type { UTXOSchema } from '../../transports/types.js';
|
|
11
10
|
import type { Account } from '../../types/account.js';
|
|
11
|
+
import type { Transport } from '../../types/transport.js';
|
|
12
12
|
import type { Chain } from '../../types/chain.js';
|
|
13
13
|
export type PublicActions = {
|
|
14
14
|
getBalance: (args: GetBalanceParameters) => Promise<GetBalanceReturnType>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type SendUTXOTransactionParameters, type SendUTXOTransactionReturnType } from '../../actions/sendUTXOTransaction.js';
|
|
2
|
-
import type { Transport } from '../../factories/createTransport.js';
|
|
3
|
-
import type { Account } from '../../types/account.js';
|
|
4
|
-
import type { Client } from '../../types/client.js';
|
|
5
2
|
import type { SignPsbtParameters, SignPsbtReturnType } from '../../transports/types.js';
|
|
3
|
+
import type { Account } from '../../types/account.js';
|
|
6
4
|
import type { Chain } from '../../types/chain.js';
|
|
5
|
+
import type { Client } from '../../types/client.js';
|
|
6
|
+
import type { Transport } from '../../types/transport.js';
|
|
7
7
|
export type WalletActions = {
|
|
8
8
|
sendUTXOTransaction: (args: SendUTXOTransactionParameters) => Promise<SendUTXOTransactionReturnType>;
|
|
9
9
|
signPbst: (args: SignPsbtParameters) => Promise<SignPsbtReturnType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../../../src/clients/decorators/wallet.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../../../src/clients/decorators/wallet.ts"],"names":[],"mappings":";;AA0BA,sCASC;AAnCD,iFAI6C;AAC7C,2DAAoD;AAqBpD,SAAgB,aAAa,CAI3B,MAAyC;IACzC,OAAO;QACL,mBAAmB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,4CAAmB,EAAC,MAAM,EAAE,IAAI,CAAC;QAChE,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,sBAAQ,EAAC,MAAM,EAAE,IAAI,CAAC;KAC3C,CAAA;AACH,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Address } from '../types/address.js';
|
|
2
2
|
import type { ErrorType } from '../errors/utils.js';
|
|
3
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
4
3
|
import type { Account } from '../types/account.js';
|
|
5
4
|
import type { Chain } from '../types/chain.js';
|
|
5
|
+
import type { Transport } from '../types/transport.js';
|
|
6
6
|
import type { BtcRpcRequestFn, RpcSchema } from '../types/request.js';
|
|
7
7
|
import type { BitcoinRpcMethods } from '../types/rpc.js';
|
|
8
8
|
import type { Prettify } from '../types/utils.js';
|
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Chain } from '../types/chain.js';
|
|
3
|
-
import type { ClientConfig } from '../types/client.js';
|
|
4
|
-
import type { BtcRpcRequestFn } from '../types/request.js';
|
|
5
|
-
import type { OneOf } from '../types/utils.js';
|
|
6
|
-
export type TransportConfig<type extends string = string, rpcRequestFn extends BtcRpcRequestFn = BtcRpcRequestFn> = {
|
|
7
|
-
name: string;
|
|
8
|
-
key: string;
|
|
9
|
-
methods?: OneOf<{
|
|
10
|
-
include?: string[] | undefined;
|
|
11
|
-
} | {
|
|
12
|
-
exclude?: string[] | undefined;
|
|
13
|
-
}> | undefined;
|
|
14
|
-
request: rpcRequestFn;
|
|
15
|
-
retryDelay?: number | undefined;
|
|
16
|
-
retryCount?: number | undefined;
|
|
17
|
-
timeout?: number | undefined;
|
|
18
|
-
type: type;
|
|
19
|
-
};
|
|
20
|
-
export type Transport<type extends string = string, rpcAttributes = Record<string, any>, rpcRequestFn extends BtcRpcRequestFn = BtcRpcRequestFn> = <chain extends Chain | undefined = Chain>({ chain, }: {
|
|
21
|
-
chain?: chain | undefined;
|
|
22
|
-
pollingInterval?: ClientConfig['pollingInterval'] | undefined;
|
|
23
|
-
retryCount?: TransportConfig['retryCount'] | undefined;
|
|
24
|
-
timeout?: TransportConfig['timeout'] | undefined;
|
|
25
|
-
}) => {
|
|
26
|
-
config: TransportConfig<type>;
|
|
27
|
-
request: rpcRequestFn;
|
|
28
|
-
value?: rpcAttributes | undefined;
|
|
29
|
-
};
|
|
30
|
-
export type CreateTransportErrorType = ErrorType;
|
|
1
|
+
import type { Transport, TransportConfig } from '../types/transport.js';
|
|
31
2
|
export declare function createTransport<type extends string, rpcAttributes extends Record<string, any>>({ key, methods, name, request, retryCount, retryDelay, timeout, type, }: TransportConfig<type>, value?: rpcAttributes | undefined): ReturnType<Transport<type, rpcAttributes>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTransport.js","sourceRoot":"","sources":["../../../src/factories/createTransport.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"createTransport.js","sourceRoot":"","sources":["../../../src/factories/createTransport.ts"],"names":[],"mappings":";;AAOA,0CA+BC;AArCD,8DAAuD;AACvD,4CAA6C;AAK7C,SAAgB,eAAe,CAI7B,EACE,GAAG,EACH,OAAO,EACP,IAAI,EACJ,OAAO,EACP,UAAU,GAAG,CAAC,EACd,UAAU,GAAG,GAAG,EAChB,OAAO,EACP,IAAI,GACkB,EACxB,KAAiC;IAEjC,MAAM,GAAG,GAAG,IAAA,YAAI,GAAE,CAAA;IAClB,OAAO;QACL,MAAM,EAAE;YACN,GAAG;YACH,OAAO;YACP,IAAI;YACJ,OAAO;YACP,UAAU;YACV,UAAU;YACV,OAAO;YACP,IAAI;SACL;QACD,OAAO,EAAE,IAAA,8BAAY,EAAC,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;QACxE,KAAK;KACN,CAAA;AACH,CAAC"}
|
|
@@ -2,15 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ankr = void 0;
|
|
4
4
|
const utxo_js_1 = require("../utxo.js");
|
|
5
|
+
const methods_js_1 = require("./methods.js");
|
|
5
6
|
const ankr = (config) => {
|
|
7
|
+
const methods = {
|
|
8
|
+
include: Object.keys(methods_js_1.ankrMethods),
|
|
9
|
+
};
|
|
6
10
|
if (config?.baseUrl) {
|
|
7
|
-
return (0, utxo_js_1.utxo)(config.baseUrl, { key: 'ankr', ...config });
|
|
11
|
+
return (0, utxo_js_1.utxo)(config.baseUrl, { key: 'ankr', ...config, methods });
|
|
8
12
|
}
|
|
9
13
|
if (!config?.apiKey) {
|
|
10
14
|
throw Error('Ankr API KEY is required');
|
|
11
15
|
}
|
|
12
16
|
return (0, utxo_js_1.utxo)(`https://rpc.ankr.com/premium-http/btc_blockbook/${config.apiKey}/api/v2`, {
|
|
13
17
|
key: 'ankr',
|
|
18
|
+
methods,
|
|
14
19
|
...config,
|
|
15
20
|
});
|
|
16
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ankr.js","sourceRoot":"","sources":["../../../../src/transports/ankr/ankr.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ankr.js","sourceRoot":"","sources":["../../../../src/transports/ankr/ankr.ts"],"names":[],"mappings":";;;AAGA,wCAAiC;AACjC,6CAA0C;AAInC,MAAM,IAAI,GAAG,CAAC,MAAmB,EAAE,EAAE;IAC1C,MAAM,OAAO,GAA+B;QAC1C,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,wBAAW,CAAiB;KAClD,CAAA;IACD,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;QACpB,OAAO,IAAA,cAAI,EAAC,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,IAAA,cAAI,EACT,mDAAmD,MAAM,CAAC,MAAM,SAAS,EACzE;QACE,GAAG,EAAE,MAAM;QACX,OAAO;QACP,GAAG,MAAM;KACV,CACF,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,IAAI,QAmBhB"}
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.blockchair = void 0;
|
|
4
4
|
const utxo_js_1 = require("../utxo.js");
|
|
5
|
+
const methods_js_1 = require("./methods.js");
|
|
5
6
|
const blockchair = (config) => (0, utxo_js_1.utxo)(config?.baseUrl || 'https://api.blockchair.com', {
|
|
6
7
|
key: 'blockchair',
|
|
7
8
|
includeChainToURL: true,
|
|
9
|
+
methods: {
|
|
10
|
+
include: Object.keys(methods_js_1.blockchairMethods),
|
|
11
|
+
},
|
|
8
12
|
...config,
|
|
9
13
|
});
|
|
10
14
|
exports.blockchair = blockchair;
|
|
@@ -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":";;;AAGA,wCAAiC;AACjC,6CAAgD;AAOzC,MAAM,UAAU,GAAG,CAAC,MAAyB,EAAE,EAAE,CACtD,IAAA,cAAI,EAAC,MAAM,EAAE,OAAO,IAAI,4BAA4B,EAAE;IACpD,GAAG,EAAE,YAAY;IACjB,iBAAiB,EAAE,IAAI;IACvB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,8BAAiB,CAAiB;KACxD;IACD,GAAG,MAAM;CACV,CAAC,CAAA;AARS,QAAA,UAAU,cAQnB"}
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.blockcypher = void 0;
|
|
4
4
|
const utxo_js_1 = require("../utxo.js");
|
|
5
|
+
const methods_js_1 = require("./methods.js");
|
|
5
6
|
const blockcypher = (config) => (0, utxo_js_1.utxo)(config?.baseUrl || 'https://api.blockcypher.com/v1/btc/main', {
|
|
6
7
|
key: 'blockcypher',
|
|
8
|
+
methods: {
|
|
9
|
+
include: Object.keys(methods_js_1.blockcypherMethods),
|
|
10
|
+
},
|
|
7
11
|
...config,
|
|
8
12
|
});
|
|
9
13
|
exports.blockcypher = blockcypher;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockcypher.js","sourceRoot":"","sources":["../../../../src/transports/blockcypher/blockcypher.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"blockcypher.js","sourceRoot":"","sources":["../../../../src/transports/blockcypher/blockcypher.ts"],"names":[],"mappings":";;;AAEA,wCAAiC;AACjC,6CAAiD;AAO1C,MAAM,WAAW,GAAG,CAAC,MAA0B,EAAE,EAAE,CACxD,IAAA,cAAI,EAAC,MAAM,EAAE,OAAO,IAAI,yCAAyC,EAAE;IACjE,GAAG,EAAE,aAAa;IAClB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,+BAAkB,CAAiB;KACzD;IACD,GAAG,MAAM;CACV,CAAC,CAAA;AAPS,QAAA,WAAW,eAOpB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ErrorType } from '../errors/utils.js';
|
|
2
|
-
import {
|
|
2
|
+
import type { CreateTransportErrorType, Transport, TransportConfig } from '../types/transport.js';
|
|
3
3
|
type BitcoinProvider = {
|
|
4
4
|
request(...args: any): Promise<any>;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.js","sourceRoot":"","sources":["../../../src/transports/custom.ts"],"names":[],"mappings":";;AAmCA,wBAoBC;AAtDD,
|
|
1
|
+
{"version":3,"file":"custom.js","sourceRoot":"","sources":["../../../src/transports/custom.ts"],"names":[],"mappings":";;AAmCA,wBAoBC;AAtDD,wEAAiE;AAkCjE,SAAgB,MAAM,CACpB,QAAkB,EAClB,SAAgC,EAAE;IAElC,MAAM,EACJ,GAAG,GAAG,QAAQ,EACd,OAAO,EACP,IAAI,GAAG,iBAAiB,EACxB,UAAU,GACX,GAAG,MAAM,CAAA;IACV,OAAO,CAAC,EAAE,UAAU,EAAE,iBAAiB,EAAE,EAAE,EAAE,CAC3C,IAAA,oCAAe,EAAC;QACd,GAAG;QACH,OAAO;QACP,IAAI;QACJ,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;QACxC,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,iBAAiB;QAClD,UAAU;QACV,IAAI,EAAE,QAAQ;KACf,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -16,7 +16,7 @@ function fallback(transports_, config = {}) {
|
|
|
16
16
|
key,
|
|
17
17
|
name,
|
|
18
18
|
async request({ method, params }) {
|
|
19
|
-
const supportedTransports = transports.reduce((
|
|
19
|
+
const supportedTransports = transports.reduce((supportedTransports, transport) => {
|
|
20
20
|
const instance = transport({
|
|
21
21
|
...rest,
|
|
22
22
|
chain,
|
|
@@ -26,18 +26,18 @@ function fallback(transports_, config = {}) {
|
|
|
26
26
|
const { include, exclude } = instance.config.methods || {};
|
|
27
27
|
if (include) {
|
|
28
28
|
if (include.includes(method)) {
|
|
29
|
-
|
|
29
|
+
supportedTransports.push(instance);
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return supportedTransports;
|
|
32
32
|
}
|
|
33
33
|
if (exclude) {
|
|
34
34
|
if (!exclude.includes(method)) {
|
|
35
|
-
|
|
35
|
+
supportedTransports.push(instance);
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return supportedTransports;
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
return
|
|
39
|
+
supportedTransports.push(instance);
|
|
40
|
+
return supportedTransports;
|
|
41
41
|
}, []);
|
|
42
42
|
if (!supportedTransports.length) {
|
|
43
43
|
throw new transport_js_1.TransportMethodNotSupportedError({ method });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallback.js","sourceRoot":"","sources":["../../../src/transports/fallback.ts"],"names":[],"mappings":";;AAsGA,4BA2HC;AAED,kCAWC;AAGD,wCAmGC;AApVD,6CAA+C;AAC/C,yDAAyE;AAEzE,wEAAiE;AAOjE,8CAAuC;AA4FvC,SAAgB,QAAQ,CACtB,WAAuB,EACvB,SAAkC,EAAE;IAEpC,MAAM,EACJ,GAAG,GAAG,UAAU,EAChB,IAAI,GAAG,UAAU,EACjB,IAAI,GAAG,KAAK,EACZ,WAAW,EAAE,YAAY,GAAG,WAAW,EACvC,UAAU,EACV,UAAU,GACX,GAAG,MAAM,CAAA;IACV,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,GAAG,IAAK,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;QAC/D,IAAI,UAAU,GAAG,WAAW,CAAA;QAE5B,IAAI,UAAU,GAAiB,GAAG,EAAE,GAAE,CAAC,CAAA;QAEvC,MAAM,SA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,GAClB,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,GAAG,OAAO,EAAE,CAAC,CAAC;gBACpD,SAAS,CAAC,MAAM,CAAA;YAElB,IAAI,cAAc,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YACf,CAAC;YACD,OAAO;gBACL,aAAa,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc;gBAC/D,CAAC;aACF,CAAA;QACH,CAAC,CAAC;aACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAG9B,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAGlD,MAAM,IAAA,cAAI,EAAC,QAAQ,CAAC,CAAA;QACpB,eAAe,EAAE,CAAA;IACnB,CAAC,CAAA;IACD,eAAe,EAAE,CAAA;AACnB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type UrlRequiredErrorType } from '../errors/transport.js';
|
|
2
2
|
import type { ErrorType } from '../errors/utils.js';
|
|
3
|
-
import { type CreateTransportErrorType, type Transport, type TransportConfig } from '../factories/createTransport.js';
|
|
4
3
|
import type { BtcRpcRequestFn, RpcSchema } from '../types/request.js';
|
|
4
|
+
import type { CreateTransportErrorType, Transport, TransportConfig } from '../types/transport.js';
|
|
5
5
|
import { type HttpRpcClientOptions } from './getHttpRpcClient.js';
|
|
6
6
|
export type HttpTransportConfig<rpcSchema extends RpcSchema | undefined = undefined, raw extends boolean = false> = {
|
|
7
7
|
batch?: boolean | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/transports/http.ts"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EACD;YACE,YAAY;YACZ,GAAG,EAAE,IAAI;SACV,CACF,CAAA;IACH,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mempool = void 0;
|
|
4
4
|
const utxo_js_1 = require("../utxo.js");
|
|
5
|
+
const methods_js_1 = require("./methods.js");
|
|
5
6
|
const mempool = (config) => (0, utxo_js_1.utxo)(config?.baseUrl || 'https://mempool.space/api', {
|
|
6
7
|
key: 'mempool',
|
|
8
|
+
methods: {
|
|
9
|
+
include: Object.keys(methods_js_1.mempoolMethods),
|
|
10
|
+
},
|
|
7
11
|
...config,
|
|
8
12
|
});
|
|
9
13
|
exports.mempool = mempool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mempool.js","sourceRoot":"","sources":["../../../../src/transports/mempool/mempool.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"mempool.js","sourceRoot":"","sources":["../../../../src/transports/mempool/mempool.ts"],"names":[],"mappings":";;;AAEA,wCAAiC;AACjC,6CAA6C;AAMtC,MAAM,OAAO,GAAG,CAAC,MAAsB,EAAE,EAAE,CAChD,IAAA,cAAI,EAAC,MAAM,EAAE,OAAO,IAAI,2BAA2B,EAAE;IACnD,GAAG,EAAE,SAAS;IACd,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,2BAAc,CAAiB;KACrD;IACD,GAAG,MAAM;CACV,CAAC,CAAA;AAPS,QAAA,OAAO,WAOhB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BlockStats, BlockStatsKeys } from '../types/blockStats.js';
|
|
2
2
|
import type { UTXO, UTXOTransaction } from '../types/transaction.js';
|
|
3
3
|
import type { HttpRpcClient } from './getHttpRpcClient.js';
|
|
4
|
-
export declare const UTXOAPISchemaMethods:
|
|
4
|
+
export declare const UTXOAPISchemaMethods: UTXOMethod[];
|
|
5
5
|
export type UTXOAPISchema = [
|
|
6
6
|
{
|
|
7
7
|
Method: 'getBalance';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/transports/types.ts"],"names":[],"mappings":";;;AAIa,QAAA,oBAAoB,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/transports/types.ts"],"names":[],"mappings":";;;AAIa,QAAA,oBAAoB,GAAiB;IAChD,YAAY;IACZ,iBAAiB;IACjB,UAAU;CACX,CAAA"}
|
|
@@ -6,9 +6,8 @@ const transport_js_1 = require("../errors/transport.js");
|
|
|
6
6
|
const createTransport_js_1 = require("../factories/createTransport.js");
|
|
7
7
|
const getHttpRpcClient_js_1 = require("./getHttpRpcClient.js");
|
|
8
8
|
const getRpcProviderMethods_js_1 = require("./getRpcProviderMethods.js");
|
|
9
|
-
const types_js_1 = require("./types.js");
|
|
10
9
|
function utxo(url, config = {}) {
|
|
11
|
-
const { fetchOptions, key = 'utxo', name = 'UTXO HTTP API', onFetchRequest, onFetchResponse, retryDelay, apiKey, } = config;
|
|
10
|
+
const { fetchOptions, key = 'utxo', name = 'UTXO HTTP API', onFetchRequest, onFetchResponse, retryDelay, apiKey, methods, } = config;
|
|
12
11
|
return ({ chain, retryCount: retryCount_, timeout: timeout_ }) => {
|
|
13
12
|
const retryCount = config.retryCount ?? retryCount_;
|
|
14
13
|
const timeout = timeout_ ?? config.timeout ?? 10000;
|
|
@@ -30,9 +29,7 @@ function utxo(url, config = {}) {
|
|
|
30
29
|
return (0, createTransport_js_1.createTransport)({
|
|
31
30
|
key,
|
|
32
31
|
name,
|
|
33
|
-
methods
|
|
34
|
-
include: types_js_1.UTXOAPISchemaMethods,
|
|
35
|
-
},
|
|
32
|
+
methods,
|
|
36
33
|
async request({ method, params }) {
|
|
37
34
|
const body = { method, params };
|
|
38
35
|
const methodHandler = rpcMethods?.[method];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utxo.js","sourceRoot":"","sources":["../../../src/transports/utxo.ts"],"names":[],"mappings":";;AAaA,
|
|
1
|
+
{"version":3,"file":"utxo.js","sourceRoot":"","sources":["../../../src/transports/utxo.ts"],"names":[],"mappings":";;AAaA,oBAwEC;AArFD,qDAAsD;AACtD,yDAAyD;AACzD,wEAAiE;AACjE,+DAAwD;AACxD,yEAAkE;AASlE,SAAgB,IAAI,CAClB,GAAY,EACZ,SAAkC,EAAE;IAEpC,MAAM,EACJ,YAAY,EACZ,GAAG,GAAG,MAAM,EACZ,IAAI,GAAG,eAAe,EACtB,cAAc,EACd,eAAe,EACf,UAAU,EACV,MAAM,EACN,OAAO,GACR,GAAG,MAAM,CAAA;IAEV,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC/D,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,WAAW,CAAA;QACnD,MAAM,OAAO,GAAG,QAAQ,IAAI,MAAM,CAAC,OAAO,IAAI,KAAM,CAAA;QACpD,IAAI,IAAI,GAAG,GAAG,CAAA;QACd,IAAI,MAAM,CAAC,iBAAiB,EAAE,CAAC;YAC7B,MAAM,SAAS,GAAG,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAA;YAC7D,IAAI,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;QACpD,CAAC;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,+BAAgB,EAAE,CAAA;QAC9B,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,sCAAgB,EAAC,IAAI,EAAE;YACpC,YAAY;YACZ,SAAS,EAAE,cAAc;YACzB,UAAU,EAAE,eAAe;YAC3B,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,UAAU,GAAG,IAAA,gDAAqB,EAAC,GAAG,CAAC,CAAA;QAE7C,OAAO,IAAA,oCAAe,EACpB;YACE,GAAG;YACH,IAAI;YACJ,OAAO;YACP,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE;gBAC9B,MAAM,IAAI,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;gBAC/B,MAAM,aAAa,GAAG,UAAU,EAAE,CAAC,MAAoB,CAAC,CAAA;gBACxD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,aAAa,EAAE,CAC9C,MAAM,EACN,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EACzB,MAAM,CACP;oBACC,MAAM,CAAC,OAAO,CAAC;wBACb,IAAI;qBACL,CAAC,CAAC,CAAA;gBACL,IAAI,KAAK,EAAE,CAAC;oBACV,MAAM,IAAI,4BAAe,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,4 +1,5 @@
|
|
|
1
1
|
import type { ErrorType } from '../errors/utils.js';
|
|
2
|
+
import type { UTXOMethod } from '../transports/types.js';
|
|
2
3
|
import type { OneOf } from './utils.js';
|
|
3
4
|
export type RpcSchema = readonly {
|
|
4
5
|
Method: string;
|
|
@@ -19,9 +20,9 @@ export type RpcParameters<rpcSchema extends RpcSchema | undefined = undefined> =
|
|
|
19
20
|
export type BtcRpcRequestOptions = {
|
|
20
21
|
dedupe?: boolean | undefined;
|
|
21
22
|
methods?: OneOf<{
|
|
22
|
-
include?:
|
|
23
|
+
include?: UTXOMethod[] | undefined;
|
|
23
24
|
} | {
|
|
24
|
-
exclude?:
|
|
25
|
+
exclude?: UTXOMethod[] | undefined;
|
|
25
26
|
}> | undefined;
|
|
26
27
|
retryDelay?: number | undefined;
|
|
27
28
|
retryCount?: number | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ErrorType } from '../errors/utils.js';
|
|
2
|
+
import type { UTXOMethod } from '../transports/types.js';
|
|
2
3
|
import type { Chain } from './chain.js';
|
|
3
4
|
import type { BtcRpcRequestFn, RpcSchema } from './request.js';
|
|
4
5
|
import type { OneOf } from './utils.js';
|
|
@@ -6,9 +7,9 @@ export type TransportConfig<type extends string = string, rpcRequestFn extends B
|
|
|
6
7
|
name: string;
|
|
7
8
|
key: string;
|
|
8
9
|
methods?: OneOf<{
|
|
9
|
-
include?:
|
|
10
|
+
include?: UTXOMethod[] | undefined;
|
|
10
11
|
} | {
|
|
11
|
-
exclude?:
|
|
12
|
+
exclude?: UTXOMethod[] | undefined;
|
|
12
13
|
}> | undefined;
|
|
13
14
|
request: rpcRequestFn;
|
|
14
15
|
retryDelay?: number | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { PublicActions } from '../clients/decorators/public.js';
|
|
2
2
|
import type { WalletActions } from '../clients/decorators/wallet.js';
|
|
3
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
4
3
|
import type { UTXOSchema } from '../transports/types.js';
|
|
5
4
|
import type { Client } from '../types/client.js';
|
|
5
|
+
import type { Transport } from '../types/transport.js';
|
|
6
6
|
import type { Account } from '../types/account.js';
|
|
7
7
|
import type { Chain } from '../types/chain.js';
|
|
8
8
|
export declare function getAction<transport extends Transport, chain extends Chain | undefined, account extends Account | undefined, rpcSchema extends UTXOSchema | undefined, extended extends {
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@bigmi/core";
|
|
2
|
-
export declare const version = "0.3.0-beta.
|
|
2
|
+
export declare const version = "0.3.0-beta.4";
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
2
1
|
import type { UTXOSchema } from '../transports/types.js';
|
|
3
2
|
import type { Account } from '../types/account.js';
|
|
4
3
|
import type { Chain } from '../types/chain.js';
|
|
5
4
|
import type { Client } from '../types/client.js';
|
|
5
|
+
import type { Transport } from '../types/transport.js';
|
|
6
6
|
export type GetBalanceParameters = {
|
|
7
7
|
/** The address of the account. */
|
|
8
8
|
address: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Block } from 'bitcoinjs-lib';
|
|
2
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
3
2
|
import type { UTXOSchema } from '../transports/types.js';
|
|
4
3
|
import type { Account } from '../types/account.js';
|
|
5
4
|
import type { Chain } from '../types/chain.js';
|
|
6
5
|
import type { Client } from '../types/client.js';
|
|
6
|
+
import type { Transport } from '../types/transport.js';
|
|
7
7
|
export type GetBlockParameters = {
|
|
8
8
|
blockHash: string;
|
|
9
9
|
blockNumber?: never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBlock.js","sourceRoot":"","sources":["../../../src/actions/getBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"getBlock.js","sourceRoot":"","sources":["../../../src/actions/getBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAmBvD,MAAM,CAAC,KAAK,UAAU,QAAQ,CAI5B,MAA2C,EAC3C,EAAE,SAAS,EAAE,WAAW,EAAsB;IAE9C,IAAI,QAA4B,CAAA;IAChC,IAAI,CAAC;QACH,IAAI,UAAU,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,UAAU,IAAI,WAAW,EAAE,CAAC;YAC/B,UAAU,GAAG,MAAM,MAAM,CAAC,OAAO,CAC/B;gBACE,MAAM,EAAE,cAAc;gBACtB,MAAM,EAAE,CAAC,WAAW,CAAC;aACtB,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB,CAAA;QACH,CAAC;QACD,IAAI,UAAU,EAAE,CAAC;YACf,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAC7B;gBACE,MAAM,EAAE,UAAU;gBAClB,MAAM,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;aACxB,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB,CAAA;QACH,CAAC;IACH,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,MAAM,IAAI,kBAAkB,CAAC,EAAE,SAAS,EAAE,WAAW,EAAW,CAAC,CAAA;IACnE,CAAC;IACD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,kBAAkB,CAAC,EAAE,SAAS,EAAE,WAAW,EAAW,CAAC,CAAA;IACnE,CAAC;IACD,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;AAChC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
2
1
|
import type { UTXOSchema } from '../transports/types.js';
|
|
3
2
|
import type { Account } from '../types/account.js';
|
|
4
3
|
import type { Chain } from '../types/chain.js';
|
|
5
4
|
import type { Client } from '../types/client.js';
|
|
5
|
+
import type { Transport } from '../types/transport.js';
|
|
6
6
|
export type GetBlockCountReturnType = number;
|
|
7
7
|
export declare function getBlockCount<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>): Promise<GetBlockCountReturnType>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
2
1
|
import type { UTXOSchema } from '../transports/types.js';
|
|
3
2
|
import type { Account } from '../types/account.js';
|
|
4
3
|
import type { BlockStats, BlockStatsKeys } from '../types/blockStats.js';
|
|
5
4
|
import type { Chain } from '../types/chain.js';
|
|
6
5
|
import type { Client } from '../types/client.js';
|
|
6
|
+
import type { Transport } from '../types/transport.js';
|
|
7
7
|
export type GetBlockStatsParameters = ({
|
|
8
8
|
blockHash: string;
|
|
9
9
|
blockNumber?: never;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Transport } from '../factories/createTransport.js';
|
|
2
1
|
import type { UTXOSchema } from '../transports/types.js';
|
|
3
2
|
import type { Account } from '../types/account.js';
|
|
4
3
|
import type { Chain } from '../types/chain.js';
|
|
5
4
|
import type { Client } from '../types/client.js';
|
|
6
5
|
import type { UTXOTransaction } from '../types/transaction.js';
|
|
6
|
+
import type { Transport } from '../types/transport.js';
|
|
7
7
|
export type GetUTXOTransactionParameters = {
|
|
8
8
|
/** The Id of the transaction */
|
|
9
9
|
txId: string;
|