@buildonspark/spark-sdk 0.1.43 → 0.1.45
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/{RequestLightningSendInput-D7fZdT4A.d.ts → RequestLightningSendInput-DEPd_fPO.d.ts} +43 -4
- package/dist/{RequestLightningSendInput-Na1mHdWg.d.cts → RequestLightningSendInput-Du0z7Om7.d.cts} +43 -4
- package/dist/address/index.cjs +2 -2
- package/dist/address/index.d.cts +2 -2
- package/dist/address/index.d.ts +2 -2
- package/dist/address/index.js +2 -2
- package/dist/{chunk-IRW5TWMH.js → chunk-5FUB65LX.js} +7 -9
- package/dist/{chunk-BUTZWYBW.js → chunk-6264CGDM.js} +4 -4
- package/dist/{chunk-VFJQNBFX.js → chunk-7V6N75CC.js} +5 -2
- package/dist/{chunk-M6A4KFIG.js → chunk-BGGEVUJK.js} +1505 -445
- package/dist/{chunk-DQYKQJRZ.js → chunk-C2S227QR.js} +675 -52
- package/dist/{chunk-GYQR4B4P.js → chunk-GZ5IPPJ2.js} +2 -2
- package/dist/{chunk-6AFUC5M2.js → chunk-HWJWKEIU.js} +8 -2
- package/dist/{chunk-TOSP3INR.js → chunk-I54FARY2.js} +4 -2
- package/dist/{chunk-WWOTVNPP.js → chunk-J2IE4Z7Y.js} +544 -431
- package/dist/{chunk-O4RYNJNB.js → chunk-KMUMFYFX.js} +3 -3
- package/dist/chunk-LHRD2WT6.js +2374 -0
- package/dist/{chunk-ABZA6R5S.js → chunk-NTFKFRQ2.js} +1 -1
- package/dist/{chunk-MIVX3GHD.js → chunk-OBFKIEMP.js} +1 -1
- package/dist/{chunk-HRQRRDSS.js → chunk-PQN3C2MF.js} +15 -15
- package/dist/{chunk-DOA6QXYQ.js → chunk-R5PXJZQS.js} +3 -1
- package/dist/{chunk-TIUBYNN5.js → chunk-YUPMXTCJ.js} +4 -4
- package/dist/graphql/objects/index.d.cts +6 -43
- package/dist/graphql/objects/index.d.ts +6 -43
- package/dist/graphql/objects/index.js +1 -1
- package/dist/index-B2AwKW5J.d.cts +214 -0
- package/dist/index-CJDi1HWc.d.ts +214 -0
- package/dist/index.cjs +4150 -1026
- package/dist/index.d.cts +764 -19
- package/dist/index.d.ts +764 -19
- package/dist/index.js +17 -21
- package/dist/index.node.cjs +4153 -1033
- package/dist/index.node.d.cts +10 -8
- package/dist/index.node.d.ts +10 -8
- package/dist/index.node.js +20 -28
- package/dist/native/index.cjs +4166 -1042
- package/dist/native/index.d.cts +369 -108
- package/dist/native/index.d.ts +369 -108
- package/dist/native/index.js +4138 -1015
- package/dist/{network-xkBSpaTn.d.ts → network-BTJl-Sul.d.ts} +1 -1
- package/dist/{network-D5lKssVl.d.cts → network-CqgsdUF2.d.cts} +1 -1
- package/dist/proto/lrc20.cjs +222 -19
- package/dist/proto/lrc20.d.cts +1 -1
- package/dist/proto/lrc20.d.ts +1 -1
- package/dist/proto/lrc20.js +2 -2
- package/dist/proto/spark.cjs +1502 -442
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark.js +5 -5
- package/dist/proto/spark_token.cjs +1515 -56
- package/dist/proto/spark_token.d.cts +153 -15
- package/dist/proto/spark_token.d.ts +153 -15
- package/dist/proto/spark_token.js +40 -4
- package/dist/{sdk-types-B-q9py_P.d.cts → sdk-types-B0SwjolI.d.cts} +1 -1
- package/dist/{sdk-types-BPoPgzda.d.ts → sdk-types-Cc4l4kb1.d.ts} +1 -1
- package/dist/services/config.cjs +7 -3
- package/dist/services/config.d.cts +5 -4
- package/dist/services/config.d.ts +5 -4
- package/dist/services/config.js +6 -6
- package/dist/services/connection.cjs +2938 -646
- package/dist/services/connection.d.cts +5 -4
- package/dist/services/connection.d.ts +5 -4
- package/dist/services/connection.js +4 -4
- package/dist/services/index.cjs +6381 -3461
- package/dist/services/index.d.cts +7 -6
- package/dist/services/index.d.ts +7 -6
- package/dist/services/index.js +15 -13
- package/dist/services/lrc-connection.cjs +227 -21
- package/dist/services/lrc-connection.d.cts +5 -4
- package/dist/services/lrc-connection.d.ts +5 -4
- package/dist/services/lrc-connection.js +4 -4
- package/dist/services/token-transactions.cjs +868 -244
- package/dist/services/token-transactions.d.cts +25 -7
- package/dist/services/token-transactions.d.ts +25 -7
- package/dist/services/token-transactions.js +5 -4
- package/dist/services/wallet-config.cjs +4 -1
- package/dist/services/wallet-config.d.cts +7 -5
- package/dist/services/wallet-config.d.ts +7 -5
- package/dist/services/wallet-config.js +3 -1
- package/dist/signer/signer.cjs +5 -2
- package/dist/signer/signer.d.cts +3 -2
- package/dist/signer/signer.d.ts +3 -2
- package/dist/signer/signer.js +2 -2
- package/dist/{signer-wqesWifN.d.ts → signer-BocS_J6B.d.ts} +2 -6
- package/dist/{signer-IO3oMRNj.d.cts → signer-DKS0AJkw.d.cts} +2 -6
- package/dist/{spark-CDm4gqS6.d.cts → spark-dM7EYXYQ.d.cts} +138 -42
- package/dist/{spark-CDm4gqS6.d.ts → spark-dM7EYXYQ.d.ts} +138 -42
- package/dist/spark_bindings/native/index.cjs +183 -0
- package/dist/spark_bindings/native/index.d.cts +14 -0
- package/dist/spark_bindings/native/index.d.ts +14 -0
- package/dist/spark_bindings/native/index.js +141 -0
- package/dist/spark_bindings/wasm/index.cjs +1093 -0
- package/dist/spark_bindings/wasm/index.d.cts +47 -0
- package/dist/spark_bindings/wasm/index.d.ts +47 -0
- package/dist/{chunk-K4C4W5FC.js → spark_bindings/wasm/index.js} +7 -6
- package/dist/types/index.cjs +1503 -443
- package/dist/types/index.d.cts +6 -5
- package/dist/types/index.d.ts +6 -5
- package/dist/types/index.js +3 -3
- package/dist/types-C-Rp0Oo7.d.cts +46 -0
- package/dist/types-C-Rp0Oo7.d.ts +46 -0
- package/dist/utils/index.cjs +358 -36
- package/dist/utils/index.d.cts +14 -134
- package/dist/utils/index.d.ts +14 -134
- package/dist/utils/index.js +8 -8
- package/package.json +21 -1
- package/src/constants.ts +5 -1
- package/src/graphql/client.ts +28 -0
- package/src/graphql/mutations/RequestCoopExit.ts +6 -0
- package/src/graphql/mutations/RequestSwapLeaves.ts +2 -0
- package/src/graphql/queries/GetCoopExitFeeQuote.ts +20 -0
- package/src/index.node.ts +0 -1
- package/src/index.ts +0 -1
- package/src/native/index.ts +1 -2
- package/src/proto/common.ts +5 -5
- package/src/proto/google/protobuf/descriptor.ts +34 -34
- package/src/proto/google/protobuf/duration.ts +2 -2
- package/src/proto/google/protobuf/empty.ts +2 -2
- package/src/proto/google/protobuf/timestamp.ts +2 -2
- package/src/proto/mock.ts +4 -4
- package/src/proto/spark.ts +1924 -525
- package/src/proto/spark_authn.ts +7 -7
- package/src/proto/spark_token.ts +1668 -105
- package/src/proto/validate/validate.ts +24 -24
- package/src/services/bolt11-spark.ts +62 -187
- package/src/services/coop-exit.ts +3 -0
- package/src/services/lrc20.ts +1 -1
- package/src/services/token-transactions.ts +209 -9
- package/src/services/transfer.ts +22 -3
- package/src/services/tree-creation.ts +13 -0
- package/src/services/wallet-config.ts +2 -1
- package/src/spark-wallet/spark-wallet.node.ts +3 -7
- package/src/spark-wallet/spark-wallet.ts +376 -232
- package/src/spark-wallet/types.ts +39 -3
- package/src/tests/bolt11-spark.test.ts +7 -15
- package/src/tests/integration/deposit.test.ts +16 -0
- package/src/tests/integration/ssp/coop-exit.test.ts +85 -21
- package/src/tests/integration/ssp/swap.test.ts +47 -0
- package/src/tests/integration/swap.test.ts +453 -433
- package/src/tests/integration/transfer.test.ts +261 -248
- package/src/tests/token-identifier.test.ts +54 -0
- package/src/tests/tokens.test.ts +218 -22
- package/src/utils/token-hashing.ts +346 -52
- package/src/utils/token-identifier.ts +88 -0
- package/src/utils/token-transaction-validation.ts +350 -5
- package/src/utils/token-transactions.ts +12 -8
- package/src/utils/transaction.ts +2 -8
- package/dist/chunk-VA7MV4MZ.js +0 -1073
- package/dist/index-7RYRH5wc.d.ts +0 -815
- package/dist/index-BJOc8Ur-.d.cts +0 -815
- package/dist/wasm-7OWFHDMS.js +0 -21
- package/src/logger.ts +0 -3
package/dist/native/index.d.cts
CHANGED
|
@@ -215,7 +215,7 @@ declare enum Network$1 {
|
|
|
215
215
|
SIGNET = 4,
|
|
216
216
|
UNRECOGNIZED = -1
|
|
217
217
|
}
|
|
218
|
-
declare enum TokenTransactionStatus {
|
|
218
|
+
declare enum TokenTransactionStatus$1 {
|
|
219
219
|
TOKEN_TRANSACTION_STARTED = 0,
|
|
220
220
|
TOKEN_TRANSACTION_SIGNED = 1,
|
|
221
221
|
TOKEN_TRANSACTION_REVEALED = 5,
|
|
@@ -230,7 +230,7 @@ declare enum TransferStatus {
|
|
|
230
230
|
TRANSFER_STATUS_SENDER_KEY_TWEAK_PENDING = 1,
|
|
231
231
|
TRANSFER_STATUS_SENDER_KEY_TWEAKED = 2,
|
|
232
232
|
TRANSFER_STATUS_RECEIVER_KEY_TWEAKED = 3,
|
|
233
|
-
|
|
233
|
+
TRANSFER_STATUS_RECEIVER_REFUND_SIGNED = 4,
|
|
234
234
|
TRANSFER_STATUS_COMPLETED = 5,
|
|
235
235
|
TRANSFER_STATUS_EXPIRED = 6,
|
|
236
236
|
TRANSFER_STATUS_RETURNED = 7,
|
|
@@ -394,6 +394,12 @@ interface SigningKeyshare {
|
|
|
394
394
|
threshold: number;
|
|
395
395
|
/** The public key of the keyshare. */
|
|
396
396
|
publicKey: Uint8Array;
|
|
397
|
+
/** The public shares of the keyshare. */
|
|
398
|
+
publicShares: {
|
|
399
|
+
[key: string]: Uint8Array;
|
|
400
|
+
};
|
|
401
|
+
/** The latest update time of the keyshare. */
|
|
402
|
+
updatedTime: Date | undefined;
|
|
397
403
|
}
|
|
398
404
|
declare const SigningKeyshare: MessageFns$3<SigningKeyshare>;
|
|
399
405
|
/**
|
|
@@ -431,6 +437,12 @@ interface NodeSignatureShares {
|
|
|
431
437
|
refundTxSigningResult: SigningResult | undefined;
|
|
432
438
|
/** The verifying key of the node. */
|
|
433
439
|
verifyingKey: Uint8Array;
|
|
440
|
+
/** The signing result of the node's transaction. This transaction is to pay to self. */
|
|
441
|
+
directNodeTxSigningResult: SigningResult | undefined;
|
|
442
|
+
/** The signing result of the node's direct refund transaction. This transaction is to broadcast for the SO. */
|
|
443
|
+
directRefundTxSigningResult: SigningResult | undefined;
|
|
444
|
+
/** The signing result of the node's direct from cpfp refund transaction. This transaction is to broadcast for the SO. */
|
|
445
|
+
directFromCpfpRefundTxSigningResult: SigningResult | undefined;
|
|
434
446
|
}
|
|
435
447
|
declare const NodeSignatureShares: MessageFns$3<NodeSignatureShares>;
|
|
436
448
|
/**
|
|
@@ -440,10 +452,16 @@ declare const NodeSignatureShares: MessageFns$3<NodeSignatureShares>;
|
|
|
440
452
|
interface NodeSignatures {
|
|
441
453
|
/** The id of the node. */
|
|
442
454
|
nodeId: string;
|
|
443
|
-
/** The final signature of the node's transaction. This transaction is to pay to self. */
|
|
455
|
+
/** The final signature of the node's cpfp transaction. This transaction is to pay to self. */
|
|
444
456
|
nodeTxSignature: Uint8Array;
|
|
445
|
-
/** The final signature of the node's refund transaction. This transaction is to pay to the user. */
|
|
457
|
+
/** The final signature of the node's cpfp refund transaction. This transaction is to pay to the user. */
|
|
446
458
|
refundTxSignature: Uint8Array;
|
|
459
|
+
/** The final signature of the node's direct transaction. This transaction is to pay for the watchtower. */
|
|
460
|
+
directNodeTxSignature: Uint8Array;
|
|
461
|
+
/** The final signature of the node's direct refund transaction. This transaction is to pay for the watchtower. */
|
|
462
|
+
directRefundTxSignature: Uint8Array;
|
|
463
|
+
/** The final signature of the node's direct from cpfp refund transaction. This transaction is to pay for the watchtower. */
|
|
464
|
+
directFromCpfpRefundTxSignature: Uint8Array;
|
|
447
465
|
}
|
|
448
466
|
declare const NodeSignatures: MessageFns$3<NodeSignatures>;
|
|
449
467
|
/** StartTreeCreationRequest is the request to start the tree creation for a tree root node. */
|
|
@@ -452,10 +470,16 @@ interface StartTreeCreationRequest {
|
|
|
452
470
|
identityPublicKey: Uint8Array;
|
|
453
471
|
/** The on-chain utxo to be used to be spent by the root node. */
|
|
454
472
|
onChainUtxo: UTXO | undefined;
|
|
455
|
-
/** The signing job for the root node's transaction. */
|
|
473
|
+
/** The signing job for the root node's cpfp transaction. */
|
|
456
474
|
rootTxSigningJob: SigningJob | undefined;
|
|
457
|
-
/** The signing job for the root node's refund transaction. */
|
|
475
|
+
/** The signing job for the root node's cpfp refund transaction. */
|
|
458
476
|
refundTxSigningJob: SigningJob | undefined;
|
|
477
|
+
/** The signing job for the root node's direct transaction. */
|
|
478
|
+
directRootTxSigningJob: SigningJob | undefined;
|
|
479
|
+
/** The signing job for the root node's direct refund transaction */
|
|
480
|
+
directRefundTxSigningJob: SigningJob | undefined;
|
|
481
|
+
/** The signing job for the root node's direct refund transaction */
|
|
482
|
+
directFromCpfpRefundTxSigningJob: SigningJob | undefined;
|
|
459
483
|
}
|
|
460
484
|
declare const StartTreeCreationRequest: MessageFns$3<StartTreeCreationRequest>;
|
|
461
485
|
/** StartTreeCreationResponse is the response to the request to start the tree creation for a tree root node. */
|
|
@@ -476,6 +500,12 @@ interface StartDepositTreeCreationRequest {
|
|
|
476
500
|
rootTxSigningJob: SigningJob | undefined;
|
|
477
501
|
/** The signing job for the root node's refund transaction. */
|
|
478
502
|
refundTxSigningJob: SigningJob | undefined;
|
|
503
|
+
/** The direct signing job for the root node's transaction. */
|
|
504
|
+
directRootTxSigningJob: SigningJob | undefined;
|
|
505
|
+
/** The signing job for the root node's direct refund transaction. */
|
|
506
|
+
directRefundTxSigningJob: SigningJob | undefined;
|
|
507
|
+
/** The signing job for the root node's direct from cpfp refund transaction. */
|
|
508
|
+
directFromCpfpRefundTxSigningJob: SigningJob | undefined;
|
|
479
509
|
}
|
|
480
510
|
declare const StartDepositTreeCreationRequest: MessageFns$3<StartDepositTreeCreationRequest>;
|
|
481
511
|
/** StartDepositTreeCreationResponse is the response to the request to start the tree creation for a tree root node. */
|
|
@@ -511,8 +541,20 @@ interface TokenMintInput$1 {
|
|
|
511
541
|
* random nonce would be favorable to populating this field.
|
|
512
542
|
*/
|
|
513
543
|
issuerProvidedTimestamp: number;
|
|
544
|
+
tokenIdentifier?: Uint8Array | undefined;
|
|
514
545
|
}
|
|
515
546
|
declare const TokenMintInput$1: MessageFns$3<TokenMintInput$1>;
|
|
547
|
+
interface TokenCreateInput$1 {
|
|
548
|
+
issuerPublicKey: Uint8Array;
|
|
549
|
+
tokenName: string;
|
|
550
|
+
tokenTicker: string;
|
|
551
|
+
decimals: number;
|
|
552
|
+
/** Decoded uint128 */
|
|
553
|
+
maxSupply: Uint8Array;
|
|
554
|
+
isFreezable: boolean;
|
|
555
|
+
creationEntityPublicKey?: Uint8Array | undefined;
|
|
556
|
+
}
|
|
557
|
+
declare const TokenCreateInput$1: MessageFns$3<TokenCreateInput$1>;
|
|
516
558
|
/**
|
|
517
559
|
* This proto is constructed by the wallet to specify outputs it wants to create
|
|
518
560
|
* as part of a token transaction. Output id and revocation public key should remain unfilled
|
|
@@ -524,7 +566,8 @@ interface TokenOutput$2 {
|
|
|
524
566
|
revocationCommitment?: Uint8Array | undefined;
|
|
525
567
|
withdrawBondSats?: number | undefined;
|
|
526
568
|
withdrawRelativeBlockLocktime?: number | undefined;
|
|
527
|
-
tokenPublicKey
|
|
569
|
+
tokenPublicKey?: Uint8Array | undefined;
|
|
570
|
+
tokenIdentifier?: Uint8Array | undefined;
|
|
528
571
|
/** Decoded uint128 */
|
|
529
572
|
tokenAmount: Uint8Array;
|
|
530
573
|
}
|
|
@@ -535,37 +578,36 @@ declare const TokenOutput$2: MessageFns$3<TokenOutput$2>;
|
|
|
535
578
|
* is cooperatively signed by the SO group to confirm a token transaction.
|
|
536
579
|
*/
|
|
537
580
|
interface TokenTransaction$1 {
|
|
538
|
-
/**
|
|
539
|
-
* For mint transactions issuer_public_key will be specified without any outputs_to_spend.
|
|
540
|
-
* For transfer transactions the token amount in the input leaves must match the token amount in the output leaves.
|
|
541
|
-
*/
|
|
542
581
|
tokenInputs?: {
|
|
543
582
|
$case: "mintInput";
|
|
544
583
|
mintInput: TokenMintInput$1;
|
|
545
584
|
} | {
|
|
546
585
|
$case: "transferInput";
|
|
547
586
|
transferInput: TokenTransferInput$1;
|
|
587
|
+
} | {
|
|
588
|
+
$case: "createInput";
|
|
589
|
+
createInput: TokenCreateInput$1;
|
|
548
590
|
} | undefined;
|
|
549
591
|
tokenOutputs: TokenOutput$2[];
|
|
550
592
|
sparkOperatorIdentityPublicKeys: Uint8Array[];
|
|
551
593
|
network: Network$1;
|
|
552
594
|
}
|
|
553
595
|
declare const TokenTransaction$1: MessageFns$3<TokenTransaction$1>;
|
|
554
|
-
interface SpentTokenOutputMetadata {
|
|
596
|
+
interface SpentTokenOutputMetadata$1 {
|
|
555
597
|
outputId: string;
|
|
556
598
|
revocationSecret: Uint8Array;
|
|
557
599
|
}
|
|
558
|
-
declare const SpentTokenOutputMetadata: MessageFns$3<SpentTokenOutputMetadata>;
|
|
559
|
-
interface TokenTransactionConfirmationMetadata {
|
|
560
|
-
spentTokenOutputsMetadata: SpentTokenOutputMetadata[];
|
|
600
|
+
declare const SpentTokenOutputMetadata$1: MessageFns$3<SpentTokenOutputMetadata$1>;
|
|
601
|
+
interface TokenTransactionConfirmationMetadata$1 {
|
|
602
|
+
spentTokenOutputsMetadata: SpentTokenOutputMetadata$1[];
|
|
561
603
|
}
|
|
562
|
-
declare const TokenTransactionConfirmationMetadata: MessageFns$3<TokenTransactionConfirmationMetadata>;
|
|
563
|
-
interface TokenTransactionWithStatus {
|
|
604
|
+
declare const TokenTransactionConfirmationMetadata$1: MessageFns$3<TokenTransactionConfirmationMetadata$1>;
|
|
605
|
+
interface TokenTransactionWithStatus$1 {
|
|
564
606
|
tokenTransaction: TokenTransaction$1 | undefined;
|
|
565
|
-
status: TokenTransactionStatus;
|
|
566
|
-
confirmationMetadata: TokenTransactionConfirmationMetadata | undefined;
|
|
607
|
+
status: TokenTransactionStatus$1;
|
|
608
|
+
confirmationMetadata: TokenTransactionConfirmationMetadata$1 | undefined;
|
|
567
609
|
}
|
|
568
|
-
declare const TokenTransactionWithStatus: MessageFns$3<TokenTransactionWithStatus>;
|
|
610
|
+
declare const TokenTransactionWithStatus$1: MessageFns$3<TokenTransactionWithStatus$1>;
|
|
569
611
|
interface SignatureWithIndex$1 {
|
|
570
612
|
/** This is a Schnorr or ECDSA DER signature which can be between 64 and 73 bytes. */
|
|
571
613
|
signature: Uint8Array;
|
|
@@ -576,7 +618,7 @@ declare const SignatureWithIndex$1: MessageFns$3<SignatureWithIndex$1>;
|
|
|
576
618
|
interface TokenTransactionSignatures {
|
|
577
619
|
/**
|
|
578
620
|
* Filled by signing the partial token transaction hash with the owner/issuer private key.
|
|
579
|
-
* For mint transactions this will be one signature for the input
|
|
621
|
+
* For mint transactions this will be one signature for the input token_public_key
|
|
580
622
|
* For transfer transactions this will be one for each output for the output owner_public_key
|
|
581
623
|
*/
|
|
582
624
|
ownerSignatures: SignatureWithIndex$1[];
|
|
@@ -587,6 +629,7 @@ interface StartTokenTransactionRequest {
|
|
|
587
629
|
partialTokenTransaction: TokenTransaction$1 | undefined;
|
|
588
630
|
/** List of ecdsa signatures authorizing movement of tokens from the token input. */
|
|
589
631
|
tokenTransactionSignatures: TokenTransactionSignatures | undefined;
|
|
632
|
+
sparkPaymentIntent: string;
|
|
590
633
|
}
|
|
591
634
|
declare const StartTokenTransactionRequest: MessageFns$3<StartTokenTransactionRequest>;
|
|
592
635
|
interface StartTokenTransactionResponse {
|
|
@@ -647,6 +690,7 @@ interface FinalizeTokenTransactionRequest {
|
|
|
647
690
|
*/
|
|
648
691
|
revocationSecrets: RevocationSecretWithIndex[];
|
|
649
692
|
identityPublicKey: Uint8Array;
|
|
693
|
+
sparkPaymentIntent: string;
|
|
650
694
|
}
|
|
651
695
|
declare const FinalizeTokenTransactionRequest: MessageFns$3<FinalizeTokenTransactionRequest>;
|
|
652
696
|
interface FreezeTokensPayload$1 {
|
|
@@ -656,6 +700,7 @@ interface FreezeTokensPayload$1 {
|
|
|
656
700
|
operatorIdentityPublicKey: Uint8Array;
|
|
657
701
|
/** Set to false when requesting a freeze. */
|
|
658
702
|
shouldUnfreeze: boolean;
|
|
703
|
+
tokenIdentifier?: Uint8Array | undefined;
|
|
659
704
|
}
|
|
660
705
|
declare const FreezeTokensPayload$1: MessageFns$3<FreezeTokensPayload$1>;
|
|
661
706
|
interface FreezeTokensRequest$1 {
|
|
@@ -670,43 +715,46 @@ interface FreezeTokensResponse$1 {
|
|
|
670
715
|
impactedTokenAmount: Uint8Array;
|
|
671
716
|
}
|
|
672
717
|
declare const FreezeTokensResponse$1: MessageFns$3<FreezeTokensResponse$1>;
|
|
673
|
-
interface QueryTokenOutputsRequest {
|
|
718
|
+
interface QueryTokenOutputsRequest$1 {
|
|
674
719
|
ownerPublicKeys: Uint8Array[];
|
|
675
720
|
/** Optionally provide token public keys. If not set return leaves for all tokens. */
|
|
676
721
|
tokenPublicKeys: Uint8Array[];
|
|
722
|
+
tokenIdentifiers: Uint8Array[];
|
|
677
723
|
/** defaults to mainnet when no network is provided. */
|
|
678
724
|
network: Network$1;
|
|
679
725
|
}
|
|
680
|
-
declare const QueryTokenOutputsRequest: MessageFns$3<QueryTokenOutputsRequest>;
|
|
726
|
+
declare const QueryTokenOutputsRequest$1: MessageFns$3<QueryTokenOutputsRequest$1>;
|
|
681
727
|
/** Request constraints are combined using an AND relation. */
|
|
682
|
-
interface QueryTokenTransactionsRequest {
|
|
728
|
+
interface QueryTokenTransactionsRequest$1 {
|
|
683
729
|
/** Returns transactions that have one of these output ids in the input or output. */
|
|
684
730
|
outputIds: string[];
|
|
685
731
|
/** Returns transactions that have this owner public key as the sender or receiver in one or more of the input/output leaves. */
|
|
686
732
|
ownerPublicKeys: Uint8Array[];
|
|
687
733
|
/** Returns transactions that related to this token public key. */
|
|
688
734
|
tokenPublicKeys: Uint8Array[];
|
|
735
|
+
/** Returns transactions that related to this token identifier. */
|
|
736
|
+
tokenIdentifiers: Uint8Array[];
|
|
689
737
|
/** Returns transactions that match the provided transaction hashes. */
|
|
690
738
|
tokenTransactionHashes: Uint8Array[];
|
|
691
739
|
limit: number;
|
|
692
740
|
offset: number;
|
|
693
741
|
}
|
|
694
|
-
declare const QueryTokenTransactionsRequest: MessageFns$3<QueryTokenTransactionsRequest>;
|
|
695
|
-
interface QueryTokenTransactionsResponse {
|
|
696
|
-
tokenTransactionsWithStatus: TokenTransactionWithStatus[];
|
|
742
|
+
declare const QueryTokenTransactionsRequest$1: MessageFns$3<QueryTokenTransactionsRequest$1>;
|
|
743
|
+
interface QueryTokenTransactionsResponse$1 {
|
|
744
|
+
tokenTransactionsWithStatus: TokenTransactionWithStatus$1[];
|
|
697
745
|
offset: number;
|
|
698
746
|
}
|
|
699
|
-
declare const QueryTokenTransactionsResponse: MessageFns$3<QueryTokenTransactionsResponse>;
|
|
700
|
-
interface OutputWithPreviousTransactionData {
|
|
747
|
+
declare const QueryTokenTransactionsResponse$1: MessageFns$3<QueryTokenTransactionsResponse$1>;
|
|
748
|
+
interface OutputWithPreviousTransactionData$1 {
|
|
701
749
|
output: TokenOutput$2 | undefined;
|
|
702
750
|
previousTransactionHash: Uint8Array;
|
|
703
751
|
previousTransactionVout: number;
|
|
704
752
|
}
|
|
705
|
-
declare const OutputWithPreviousTransactionData: MessageFns$3<OutputWithPreviousTransactionData>;
|
|
706
|
-
interface QueryTokenOutputsResponse {
|
|
707
|
-
outputsWithPreviousTransactionData: OutputWithPreviousTransactionData[];
|
|
753
|
+
declare const OutputWithPreviousTransactionData$1: MessageFns$3<OutputWithPreviousTransactionData$1>;
|
|
754
|
+
interface QueryTokenOutputsResponse$1 {
|
|
755
|
+
outputsWithPreviousTransactionData: OutputWithPreviousTransactionData$1[];
|
|
708
756
|
}
|
|
709
|
-
declare const QueryTokenOutputsResponse: MessageFns$3<QueryTokenOutputsResponse>;
|
|
757
|
+
declare const QueryTokenOutputsResponse$1: MessageFns$3<QueryTokenOutputsResponse$1>;
|
|
710
758
|
/** TreeNode represents a node on the tree. */
|
|
711
759
|
interface TreeNode {
|
|
712
760
|
/** The id of the node. */
|
|
@@ -717,7 +765,7 @@ interface TreeNode {
|
|
|
717
765
|
value: number;
|
|
718
766
|
/** The id of the parent node. */
|
|
719
767
|
parentNodeId?: string | undefined;
|
|
720
|
-
/** The transaction of the node, this transaction is to pay to the same address as the node. */
|
|
768
|
+
/** The cpfp transaction of the node, this transaction is to pay to the same address as the node. */
|
|
721
769
|
nodeTx: Uint8Array;
|
|
722
770
|
/** The refund transaction of the node, this transaction is to pay to the user. */
|
|
723
771
|
refundTx: Uint8Array;
|
|
@@ -733,6 +781,18 @@ interface TreeNode {
|
|
|
733
781
|
status: string;
|
|
734
782
|
/** The network of the node. */
|
|
735
783
|
network: Network$1;
|
|
784
|
+
/** The creation time of the node. */
|
|
785
|
+
createdTime: Date | undefined;
|
|
786
|
+
/** The latest update time of the node. */
|
|
787
|
+
updatedTime: Date | undefined;
|
|
788
|
+
/** The signing public key of the owner of the node. */
|
|
789
|
+
ownerSigningPublicKey: Uint8Array;
|
|
790
|
+
/** The direct transaction of the node, this transaction is for the watchtower to broadcast. */
|
|
791
|
+
directTx: Uint8Array;
|
|
792
|
+
/** The refund transaction of the node, this transaction is to pay to the user. */
|
|
793
|
+
directRefundTx: Uint8Array;
|
|
794
|
+
/** The refund transaction of the node, this transaction is to pay to the user. */
|
|
795
|
+
directFromCpfpRefundTx: Uint8Array;
|
|
736
796
|
}
|
|
737
797
|
declare const TreeNode: MessageFns$3<TreeNode>;
|
|
738
798
|
/** FinalizeNodeSignaturesRequest is the request to finalize the signatures for a node. */
|
|
@@ -766,6 +826,8 @@ declare const SecretShare$1: MessageFns$3<SecretShare$1>;
|
|
|
766
826
|
interface LeafRefundTxSigningJob {
|
|
767
827
|
leafId: string;
|
|
768
828
|
refundTxSigningJob: SigningJob | undefined;
|
|
829
|
+
directRefundTxSigningJob: SigningJob | undefined;
|
|
830
|
+
directFromCpfpRefundTxSigningJob: SigningJob | undefined;
|
|
769
831
|
}
|
|
770
832
|
declare const LeafRefundTxSigningJob: MessageFns$3<LeafRefundTxSigningJob>;
|
|
771
833
|
interface UserSignedTxSigningJob {
|
|
@@ -781,6 +843,8 @@ interface LeafRefundTxSigningResult {
|
|
|
781
843
|
leafId: string;
|
|
782
844
|
refundTxSigningResult: SigningResult | undefined;
|
|
783
845
|
verifyingKey: Uint8Array;
|
|
846
|
+
directRefundTxSigningResult: SigningResult | undefined;
|
|
847
|
+
directFromCpfpRefundTxSigningResult: SigningResult | undefined;
|
|
784
848
|
}
|
|
785
849
|
declare const LeafRefundTxSigningResult: MessageFns$3<LeafRefundTxSigningResult>;
|
|
786
850
|
interface StartUserSignedTransferRequest {
|
|
@@ -789,6 +853,8 @@ interface StartUserSignedTransferRequest {
|
|
|
789
853
|
leavesToSend: UserSignedTxSigningJob[];
|
|
790
854
|
receiverIdentityPublicKey: Uint8Array;
|
|
791
855
|
expiryTime: Date | undefined;
|
|
856
|
+
directLeavesToSend: UserSignedTxSigningJob[];
|
|
857
|
+
directFromCpfpLeavesToSend: UserSignedTxSigningJob[];
|
|
792
858
|
}
|
|
793
859
|
declare const StartUserSignedTransferRequest: MessageFns$3<StartUserSignedTransferRequest>;
|
|
794
860
|
interface StartTransferRequest {
|
|
@@ -800,6 +866,7 @@ interface StartTransferRequest {
|
|
|
800
866
|
expiryTime: Date | undefined;
|
|
801
867
|
/** If this field is set, the leaves_to_send and key_tweak_proofs will be ignored. */
|
|
802
868
|
transferPackage: TransferPackage | undefined;
|
|
869
|
+
sparkPaymentIntent: string;
|
|
803
870
|
}
|
|
804
871
|
declare const StartTransferRequest: MessageFns$3<StartTransferRequest>;
|
|
805
872
|
interface StartTransferResponse {
|
|
@@ -813,7 +880,7 @@ declare const StartTransferResponse: MessageFns$3<StartTransferResponse>;
|
|
|
813
880
|
* the coordinator SO.
|
|
814
881
|
*/
|
|
815
882
|
interface TransferPackage {
|
|
816
|
-
/** The leaves to send, with user signed refunds and signing package. */
|
|
883
|
+
/** The leaves to send, with user signed cpfp refunds and signing package. */
|
|
817
884
|
leavesToSend: UserSignedTxSigningJob[];
|
|
818
885
|
/** The map of SO identifier to ciphertext of SendLeafTweaks. */
|
|
819
886
|
keyTweakPackage: {
|
|
@@ -821,6 +888,10 @@ interface TransferPackage {
|
|
|
821
888
|
};
|
|
822
889
|
/** The signature of user to prove that the key_tweak_package is not tampered. */
|
|
823
890
|
userSignature: Uint8Array;
|
|
891
|
+
/** The leaves to send, with user signed direct refunds and signing package. */
|
|
892
|
+
directLeavesToSend: UserSignedTxSigningJob[];
|
|
893
|
+
/** The leaves to send, with user signed direct from cpfp refunds and signing package. */
|
|
894
|
+
directFromCpfpLeavesToSend: UserSignedTxSigningJob[];
|
|
824
895
|
}
|
|
825
896
|
declare const TransferPackage: MessageFns$3<TransferPackage>;
|
|
826
897
|
interface SendLeafKeyTweak {
|
|
@@ -833,12 +904,15 @@ interface SendLeafKeyTweak {
|
|
|
833
904
|
/** Signature over Sha256(leaf_id||transfer_id||secret_cipher) */
|
|
834
905
|
signature: Uint8Array;
|
|
835
906
|
refundSignature: Uint8Array;
|
|
907
|
+
directRefundSignature: Uint8Array;
|
|
908
|
+
directFromCpfpRefundSignature: Uint8Array;
|
|
836
909
|
}
|
|
837
910
|
declare const SendLeafKeyTweak: MessageFns$3<SendLeafKeyTweak>;
|
|
838
911
|
interface FinalizeTransferRequest {
|
|
839
912
|
transferId: string;
|
|
840
913
|
ownerIdentityPublicKey: Uint8Array;
|
|
841
914
|
leavesToSend: SendLeafKeyTweak[];
|
|
915
|
+
sparkPaymentIntent: string;
|
|
842
916
|
}
|
|
843
917
|
declare const FinalizeTransferRequest: MessageFns$3<FinalizeTransferRequest>;
|
|
844
918
|
interface FinalizeTransferWithTransferPackageRequest {
|
|
@@ -869,6 +943,8 @@ interface TransferLeaf {
|
|
|
869
943
|
secretCipher: Uint8Array;
|
|
870
944
|
signature: Uint8Array;
|
|
871
945
|
intermediateRefundTx: Uint8Array;
|
|
946
|
+
intermediateDirectRefundTx: Uint8Array;
|
|
947
|
+
intermediateDirectFromCpfpRefundTx: Uint8Array;
|
|
872
948
|
}
|
|
873
949
|
declare const TransferLeaf: MessageFns$3<TransferLeaf>;
|
|
874
950
|
interface TransferFilter {
|
|
@@ -890,6 +966,7 @@ interface TransferFilter {
|
|
|
890
966
|
types: TransferType[];
|
|
891
967
|
/** defaults to mainnet when no network is provided. */
|
|
892
968
|
network: Network$1;
|
|
969
|
+
statuses: TransferStatus[];
|
|
893
970
|
}
|
|
894
971
|
declare const TransferFilter: MessageFns$3<TransferFilter>;
|
|
895
972
|
interface QueryTransfersResponse {
|
|
@@ -921,20 +998,6 @@ interface ClaimTransferSignRefundsResponse {
|
|
|
921
998
|
signingResults: LeafRefundTxSigningResult[];
|
|
922
999
|
}
|
|
923
1000
|
declare const ClaimTransferSignRefundsResponse: MessageFns$3<ClaimTransferSignRefundsResponse>;
|
|
924
|
-
interface AggregateNodesRequest {
|
|
925
|
-
nodeIds: string[];
|
|
926
|
-
signingJob: SigningJob | undefined;
|
|
927
|
-
/** Serves as a temporary identity public key, this should be get from auth process. */
|
|
928
|
-
ownerIdentityPublicKey: Uint8Array;
|
|
929
|
-
}
|
|
930
|
-
declare const AggregateNodesRequest: MessageFns$3<AggregateNodesRequest>;
|
|
931
|
-
interface AggregateNodesResponse {
|
|
932
|
-
aggregateSignature: SigningResult | undefined;
|
|
933
|
-
verifyingKey: Uint8Array;
|
|
934
|
-
parentNodeTx: Uint8Array;
|
|
935
|
-
parentNodeVout: number;
|
|
936
|
-
}
|
|
937
|
-
declare const AggregateNodesResponse: MessageFns$3<AggregateNodesResponse>;
|
|
938
1001
|
interface StorePreimageShareRequest {
|
|
939
1002
|
paymentHash: Uint8Array;
|
|
940
1003
|
preimageShare: SecretShare$1 | undefined;
|
|
@@ -1010,6 +1073,8 @@ interface CounterLeafSwapRequest {
|
|
|
1010
1073
|
transfer: StartTransferRequest | undefined;
|
|
1011
1074
|
swapId: string;
|
|
1012
1075
|
adaptorPublicKey: Uint8Array;
|
|
1076
|
+
directAdaptorPublicKey: Uint8Array;
|
|
1077
|
+
directFromCpfpAdaptorPublicKey: Uint8Array;
|
|
1013
1078
|
}
|
|
1014
1079
|
declare const CounterLeafSwapRequest: MessageFns$3<CounterLeafSwapRequest>;
|
|
1015
1080
|
interface CounterLeafSwapResponse {
|
|
@@ -1038,6 +1103,9 @@ interface ExtendLeafRequest {
|
|
|
1038
1103
|
ownerIdentityPublicKey: Uint8Array;
|
|
1039
1104
|
nodeTxSigningJob: SigningJob | undefined;
|
|
1040
1105
|
refundTxSigningJob: SigningJob | undefined;
|
|
1106
|
+
directNodeTxSigningJob: SigningJob | undefined;
|
|
1107
|
+
directRefundTxSigningJob: SigningJob | undefined;
|
|
1108
|
+
directFromCpfpRefundTxSigningJob: SigningJob | undefined;
|
|
1041
1109
|
}
|
|
1042
1110
|
declare const ExtendLeafRequest: MessageFns$3<ExtendLeafRequest>;
|
|
1043
1111
|
interface ExtendLeafSigningResult {
|
|
@@ -1049,6 +1117,9 @@ interface ExtendLeafResponse {
|
|
|
1049
1117
|
leafId: string;
|
|
1050
1118
|
nodeTxSigningResult: ExtendLeafSigningResult | undefined;
|
|
1051
1119
|
refundTxSigningResult: ExtendLeafSigningResult | undefined;
|
|
1120
|
+
directNodeTxSigningResult: ExtendLeafSigningResult | undefined;
|
|
1121
|
+
directRefundTxSigningResult: ExtendLeafSigningResult | undefined;
|
|
1122
|
+
directFromCpfpRefundTxSigningResult: ExtendLeafSigningResult | undefined;
|
|
1052
1123
|
}
|
|
1053
1124
|
declare const ExtendLeafResponse: MessageFns$3<ExtendLeafResponse>;
|
|
1054
1125
|
interface AddressRequestNode {
|
|
@@ -1082,12 +1153,18 @@ interface PrepareTreeAddressResponse {
|
|
|
1082
1153
|
}
|
|
1083
1154
|
declare const PrepareTreeAddressResponse: MessageFns$3<PrepareTreeAddressResponse>;
|
|
1084
1155
|
interface CreationNode {
|
|
1085
|
-
/** This is the tx that spends the parent node's output. */
|
|
1156
|
+
/** This is the cpfp tx that spends the parent node's output. */
|
|
1086
1157
|
nodeTxSigningJob: SigningJob | undefined;
|
|
1087
1158
|
/** The refund tx can only exist if there's no children. */
|
|
1088
1159
|
refundTxSigningJob: SigningJob | undefined;
|
|
1089
1160
|
/** The children will spend the output of the node's tx. Vout is the index of the child. */
|
|
1090
1161
|
children: CreationNode[];
|
|
1162
|
+
/** This is the direct tx that spends the parent node's output. */
|
|
1163
|
+
directNodeTxSigningJob: SigningJob | undefined;
|
|
1164
|
+
/** The direct refund tx can only exist if there's no children. */
|
|
1165
|
+
directRefundTxSigningJob: SigningJob | undefined;
|
|
1166
|
+
/** The direct from cpfp refund tx can only exist if there's no children. */
|
|
1167
|
+
directFromCpfpRefundTxSigningJob: SigningJob | undefined;
|
|
1091
1168
|
}
|
|
1092
1169
|
declare const CreationNode: MessageFns$3<CreationNode>;
|
|
1093
1170
|
interface CreateTreeRequest {
|
|
@@ -1109,6 +1186,9 @@ interface CreationResponseNode {
|
|
|
1109
1186
|
nodeTxSigningResult: SigningResult | undefined;
|
|
1110
1187
|
refundTxSigningResult: SigningResult | undefined;
|
|
1111
1188
|
children: CreationResponseNode[];
|
|
1189
|
+
directNodeTxSigningResult: SigningResult | undefined;
|
|
1190
|
+
directRefundTxSigningResult: SigningResult | undefined;
|
|
1191
|
+
directFromCpfpRefundTxSigningResult: SigningResult | undefined;
|
|
1112
1192
|
}
|
|
1113
1193
|
declare const CreationResponseNode: MessageFns$3<CreationResponseNode>;
|
|
1114
1194
|
interface CreateTreeResponse {
|
|
@@ -1195,6 +1275,10 @@ interface QueryUnusedDepositAddressesRequest {
|
|
|
1195
1275
|
identityPublicKey: Uint8Array;
|
|
1196
1276
|
/** defaults to mainnet when no network is provided. */
|
|
1197
1277
|
network: Network$1;
|
|
1278
|
+
/** defaults to 100 if not set. */
|
|
1279
|
+
limit: number;
|
|
1280
|
+
/** defaults to 0 if not set. */
|
|
1281
|
+
offset: number;
|
|
1198
1282
|
}
|
|
1199
1283
|
declare const QueryUnusedDepositAddressesRequest: MessageFns$3<QueryUnusedDepositAddressesRequest>;
|
|
1200
1284
|
interface QueryStaticDepositAddressesRequest {
|
|
@@ -1214,6 +1298,8 @@ interface DepositAddressQueryResult {
|
|
|
1214
1298
|
declare const DepositAddressQueryResult: MessageFns$3<DepositAddressQueryResult>;
|
|
1215
1299
|
interface QueryUnusedDepositAddressesResponse {
|
|
1216
1300
|
depositAddresses: DepositAddressQueryResult[];
|
|
1301
|
+
/** defaults to -1 if there are no more results */
|
|
1302
|
+
offset: number;
|
|
1217
1303
|
}
|
|
1218
1304
|
declare const QueryUnusedDepositAddressesResponse: MessageFns$3<QueryUnusedDepositAddressesResponse>;
|
|
1219
1305
|
interface QueryStaticDepositAddressesResponse {
|
|
@@ -1318,6 +1404,11 @@ interface SparkServiceClient$1<CallOptionsExt = {}> {
|
|
|
1318
1404
|
start_tree_creation(request: DeepPartial$3<StartTreeCreationRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTreeCreationResponse>;
|
|
1319
1405
|
finalize_node_signatures(request: DeepPartial$3<FinalizeNodeSignaturesRequest>, options?: CallOptions & CallOptionsExt): Promise<FinalizeNodeSignaturesResponse>;
|
|
1320
1406
|
start_transfer(request: DeepPartial$3<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
|
|
1407
|
+
/**
|
|
1408
|
+
* This is deprecated, please use finalize_transfer_with_transfer_package instead.
|
|
1409
|
+
*
|
|
1410
|
+
* @deprecated
|
|
1411
|
+
*/
|
|
1321
1412
|
finalize_transfer(request: DeepPartial$3<FinalizeTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<FinalizeTransferResponse>;
|
|
1322
1413
|
finalize_transfer_with_transfer_package(request: DeepPartial$3<FinalizeTransferWithTransferPackageRequest>, options?: CallOptions & CallOptionsExt): Promise<FinalizeTransferResponse>;
|
|
1323
1414
|
cancel_transfer(request: DeepPartial$3<CancelTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<CancelTransferResponse>;
|
|
@@ -1325,7 +1416,6 @@ interface SparkServiceClient$1<CallOptionsExt = {}> {
|
|
|
1325
1416
|
query_all_transfers(request: DeepPartial$3<TransferFilter>, options?: CallOptions & CallOptionsExt): Promise<QueryTransfersResponse>;
|
|
1326
1417
|
claim_transfer_tweak_keys(request: DeepPartial$3<ClaimTransferTweakKeysRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
1327
1418
|
claim_transfer_sign_refunds(request: DeepPartial$3<ClaimTransferSignRefundsRequest>, options?: CallOptions & CallOptionsExt): Promise<ClaimTransferSignRefundsResponse>;
|
|
1328
|
-
aggregate_nodes(request: DeepPartial$3<AggregateNodesRequest>, options?: CallOptions & CallOptionsExt): Promise<AggregateNodesResponse>;
|
|
1329
1419
|
store_preimage_share(request: DeepPartial$3<StorePreimageShareRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
1330
1420
|
get_signing_commitments(request: DeepPartial$3<GetSigningCommitmentsRequest>, options?: CallOptions & CallOptionsExt): Promise<GetSigningCommitmentsResponse>;
|
|
1331
1421
|
cooperative_exit(request: DeepPartial$3<CooperativeExitRequest>, options?: CallOptions & CallOptionsExt): Promise<CooperativeExitResponse>;
|
|
@@ -1362,8 +1452,8 @@ interface SparkServiceClient$1<CallOptionsExt = {}> {
|
|
|
1362
1452
|
sign_token_transaction(request: DeepPartial$3<SignTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<SignTokenTransactionResponse>;
|
|
1363
1453
|
finalize_token_transaction(request: DeepPartial$3<FinalizeTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
1364
1454
|
freeze_tokens(request: DeepPartial$3<FreezeTokensRequest$1>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse$1>;
|
|
1365
|
-
query_token_outputs(request: DeepPartial$3<QueryTokenOutputsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse>;
|
|
1366
|
-
query_token_transactions(request: DeepPartial$3<QueryTokenTransactionsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse>;
|
|
1455
|
+
query_token_outputs(request: DeepPartial$3<QueryTokenOutputsRequest$1>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse$1>;
|
|
1456
|
+
query_token_transactions(request: DeepPartial$3<QueryTokenTransactionsRequest$1>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse$1>;
|
|
1367
1457
|
return_lightning_payment(request: DeepPartial$3<ReturnLightningPaymentRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
1368
1458
|
query_unused_deposit_addresses(request: DeepPartial$3<QueryUnusedDepositAddressesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryUnusedDepositAddressesResponse>;
|
|
1369
1459
|
query_static_deposit_addresses(request: DeepPartial$3<QueryStaticDepositAddressesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryStaticDepositAddressesResponse>;
|
|
@@ -1395,10 +1485,6 @@ interface ISigningCommitment {
|
|
|
1395
1485
|
hiding: Uint8Array;
|
|
1396
1486
|
binding: Uint8Array;
|
|
1397
1487
|
}
|
|
1398
|
-
interface DummyTx {
|
|
1399
|
-
tx: Uint8Array;
|
|
1400
|
-
txid: string;
|
|
1401
|
-
}
|
|
1402
1488
|
|
|
1403
1489
|
type Polynomial = {
|
|
1404
1490
|
fieldModulus: bigint;
|
|
@@ -1674,6 +1760,43 @@ interface CoopExitFeeEstimatesOutput {
|
|
|
1674
1760
|
speedSlow?: CoopExitFeeEstimate | undefined;
|
|
1675
1761
|
}
|
|
1676
1762
|
|
|
1763
|
+
interface CoopExitFeeQuote {
|
|
1764
|
+
/**
|
|
1765
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
1766
|
+
* string.
|
|
1767
|
+
**/
|
|
1768
|
+
id: string;
|
|
1769
|
+
/** The date and time when the entity was first created. **/
|
|
1770
|
+
createdAt: string;
|
|
1771
|
+
/** The date and time when the entity was last updated. **/
|
|
1772
|
+
updatedAt: string;
|
|
1773
|
+
/** The network the coop exit fee quote is on. **/
|
|
1774
|
+
network: BitcoinNetwork;
|
|
1775
|
+
/** The total currency amount of all the nodes user swapped for the coop exit quote. **/
|
|
1776
|
+
totalAmount: CurrencyAmount;
|
|
1777
|
+
/** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is fast. **/
|
|
1778
|
+
userFeeFast: CurrencyAmount;
|
|
1779
|
+
/** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is medium. **/
|
|
1780
|
+
userFeeMedium: CurrencyAmount;
|
|
1781
|
+
/** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is slow. **/
|
|
1782
|
+
userFeeSlow: CurrencyAmount;
|
|
1783
|
+
/** The L1 broadcast fee user pays for the coop exit when exit speed is fast. **/
|
|
1784
|
+
l1BroadcastFeeFast: CurrencyAmount;
|
|
1785
|
+
/** The L1 broadcast fee user pays for the coop exit when exit speed is medium. **/
|
|
1786
|
+
l1BroadcastFeeMedium: CurrencyAmount;
|
|
1787
|
+
/** The L1 broadcast fee user pays for the coop exit when exit speed is slow. **/
|
|
1788
|
+
l1BroadcastFeeSlow: CurrencyAmount;
|
|
1789
|
+
/** The time when the coop exit fee quote expires. **/
|
|
1790
|
+
expiresAt: string;
|
|
1791
|
+
/** The typename of the object **/
|
|
1792
|
+
typename: string;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
interface CoopExitFeeQuoteInput {
|
|
1796
|
+
leafExternalIds: string[];
|
|
1797
|
+
withdrawalAddress: string;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1677
1800
|
declare enum ExitSpeed {
|
|
1678
1801
|
/**
|
|
1679
1802
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -1864,10 +1987,10 @@ declare class SspClient {
|
|
|
1864
1987
|
getCoopExitFeeEstimate({ leafExternalIds, withdrawalAddress, }: CoopExitFeeEstimatesInput): Promise<CoopExitFeeEstimatesOutput | null>;
|
|
1865
1988
|
getCurrentUser(): Promise<void>;
|
|
1866
1989
|
completeCoopExit({ userOutboundTransferExternalId, coopExitRequestId, }: CompleteCoopExitInput): Promise<CoopExitRequest | null>;
|
|
1867
|
-
requestCoopExit({ leafExternalIds, withdrawalAddress, idempotencyKey, exitSpeed, }: RequestCoopExitInput): Promise<CoopExitRequest | null>;
|
|
1990
|
+
requestCoopExit({ leafExternalIds, withdrawalAddress, idempotencyKey, exitSpeed, feeLeafExternalIds, feeQuoteId, withdrawAll, }: RequestCoopExitInput): Promise<CoopExitRequest | null>;
|
|
1868
1991
|
requestLightningReceive({ amountSats, network, paymentHash, expirySecs, memo, includeSparkAddress, receiverIdentityPubkey, descriptionHash, }: RequestLightningReceiveInput): Promise<LightningReceiveRequest | null>;
|
|
1869
1992
|
requestLightningSend({ encodedInvoice, idempotencyKey, amountSats, }: RequestLightningSendInput): Promise<LightningSendRequest | null>;
|
|
1870
|
-
requestLeaveSwap({ adaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
1993
|
+
requestLeaveSwap({ adaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, targetAmountSatsList, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
1871
1994
|
completeLeaveSwap({ adaptorSecretKey, userOutboundTransferExternalId, leavesSwapRequestId, }: CompleteLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
1872
1995
|
getLightningReceiveRequest(id: string): Promise<LightningReceiveRequest | null>;
|
|
1873
1996
|
getLightningSendRequest(id: string): Promise<LightningSendRequest | null>;
|
|
@@ -1887,6 +2010,7 @@ declare class SspClient {
|
|
|
1887
2010
|
getChallenge(): Promise<GetChallengeOutput | null>;
|
|
1888
2011
|
verifyChallenge(signature: string, protectedChallenge: string): Promise<VerifyChallengeOutput | null>;
|
|
1889
2012
|
authenticate(): Promise<void>;
|
|
2013
|
+
getCoopExitFeeQuote({ leafExternalIds, withdrawalAddress, }: CoopExitFeeQuoteInput): Promise<CoopExitFeeQuote | null>;
|
|
1890
2014
|
}
|
|
1891
2015
|
|
|
1892
2016
|
interface Leaf {
|
|
@@ -2231,6 +2355,16 @@ interface MessageFns$2<T> {
|
|
|
2231
2355
|
fromPartial(object: DeepPartial$2<T>): T;
|
|
2232
2356
|
}
|
|
2233
2357
|
|
|
2358
|
+
declare enum TokenTransactionStatus {
|
|
2359
|
+
TOKEN_TRANSACTION_STARTED = 0,
|
|
2360
|
+
TOKEN_TRANSACTION_SIGNED = 1,
|
|
2361
|
+
TOKEN_TRANSACTION_REVEALED = 5,
|
|
2362
|
+
TOKEN_TRANSACTION_FINALIZED = 2,
|
|
2363
|
+
TOKEN_TRANSACTION_STARTED_CANCELLED = 3,
|
|
2364
|
+
TOKEN_TRANSACTION_SIGNED_CANCELLED = 4,
|
|
2365
|
+
TOKEN_TRANSACTION_UNKNOWN = 10,
|
|
2366
|
+
UNRECOGNIZED = -1
|
|
2367
|
+
}
|
|
2234
2368
|
/**
|
|
2235
2369
|
* This proto is constructed by the wallet to specify leaves it wants to spend
|
|
2236
2370
|
* as part of the token transaction.
|
|
@@ -2246,19 +2380,20 @@ interface TokenTransferInput {
|
|
|
2246
2380
|
declare const TokenTransferInput: MessageFns$1<TokenTransferInput>;
|
|
2247
2381
|
interface TokenMintInput {
|
|
2248
2382
|
issuerPublicKey: Uint8Array;
|
|
2249
|
-
|
|
2250
|
-
* Issuer provided timestamp of when the transaction was signed/constructed.
|
|
2251
|
-
* Helps provide idempotency and ensures that each mint input signature is
|
|
2252
|
-
* unique as long as multiple mint signatures are not happening at the same
|
|
2253
|
-
* time. Also gives a potentially useful data point for when the issuer
|
|
2254
|
-
* authorized from their perspective. Note that we have no way of proving
|
|
2255
|
-
* this is accurate.
|
|
2256
|
-
* TODO: Consider whether implementing generic idempotency controls and/or a
|
|
2257
|
-
* random nonce would be favorable to populating this field.
|
|
2258
|
-
*/
|
|
2259
|
-
issuerProvidedTimestamp: number;
|
|
2383
|
+
tokenIdentifier?: Uint8Array | undefined;
|
|
2260
2384
|
}
|
|
2261
2385
|
declare const TokenMintInput: MessageFns$1<TokenMintInput>;
|
|
2386
|
+
interface TokenCreateInput {
|
|
2387
|
+
issuerPublicKey: Uint8Array;
|
|
2388
|
+
tokenName: string;
|
|
2389
|
+
tokenTicker: string;
|
|
2390
|
+
decimals: number;
|
|
2391
|
+
/** Decoded uint128 */
|
|
2392
|
+
maxSupply: Uint8Array;
|
|
2393
|
+
isFreezable: boolean;
|
|
2394
|
+
creationEntityPublicKey?: Uint8Array | undefined;
|
|
2395
|
+
}
|
|
2396
|
+
declare const TokenCreateInput: MessageFns$1<TokenCreateInput>;
|
|
2262
2397
|
/**
|
|
2263
2398
|
* This proto is constructed by the wallet to specify outputs it wants to create
|
|
2264
2399
|
* as part of a token transaction. Output id and revocation public key should
|
|
@@ -2271,7 +2406,8 @@ interface TokenOutput$1 {
|
|
|
2271
2406
|
revocationCommitment?: Uint8Array | undefined;
|
|
2272
2407
|
withdrawBondSats?: number | undefined;
|
|
2273
2408
|
withdrawRelativeBlockLocktime?: number | undefined;
|
|
2274
|
-
tokenPublicKey
|
|
2409
|
+
tokenPublicKey?: Uint8Array | undefined;
|
|
2410
|
+
tokenIdentifier?: Uint8Array | undefined;
|
|
2275
2411
|
/** Decoded uint128 */
|
|
2276
2412
|
tokenAmount: Uint8Array;
|
|
2277
2413
|
}
|
|
@@ -2295,6 +2431,9 @@ interface TokenTransaction {
|
|
|
2295
2431
|
} | {
|
|
2296
2432
|
$case: "transferInput";
|
|
2297
2433
|
transferInput: TokenTransferInput;
|
|
2434
|
+
} | {
|
|
2435
|
+
$case: "createInput";
|
|
2436
|
+
createInput: TokenCreateInput;
|
|
2298
2437
|
} | undefined;
|
|
2299
2438
|
tokenOutputs: TokenOutput$1[];
|
|
2300
2439
|
sparkOperatorIdentityPublicKeys: Uint8Array[];
|
|
@@ -2305,6 +2444,12 @@ interface TokenTransaction {
|
|
|
2305
2444
|
*/
|
|
2306
2445
|
expiryTime: Date | undefined;
|
|
2307
2446
|
network: Network$1;
|
|
2447
|
+
/**
|
|
2448
|
+
* The timestamp of when the client created the transaction. This is used to
|
|
2449
|
+
* determine which transaction should win in a race condition. Earlier
|
|
2450
|
+
* timestamps win over later ones.
|
|
2451
|
+
*/
|
|
2452
|
+
clientCreatedTimestamp: Date | undefined;
|
|
2308
2453
|
}
|
|
2309
2454
|
declare const TokenTransaction: MessageFns$1<TokenTransaction>;
|
|
2310
2455
|
interface SignatureWithIndex {
|
|
@@ -2340,7 +2485,7 @@ interface StartTransactionRequest {
|
|
|
2340
2485
|
/**
|
|
2341
2486
|
* How long the transaction should be valid for, in seconds.
|
|
2342
2487
|
* The server will set the actual expiry_time in the final transaction based
|
|
2343
|
-
* on this duration. Must be
|
|
2488
|
+
* on this duration. Must be within [1, 300] seconds.
|
|
2344
2489
|
*/
|
|
2345
2490
|
validityDurationSeconds: number;
|
|
2346
2491
|
}
|
|
@@ -2360,6 +2505,82 @@ declare const CommitTransactionRequest: MessageFns$1<CommitTransactionRequest>;
|
|
|
2360
2505
|
interface CommitTransactionResponse {
|
|
2361
2506
|
}
|
|
2362
2507
|
declare const CommitTransactionResponse: MessageFns$1<CommitTransactionResponse>;
|
|
2508
|
+
interface QueryTokenMetadataRequest {
|
|
2509
|
+
tokenIdentifiers: Uint8Array[];
|
|
2510
|
+
issuerPublicKeys: Uint8Array[];
|
|
2511
|
+
}
|
|
2512
|
+
declare const QueryTokenMetadataRequest: MessageFns$1<QueryTokenMetadataRequest>;
|
|
2513
|
+
interface TokenMetadata$1 {
|
|
2514
|
+
issuerPublicKey: Uint8Array;
|
|
2515
|
+
tokenName: string;
|
|
2516
|
+
tokenTicker: string;
|
|
2517
|
+
decimals: number;
|
|
2518
|
+
/** Decoded uint128 */
|
|
2519
|
+
maxSupply: Uint8Array;
|
|
2520
|
+
isFreezable: boolean;
|
|
2521
|
+
creationEntityPublicKey?: Uint8Array | undefined;
|
|
2522
|
+
tokenIdentifier: Uint8Array;
|
|
2523
|
+
}
|
|
2524
|
+
declare const TokenMetadata$1: MessageFns$1<TokenMetadata$1>;
|
|
2525
|
+
interface QueryTokenMetadataResponse {
|
|
2526
|
+
tokenMetadata: TokenMetadata$1[];
|
|
2527
|
+
}
|
|
2528
|
+
declare const QueryTokenMetadataResponse: MessageFns$1<QueryTokenMetadataResponse>;
|
|
2529
|
+
interface QueryTokenOutputsRequest {
|
|
2530
|
+
ownerPublicKeys: Uint8Array[];
|
|
2531
|
+
/** Optionally provide issuer public keys or token identifiers. If both are not set return outputs for all tokens. */
|
|
2532
|
+
issuerPublicKeys: Uint8Array[];
|
|
2533
|
+
tokenIdentifiers: Uint8Array[];
|
|
2534
|
+
/** defaults to mainnet when no network is provided. */
|
|
2535
|
+
network: Network$1;
|
|
2536
|
+
}
|
|
2537
|
+
declare const QueryTokenOutputsRequest: MessageFns$1<QueryTokenOutputsRequest>;
|
|
2538
|
+
/** Request constraints are combined using an AND relation. */
|
|
2539
|
+
interface QueryTokenTransactionsRequest {
|
|
2540
|
+
/** Returns transactions that have one of these output ids in the input or output. */
|
|
2541
|
+
outputIds: string[];
|
|
2542
|
+
/** Returns transactions that have this owner public key as the sender or receiver in one or more of the input/output leaves. */
|
|
2543
|
+
ownerPublicKeys: Uint8Array[];
|
|
2544
|
+
/** Returns transactions that related to this token public key. */
|
|
2545
|
+
issuerPublicKeys: Uint8Array[];
|
|
2546
|
+
/** Returns transactions that related to this token identifier. */
|
|
2547
|
+
tokenIdentifiers: Uint8Array[];
|
|
2548
|
+
/** Returns transactions that match the provided transaction hashes. */
|
|
2549
|
+
tokenTransactionHashes: Uint8Array[];
|
|
2550
|
+
limit: number;
|
|
2551
|
+
offset: number;
|
|
2552
|
+
}
|
|
2553
|
+
declare const QueryTokenTransactionsRequest: MessageFns$1<QueryTokenTransactionsRequest>;
|
|
2554
|
+
interface QueryTokenTransactionsResponse {
|
|
2555
|
+
tokenTransactionsWithStatus: TokenTransactionWithStatus[];
|
|
2556
|
+
offset: number;
|
|
2557
|
+
}
|
|
2558
|
+
declare const QueryTokenTransactionsResponse: MessageFns$1<QueryTokenTransactionsResponse>;
|
|
2559
|
+
interface OutputWithPreviousTransactionData {
|
|
2560
|
+
output: TokenOutput$1 | undefined;
|
|
2561
|
+
previousTransactionHash: Uint8Array;
|
|
2562
|
+
previousTransactionVout: number;
|
|
2563
|
+
}
|
|
2564
|
+
declare const OutputWithPreviousTransactionData: MessageFns$1<OutputWithPreviousTransactionData>;
|
|
2565
|
+
interface QueryTokenOutputsResponse {
|
|
2566
|
+
outputsWithPreviousTransactionData: OutputWithPreviousTransactionData[];
|
|
2567
|
+
}
|
|
2568
|
+
declare const QueryTokenOutputsResponse: MessageFns$1<QueryTokenOutputsResponse>;
|
|
2569
|
+
interface SpentTokenOutputMetadata {
|
|
2570
|
+
outputId: string;
|
|
2571
|
+
revocationSecret: Uint8Array;
|
|
2572
|
+
}
|
|
2573
|
+
declare const SpentTokenOutputMetadata: MessageFns$1<SpentTokenOutputMetadata>;
|
|
2574
|
+
interface TokenTransactionConfirmationMetadata {
|
|
2575
|
+
spentTokenOutputsMetadata: SpentTokenOutputMetadata[];
|
|
2576
|
+
}
|
|
2577
|
+
declare const TokenTransactionConfirmationMetadata: MessageFns$1<TokenTransactionConfirmationMetadata>;
|
|
2578
|
+
interface TokenTransactionWithStatus {
|
|
2579
|
+
tokenTransaction: TokenTransaction | undefined;
|
|
2580
|
+
status: TokenTransactionStatus;
|
|
2581
|
+
confirmationMetadata: TokenTransactionConfirmationMetadata | undefined;
|
|
2582
|
+
}
|
|
2583
|
+
declare const TokenTransactionWithStatus: MessageFns$1<TokenTransactionWithStatus>;
|
|
2363
2584
|
interface SparkTokenServiceClient<CallOptionsExt = {}> {
|
|
2364
2585
|
/**
|
|
2365
2586
|
* Start process to create final token transaction with all inputs required
|
|
@@ -2371,6 +2592,9 @@ interface SparkTokenServiceClient<CallOptionsExt = {}> {
|
|
|
2371
2592
|
* coordinated by one SO.
|
|
2372
2593
|
*/
|
|
2373
2594
|
commit_transaction(request: DeepPartial$1<CommitTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<CommitTransactionResponse>;
|
|
2595
|
+
query_token_metadata(request: DeepPartial$1<QueryTokenMetadataRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenMetadataResponse>;
|
|
2596
|
+
query_token_transactions(request: DeepPartial$1<QueryTokenTransactionsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse>;
|
|
2597
|
+
query_token_outputs(request: DeepPartial$1<QueryTokenOutputsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse>;
|
|
2374
2598
|
}
|
|
2375
2599
|
type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
2376
2600
|
type DeepPartial$1<T> = T extends Builtin$1 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$1<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$1<U>> : T extends {
|
|
@@ -2839,6 +3063,8 @@ interface WalletTransferLeaf {
|
|
|
2839
3063
|
intermediateRefundTx: string;
|
|
2840
3064
|
}
|
|
2841
3065
|
|
|
3066
|
+
type HumanReadableTokenIdentifier = `btk1${string}` | `btkrt1${string}` | `btkt1${string}` | `btks1${string}` | `btkl1${string}`;
|
|
3067
|
+
|
|
2842
3068
|
type CreateLightningInvoiceParams = {
|
|
2843
3069
|
amountSats: number;
|
|
2844
3070
|
memo?: string;
|
|
@@ -2857,13 +3083,44 @@ type TransferParams = {
|
|
|
2857
3083
|
amountSats: number;
|
|
2858
3084
|
receiverSparkAddress: string;
|
|
2859
3085
|
};
|
|
2860
|
-
|
|
3086
|
+
/**
|
|
3087
|
+
* Token metadata containing essential information about a token.
|
|
3088
|
+
* This is the wallet's internal representation with JavaScript-friendly types.
|
|
3089
|
+
*
|
|
3090
|
+
* rawTokenIdentifier: This is the raw binary token identifier - This is used to encode the human readable token identifier.
|
|
3091
|
+
*
|
|
3092
|
+
* tokenPublicKey: This is the hex-encoded public key of the token issuer - Same as issuerPublicKey.
|
|
3093
|
+
*
|
|
3094
|
+
* @example
|
|
3095
|
+
* ```typescript
|
|
3096
|
+
* const tokenMetadata: TokenMetadata = {
|
|
3097
|
+
* rawTokenIdentifier: new Uint8Array([1, 2, 3]),
|
|
3098
|
+
* tokenPublicKey: "0348fbb...",
|
|
3099
|
+
* tokenName: "SparkToken",
|
|
3100
|
+
* tokenTicker: "SPK",
|
|
3101
|
+
* decimals: 8,
|
|
3102
|
+
* maxSupply: 1000000n
|
|
3103
|
+
* };
|
|
3104
|
+
* ```
|
|
3105
|
+
*/
|
|
3106
|
+
type TokenMetadata = {
|
|
3107
|
+
/** Raw binary token identifier - This is used to encode the human readable token identifier */
|
|
3108
|
+
rawTokenIdentifier: Uint8Array;
|
|
3109
|
+
/** Hex-encoded public key of the token issuer - Same as issuerPublicKey */
|
|
2861
3110
|
tokenPublicKey: string;
|
|
3111
|
+
/** Human-readable name of the token (e.g., SparkToken)*/
|
|
2862
3112
|
tokenName: string;
|
|
2863
|
-
|
|
2864
|
-
|
|
3113
|
+
/** Short ticker symbol for the token (e.g., "SPK") */
|
|
3114
|
+
tokenTicker: string;
|
|
3115
|
+
/** Number of decimal places for token amounts */
|
|
3116
|
+
decimals: number;
|
|
3117
|
+
/** Maximum supply of tokens that can ever be minted */
|
|
2865
3118
|
maxSupply: bigint;
|
|
2866
3119
|
};
|
|
3120
|
+
type TokenBalanceMap = Map<HumanReadableTokenIdentifier, {
|
|
3121
|
+
balance: bigint;
|
|
3122
|
+
tokenMetadata: TokenMetadata;
|
|
3123
|
+
}>;
|
|
2867
3124
|
type InitWalletResponse = {
|
|
2868
3125
|
mnemonic?: string | undefined;
|
|
2869
3126
|
};
|
|
@@ -2901,7 +3158,7 @@ declare class SparkWallet extends EventEmitter {
|
|
|
2901
3158
|
private sparkAddress;
|
|
2902
3159
|
private streamController;
|
|
2903
3160
|
protected leaves: TreeNode[];
|
|
2904
|
-
protected tokenOutputs: Map<string, OutputWithPreviousTransactionData[]>;
|
|
3161
|
+
protected tokenOutputs: Map<string, OutputWithPreviousTransactionData$1[]>;
|
|
2905
3162
|
private claimTransfersInterval;
|
|
2906
3163
|
protected wrapWithOtelSpan<T>(name: string, fn: (...args: any[]) => Promise<T>): (...args: any[]) => Promise<T>;
|
|
2907
3164
|
protected constructor(options?: ConfigOptions, signer?: SparkSigner);
|
|
@@ -2992,12 +3249,6 @@ declare class SparkWallet extends EventEmitter {
|
|
|
2992
3249
|
transfers: WalletTransfer[];
|
|
2993
3250
|
offset: number;
|
|
2994
3251
|
}>;
|
|
2995
|
-
/**
|
|
2996
|
-
* Gets the held token info for the wallet.
|
|
2997
|
-
*
|
|
2998
|
-
* @deprecated The information is returned in getBalance
|
|
2999
|
-
*/
|
|
3000
|
-
getTokenInfo(): Promise<TokenInfo[]>;
|
|
3001
3252
|
/**
|
|
3002
3253
|
* Gets the current balance of the wallet.
|
|
3003
3254
|
* You can use the forceRefetch option to synchronize your wallet and claim any
|
|
@@ -3005,14 +3256,11 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3005
3256
|
*
|
|
3006
3257
|
* @returns {Promise<Object>} Object containing:
|
|
3007
3258
|
* - balance: The wallet's current balance in satoshis
|
|
3008
|
-
* - tokenBalances: Map of token
|
|
3259
|
+
* - tokenBalances: Map of the human readable token identifier to token balances and token info
|
|
3009
3260
|
*/
|
|
3010
3261
|
getBalance(): Promise<{
|
|
3011
3262
|
balance: bigint;
|
|
3012
|
-
tokenBalances:
|
|
3013
|
-
balance: bigint;
|
|
3014
|
-
tokenInfo: TokenInfo;
|
|
3015
|
-
}>;
|
|
3263
|
+
tokenBalances: TokenBalanceMap;
|
|
3016
3264
|
}>;
|
|
3017
3265
|
private getTokenBalance;
|
|
3018
3266
|
private getInternalBalance;
|
|
@@ -3097,6 +3345,15 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3097
3345
|
* @returns {Promise<string[]>} The unused deposit addresses
|
|
3098
3346
|
*/
|
|
3099
3347
|
getUnusedDepositAddresses(): Promise<string[]>;
|
|
3348
|
+
/**
|
|
3349
|
+
* Gets all unused deposit addresses for the wallet.
|
|
3350
|
+
*
|
|
3351
|
+
* @param {Object} params - Parameters for querying unused deposit addresses
|
|
3352
|
+
* @param {Uint8Array<ArrayBufferLike>} [params.identityPublicKey] - The identity public key
|
|
3353
|
+
* @param {NetworkProto} [params.network] - The network
|
|
3354
|
+
* @returns {Promise<DepositAddressQueryResult[]>} The unused deposit addresses
|
|
3355
|
+
*/
|
|
3356
|
+
private queryAllUnusedDepositAddresses;
|
|
3100
3357
|
/**
|
|
3101
3358
|
* Claims a deposit to the wallet.
|
|
3102
3359
|
* Note that if you used advancedDeposit, you don't need to call this function.
|
|
@@ -3219,13 +3476,18 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3219
3476
|
*
|
|
3220
3477
|
* @param {Object} params - Parameters for the withdrawal
|
|
3221
3478
|
* @param {string} params.onchainAddress - The Bitcoin address where the funds should be sent
|
|
3222
|
-
* @param {
|
|
3479
|
+
* @param {CoopExitFeeQuote} params.feeQuote - The fee quote for the withdrawal
|
|
3480
|
+
* @param {ExitSpeed} params.exitSpeed - The exit speed chosen for the withdrawal
|
|
3481
|
+
* @param {number} [params.amountSats] - The amount in satoshis to withdraw. If not specified, attempts to withdraw all available funds and deductFeeFromWithdrawalAmount is set to true.
|
|
3482
|
+
* @param {boolean} [params.deductFeeFromWithdrawalAmount] - Controls how the withdrawal fee is handled. If true, the fee is deducted from the withdrawal amount (amountSats), meaning the recipient will receive amountSats minus the fee. If false, the fee is paid separately from the wallet balance, meaning the recipient will receive the full amountSats.
|
|
3223
3483
|
* @returns {Promise<CoopExitRequest | null | undefined>} The withdrawal request details, or null/undefined if the request cannot be completed
|
|
3224
3484
|
*/
|
|
3225
|
-
withdraw({ onchainAddress, exitSpeed, amountSats, }: {
|
|
3485
|
+
withdraw({ onchainAddress, exitSpeed, feeQuote, amountSats, deductFeeFromWithdrawalAmount, }: {
|
|
3226
3486
|
onchainAddress: string;
|
|
3227
3487
|
exitSpeed: ExitSpeed;
|
|
3488
|
+
feeQuote: CoopExitFeeQuote;
|
|
3228
3489
|
amountSats?: number;
|
|
3490
|
+
deductFeeFromWithdrawalAmount?: boolean;
|
|
3229
3491
|
}): Promise<CoopExitRequest | null>;
|
|
3230
3492
|
/**
|
|
3231
3493
|
* Internal method to perform a cooperative exit (withdrawal).
|
|
@@ -3242,12 +3504,12 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3242
3504
|
* @param {Object} params - Input parameters for fee estimation
|
|
3243
3505
|
* @param {number} params.amountSats - The amount in satoshis to withdraw
|
|
3244
3506
|
* @param {string} params.withdrawalAddress - The Bitcoin address where the funds should be sent
|
|
3245
|
-
* @returns {Promise<
|
|
3507
|
+
* @returns {Promise<CoopExitFeeQuote | null>} Fee estimate for the withdrawal
|
|
3246
3508
|
*/
|
|
3247
|
-
|
|
3509
|
+
getWithdrawalFeeQuote({ amountSats, withdrawalAddress, }: {
|
|
3248
3510
|
amountSats: number;
|
|
3249
3511
|
withdrawalAddress: string;
|
|
3250
|
-
}): Promise<
|
|
3512
|
+
}): Promise<CoopExitFeeQuote | null>;
|
|
3251
3513
|
/**
|
|
3252
3514
|
* Gets a transfer that has been sent by the SSP to the wallet.
|
|
3253
3515
|
*
|
|
@@ -3263,7 +3525,7 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3263
3525
|
* @param {string} id - The ID of the transfer
|
|
3264
3526
|
* @returns {Promise<Transfer | undefined>} The transfer
|
|
3265
3527
|
*/
|
|
3266
|
-
getTransfer(id: string): Promise<
|
|
3528
|
+
getTransfer(id: string): Promise<WalletTransfer | undefined>;
|
|
3267
3529
|
/**
|
|
3268
3530
|
* Synchronizes token outputs for the wallet.
|
|
3269
3531
|
*
|
|
@@ -3286,7 +3548,7 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3286
3548
|
tokenAmount: bigint;
|
|
3287
3549
|
receiverSparkAddress: string;
|
|
3288
3550
|
outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST";
|
|
3289
|
-
selectedOutputs?: OutputWithPreviousTransactionData[];
|
|
3551
|
+
selectedOutputs?: OutputWithPreviousTransactionData$1[];
|
|
3290
3552
|
}): Promise<string>;
|
|
3291
3553
|
/**
|
|
3292
3554
|
* Transfers tokens with multiple outputs
|
|
@@ -3302,16 +3564,19 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3302
3564
|
tokenPublicKey: string;
|
|
3303
3565
|
tokenAmount: bigint;
|
|
3304
3566
|
receiverSparkAddress: string;
|
|
3305
|
-
}[], outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST", selectedOutputs?: OutputWithPreviousTransactionData[]): Promise<string>;
|
|
3567
|
+
}[], outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST", selectedOutputs?: OutputWithPreviousTransactionData$1[]): Promise<string>;
|
|
3306
3568
|
/**
|
|
3307
3569
|
* Retrieves token transaction history for specified tokens owned by the wallet.
|
|
3308
3570
|
* Can optionally filter by specific transaction hashes.
|
|
3309
3571
|
*
|
|
3310
|
-
* @param
|
|
3572
|
+
* @param ownerPublicKeys - Optional array of owner public keys to query transactions for
|
|
3573
|
+
* @param issuerPublicKeys - Optional array of issuer public keys to query transactions for
|
|
3311
3574
|
* @param tokenTransactionHashes - Optional array of specific transaction hashes to filter by
|
|
3575
|
+
* @param tokenIdentifiers - Optional array of token identifiers to filter by
|
|
3576
|
+
* @param outputIds - Optional array of output IDs to filter by
|
|
3312
3577
|
* @returns Promise resolving to array of token transactions with their current status
|
|
3313
3578
|
*/
|
|
3314
|
-
queryTokenTransactions(
|
|
3579
|
+
queryTokenTransactions(ownerPublicKeys?: string[], issuerPublicKeys?: string[], tokenTransactionHashes?: string[], tokenIdentifiers?: string[], outputIds?: string[]): Promise<TokenTransactionWithStatus[]>;
|
|
3315
3580
|
getTokenL1Address(): Promise<string>;
|
|
3316
3581
|
/**
|
|
3317
3582
|
* Signs a message with the identity key.
|
|
@@ -3393,11 +3658,6 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3393
3658
|
private queryNodes;
|
|
3394
3659
|
}
|
|
3395
3660
|
|
|
3396
|
-
declare function getLatestDepositTxId(address: string): Promise<string | null>;
|
|
3397
|
-
declare function isTxBroadcast(txid: string, baseUrl: string, network?: any): Promise<boolean>;
|
|
3398
|
-
|
|
3399
|
-
declare function createDummyTx(address: string, amountSats: bigint): Promise<DummyTx>;
|
|
3400
|
-
|
|
3401
3661
|
declare function generateSignatureFromExistingAdaptor(signature: Uint8Array, adaptorPrivateKeyBytes: Uint8Array): Uint8Array;
|
|
3402
3662
|
declare function generateAdaptorFromSignature(signature: Uint8Array): {
|
|
3403
3663
|
adaptorSignature: Uint8Array;
|
|
@@ -3425,6 +3685,9 @@ declare function subtractPrivateKeys(a: Uint8Array, b: Uint8Array): Uint8Array<A
|
|
|
3425
3685
|
declare function sumOfPrivateKeys(keys: Uint8Array[]): Uint8Array<ArrayBufferLike>;
|
|
3426
3686
|
declare function lastKeyWithTarget(target: Uint8Array, keys: Uint8Array[]): Uint8Array<ArrayBufferLike>;
|
|
3427
3687
|
|
|
3688
|
+
declare function getLatestDepositTxId(address: string): Promise<string | null>;
|
|
3689
|
+
declare function isTxBroadcast(txid: string, baseUrl: string, network?: any): Promise<boolean>;
|
|
3690
|
+
|
|
3428
3691
|
declare function proofOfPossessionMessageHashForDepositAddress(userPubkey: Uint8Array, operatorPubkey: Uint8Array, depositAddress: string): Uint8Array;
|
|
3429
3692
|
|
|
3430
3693
|
declare function collectResponses<T>(responses: PromiseSettledResult<T>[]): T[];
|
|
@@ -3438,11 +3701,9 @@ declare function createSigningCommitment(binding: Uint8Array, hiding: Uint8Array
|
|
|
3438
3701
|
declare function encodeSigningCommitmentToBytes(commitment: SigningCommitment): Uint8Array;
|
|
3439
3702
|
declare function decodeBytesToSigningCommitment(bytes: Uint8Array): SigningCommitment;
|
|
3440
3703
|
|
|
3441
|
-
declare function calculateAvailableTokenAmount(outputLeaves: OutputWithPreviousTransactionData[]): bigint;
|
|
3442
|
-
declare function checkIfSelectedOutputsAreAvailable(selectedOutputs: OutputWithPreviousTransactionData[], tokenOutputs: Map<string, OutputWithPreviousTransactionData[]>, tokenPublicKey: Uint8Array): boolean;
|
|
3443
|
-
declare function filterTokenBalanceForTokenPublicKey(tokenBalances:
|
|
3444
|
-
balance: bigint;
|
|
3445
|
-
}>, publicKey: string): {
|
|
3704
|
+
declare function calculateAvailableTokenAmount(outputLeaves: OutputWithPreviousTransactionData$1[]): bigint;
|
|
3705
|
+
declare function checkIfSelectedOutputsAreAvailable(selectedOutputs: OutputWithPreviousTransactionData$1[], tokenOutputs: Map<string, OutputWithPreviousTransactionData$1[]>, tokenPublicKey: Uint8Array): boolean;
|
|
3706
|
+
declare function filterTokenBalanceForTokenPublicKey(tokenBalances: TokenBalanceMap, publicKey: string): {
|
|
3446
3707
|
balance: bigint;
|
|
3447
3708
|
};
|
|
3448
3709
|
|
|
@@ -3515,4 +3776,4 @@ declare function constructFeeBumpTx(txHex: string, utxos: Utxo[], feeRate: FeeRa
|
|
|
3515
3776
|
|
|
3516
3777
|
declare function getSparkAddressFromTaproot(taprootAddress: string): SparkAddressFormat;
|
|
3517
3778
|
|
|
3518
|
-
export { AuthenticationError, type BroadcastConfig, type BroadcastResult, ConfigurationError, DEFAULT_FEE_SATS, ReactNativeSparkSigner as DefaultSparkSigner, type FeeBumpTxChain, type FeeBumpTxPackage, type FeeRate, InternalValidationError, LRC_WALLET_NETWORK, LRC_WALLET_NETWORK_TYPE, type LeafInfo, Network, NetworkError, NetworkToProto, type NetworkType, NotImplementedError, RPCError, ReactNativeSparkSigner, SparkSDKError, SparkWallet, type TxChain, type Utxo, ValidationError, type VerifiableSecretShare, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, bigIntToPrivateKey, calculateAvailableTokenAmount, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, computerLagrangeCoefficients, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs,
|
|
3779
|
+
export { AuthenticationError, type BroadcastConfig, type BroadcastResult, ConfigurationError, DEFAULT_FEE_SATS, ReactNativeSparkSigner as DefaultSparkSigner, type FeeBumpTxChain, type FeeBumpTxPackage, type FeeRate, InternalValidationError, LRC_WALLET_NETWORK, LRC_WALLET_NETWORK_TYPE, type LeafInfo, Network, NetworkError, NetworkToProto, type NetworkType, NotImplementedError, RPCError, ReactNativeSparkSigner, SparkSDKError, SparkWallet, type TxChain, type Utxo, ValidationError, type VerifiableSecretShare, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, bigIntToPrivateKey, calculateAvailableTokenAmount, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, computerLagrangeCoefficients, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs, createRefundTx, createSigningCommitment, createSigningNonce, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, evaluatePolynomial, fieldDiv, filterTokenBalanceForTokenPublicKey, generateAdaptorFromSignature, generatePolynomialForSecretSharing, generateSignatureFromExistingAdaptor, getCurrentTimelock, getEphemeralAnchorOutput, getLatestDepositTxId, getNetwork, getNetworkFromAddress, getNetworkFromString, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomBigInt, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getSparkAddressFromTaproot, getTransactionSequence, getTransferPackageSigningPayload, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, isEphemeralAnchorOutput, isTxBroadcast, lastKeyWithTarget, maybeApplyFee, modInverse, proofOfPossessionMessageHashForDepositAddress, recoverSecret, splitSecret, splitSecretWithProofs, subtractPrivateKeys, subtractPublicKeys, sumOfPrivateKeys, validateOutboundAdaptorSignature, validateShare };
|