@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.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as CreateLightningInvoiceParams, I as InitWalletResponse, P as PayLightningInvoiceParams, c as SparkWallet, b as SparkWalletEvents, S as SparkWalletProps, a as TokenInfo, T as TransferParams } from './spark-wallet-CnMcVywa.cjs';
1
+ export { C as CreateLightningInvoiceParams, I as InitWalletResponse, P as PayLightningInvoiceParams, c as SparkWallet, b as SparkWalletEvents, S as SparkWalletProps, a as TokenInfo, T as TransferParams } from './spark-wallet-DNklv7QR.cjs';
2
2
  export { addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, calculateAvailableTokenAmount, checkIfSelectedOutputsAreAvailable, collectResponses, computeTaprootKeyNoScript, createRefundTx, createSigningCommitment, createSigningNonce, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, filterTokenBalanceForTokenPublicKey, generateAdaptorFromSignature, generateSignatureFromExistingAdaptor, getEphemeralAnchorOutput, getLatestDepositTxId, getMasterHDKeyFromSeed, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getTransactionSequence, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, lastKeyWithTarget, proofOfPossessionMessageHashForDepositAddress, subtractPrivateKeys, subtractPublicKeys, sumOfPrivateKeys, validateOutboundAdaptorSignature } from './utils/index.cjs';
3
3
  export { L as LRC_WALLET_NETWORK, c as LRC_WALLET_NETWORK_TYPE, N as Network, b as NetworkToProto, a as NetworkType, g as getNetwork, d as getNetworkFromAddress } from './network-6wZCWlKG.cjs';
4
4
  export { V as VerifiableSecretShare, d as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, a as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, b as splitSecretWithProofs, v as validateShare } from './signer-GXP_J56h.cjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as CreateLightningInvoiceParams, I as InitWalletResponse, P as PayLightningInvoiceParams, c as SparkWallet, b as SparkWalletEvents, S as SparkWalletProps, a as TokenInfo, T as TransferParams } from './spark-wallet-BrFeAWDB.js';
1
+ export { C as CreateLightningInvoiceParams, I as InitWalletResponse, P as PayLightningInvoiceParams, c as SparkWallet, b as SparkWalletEvents, S as SparkWalletProps, a as TokenInfo, T as TransferParams } from './spark-wallet-Bb43IsYU.js';
2
2
  export { addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, calculateAvailableTokenAmount, checkIfSelectedOutputsAreAvailable, collectResponses, computeTaprootKeyNoScript, createRefundTx, createSigningCommitment, createSigningNonce, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, filterTokenBalanceForTokenPublicKey, generateAdaptorFromSignature, generateSignatureFromExistingAdaptor, getEphemeralAnchorOutput, getLatestDepositTxId, getMasterHDKeyFromSeed, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getTransactionSequence, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, lastKeyWithTarget, proofOfPossessionMessageHashForDepositAddress, subtractPrivateKeys, subtractPublicKeys, sumOfPrivateKeys, validateOutboundAdaptorSignature } from './utils/index.js';
3
3
  export { L as LRC_WALLET_NETWORK, c as LRC_WALLET_NETWORK_TYPE, N as Network, b as NetworkToProto, a as NetworkType, g as getNetwork, d as getNetworkFromAddress } from './network-CVknbl3W.js';
4
4
  export { V as VerifiableSecretShare, d as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, a as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, b as splitSecretWithProofs, v as validateShare } from './signer-BadE1lSY.js';
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  getLatestDepositTxId,
8
8
  getNextTransactionSequence,
9
9
  getTransactionSequence
10
- } from "./chunk-G5ADKRQI.js";
10
+ } from "./chunk-LI5VQWVO.js";
11
11
  import {
12
12
  computeTaprootKeyNoScript,
13
13
  getP2TRAddressFromPkScript,
@@ -49,7 +49,10 @@ import {
49
49
  } from "./chunk-XFLRFB5W.js";
50
50
  import {
51
51
  WalletConfigService
52
- } from "./chunk-NXSLIDA6.js";
52
+ } from "./chunk-VTZVTLU4.js";
53
+ import {
54
+ ELECTRS_CREDENTIALS
55
+ } from "./chunk-TT5MFF6V.js";
53
56
  import "./chunk-QE6JYJ77.js";
