@buildonspark/spark-sdk 0.3.2 → 0.3.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 +6 -0
- package/dist/bare/index.cjs +16 -167
- package/dist/bare/index.d.cts +4 -19
- package/dist/bare/index.d.ts +4 -19
- package/dist/bare/index.js +16 -167
- package/dist/{chunk-4KGN75J4.js → chunk-55XNR6DM.js} +1 -1
- package/dist/{chunk-JDQKNT7G.js → chunk-SXXM52XH.js} +16 -167
- package/dist/debug.cjs +16 -167
- package/dist/debug.d.cts +2 -2
- package/dist/debug.d.ts +2 -2
- package/dist/debug.js +1 -1
- package/dist/index.cjs +16 -167
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/index.node.cjs +16 -167
- package/dist/index.node.d.cts +4 -4
- package/dist/index.node.d.ts +4 -4
- package/dist/index.node.js +1 -1
- package/dist/{logging-Bt2FNHFR.d.cts → logging-CGeEoKYd.d.cts} +3 -3
- package/dist/{logging-IsaT3wjW.d.ts → logging-DpSsvFVM.d.ts} +3 -3
- package/dist/native/index.cjs +16 -167
- package/dist/native/index.d.cts +4 -19
- package/dist/native/index.d.ts +4 -19
- package/dist/native/index.js +16 -167
- package/dist/{spark-wallet-V03V4Tgm.d.cts → spark-wallet-BVBrWYKL.d.cts} +2 -17
- package/dist/{spark-wallet-KI68-_jO.d.ts → spark-wallet-CFPm6wZs.d.ts} +2 -17
- package/dist/{spark-wallet.node-BtkqW5vn.d.cts → spark-wallet.node-B_00X-1j.d.cts} +1 -1
- package/dist/{spark-wallet.node-Cuvw8Kvq.d.ts → spark-wallet.node-e1gncoIZ.d.ts} +1 -1
- package/dist/tests/test-utils.cjs +5 -4
- package/dist/tests/test-utils.d.cts +2 -2
- package/dist/tests/test-utils.d.ts +2 -2
- package/dist/tests/test-utils.js +2 -2
- package/dist/{token-transactions-fTnCtBpp.d.cts → token-transactions-BZGtwFFM.d.cts} +1 -1
- package/dist/{token-transactions-5XxBewhV.d.ts → token-transactions-BkAqlmY6.d.ts} +1 -1
- package/package.json +1 -1
- package/src/services/transfer.ts +2 -213
- package/src/utils/transaction.ts +8 -8
- package/src/tests/integration/swap.test.ts +0 -780
package/dist/native/index.cjs
CHANGED
|
@@ -19254,10 +19254,10 @@ var INITIAL_TIMELOCK = 2e3;
|
|
|
19254
19254
|
var TEST_UNILATERAL_TIMELOCK = 100;
|
|
19255
19255
|
var TIME_LOCK_INTERVAL = 100;
|
|
19256
19256
|
var DIRECT_TIMELOCK_OFFSET = 50;
|
|
19257
|
-
var INITIAL_SEQUENCE = INITIAL_TIMELOCK;
|
|
19258
|
-
var INITIAL_DIRECT_SEQUENCE = INITIAL_TIMELOCK + DIRECT_TIMELOCK_OFFSET;
|
|
19259
|
-
var TEST_UNILATERAL_SEQUENCE = TEST_UNILATERAL_TIMELOCK;
|
|
19260
|
-
var TEST_UNILATERAL_DIRECT_SEQUENCE = TEST_UNILATERAL_TIMELOCK + DIRECT_TIMELOCK_OFFSET;
|
|
19257
|
+
var INITIAL_SEQUENCE = 1 << 30 | INITIAL_TIMELOCK;
|
|
19258
|
+
var INITIAL_DIRECT_SEQUENCE = 1 << 30 | INITIAL_TIMELOCK + DIRECT_TIMELOCK_OFFSET;
|
|
19259
|
+
var TEST_UNILATERAL_SEQUENCE = 1 << 30 | TEST_UNILATERAL_TIMELOCK;
|
|
19260
|
+
var TEST_UNILATERAL_DIRECT_SEQUENCE = 1 << 30 | TEST_UNILATERAL_TIMELOCK + DIRECT_TIMELOCK_OFFSET;
|
|
19261
19261
|
var ESTIMATED_TX_SIZE = 191;
|
|
19262
19262
|
var DEFAULT_SATS_PER_VBYTE = 5;
|
|
19263
19263
|
var DEFAULT_FEE_SATS = ESTIMATED_TX_SIZE * DEFAULT_SATS_PER_VBYTE;
|
|
@@ -19528,8 +19528,8 @@ function getCurrentTimelock(currSequence) {
|
|
|
19528
19528
|
function getTransactionSequence(currSequence) {
|
|
19529
19529
|
const timelock = getCurrentTimelock(currSequence);
|
|
19530
19530
|
return {
|
|
19531
|
-
nextSequence: timelock,
|
|
19532
|
-
nextDirectSequence: timelock + DIRECT_TIMELOCK_OFFSET
|
|
19531
|
+
nextSequence: 1 << 30 | timelock,
|
|
19532
|
+
nextDirectSequence: 1 << 30 | timelock + DIRECT_TIMELOCK_OFFSET
|
|
19533
19533
|
};
|
|
19534
19534
|
}
|
|
19535
19535
|
function checkIfValidSequence(currSequence) {
|
|
@@ -19572,8 +19572,8 @@ function getNextTransactionSequence(currSequence, isNodeTx) {
|
|
|
19572
19572
|
});
|
|
19573
19573
|
}
|
|
19574
19574
|
return {
|
|
19575
|
-
nextSequence: nextTimelock,
|
|
19576
|
-
nextDirectSequence: nextTimelock + DIRECT_TIMELOCK_OFFSET
|
|
19575
|
+
nextSequence: 1 << 30 | nextTimelock,
|
|
19576
|
+
nextDirectSequence: 1 << 30 | nextTimelock + DIRECT_TIMELOCK_OFFSET
|
|
19577
19577
|
};
|
|
19578
19578
|
}
|
|
19579
19579
|
function getEphemeralAnchorOutput() {
|
|
@@ -20238,7 +20238,7 @@ var isWebExtension = (
|
|
|
20238
20238
|
"chrome" in globalThis && globalThis.chrome.runtime?.id
|
|
20239
20239
|
);
|
|
20240
20240
|
var userAgent = "navigator" in globalThis ? globalThis.navigator.userAgent || "unknown-user-agent" : void 0;
|
|
20241
|
-
var packageVersion = true ? "0.3.
|
|
20241
|
+
var packageVersion = true ? "0.3.3" : "unknown";
|
|
20242
20242
|
var baseEnvStr = "unknown";
|
|
20243
20243
|
if (isBun) {
|
|
20244
20244
|
const bunVersion = "version" in globalThis.Bun ? globalThis.Bun.version : "unknown-version";
|
|
@@ -26122,51 +26122,6 @@ var BaseTransferService = class {
|
|
|
26122
26122
|
this.connectionManager = connectionManager;
|
|
26123
26123
|
this.signingService = signingService;
|
|
26124
26124
|
}
|
|
26125
|
-
async sendTransferTweakKey(transfer, leaves, cpfpRefundSignatureMap, directRefundSignatureMap, directFromCpfpRefundSignatureMap) {
|
|
26126
|
-
const keyTweakInputMap = await this.prepareSendTransferKeyTweaks(
|
|
26127
|
-
transfer.id,
|
|
26128
|
-
transfer.receiverIdentityPublicKey,
|
|
26129
|
-
leaves,
|
|
26130
|
-
cpfpRefundSignatureMap,
|
|
26131
|
-
directRefundSignatureMap,
|
|
26132
|
-
directFromCpfpRefundSignatureMap
|
|
26133
|
-
);
|
|
26134
|
-
let updatedTransfer;
|
|
26135
|
-
const coordinatorOperator = this.config.getSigningOperators()[this.config.getCoordinatorIdentifier()];
|
|
26136
|
-
if (!coordinatorOperator) {
|
|
26137
|
-
throw new ValidationError("Coordinator operator not found", {
|
|
26138
|
-
field: "coordinator"
|
|
26139
|
-
});
|
|
26140
|
-
}
|
|
26141
|
-
for (const [identifier, operator] of Object.entries(
|
|
26142
|
-
this.config.getSigningOperators()
|
|
26143
|
-
).filter(([_, op]) => op.address !== this.config.getCoordinatorAddress())) {
|
|
26144
|
-
updatedTransfer = await this.finalizeTransfer(
|
|
26145
|
-
operator,
|
|
26146
|
-
identifier,
|
|
26147
|
-
keyTweakInputMap,
|
|
26148
|
-
transfer,
|
|
26149
|
-
updatedTransfer
|
|
26150
|
-
);
|
|
26151
|
-
}
|
|
26152
|
-
updatedTransfer = await this.finalizeTransfer(
|
|
26153
|
-
coordinatorOperator,
|
|
26154
|
-
this.config.getCoordinatorIdentifier(),
|
|
26155
|
-
keyTweakInputMap,
|
|
26156
|
-
transfer,
|
|
26157
|
-
updatedTransfer
|
|
26158
|
-
);
|
|
26159
|
-
if (!updatedTransfer) {
|
|
26160
|
-
throw new ValidationError(
|
|
26161
|
-
"No transfer response received from any operator",
|
|
26162
|
-
{
|
|
26163
|
-
field: "operators",
|
|
26164
|
-
value: Object.keys(this.config.getSigningOperators()).length
|
|
26165
|
-
}
|
|
26166
|
-
);
|
|
26167
|
-
}
|
|
26168
|
-
return updatedTransfer;
|
|
26169
|
-
}
|
|
26170
26125
|
async deliverTransferPackage(transfer, leaves, cpfpRefundSignatureMap, directRefundSignatureMap, directFromCpfpRefundSignatureMap) {
|
|
26171
26126
|
const keyTweakInputMap = await this.prepareSendTransferKeyTweaks(
|
|
26172
26127
|
transfer.id,
|
|
@@ -26308,55 +26263,7 @@ var BaseTransferService = class {
|
|
|
26308
26263
|
transferPackage.userSignature = new Uint8Array(signature);
|
|
26309
26264
|
return transferPackage;
|
|
26310
26265
|
}
|
|
26311
|
-
async
|
|
26312
|
-
const sparkClient = await this.connectionManager.createSparkClient(
|
|
26313
|
-
operator.address
|
|
26314
|
-
);
|
|
26315
|
-
const leavesToSend = keyTweakInputMap.get(identifier);
|
|
26316
|
-
if (!leavesToSend) {
|
|
26317
|
-
throw new ValidationError("No leaves to send for operator", {
|
|
26318
|
-
field: "operator",
|
|
26319
|
-
value: identifier
|
|
26320
|
-
});
|
|
26321
|
-
}
|
|
26322
|
-
let transferResp;
|
|
26323
|
-
try {
|
|
26324
|
-
transferResp = await sparkClient.finalize_transfer({
|
|
26325
|
-
transferId: transfer.id,
|
|
26326
|
-
ownerIdentityPublicKey: await this.config.signer.getIdentityPublicKey(),
|
|
26327
|
-
leavesToSend
|
|
26328
|
-
});
|
|
26329
|
-
} catch (error) {
|
|
26330
|
-
throw new NetworkError(
|
|
26331
|
-
"Failed to finalize transfer",
|
|
26332
|
-
{
|
|
26333
|
-
method: "POST"
|
|
26334
|
-
},
|
|
26335
|
-
error
|
|
26336
|
-
);
|
|
26337
|
-
}
|
|
26338
|
-
if (!updatedTransfer) {
|
|
26339
|
-
updatedTransfer = transferResp.transfer;
|
|
26340
|
-
} else {
|
|
26341
|
-
if (!transferResp.transfer) {
|
|
26342
|
-
throw new ValidationError("No transfer response from operator", {
|
|
26343
|
-
field: "transfer",
|
|
26344
|
-
value: transfer.id
|
|
26345
|
-
});
|
|
26346
|
-
}
|
|
26347
|
-
if (!this.compareTransfers(updatedTransfer, transferResp.transfer)) {
|
|
26348
|
-
throw new ValidationError(
|
|
26349
|
-
"Inconsistent transfer response from operators",
|
|
26350
|
-
{
|
|
26351
|
-
field: "transfer",
|
|
26352
|
-
value: transfer.id
|
|
26353
|
-
}
|
|
26354
|
-
);
|
|
26355
|
-
}
|
|
26356
|
-
}
|
|
26357
|
-
return updatedTransfer;
|
|
26358
|
-
}
|
|
26359
|
-
async signRefunds(leafDataMap, operatorSigningResults, cpfpAdaptorPubKey, directAdaptorPubKey, directFromCpfpAdaptorPubKey) {
|
|
26266
|
+
async signRefunds(leafDataMap, operatorSigningResults) {
|
|
26360
26267
|
const nodeSignatures = [];
|
|
26361
26268
|
for (const operatorSigningResult of operatorSigningResults) {
|
|
26362
26269
|
const leafData = leafDataMap.get(operatorSigningResult.leafId);
|
|
@@ -26385,7 +26292,6 @@ var BaseTransferService = class {
|
|
|
26385
26292
|
keyDerivation: leafData.keyDerivation,
|
|
26386
26293
|
selfCommitment: leafData.signingNonceCommitment,
|
|
26387
26294
|
statechainCommitments: operatorSigningResult.refundTxSigningResult?.signingNonceCommitments,
|
|
26388
|
-
adaptorPubKey: cpfpAdaptorPubKey,
|
|
26389
26295
|
verifyingKey: operatorSigningResult.verifyingKey
|
|
26390
26296
|
});
|
|
26391
26297
|
const cpfpRefundAggregate = await this.config.signer.aggregateFrost({
|
|
@@ -26396,8 +26302,7 @@ var BaseTransferService = class {
|
|
|
26396
26302
|
statechainCommitments: operatorSigningResult.refundTxSigningResult?.signingNonceCommitments,
|
|
26397
26303
|
selfCommitment: leafData.signingNonceCommitment,
|
|
26398
26304
|
publicKey,
|
|
26399
|
-
selfSignature: cpfpUserSignature
|
|
26400
|
-
adaptorPubKey: cpfpAdaptorPubKey
|
|
26305
|
+
selfSignature: cpfpUserSignature
|
|
26401
26306
|
});
|
|
26402
26307
|
let directRefundAggregate;
|
|
26403
26308
|
let directFromCpfpRefundAggregate;
|
|
@@ -26415,7 +26320,6 @@ var BaseTransferService = class {
|
|
|
26415
26320
|
keyDerivation: leafData.keyDerivation,
|
|
26416
26321
|
selfCommitment: leafData.directSigningNonceCommitment,
|
|
26417
26322
|
statechainCommitments: operatorSigningResult.directRefundTxSigningResult?.signingNonceCommitments,
|
|
26418
|
-
adaptorPubKey: directAdaptorPubKey,
|
|
26419
26323
|
verifyingKey: operatorSigningResult.verifyingKey
|
|
26420
26324
|
});
|
|
26421
26325
|
directRefundAggregate = await this.config.signer.aggregateFrost({
|
|
@@ -26426,8 +26330,7 @@ var BaseTransferService = class {
|
|
|
26426
26330
|
statechainCommitments: operatorSigningResult.directRefundTxSigningResult?.signingNonceCommitments,
|
|
26427
26331
|
selfCommitment: leafData.directSigningNonceCommitment,
|
|
26428
26332
|
publicKey,
|
|
26429
|
-
selfSignature: directUserSignature
|
|
26430
|
-
adaptorPubKey: directAdaptorPubKey
|
|
26333
|
+
selfSignature: directUserSignature
|
|
26431
26334
|
});
|
|
26432
26335
|
}
|
|
26433
26336
|
if (leafData.directFromCpfpRefundTx) {
|
|
@@ -26442,7 +26345,6 @@ var BaseTransferService = class {
|
|
|
26442
26345
|
keyDerivation: leafData.keyDerivation,
|
|
26443
26346
|
selfCommitment: leafData.directFromCpfpRefundSigningNonceCommitment,
|
|
26444
26347
|
statechainCommitments: operatorSigningResult.directFromCpfpRefundTxSigningResult?.signingNonceCommitments,
|
|
26445
|
-
adaptorPubKey: directFromCpfpAdaptorPubKey,
|
|
26446
26348
|
verifyingKey: operatorSigningResult.verifyingKey
|
|
26447
26349
|
});
|
|
26448
26350
|
directFromCpfpRefundAggregate = await this.config.signer.aggregateFrost({
|
|
@@ -26453,8 +26355,7 @@ var BaseTransferService = class {
|
|
|
26453
26355
|
statechainCommitments: operatorSigningResult.directFromCpfpRefundTxSigningResult?.signingNonceCommitments,
|
|
26454
26356
|
selfCommitment: leafData.directFromCpfpRefundSigningNonceCommitment,
|
|
26455
26357
|
publicKey,
|
|
26456
|
-
selfSignature: directFromCpfpUserSignature
|
|
26457
|
-
adaptorPubKey: directFromCpfpAdaptorPubKey
|
|
26358
|
+
selfSignature: directFromCpfpUserSignature
|
|
26458
26359
|
});
|
|
26459
26360
|
}
|
|
26460
26361
|
}
|
|
@@ -26570,30 +26471,6 @@ var TransferService = class extends BaseTransferService {
|
|
|
26570
26471
|
constructor(config, connectionManager, signingService) {
|
|
26571
26472
|
super(config, connectionManager, signingService);
|
|
26572
26473
|
}
|
|
26573
|
-
/**
|
|
26574
|
-
* @deprecated Use sendTransferWithKeyTweaks instead
|
|
26575
|
-
* Deprecated in v0.1.32
|
|
26576
|
-
*/
|
|
26577
|
-
async sendTransfer(leaves, receiverIdentityPubkey) {
|
|
26578
|
-
const {
|
|
26579
|
-
transfer,
|
|
26580
|
-
signatureMap,
|
|
26581
|
-
directSignatureMap,
|
|
26582
|
-
directFromCpfpSignatureMap
|
|
26583
|
-
} = await this.sendTransferSignRefund(
|
|
26584
|
-
leaves,
|
|
26585
|
-
receiverIdentityPubkey,
|
|
26586
|
-
new Date(Date.now() + DEFAULT_EXPIRY_TIME)
|
|
26587
|
-
);
|
|
26588
|
-
const transferWithTweakedKeys = await this.sendTransferTweakKey(
|
|
26589
|
-
transfer,
|
|
26590
|
-
leaves,
|
|
26591
|
-
signatureMap,
|
|
26592
|
-
directSignatureMap,
|
|
26593
|
-
directFromCpfpSignatureMap
|
|
26594
|
-
);
|
|
26595
|
-
return transferWithTweakedKeys;
|
|
26596
|
-
}
|
|
26597
26474
|
async claimTransfer(transfer, leaves) {
|
|
26598
26475
|
let proofMap;
|
|
26599
26476
|
if (transfer.status === 2 /* TRANSFER_STATUS_SENDER_KEY_TWEAKED */) {
|
|
@@ -26737,18 +26614,7 @@ var TransferService = class extends BaseTransferService {
|
|
|
26737
26614
|
leafDataMap
|
|
26738
26615
|
};
|
|
26739
26616
|
}
|
|
26740
|
-
async
|
|
26741
|
-
return this.sendTransferSignRefundInternal(
|
|
26742
|
-
leaves,
|
|
26743
|
-
receiverIdentityPubkey,
|
|
26744
|
-
expiryTime,
|
|
26745
|
-
true,
|
|
26746
|
-
cpfpAdaptorPubKey,
|
|
26747
|
-
directAdaptorPubKey,
|
|
26748
|
-
directFromCpfpAdaptorPubKey
|
|
26749
|
-
);
|
|
26750
|
-
}
|
|
26751
|
-
async sendTransferSignRefundInternal(leaves, receiverIdentityPubkey, expiryTime, forSwap, cpfpAdaptorPubKey, directAdaptorPubKey, directFromCpfpAdaptorPubKey) {
|
|
26617
|
+
async sendTransferSignRefundInternal(leaves, receiverIdentityPubkey, expiryTime, forSwap) {
|
|
26752
26618
|
const transferId = (0, import_uuidv72.uuidv7)();
|
|
26753
26619
|
const leafDataMap = /* @__PURE__ */ new Map();
|
|
26754
26620
|
for (const leaf of leaves) {
|
|
@@ -26783,21 +26649,7 @@ var TransferService = class extends BaseTransferService {
|
|
|
26783
26649
|
);
|
|
26784
26650
|
let response;
|
|
26785
26651
|
try {
|
|
26786
|
-
if (
|
|
26787
|
-
response = await sparkClient.counter_leaf_swap_v2({
|
|
26788
|
-
transfer: {
|
|
26789
|
-
transferId,
|
|
26790
|
-
leavesToSend: signingJobs,
|
|
26791
|
-
ownerIdentityPublicKey: await this.config.signer.getIdentityPublicKey(),
|
|
26792
|
-
receiverIdentityPublicKey: receiverIdentityPubkey,
|
|
26793
|
-
expiryTime
|
|
26794
|
-
},
|
|
26795
|
-
swapId: (0, import_uuidv72.uuidv7)(),
|
|
26796
|
-
adaptorPublicKey: cpfpAdaptorPubKey,
|
|
26797
|
-
directAdaptorPublicKey: directAdaptorPubKey,
|
|
26798
|
-
directFromCpfpAdaptorPublicKey: directFromCpfpAdaptorPubKey
|
|
26799
|
-
});
|
|
26800
|
-
} else if (forSwap) {
|
|
26652
|
+
if (forSwap) {
|
|
26801
26653
|
response = await sparkClient.start_leaf_swap_v2({
|
|
26802
26654
|
transferId,
|
|
26803
26655
|
leavesToSend: signingJobs,
|
|
@@ -26822,10 +26674,7 @@ var TransferService = class extends BaseTransferService {
|
|
|
26822
26674
|
}
|
|
26823
26675
|
const signatures = await this.signRefunds(
|
|
26824
26676
|
leafDataMap,
|
|
26825
|
-
response.signingResults
|
|
26826
|
-
cpfpAdaptorPubKey,
|
|
26827
|
-
directAdaptorPubKey,
|
|
26828
|
-
directFromCpfpAdaptorPubKey
|
|
26677
|
+
response.signingResults
|
|
26829
26678
|
);
|
|
26830
26679
|
const cpfpSignatureMap = /* @__PURE__ */ new Map();
|
|
26831
26680
|
const directSignatureMap = /* @__PURE__ */ new Map();
|
package/dist/native/index.d.cts
CHANGED
|
@@ -3069,9 +3069,9 @@ declare function filterTokenBalanceForTokenIdentifier(tokenBalances: TokenBalanc
|
|
|
3069
3069
|
declare function getTransferPackageSigningPayload(transferID: string, transferPackage: TransferPackage): Uint8Array;
|
|
3070
3070
|
|
|
3071
3071
|
declare const DIRECT_TIMELOCK_OFFSET = 50;
|
|
3072
|
-
declare const INITIAL_SEQUENCE
|
|
3072
|
+
declare const INITIAL_SEQUENCE: number;
|
|
3073
3073
|
declare const INITIAL_DIRECT_SEQUENCE: number;
|
|
3074
|
-
declare const TEST_UNILATERAL_SEQUENCE
|
|
3074
|
+
declare const TEST_UNILATERAL_SEQUENCE: number;
|
|
3075
3075
|
declare const TEST_UNILATERAL_DIRECT_SEQUENCE: number;
|
|
3076
3076
|
declare const DEFAULT_FEE_SATS: number;
|
|
3077
3077
|
/**
|
|
@@ -3355,12 +3355,10 @@ declare class BaseTransferService {
|
|
|
3355
3355
|
protected readonly connectionManager: ConnectionManager;
|
|
3356
3356
|
protected readonly signingService: SigningService;
|
|
3357
3357
|
constructor(config: WalletConfigService, connectionManager: ConnectionManager, signingService: SigningService);
|
|
3358
|
-
sendTransferTweakKey(transfer: Transfer$1, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer$1>;
|
|
3359
3358
|
deliverTransferPackage(transfer: Transfer$1, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer$1>;
|
|
3360
3359
|
sendTransferWithKeyTweaks(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, sparkInvoice?: SparkAddressFormat): Promise<Transfer$1>;
|
|
3361
3360
|
private prepareTransferPackage;
|
|
3362
|
-
|
|
3363
|
-
signRefunds(leafDataMap: Map<string, LeafRefundSigningData>, operatorSigningResults: LeafRefundTxSigningResult[], cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<NodeSignatures[]>;
|
|
3361
|
+
signRefunds(leafDataMap: Map<string, LeafRefundSigningData>, operatorSigningResults: LeafRefundTxSigningResult[]): Promise<NodeSignatures[]>;
|
|
3364
3362
|
private prepareSendTransferKeyTweaks;
|
|
3365
3363
|
private prepareSingleSendTransferKeyTweak;
|
|
3366
3364
|
protected findShare(shares: VerifiableSecretShare[], operatorID: number): VerifiableSecretShare | undefined;
|
|
@@ -3368,11 +3366,6 @@ declare class BaseTransferService {
|
|
|
3368
3366
|
}
|
|
3369
3367
|
declare class TransferService extends BaseTransferService {
|
|
3370
3368
|
constructor(config: WalletConfigService, connectionManager: ConnectionManager, signingService: SigningService);
|
|
3371
|
-
/**
|
|
3372
|
-
* @deprecated Use sendTransferWithKeyTweaks instead
|
|
3373
|
-
* Deprecated in v0.1.32
|
|
3374
|
-
*/
|
|
3375
|
-
sendTransfer(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array): Promise<Transfer$1>;
|
|
3376
3369
|
claimTransfer(transfer: Transfer$1, leaves: LeafKeyTweak[]): Promise<FinalizeNodeSignaturesResponse>;
|
|
3377
3370
|
queryPendingTransfers(transferIds?: string[]): Promise<QueryTransfersResponse>;
|
|
3378
3371
|
queryAllTransfers(limit: number, offset: number): Promise<QueryTransfersResponse>;
|
|
@@ -3392,15 +3385,7 @@ declare class TransferService extends BaseTransferService {
|
|
|
3392
3385
|
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
3393
3386
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
3394
3387
|
}>;
|
|
3395
|
-
|
|
3396
|
-
transfer: Transfer$1;
|
|
3397
|
-
signatureMap: Map<string, Uint8Array>;
|
|
3398
|
-
directSignatureMap: Map<string, Uint8Array>;
|
|
3399
|
-
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
3400
|
-
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
3401
|
-
signingResults: LeafRefundTxSigningResult[];
|
|
3402
|
-
}>;
|
|
3403
|
-
sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean, cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<{
|
|
3388
|
+
sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean): Promise<{
|
|
3404
3389
|
transfer: Transfer$1;
|
|
3405
3390
|
signatureMap: Map<string, Uint8Array>;
|
|
3406
3391
|
directSignatureMap: Map<string, Uint8Array>;
|
package/dist/native/index.d.ts
CHANGED
|
@@ -3069,9 +3069,9 @@ declare function filterTokenBalanceForTokenIdentifier(tokenBalances: TokenBalanc
|
|
|
3069
3069
|
declare function getTransferPackageSigningPayload(transferID: string, transferPackage: TransferPackage): Uint8Array;
|
|
3070
3070
|
|
|
3071
3071
|
declare const DIRECT_TIMELOCK_OFFSET = 50;
|
|
3072
|
-
declare const INITIAL_SEQUENCE
|
|
3072
|
+
declare const INITIAL_SEQUENCE: number;
|
|
3073
3073
|
declare const INITIAL_DIRECT_SEQUENCE: number;
|
|
3074
|
-
declare const TEST_UNILATERAL_SEQUENCE
|
|
3074
|
+
declare const TEST_UNILATERAL_SEQUENCE: number;
|
|
3075
3075
|
declare const TEST_UNILATERAL_DIRECT_SEQUENCE: number;
|
|
3076
3076
|
declare const DEFAULT_FEE_SATS: number;
|
|
3077
3077
|
/**
|
|
@@ -3355,12 +3355,10 @@ declare class BaseTransferService {
|
|
|
3355
3355
|
protected readonly connectionManager: ConnectionManager;
|
|
3356
3356
|
protected readonly signingService: SigningService;
|
|
3357
3357
|
constructor(config: WalletConfigService, connectionManager: ConnectionManager, signingService: SigningService);
|
|
3358
|
-
sendTransferTweakKey(transfer: Transfer$1, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer$1>;
|
|
3359
3358
|
deliverTransferPackage(transfer: Transfer$1, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer$1>;
|
|
3360
3359
|
sendTransferWithKeyTweaks(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, sparkInvoice?: SparkAddressFormat): Promise<Transfer$1>;
|
|
3361
3360
|
private prepareTransferPackage;
|
|
3362
|
-
|
|
3363
|
-
signRefunds(leafDataMap: Map<string, LeafRefundSigningData>, operatorSigningResults: LeafRefundTxSigningResult[], cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<NodeSignatures[]>;
|
|
3361
|
+
signRefunds(leafDataMap: Map<string, LeafRefundSigningData>, operatorSigningResults: LeafRefundTxSigningResult[]): Promise<NodeSignatures[]>;
|
|
3364
3362
|
private prepareSendTransferKeyTweaks;
|
|
3365
3363
|
private prepareSingleSendTransferKeyTweak;
|
|
3366
3364
|
protected findShare(shares: VerifiableSecretShare[], operatorID: number): VerifiableSecretShare | undefined;
|
|
@@ -3368,11 +3366,6 @@ declare class BaseTransferService {
|
|
|
3368
3366
|
}
|
|
3369
3367
|
declare class TransferService extends BaseTransferService {
|
|
3370
3368
|
constructor(config: WalletConfigService, connectionManager: ConnectionManager, signingService: SigningService);
|
|
3371
|
-
/**
|
|
3372
|
-
* @deprecated Use sendTransferWithKeyTweaks instead
|
|
3373
|
-
* Deprecated in v0.1.32
|
|
3374
|
-
*/
|
|
3375
|
-
sendTransfer(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array): Promise<Transfer$1>;
|
|
3376
3369
|
claimTransfer(transfer: Transfer$1, leaves: LeafKeyTweak[]): Promise<FinalizeNodeSignaturesResponse>;
|
|
3377
3370
|
queryPendingTransfers(transferIds?: string[]): Promise<QueryTransfersResponse>;
|
|
3378
3371
|
queryAllTransfers(limit: number, offset: number): Promise<QueryTransfersResponse>;
|
|
@@ -3392,15 +3385,7 @@ declare class TransferService extends BaseTransferService {
|
|
|
3392
3385
|
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
3393
3386
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
3394
3387
|
}>;
|
|
3395
|
-
|
|
3396
|
-
transfer: Transfer$1;
|
|
3397
|
-
signatureMap: Map<string, Uint8Array>;
|
|
3398
|
-
directSignatureMap: Map<string, Uint8Array>;
|
|
3399
|
-
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
3400
|
-
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
3401
|
-
signingResults: LeafRefundTxSigningResult[];
|
|
3402
|
-
}>;
|
|
3403
|
-
sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean, cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<{
|
|
3388
|
+
sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean): Promise<{
|
|
3404
3389
|
transfer: Transfer$1;
|
|
3405
3390
|
signatureMap: Map<string, Uint8Array>;
|
|
3406
3391
|
directSignatureMap: Map<string, Uint8Array>;
|