@buildonspark/spark-sdk 0.1.44 → 0.1.46
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 +17 -0
- package/dist/{RequestLightningSendInput-BxbCtwpV.d.cts → RequestLightningSendInput-2cSh_In4.d.cts} +1 -1
- package/dist/{RequestLightningSendInput-RGel43ks.d.ts → RequestLightningSendInput-CN6BNg_g.d.ts} +1 -1
- 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-EKFD62HN.js → chunk-4EMV7HHW.js} +2 -1
- package/dist/{chunk-4Q2ZDYYU.js → chunk-BGGEVUJK.js} +1157 -208
- package/dist/{chunk-CIZNCBKE.js → chunk-C2S227QR.js} +648 -45
- package/dist/{chunk-WPTRVD2V.js → chunk-DXR2PXJU.js} +15 -15
- package/dist/{chunk-NBCNYDWJ.js → chunk-HHNQ3ZHC.js} +2 -2
- package/dist/{chunk-DAXGVPVM.js → chunk-HSCLBJEL.js} +2 -2
- package/dist/{chunk-6AFUC5M2.js → chunk-HWJWKEIU.js} +8 -2
- package/dist/{chunk-A2ZLMH6I.js → chunk-JB64OQES.js} +259 -327
- package/dist/{chunk-KEKGSH7B.js → chunk-KMUMFYFX.js} +3 -3
- package/dist/chunk-LHRD2WT6.js +2374 -0
- package/dist/{chunk-HTMXTJRK.js → chunk-N5VZVCGJ.js} +4 -4
- package/dist/{chunk-SQKXGAIR.js → chunk-NTFKFRQ2.js} +1 -1
- package/dist/{chunk-K4BJARWM.js → chunk-OBFKIEMP.js} +1 -1
- package/dist/{chunk-UBT6EDVJ.js → chunk-OFCJFZ4I.js} +1 -1
- package/dist/{chunk-XX4RRWOX.js → chunk-UXDODSDT.js} +8 -10
- package/dist/graphql/objects/index.d.cts +5 -4
- package/dist/graphql/objects/index.d.ts +5 -4
- package/dist/index-CKL5DodV.d.cts +214 -0
- package/dist/index-COm59SPw.d.ts +214 -0
- package/dist/index.cjs +4026 -1315
- package/dist/index.d.cts +764 -19
- package/dist/index.d.ts +764 -19
- package/dist/index.js +23 -27
- package/dist/index.node.cjs +4026 -1319
- package/dist/index.node.d.cts +10 -8
- package/dist/index.node.d.ts +10 -8
- package/dist/index.node.js +23 -31
- package/dist/native/index.cjs +4027 -1316
- package/dist/native/index.d.cts +281 -85
- package/dist/native/index.d.ts +281 -85
- package/dist/native/index.js +4018 -1307
- package/dist/{network-CfxLnaot.d.cts → network-Css46DAz.d.cts} +1 -1
- package/dist/{network-CroCOQ0B.d.ts → network-hynb7iTZ.d.ts} +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 +1154 -205
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark.js +3 -1
- package/dist/proto/spark_token.cjs +1377 -58
- 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-CTbTdDbE.d.ts → sdk-types-CKBsylfW.d.ts} +1 -1
- package/dist/{sdk-types-BeCBoozO.d.cts → sdk-types-Ct8xmN7l.d.cts} +1 -1
- package/dist/services/config.cjs +2 -2
- 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 +2438 -262
- 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 +5937 -3154
- package/dist/services/index.d.cts +7 -6
- package/dist/services/index.d.ts +7 -6
- package/dist/services/index.js +17 -15
- package/dist/services/lrc-connection.cjs +223 -20
- 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 +840 -236
- 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 +3 -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 +1 -1
- 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-D7vfYik9.d.ts → signer-BP6F__oR.d.cts} +2 -6
- package/dist/{signer-DaY8c60s.d.cts → signer-BVZJXcq7.d.ts} +2 -6
- package/dist/{spark-C4ZrsgjC.d.cts → spark-DbzGfse6.d.cts} +93 -15
- package/dist/{spark-C4ZrsgjC.d.ts → spark-DbzGfse6.d.ts} +93 -15
- 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 +1156 -208
- package/dist/types/index.d.cts +5 -4
- package/dist/types/index.d.ts +5 -4
- package/dist/types/index.js +2 -2
- package/dist/types-C-Rp0Oo7.d.cts +46 -0
- package/dist/types-C-Rp0Oo7.d.ts +46 -0
- package/dist/utils/index.cjs +65 -13
- package/dist/utils/index.d.cts +14 -134
- package/dist/utils/index.d.ts +14 -134
- package/dist/utils/index.js +13 -13
- package/package.json +22 -2
- 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 +1452 -185
- 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 +197 -9
- package/src/services/transfer.ts +22 -0
- package/src/services/tree-creation.ts +13 -0
- package/src/services/wallet-config.ts +2 -2
- package/src/spark-wallet/spark-wallet.node.ts +0 -4
- package/src/spark-wallet/spark-wallet.ts +76 -108
- package/src/spark-wallet/types.ts +39 -3
- package/src/tests/bolt11-spark.test.ts +7 -15
- package/src/tests/integration/ssp/coop-exit.test.ts +7 -7
- 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 -23
- package/src/utils/token-hashing.ts +320 -44
- 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 +0 -6
- package/dist/chunk-B3AMIGJG.js +0 -1073
- package/dist/index-CZmDdSts.d.cts +0 -829
- package/dist/index-ClIRO_3y.d.ts +0 -829
- package/dist/wasm-7OWFHDMS.js +0 -21
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,
|
|
@@ -437,6 +437,12 @@ interface NodeSignatureShares {
|
|
|
437
437
|
refundTxSigningResult: SigningResult | undefined;
|
|
438
438
|
/** The verifying key of the node. */
|
|
439
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;
|
|
440
446
|
}
|
|
441
447
|
declare const NodeSignatureShares: MessageFns$3<NodeSignatureShares>;
|
|
442
448
|
/**
|
|
@@ -446,10 +452,16 @@ declare const NodeSignatureShares: MessageFns$3<NodeSignatureShares>;
|
|
|
446
452
|
interface NodeSignatures {
|
|
447
453
|
/** The id of the node. */
|
|
448
454
|
nodeId: string;
|
|
449
|
-
/** 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. */
|
|
450
456
|
nodeTxSignature: Uint8Array;
|
|
451
|
-
/** 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. */
|
|
452
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;
|
|
453
465
|
}
|
|
454
466
|
declare const NodeSignatures: MessageFns$3<NodeSignatures>;
|
|
455
467
|
/** StartTreeCreationRequest is the request to start the tree creation for a tree root node. */
|
|
@@ -458,10 +470,16 @@ interface StartTreeCreationRequest {
|
|
|
458
470
|
identityPublicKey: Uint8Array;
|
|
459
471
|
/** The on-chain utxo to be used to be spent by the root node. */
|
|
460
472
|
onChainUtxo: UTXO | undefined;
|
|
461
|
-
/** The signing job for the root node's transaction. */
|
|
473
|
+
/** The signing job for the root node's cpfp transaction. */
|
|
462
474
|
rootTxSigningJob: SigningJob | undefined;
|
|
463
|
-
/** The signing job for the root node's refund transaction. */
|
|
475
|
+
/** The signing job for the root node's cpfp refund transaction. */
|
|
464
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;
|
|
465
483
|
}
|
|
466
484
|
declare const StartTreeCreationRequest: MessageFns$3<StartTreeCreationRequest>;
|
|
467
485
|
/** StartTreeCreationResponse is the response to the request to start the tree creation for a tree root node. */
|
|
@@ -482,6 +500,12 @@ interface StartDepositTreeCreationRequest {
|
|
|
482
500
|
rootTxSigningJob: SigningJob | undefined;
|
|
483
501
|
/** The signing job for the root node's refund transaction. */
|
|
484
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;
|
|
485
509
|
}
|
|
486
510
|
declare const StartDepositTreeCreationRequest: MessageFns$3<StartDepositTreeCreationRequest>;
|
|
487
511
|
/** StartDepositTreeCreationResponse is the response to the request to start the tree creation for a tree root node. */
|
|
@@ -517,8 +541,20 @@ interface TokenMintInput$1 {
|
|
|
517
541
|
* random nonce would be favorable to populating this field.
|
|
518
542
|
*/
|
|
519
543
|
issuerProvidedTimestamp: number;
|
|
544
|
+
tokenIdentifier?: Uint8Array | undefined;
|
|
520
545
|
}
|
|
521
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>;
|
|
522
558
|
/**
|
|
523
559
|
* This proto is constructed by the wallet to specify outputs it wants to create
|
|
524
560
|
* as part of a token transaction. Output id and revocation public key should remain unfilled
|
|
@@ -530,7 +566,8 @@ interface TokenOutput$2 {
|
|
|
530
566
|
revocationCommitment?: Uint8Array | undefined;
|
|
531
567
|
withdrawBondSats?: number | undefined;
|
|
532
568
|
withdrawRelativeBlockLocktime?: number | undefined;
|
|
533
|
-
tokenPublicKey
|
|
569
|
+
tokenPublicKey?: Uint8Array | undefined;
|
|
570
|
+
tokenIdentifier?: Uint8Array | undefined;
|
|
534
571
|
/** Decoded uint128 */
|
|
535
572
|
tokenAmount: Uint8Array;
|
|
536
573
|
}
|
|
@@ -541,37 +578,36 @@ declare const TokenOutput$2: MessageFns$3<TokenOutput$2>;
|
|
|
541
578
|
* is cooperatively signed by the SO group to confirm a token transaction.
|
|
542
579
|
*/
|
|
543
580
|
interface TokenTransaction$1 {
|
|
544
|
-
/**
|
|
545
|
-
* For mint transactions issuer_public_key will be specified without any outputs_to_spend.
|
|
546
|
-
* For transfer transactions the token amount in the input leaves must match the token amount in the output leaves.
|
|
547
|
-
*/
|
|
548
581
|
tokenInputs?: {
|
|
549
582
|
$case: "mintInput";
|
|
550
583
|
mintInput: TokenMintInput$1;
|
|
551
584
|
} | {
|
|
552
585
|
$case: "transferInput";
|
|
553
586
|
transferInput: TokenTransferInput$1;
|
|
587
|
+
} | {
|
|
588
|
+
$case: "createInput";
|
|
589
|
+
createInput: TokenCreateInput$1;
|
|
554
590
|
} | undefined;
|
|
555
591
|
tokenOutputs: TokenOutput$2[];
|
|
556
592
|
sparkOperatorIdentityPublicKeys: Uint8Array[];
|
|
557
593
|
network: Network$1;
|
|
558
594
|
}
|
|
559
595
|
declare const TokenTransaction$1: MessageFns$3<TokenTransaction$1>;
|
|
560
|
-
interface SpentTokenOutputMetadata {
|
|
596
|
+
interface SpentTokenOutputMetadata$1 {
|
|
561
597
|
outputId: string;
|
|
562
598
|
revocationSecret: Uint8Array;
|
|
563
599
|
}
|
|
564
|
-
declare const SpentTokenOutputMetadata: MessageFns$3<SpentTokenOutputMetadata>;
|
|
565
|
-
interface TokenTransactionConfirmationMetadata {
|
|
566
|
-
spentTokenOutputsMetadata: SpentTokenOutputMetadata[];
|
|
600
|
+
declare const SpentTokenOutputMetadata$1: MessageFns$3<SpentTokenOutputMetadata$1>;
|
|
601
|
+
interface TokenTransactionConfirmationMetadata$1 {
|
|
602
|
+
spentTokenOutputsMetadata: SpentTokenOutputMetadata$1[];
|
|
567
603
|
}
|
|
568
|
-
declare const TokenTransactionConfirmationMetadata: MessageFns$3<TokenTransactionConfirmationMetadata>;
|
|
569
|
-
interface TokenTransactionWithStatus {
|
|
604
|
+
declare const TokenTransactionConfirmationMetadata$1: MessageFns$3<TokenTransactionConfirmationMetadata$1>;
|
|
605
|
+
interface TokenTransactionWithStatus$1 {
|
|
570
606
|
tokenTransaction: TokenTransaction$1 | undefined;
|
|
571
|
-
status: TokenTransactionStatus;
|
|
572
|
-
confirmationMetadata: TokenTransactionConfirmationMetadata | undefined;
|
|
607
|
+
status: TokenTransactionStatus$1;
|
|
608
|
+
confirmationMetadata: TokenTransactionConfirmationMetadata$1 | undefined;
|
|
573
609
|
}
|
|
574
|
-
declare const TokenTransactionWithStatus: MessageFns$3<TokenTransactionWithStatus>;
|
|
610
|
+
declare const TokenTransactionWithStatus$1: MessageFns$3<TokenTransactionWithStatus$1>;
|
|
575
611
|
interface SignatureWithIndex$1 {
|
|
576
612
|
/** This is a Schnorr or ECDSA DER signature which can be between 64 and 73 bytes. */
|
|
577
613
|
signature: Uint8Array;
|
|
@@ -582,7 +618,7 @@ declare const SignatureWithIndex$1: MessageFns$3<SignatureWithIndex$1>;
|
|
|
582
618
|
interface TokenTransactionSignatures {
|
|
583
619
|
/**
|
|
584
620
|
* Filled by signing the partial token transaction hash with the owner/issuer private key.
|
|
585
|
-
* 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
|
|
586
622
|
* For transfer transactions this will be one for each output for the output owner_public_key
|
|
587
623
|
*/
|
|
588
624
|
ownerSignatures: SignatureWithIndex$1[];
|
|
@@ -664,6 +700,7 @@ interface FreezeTokensPayload$1 {
|
|
|
664
700
|
operatorIdentityPublicKey: Uint8Array;
|
|
665
701
|
/** Set to false when requesting a freeze. */
|
|
666
702
|
shouldUnfreeze: boolean;
|
|
703
|
+
tokenIdentifier?: Uint8Array | undefined;
|
|
667
704
|
}
|
|
668
705
|
declare const FreezeTokensPayload$1: MessageFns$3<FreezeTokensPayload$1>;
|
|
669
706
|
interface FreezeTokensRequest$1 {
|
|
@@ -678,43 +715,46 @@ interface FreezeTokensResponse$1 {
|
|
|
678
715
|
impactedTokenAmount: Uint8Array;
|
|
679
716
|
}
|
|
680
717
|
declare const FreezeTokensResponse$1: MessageFns$3<FreezeTokensResponse$1>;
|
|
681
|
-
interface QueryTokenOutputsRequest {
|
|
718
|
+
interface QueryTokenOutputsRequest$1 {
|
|
682
719
|
ownerPublicKeys: Uint8Array[];
|
|
683
720
|
/** Optionally provide token public keys. If not set return leaves for all tokens. */
|
|
684
721
|
tokenPublicKeys: Uint8Array[];
|
|
722
|
+
tokenIdentifiers: Uint8Array[];
|
|
685
723
|
/** defaults to mainnet when no network is provided. */
|
|
686
724
|
network: Network$1;
|
|
687
725
|
}
|
|
688
|
-
declare const QueryTokenOutputsRequest: MessageFns$3<QueryTokenOutputsRequest>;
|
|
726
|
+
declare const QueryTokenOutputsRequest$1: MessageFns$3<QueryTokenOutputsRequest$1>;
|
|
689
727
|
/** Request constraints are combined using an AND relation. */
|
|
690
|
-
interface QueryTokenTransactionsRequest {
|
|
728
|
+
interface QueryTokenTransactionsRequest$1 {
|
|
691
729
|
/** Returns transactions that have one of these output ids in the input or output. */
|
|
692
730
|
outputIds: string[];
|
|
693
731
|
/** Returns transactions that have this owner public key as the sender or receiver in one or more of the input/output leaves. */
|
|
694
732
|
ownerPublicKeys: Uint8Array[];
|
|
695
733
|
/** Returns transactions that related to this token public key. */
|
|
696
734
|
tokenPublicKeys: Uint8Array[];
|
|
735
|
+
/** Returns transactions that related to this token identifier. */
|
|
736
|
+
tokenIdentifiers: Uint8Array[];
|
|
697
737
|
/** Returns transactions that match the provided transaction hashes. */
|
|
698
738
|
tokenTransactionHashes: Uint8Array[];
|
|
699
739
|
limit: number;
|
|
700
740
|
offset: number;
|
|
701
741
|
}
|
|
702
|
-
declare const QueryTokenTransactionsRequest: MessageFns$3<QueryTokenTransactionsRequest>;
|
|
703
|
-
interface QueryTokenTransactionsResponse {
|
|
704
|
-
tokenTransactionsWithStatus: TokenTransactionWithStatus[];
|
|
742
|
+
declare const QueryTokenTransactionsRequest$1: MessageFns$3<QueryTokenTransactionsRequest$1>;
|
|
743
|
+
interface QueryTokenTransactionsResponse$1 {
|
|
744
|
+
tokenTransactionsWithStatus: TokenTransactionWithStatus$1[];
|
|
705
745
|
offset: number;
|
|
706
746
|
}
|
|
707
|
-
declare const QueryTokenTransactionsResponse: MessageFns$3<QueryTokenTransactionsResponse>;
|
|
708
|
-
interface OutputWithPreviousTransactionData {
|
|
747
|
+
declare const QueryTokenTransactionsResponse$1: MessageFns$3<QueryTokenTransactionsResponse$1>;
|
|
748
|
+
interface OutputWithPreviousTransactionData$1 {
|
|
709
749
|
output: TokenOutput$2 | undefined;
|
|
710
750
|
previousTransactionHash: Uint8Array;
|
|
711
751
|
previousTransactionVout: number;
|
|
712
752
|
}
|
|
713
|
-
declare const OutputWithPreviousTransactionData: MessageFns$3<OutputWithPreviousTransactionData>;
|
|
714
|
-
interface QueryTokenOutputsResponse {
|
|
715
|
-
outputsWithPreviousTransactionData: OutputWithPreviousTransactionData[];
|
|
753
|
+
declare const OutputWithPreviousTransactionData$1: MessageFns$3<OutputWithPreviousTransactionData$1>;
|
|
754
|
+
interface QueryTokenOutputsResponse$1 {
|
|
755
|
+
outputsWithPreviousTransactionData: OutputWithPreviousTransactionData$1[];
|
|
716
756
|
}
|
|
717
|
-
declare const QueryTokenOutputsResponse: MessageFns$3<QueryTokenOutputsResponse>;
|
|
757
|
+
declare const QueryTokenOutputsResponse$1: MessageFns$3<QueryTokenOutputsResponse$1>;
|
|
718
758
|
/** TreeNode represents a node on the tree. */
|
|
719
759
|
interface TreeNode {
|
|
720
760
|
/** The id of the node. */
|
|
@@ -725,7 +765,7 @@ interface TreeNode {
|
|
|
725
765
|
value: number;
|
|
726
766
|
/** The id of the parent node. */
|
|
727
767
|
parentNodeId?: string | undefined;
|
|
728
|
-
/** 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. */
|
|
729
769
|
nodeTx: Uint8Array;
|
|
730
770
|
/** The refund transaction of the node, this transaction is to pay to the user. */
|
|
731
771
|
refundTx: Uint8Array;
|
|
@@ -747,6 +787,12 @@ interface TreeNode {
|
|
|
747
787
|
updatedTime: Date | undefined;
|
|
748
788
|
/** The signing public key of the owner of the node. */
|
|
749
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;
|
|
750
796
|
}
|
|
751
797
|
declare const TreeNode: MessageFns$3<TreeNode>;
|
|
752
798
|
/** FinalizeNodeSignaturesRequest is the request to finalize the signatures for a node. */
|
|
@@ -780,6 +826,8 @@ declare const SecretShare$1: MessageFns$3<SecretShare$1>;
|
|
|
780
826
|
interface LeafRefundTxSigningJob {
|
|
781
827
|
leafId: string;
|
|
782
828
|
refundTxSigningJob: SigningJob | undefined;
|
|
829
|
+
directRefundTxSigningJob: SigningJob | undefined;
|
|
830
|
+
directFromCpfpRefundTxSigningJob: SigningJob | undefined;
|
|
783
831
|
}
|
|
784
832
|
declare const LeafRefundTxSigningJob: MessageFns$3<LeafRefundTxSigningJob>;
|
|
785
833
|
interface UserSignedTxSigningJob {
|
|
@@ -795,6 +843,8 @@ interface LeafRefundTxSigningResult {
|
|
|
795
843
|
leafId: string;
|
|
796
844
|
refundTxSigningResult: SigningResult | undefined;
|
|
797
845
|
verifyingKey: Uint8Array;
|
|
846
|
+
directRefundTxSigningResult: SigningResult | undefined;
|
|
847
|
+
directFromCpfpRefundTxSigningResult: SigningResult | undefined;
|
|
798
848
|
}
|
|
799
849
|
declare const LeafRefundTxSigningResult: MessageFns$3<LeafRefundTxSigningResult>;
|
|
800
850
|
interface StartUserSignedTransferRequest {
|
|
@@ -803,6 +853,8 @@ interface StartUserSignedTransferRequest {
|
|
|
803
853
|
leavesToSend: UserSignedTxSigningJob[];
|
|
804
854
|
receiverIdentityPublicKey: Uint8Array;
|
|
805
855
|
expiryTime: Date | undefined;
|
|
856
|
+
directLeavesToSend: UserSignedTxSigningJob[];
|
|
857
|
+
directFromCpfpLeavesToSend: UserSignedTxSigningJob[];
|
|
806
858
|
}
|
|
807
859
|
declare const StartUserSignedTransferRequest: MessageFns$3<StartUserSignedTransferRequest>;
|
|
808
860
|
interface StartTransferRequest {
|
|
@@ -828,7 +880,7 @@ declare const StartTransferResponse: MessageFns$3<StartTransferResponse>;
|
|
|
828
880
|
* the coordinator SO.
|
|
829
881
|
*/
|
|
830
882
|
interface TransferPackage {
|
|
831
|
-
/** The leaves to send, with user signed refunds and signing package. */
|
|
883
|
+
/** The leaves to send, with user signed cpfp refunds and signing package. */
|
|
832
884
|
leavesToSend: UserSignedTxSigningJob[];
|
|
833
885
|
/** The map of SO identifier to ciphertext of SendLeafTweaks. */
|
|
834
886
|
keyTweakPackage: {
|
|
@@ -836,6 +888,10 @@ interface TransferPackage {
|
|
|
836
888
|
};
|
|
837
889
|
/** The signature of user to prove that the key_tweak_package is not tampered. */
|
|
838
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[];
|
|
839
895
|
}
|
|
840
896
|
declare const TransferPackage: MessageFns$3<TransferPackage>;
|
|
841
897
|
interface SendLeafKeyTweak {
|
|
@@ -848,6 +904,8 @@ interface SendLeafKeyTweak {
|
|
|
848
904
|
/** Signature over Sha256(leaf_id||transfer_id||secret_cipher) */
|
|
849
905
|
signature: Uint8Array;
|
|
850
906
|
refundSignature: Uint8Array;
|
|
907
|
+
directRefundSignature: Uint8Array;
|
|
908
|
+
directFromCpfpRefundSignature: Uint8Array;
|
|
851
909
|
}
|
|
852
910
|
declare const SendLeafKeyTweak: MessageFns$3<SendLeafKeyTweak>;
|
|
853
911
|
interface FinalizeTransferRequest {
|
|
@@ -885,6 +943,8 @@ interface TransferLeaf {
|
|
|
885
943
|
secretCipher: Uint8Array;
|
|
886
944
|
signature: Uint8Array;
|
|
887
945
|
intermediateRefundTx: Uint8Array;
|
|
946
|
+
intermediateDirectRefundTx: Uint8Array;
|
|
947
|
+
intermediateDirectFromCpfpRefundTx: Uint8Array;
|
|
888
948
|
}
|
|
889
949
|
declare const TransferLeaf: MessageFns$3<TransferLeaf>;
|
|
890
950
|
interface TransferFilter {
|
|
@@ -1013,6 +1073,8 @@ interface CounterLeafSwapRequest {
|
|
|
1013
1073
|
transfer: StartTransferRequest | undefined;
|
|
1014
1074
|
swapId: string;
|
|
1015
1075
|
adaptorPublicKey: Uint8Array;
|
|
1076
|
+
directAdaptorPublicKey: Uint8Array;
|
|
1077
|
+
directFromCpfpAdaptorPublicKey: Uint8Array;
|
|
1016
1078
|
}
|
|
1017
1079
|
declare const CounterLeafSwapRequest: MessageFns$3<CounterLeafSwapRequest>;
|
|
1018
1080
|
interface CounterLeafSwapResponse {
|
|
@@ -1041,6 +1103,9 @@ interface ExtendLeafRequest {
|
|
|
1041
1103
|
ownerIdentityPublicKey: Uint8Array;
|
|
1042
1104
|
nodeTxSigningJob: SigningJob | undefined;
|
|
1043
1105
|
refundTxSigningJob: SigningJob | undefined;
|
|
1106
|
+
directNodeTxSigningJob: SigningJob | undefined;
|
|
1107
|
+
directRefundTxSigningJob: SigningJob | undefined;
|
|
1108
|
+
directFromCpfpRefundTxSigningJob: SigningJob | undefined;
|
|
1044
1109
|
}
|
|
1045
1110
|
declare const ExtendLeafRequest: MessageFns$3<ExtendLeafRequest>;
|
|
1046
1111
|
interface ExtendLeafSigningResult {
|
|
@@ -1052,6 +1117,9 @@ interface ExtendLeafResponse {
|
|
|
1052
1117
|
leafId: string;
|
|
1053
1118
|
nodeTxSigningResult: ExtendLeafSigningResult | undefined;
|
|
1054
1119
|
refundTxSigningResult: ExtendLeafSigningResult | undefined;
|
|
1120
|
+
directNodeTxSigningResult: ExtendLeafSigningResult | undefined;
|
|
1121
|
+
directRefundTxSigningResult: ExtendLeafSigningResult | undefined;
|
|
1122
|
+
directFromCpfpRefundTxSigningResult: ExtendLeafSigningResult | undefined;
|
|
1055
1123
|
}
|
|
1056
1124
|
declare const ExtendLeafResponse: MessageFns$3<ExtendLeafResponse>;
|
|
1057
1125
|
interface AddressRequestNode {
|
|
@@ -1085,12 +1153,18 @@ interface PrepareTreeAddressResponse {
|
|
|
1085
1153
|
}
|
|
1086
1154
|
declare const PrepareTreeAddressResponse: MessageFns$3<PrepareTreeAddressResponse>;
|
|
1087
1155
|
interface CreationNode {
|
|
1088
|
-
/** This is the tx that spends the parent node's output. */
|
|
1156
|
+
/** This is the cpfp tx that spends the parent node's output. */
|
|
1089
1157
|
nodeTxSigningJob: SigningJob | undefined;
|
|
1090
1158
|
/** The refund tx can only exist if there's no children. */
|
|
1091
1159
|
refundTxSigningJob: SigningJob | undefined;
|
|
1092
1160
|
/** The children will spend the output of the node's tx. Vout is the index of the child. */
|
|
1093
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;
|
|
1094
1168
|
}
|
|
1095
1169
|
declare const CreationNode: MessageFns$3<CreationNode>;
|
|
1096
1170
|
interface CreateTreeRequest {
|
|
@@ -1112,6 +1186,9 @@ interface CreationResponseNode {
|
|
|
1112
1186
|
nodeTxSigningResult: SigningResult | undefined;
|
|
1113
1187
|
refundTxSigningResult: SigningResult | undefined;
|
|
1114
1188
|
children: CreationResponseNode[];
|
|
1189
|
+
directNodeTxSigningResult: SigningResult | undefined;
|
|
1190
|
+
directRefundTxSigningResult: SigningResult | undefined;
|
|
1191
|
+
directFromCpfpRefundTxSigningResult: SigningResult | undefined;
|
|
1115
1192
|
}
|
|
1116
1193
|
declare const CreationResponseNode: MessageFns$3<CreationResponseNode>;
|
|
1117
1194
|
interface CreateTreeResponse {
|
|
@@ -1375,8 +1452,8 @@ interface SparkServiceClient$1<CallOptionsExt = {}> {
|
|
|
1375
1452
|
sign_token_transaction(request: DeepPartial$3<SignTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<SignTokenTransactionResponse>;
|
|
1376
1453
|
finalize_token_transaction(request: DeepPartial$3<FinalizeTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
1377
1454
|
freeze_tokens(request: DeepPartial$3<FreezeTokensRequest$1>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse$1>;
|
|
1378
|
-
query_token_outputs(request: DeepPartial$3<QueryTokenOutputsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse>;
|
|
1379
|
-
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>;
|
|
1380
1457
|
return_lightning_payment(request: DeepPartial$3<ReturnLightningPaymentRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
1381
1458
|
query_unused_deposit_addresses(request: DeepPartial$3<QueryUnusedDepositAddressesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryUnusedDepositAddressesResponse>;
|
|
1382
1459
|
query_static_deposit_addresses(request: DeepPartial$3<QueryStaticDepositAddressesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryStaticDepositAddressesResponse>;
|
|
@@ -1408,10 +1485,6 @@ interface ISigningCommitment {
|
|
|
1408
1485
|
hiding: Uint8Array;
|
|
1409
1486
|
binding: Uint8Array;
|
|
1410
1487
|
}
|
|
1411
|
-
interface DummyTx {
|
|
1412
|
-
tx: Uint8Array;
|
|
1413
|
-
txid: string;
|
|
1414
|
-
}
|
|
1415
1488
|
|
|
1416
1489
|
type Polynomial = {
|
|
1417
1490
|
fieldModulus: bigint;
|
|
@@ -2282,6 +2355,16 @@ interface MessageFns$2<T> {
|
|
|
2282
2355
|
fromPartial(object: DeepPartial$2<T>): T;
|
|
2283
2356
|
}
|
|
2284
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
|
+
}
|
|
2285
2368
|
/**
|
|
2286
2369
|
* This proto is constructed by the wallet to specify leaves it wants to spend
|
|
2287
2370
|
* as part of the token transaction.
|
|
@@ -2297,19 +2380,20 @@ interface TokenTransferInput {
|
|
|
2297
2380
|
declare const TokenTransferInput: MessageFns$1<TokenTransferInput>;
|
|
2298
2381
|
interface TokenMintInput {
|
|
2299
2382
|
issuerPublicKey: Uint8Array;
|
|
2300
|
-
|
|
2301
|
-
* Issuer provided timestamp of when the transaction was signed/constructed.
|
|
2302
|
-
* Helps provide idempotency and ensures that each mint input signature is
|
|
2303
|
-
* unique as long as multiple mint signatures are not happening at the same
|
|
2304
|
-
* time. Also gives a potentially useful data point for when the issuer
|
|
2305
|
-
* authorized from their perspective. Note that we have no way of proving
|
|
2306
|
-
* this is accurate.
|
|
2307
|
-
* TODO: Consider whether implementing generic idempotency controls and/or a
|
|
2308
|
-
* random nonce would be favorable to populating this field.
|
|
2309
|
-
*/
|
|
2310
|
-
issuerProvidedTimestamp: number;
|
|
2383
|
+
tokenIdentifier?: Uint8Array | undefined;
|
|
2311
2384
|
}
|
|
2312
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>;
|
|
2313
2397
|
/**
|
|
2314
2398
|
* This proto is constructed by the wallet to specify outputs it wants to create
|
|
2315
2399
|
* as part of a token transaction. Output id and revocation public key should
|
|
@@ -2322,7 +2406,8 @@ interface TokenOutput$1 {
|
|
|
2322
2406
|
revocationCommitment?: Uint8Array | undefined;
|
|
2323
2407
|
withdrawBondSats?: number | undefined;
|
|
2324
2408
|
withdrawRelativeBlockLocktime?: number | undefined;
|
|
2325
|
-
tokenPublicKey
|
|
2409
|
+
tokenPublicKey?: Uint8Array | undefined;
|
|
2410
|
+
tokenIdentifier?: Uint8Array | undefined;
|
|
2326
2411
|
/** Decoded uint128 */
|
|
2327
2412
|
tokenAmount: Uint8Array;
|
|
2328
2413
|
}
|
|
@@ -2346,6 +2431,9 @@ interface TokenTransaction {
|
|
|
2346
2431
|
} | {
|
|
2347
2432
|
$case: "transferInput";
|
|
2348
2433
|
transferInput: TokenTransferInput;
|
|
2434
|
+
} | {
|
|
2435
|
+
$case: "createInput";
|
|
2436
|
+
createInput: TokenCreateInput;
|
|
2349
2437
|
} | undefined;
|
|
2350
2438
|
tokenOutputs: TokenOutput$1[];
|
|
2351
2439
|
sparkOperatorIdentityPublicKeys: Uint8Array[];
|
|
@@ -2356,6 +2444,12 @@ interface TokenTransaction {
|
|
|
2356
2444
|
*/
|
|
2357
2445
|
expiryTime: Date | undefined;
|
|
2358
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;
|
|
2359
2453
|
}
|
|
2360
2454
|
declare const TokenTransaction: MessageFns$1<TokenTransaction>;
|
|
2361
2455
|
interface SignatureWithIndex {
|
|
@@ -2391,7 +2485,7 @@ interface StartTransactionRequest {
|
|
|
2391
2485
|
/**
|
|
2392
2486
|
* How long the transaction should be valid for, in seconds.
|
|
2393
2487
|
* The server will set the actual expiry_time in the final transaction based
|
|
2394
|
-
* on this duration. Must be
|
|
2488
|
+
* on this duration. Must be within [1, 300] seconds.
|
|
2395
2489
|
*/
|
|
2396
2490
|
validityDurationSeconds: number;
|
|
2397
2491
|
}
|
|
@@ -2411,6 +2505,82 @@ declare const CommitTransactionRequest: MessageFns$1<CommitTransactionRequest>;
|
|
|
2411
2505
|
interface CommitTransactionResponse {
|
|
2412
2506
|
}
|
|
2413
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>;
|
|
2414
2584
|
interface SparkTokenServiceClient<CallOptionsExt = {}> {
|
|
2415
2585
|
/**
|
|
2416
2586
|
* Start process to create final token transaction with all inputs required
|
|
@@ -2422,6 +2592,9 @@ interface SparkTokenServiceClient<CallOptionsExt = {}> {
|
|
|
2422
2592
|
* coordinated by one SO.
|
|
2423
2593
|
*/
|
|
2424
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>;
|
|
2425
2598
|
}
|
|
2426
2599
|
type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
2427
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 {
|
|
@@ -2890,6 +3063,8 @@ interface WalletTransferLeaf {
|
|
|
2890
3063
|
intermediateRefundTx: string;
|
|
2891
3064
|
}
|
|
2892
3065
|
|
|
3066
|
+
type HumanReadableTokenIdentifier = `btk1${string}` | `btkrt1${string}` | `btkt1${string}` | `btks1${string}` | `btkl1${string}`;
|
|
3067
|
+
|
|
2893
3068
|
type CreateLightningInvoiceParams = {
|
|
2894
3069
|
amountSats: number;
|
|
2895
3070
|
memo?: string;
|
|
@@ -2908,13 +3083,44 @@ type TransferParams = {
|
|
|
2908
3083
|
amountSats: number;
|
|
2909
3084
|
receiverSparkAddress: string;
|
|
2910
3085
|
};
|
|
2911
|
-
|
|
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 */
|
|
2912
3110
|
tokenPublicKey: string;
|
|
3111
|
+
/** Human-readable name of the token (e.g., SparkToken)*/
|
|
2913
3112
|
tokenName: string;
|
|
2914
|
-
|
|
2915
|
-
|
|
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 */
|
|
2916
3118
|
maxSupply: bigint;
|
|
2917
3119
|
};
|
|
3120
|
+
type TokenBalanceMap = Map<HumanReadableTokenIdentifier, {
|
|
3121
|
+
balance: bigint;
|
|
3122
|
+
tokenMetadata: TokenMetadata;
|
|
3123
|
+
}>;
|
|
2918
3124
|
type InitWalletResponse = {
|
|
2919
3125
|
mnemonic?: string | undefined;
|
|
2920
3126
|
};
|
|
@@ -2952,7 +3158,7 @@ declare class SparkWallet extends EventEmitter {
|
|
|
2952
3158
|
private sparkAddress;
|
|
2953
3159
|
private streamController;
|
|
2954
3160
|
protected leaves: TreeNode[];
|
|
2955
|
-
protected tokenOutputs: Map<string, OutputWithPreviousTransactionData[]>;
|
|
3161
|
+
protected tokenOutputs: Map<string, OutputWithPreviousTransactionData$1[]>;
|
|
2956
3162
|
private claimTransfersInterval;
|
|
2957
3163
|
protected wrapWithOtelSpan<T>(name: string, fn: (...args: any[]) => Promise<T>): (...args: any[]) => Promise<T>;
|
|
2958
3164
|
protected constructor(options?: ConfigOptions, signer?: SparkSigner);
|
|
@@ -3043,12 +3249,6 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3043
3249
|
transfers: WalletTransfer[];
|
|
3044
3250
|
offset: number;
|
|
3045
3251
|
}>;
|
|
3046
|
-
/**
|
|
3047
|
-
* Gets the held token info for the wallet.
|
|
3048
|
-
*
|
|
3049
|
-
* @deprecated The information is returned in getBalance
|
|
3050
|
-
*/
|
|
3051
|
-
getTokenInfo(): Promise<TokenInfo[]>;
|
|
3052
3252
|
/**
|
|
3053
3253
|
* Gets the current balance of the wallet.
|
|
3054
3254
|
* You can use the forceRefetch option to synchronize your wallet and claim any
|
|
@@ -3056,14 +3256,11 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3056
3256
|
*
|
|
3057
3257
|
* @returns {Promise<Object>} Object containing:
|
|
3058
3258
|
* - balance: The wallet's current balance in satoshis
|
|
3059
|
-
* - tokenBalances: Map of token
|
|
3259
|
+
* - tokenBalances: Map of the human readable token identifier to token balances and token info
|
|
3060
3260
|
*/
|
|
3061
3261
|
getBalance(): Promise<{
|
|
3062
3262
|
balance: bigint;
|
|
3063
|
-
tokenBalances:
|
|
3064
|
-
balance: bigint;
|
|
3065
|
-
tokenInfo: TokenInfo;
|
|
3066
|
-
}>;
|
|
3263
|
+
tokenBalances: TokenBalanceMap;
|
|
3067
3264
|
}>;
|
|
3068
3265
|
private getTokenBalance;
|
|
3069
3266
|
private getInternalBalance;
|
|
@@ -3328,7 +3525,7 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3328
3525
|
* @param {string} id - The ID of the transfer
|
|
3329
3526
|
* @returns {Promise<Transfer | undefined>} The transfer
|
|
3330
3527
|
*/
|
|
3331
|
-
getTransfer(id: string): Promise<
|
|
3528
|
+
getTransfer(id: string): Promise<WalletTransfer | undefined>;
|
|
3332
3529
|
/**
|
|
3333
3530
|
* Synchronizes token outputs for the wallet.
|
|
3334
3531
|
*
|
|
@@ -3351,7 +3548,7 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3351
3548
|
tokenAmount: bigint;
|
|
3352
3549
|
receiverSparkAddress: string;
|
|
3353
3550
|
outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST";
|
|
3354
|
-
selectedOutputs?: OutputWithPreviousTransactionData[];
|
|
3551
|
+
selectedOutputs?: OutputWithPreviousTransactionData$1[];
|
|
3355
3552
|
}): Promise<string>;
|
|
3356
3553
|
/**
|
|
3357
3554
|
* Transfers tokens with multiple outputs
|
|
@@ -3367,16 +3564,19 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3367
3564
|
tokenPublicKey: string;
|
|
3368
3565
|
tokenAmount: bigint;
|
|
3369
3566
|
receiverSparkAddress: string;
|
|
3370
|
-
}[], outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST", selectedOutputs?: OutputWithPreviousTransactionData[]): Promise<string>;
|
|
3567
|
+
}[], outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST", selectedOutputs?: OutputWithPreviousTransactionData$1[]): Promise<string>;
|
|
3371
3568
|
/**
|
|
3372
3569
|
* Retrieves token transaction history for specified tokens owned by the wallet.
|
|
3373
3570
|
* Can optionally filter by specific transaction hashes.
|
|
3374
3571
|
*
|
|
3375
|
-
* @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
|
|
3376
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
|
|
3377
3577
|
* @returns Promise resolving to array of token transactions with their current status
|
|
3378
3578
|
*/
|
|
3379
|
-
queryTokenTransactions(
|
|
3579
|
+
queryTokenTransactions(ownerPublicKeys?: string[], issuerPublicKeys?: string[], tokenTransactionHashes?: string[], tokenIdentifiers?: string[], outputIds?: string[]): Promise<TokenTransactionWithStatus[]>;
|
|
3380
3580
|
getTokenL1Address(): Promise<string>;
|
|
3381
3581
|
/**
|
|
3382
3582
|
* Signs a message with the identity key.
|
|
@@ -3458,11 +3658,6 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3458
3658
|
private queryNodes;
|
|
3459
3659
|
}
|
|
3460
3660
|
|
|
3461
|
-
declare function getLatestDepositTxId(address: string): Promise<string | null>;
|
|
3462
|
-
declare function isTxBroadcast(txid: string, baseUrl: string, network?: any): Promise<boolean>;
|
|
3463
|
-
|
|
3464
|
-
declare function createDummyTx(address: string, amountSats: bigint): Promise<DummyTx>;
|
|
3465
|
-
|
|
3466
3661
|
declare function generateSignatureFromExistingAdaptor(signature: Uint8Array, adaptorPrivateKeyBytes: Uint8Array): Uint8Array;
|
|
3467
3662
|
declare function generateAdaptorFromSignature(signature: Uint8Array): {
|
|
3468
3663
|
adaptorSignature: Uint8Array;
|
|
@@ -3490,6 +3685,9 @@ declare function subtractPrivateKeys(a: Uint8Array, b: Uint8Array): Uint8Array<A
|
|
|
3490
3685
|
declare function sumOfPrivateKeys(keys: Uint8Array[]): Uint8Array<ArrayBufferLike>;
|
|
3491
3686
|
declare function lastKeyWithTarget(target: Uint8Array, keys: Uint8Array[]): Uint8Array<ArrayBufferLike>;
|
|
3492
3687
|
|
|
3688
|
+
declare function getLatestDepositTxId(address: string): Promise<string | null>;
|
|
3689
|
+
declare function isTxBroadcast(txid: string, baseUrl: string, network?: any): Promise<boolean>;
|
|
3690
|
+
|
|
3493
3691
|
declare function proofOfPossessionMessageHashForDepositAddress(userPubkey: Uint8Array, operatorPubkey: Uint8Array, depositAddress: string): Uint8Array;
|
|
3494
3692
|
|
|
3495
3693
|
declare function collectResponses<T>(responses: PromiseSettledResult<T>[]): T[];
|
|
@@ -3503,11 +3701,9 @@ declare function createSigningCommitment(binding: Uint8Array, hiding: Uint8Array
|
|
|
3503
3701
|
declare function encodeSigningCommitmentToBytes(commitment: SigningCommitment): Uint8Array;
|
|
3504
3702
|
declare function decodeBytesToSigningCommitment(bytes: Uint8Array): SigningCommitment;
|
|
3505
3703
|
|
|
3506
|
-
declare function calculateAvailableTokenAmount(outputLeaves: OutputWithPreviousTransactionData[]): bigint;
|
|
3507
|
-
declare function checkIfSelectedOutputsAreAvailable(selectedOutputs: OutputWithPreviousTransactionData[], tokenOutputs: Map<string, OutputWithPreviousTransactionData[]>, tokenPublicKey: Uint8Array): boolean;
|
|
3508
|
-
declare function filterTokenBalanceForTokenPublicKey(tokenBalances:
|
|
3509
|
-
balance: bigint;
|
|
3510
|
-
}>, 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): {
|
|
3511
3707
|
balance: bigint;
|
|
3512
3708
|
};
|
|
3513
3709
|
|
|
@@ -3580,4 +3776,4 @@ declare function constructFeeBumpTx(txHex: string, utxos: Utxo[], feeRate: FeeRa
|
|
|
3580
3776
|
|
|
3581
3777
|
declare function getSparkAddressFromTaproot(taprootAddress: string): SparkAddressFormat;
|
|
3582
3778
|
|
|
3583
|
-
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 };
|