54
57
  import {
55
58
  LRC_WALLET_NETWORK,
@@ -127,9 +130,6 @@ import {
127
130
  ValidationError
128
131
  } from "./chunk-7Z7Y2PCW.js";
129
132
  import "./chunk-GPC7GYUG.js";
130
- import {
131
- ELECTRS_CREDENTIALS
132
- } from "./chunk-TT5MFF6V.js";
133
133
  import {
134
134
  Buffer
135
135
  } from "./chunk-TNZ6QAWE.js";
@@ -1031,7 +1031,7 @@ var TransferService = class extends BaseTransferService {
1031
1031
  }
1032
1032
  async claimTransfer(transfer, leaves) {
1033
1033
  let proofMap;
1034
- if (transfer.status === 2 /* TRANSFER_STATUS_SENDER_KEY_TWEAKED */ || transfer.status === 3 /* TRANSFER_STATUS_RECEIVER_KEY_TWEAKED */) {
1034
+ if (transfer.status === 2 /* TRANSFER_STATUS_SENDER_KEY_TWEAKED */) {
1035
1035
  proofMap = await this.claimTransferTweakKeys(transfer, leaves);
1036
1036
  }
1037
1037
  const signatures = await this.claimTransferSignRefunds(
@@ -2951,8 +2951,9 @@ var SparkWallet = class _SparkWallet extends EventEmitter {
2951
2951
  connectionManager;
2952
2952
  lrc20ConnectionManager;
2953
2953
  lrc20Wallet;
2954
- depositService;
2955
2954
  transferService;
2955
+ tracerId = "spark-sdk";
2956
+ depositService;
2956
2957
  treeCreationService;
2957
2958
  lightningService;
2958
2959
  coopExitService;
@@ -3107,10 +3108,6 @@ var SparkWallet = class _SparkWallet extends EventEmitter {
3107
3108
  }) {
3108
3109
  const wallet = new _SparkWallet(options, signer);
3109
3110
  const initResponse = await wallet.initWallet(mnemonicOrSeed, accountNumber);
3110
- if (isNode) {
3111
- await wallet.initializeTracer("spark-sdk");
3112
- wallet.wrapSparkWalletWithTracing();
3113
- }
3114
3111
  return {
3115
3112
  wallet,
3116
3113
  ...initResponse
@@ -3204,6 +3201,9 @@ var SparkWallet = class _SparkWallet extends EventEmitter {
3204
3201
  const claimedTransfersIds = await this.claimTransfers();
3205
3202
  try {
3206
3203
  for await (const data of stream) {
3204
+ if (this.streamController?.signal.aborted) {
3205
+ break;
3206
+ }
3207
3207
  if (data.event?.$case === "connected") {
3208
3208
  console.log("connected");
3209
3209
  this.emit("stream:connected");
@@ -3469,6 +3469,10 @@ var SparkWallet = class _SparkWallet extends EventEmitter {
3469
3469
  LRC_WALLET_NETWORK_TYPE[network],
3470
3470
  this.config.lrc20ApiConfig
3471
3471
  );
3472
+ if (isNode) {
3473
+ await this.initializeTracer(this.tracerId);
3474
+ this.wrapSparkWalletWithTracing();
3475
+ }
3472
3476
  return {
3473
3477
  mnemonic
3474
3478
  };
@@ -4836,6 +4840,14 @@ var SparkWallet = class _SparkWallet extends EventEmitter {
4836
4840
  selectedOutputs
4837
4841
  );
4838
4842
  }
4843
+ /**
4844
+ * Retrieves token transaction history for specified tokens owned by the wallet.
4845
+ * Can optionally filter by specific transaction hashes.
4846
+ *
4847
+ * @param tokenPublicKeys - Array of token public keys to query transactions for
4848
+ * @param tokenTransactionHashes - Optional array of specific transaction hashes to filter by
4849
+ * @returns Promise resolving to array of token transactions with their current status
4850
+ */
4839
4851
  async queryTokenTransactions(tokenPublicKeys, tokenTransactionHashes) {
4840
4852
  const sparkClient = await this.connectionManager.createSparkClient(
4841
4853
  this.config.getCoordinatorAddress()