@buildonspark/spark-sdk 0.1.25 → 0.1.26

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.
@@ -1,6 +1,10 @@
1
1
  import {
2
2
  getP2TRScriptFromPublicKey
3
3
  } from "./chunk-ASPK2HFV.js";
4
+ import {
5
+ ELECTRS_CREDENTIALS,
6
+ getElectrsUrl
7
+ } from "./chunk-TT5MFF6V.js";
4
8
  import {
5
9
  getNetworkFromAddress
6
10
  } from "./chunk-NGNWJXBO.js";
@@ -10,10 +14,6 @@ import {
10
14
  import {
11
15
  ValidationError
12
16
  } from "./chunk-7Z7Y2PCW.js";
13
- import {
14
- ELECTRS_CREDENTIALS,
15
- getElectrsUrl
16
- } from "./chunk-TT5MFF6V.js";
17
17
 
18
18
  // src/utils/mempool.ts
19
19
  async function getLatestDepositTxId(address) {
@@ -98,4 +98,4 @@ export {
98
98
  getEphemeralAnchorOutput,
99
99
  getLatestDepositTxId
100
100
  };
101
- //# sourceMappingURL=chunk-G5ADKRQI.js.map
101
+ //# sourceMappingURL=chunk-LI5VQWVO.js.map
@@ -1,3 +1,8 @@
1
+ import {
2
+ LOCAL_WALLET_CONFIG,
3
+ MAINNET_WALLET_CONFIG,
4
+ REGTEST_WALLET_CONFIG
5
+ } from "./chunk-TT5MFF6V.js";
1
6
  import {
2
7
  DefaultSparkSigner
3
8
  } from "./chunk-QE6JYJ77.js";
@@ -8,11 +13,6 @@ import {
8
13
  import {
9
14
  ConfigurationError
10
15
  } from "./chunk-7Z7Y2PCW.js";
11
- import {
12
- LOCAL_WALLET_CONFIG,
13
- MAINNET_WALLET_CONFIG,
14
- REGTEST_WALLET_CONFIG
15
- } from "./chunk-TT5MFF6V.js";
16
16
 
17
17
  // src/services/config.ts
18
18
  var WalletConfigService = class {
@@ -105,4 +105,4 @@ var WalletConfigService = class {
105
105
  export {
106
106
  WalletConfigService
107
107
  };
108
- //# sourceMappingURL=chunk-NXSLIDA6.js.map
108
+ //# sourceMappingURL=chunk-VTZVTLU4.js.map
package/dist/index.cjs CHANGED
@@ -17123,7 +17123,7 @@ var TransferService = class extends BaseTransferService {
17123
17123
  }
17124
17124
  async claimTransfer(transfer, leaves) {
17125
17125
  let proofMap;
17126
- if (transfer.status === 2 /* TRANSFER_STATUS_SENDER_KEY_TWEAKED */ || transfer.status === 3 /* TRANSFER_STATUS_RECEIVER_KEY_TWEAKED */) {
17126
+ if (transfer.status === 2 /* TRANSFER_STATUS_SENDER_KEY_TWEAKED */) {
17127
17127
  proofMap = await this.claimTransferTweakKeys(transfer, leaves);
17128
17128
  }
17129
17129
  const signatures = await this.claimTransferSignRefunds(
@@ -20709,8 +20709,9 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
20709
20709
  connectionManager;
20710
20710
  lrc20ConnectionManager;
20711
20711
  lrc20Wallet;
20712
- depositService;
20713
20712
  transferService;
20713
+ tracerId = "spark-sdk";
20714
+ depositService;
20714
20715
  treeCreationService;
20715
20716
  lightningService;
20716
20717
  coopExitService;
@@ -20865,10 +20866,6 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
20865
20866
  }) {
20866
20867
  const wallet = new _SparkWallet(options, signer);
20867
20868
  const initResponse = await wallet.initWallet(mnemonicOrSeed, accountNumber);
20868
- if (import_core12.isNode) {
20869
- await wallet.initializeTracer("spark-sdk");
20870
- wallet.wrapSparkWalletWithTracing();
20871
- }
20872
20869
  return {
20873
20870
  wallet,
20874
20871
  ...initResponse
@@ -20962,6 +20959,9 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
20962
20959
  const claimedTransfersIds = await this.claimTransfers();
20963
20960
  try {
20964
20961
  for await (const data of stream) {
20962
+ if (this.streamController?.signal.aborted) {
20963
+ break;
20964
+ }
20965
20965
  if (data.event?.$case === "connected") {
20966
20966
  console.log("connected");
20967
20967
  this.emit("stream:connected");
@@ -21227,6 +21227,10 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
21227
21227
  LRC_WALLET_NETWORK_TYPE[network],
21228
21228
  this.config.lrc20ApiConfig
21229
21229
  );
21230
+ if (import_core12.isNode) {
21231
+ await this.initializeTracer(this.tracerId);
21232
+ this.wrapSparkWalletWithTracing();
21233
+ }
21230
21234
  return {
21231
21235
  mnemonic
21232
21236
  };
@@ -22594,6 +22598,14 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
22594
22598
  selectedOutputs
22595
22599
  );
22596
22600
  }
22601
+ /**
22602
+ * Retrieves token transaction history for specified tokens owned by the wallet.
22603
+ * Can optionally filter by specific transaction hashes.
22604
+ *
22605
+ * @param tokenPublicKeys - Array of token public keys to query transactions for
22606
+ * @param tokenTransactionHashes - Optional array of specific transaction hashes to filter by
22607
+ * @returns Promise resolving to array of token transactions with their current status
22608
+ */
22597
22609
  async queryTokenTransactions(tokenPublicKeys, tokenTransactionHashes) {
22598
22610
  const sparkClient = await this.connectionManager.createSparkClient(
22599
22611
  this.config.getCoordinatorAddress()