@breeztech/breez-sdk-spark 0.27.0-dev1 → 0.27.0
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/breez-sdk-spark.tgz +0 -0
- package/bundler/breez_sdk_spark_wasm.d.ts +347 -95
- package/bundler/breez_sdk_spark_wasm_bg.js +210 -92
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +28 -14
- package/bundler/storage/index.js +251 -20
- package/bundler/tree-store/index.js +39 -6
- package/deno/breez_sdk_spark_wasm.d.ts +347 -95
- package/deno/breez_sdk_spark_wasm.js +210 -92
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +28 -14
- package/itest/database-drivers.test.js +45 -0
- package/nodejs/breez_sdk_spark_wasm.d.ts +347 -95
- package/nodejs/breez_sdk_spark_wasm.js +210 -92
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +28 -14
- package/nodejs/index.js +6 -0
- package/nodejs/mysql-session-store/index.cjs +3 -1
- package/nodejs/mysql-storage/index.cjs +238 -20
- package/nodejs/mysql-storage/migrations.cjs +49 -1
- package/nodejs/mysql-token-store/index.cjs +3 -7
- package/nodejs/mysql-tree-store/index.cjs +26 -1
- package/nodejs/postgres-session-store/index.cjs +3 -1
- package/nodejs/postgres-storage/index.cjs +228 -19
- package/nodejs/postgres-storage/migrations.cjs +49 -0
- package/nodejs/postgres-token-store/index.cjs +3 -1
- package/nodejs/postgres-tree-store/index.cjs +25 -1
- package/nodejs/postgres-tree-store/migrations.cjs +10 -0
- package/nodejs/storage/index.cjs +210 -19
- package/nodejs/storage/migrations.cjs +38 -0
- package/nodejs/tree-store/index.cjs +35 -0
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +375 -109
- package/web/breez_sdk_spark_wasm.js +210 -92
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +28 -14
- package/web/storage/index.js +251 -20
- package/web/tree-store/index.js +39 -6
|
@@ -57,6 +57,7 @@ export interface TreeStore {
|
|
|
57
57
|
storeAncestors: (pedigrees: LeafPedigree[]) => Promise<void>;
|
|
58
58
|
leavesMissingExitChains: () => Promise<string[]>;
|
|
59
59
|
getLeaves: () => Promise<Leaves>;
|
|
60
|
+
getLeavesWithStatus: (statuses: string[]) => Promise<TreeNode[]>;
|
|
60
61
|
getExitChains: (leafIds: string[]) => Promise<LeafPedigree[]>;
|
|
61
62
|
getAvailableBalance: () => Promise<bigint>;
|
|
62
63
|
getVerifiedLeafKeys: () => Promise<[string, string, string][]>;
|
|
@@ -517,6 +518,14 @@ export interface WasmSdkContextConfig {
|
|
|
517
518
|
proxy?: ProxyConfig;
|
|
518
519
|
}
|
|
519
520
|
|
|
521
|
+
/**
|
|
522
|
+
* The error SDK methods throw. `docsUrl` links to the guide section that
|
|
523
|
+
* explains the error, when it has one.
|
|
524
|
+
*/
|
|
525
|
+
export interface SdkError extends Error {
|
|
526
|
+
docsUrl?: string;
|
|
527
|
+
}
|
|
528
|
+
|
|
520
529
|
export interface AddContactRequest {
|
|
521
530
|
name: string;
|
|
522
531
|
paymentIdentifier: string;
|
|
@@ -545,7 +554,7 @@ export interface BatchRecipient {
|
|
|
545
554
|
|
|
546
555
|
export interface BatchTotal {
|
|
547
556
|
tokenIdentifier?: string;
|
|
548
|
-
amount:
|
|
557
|
+
amount: bigint;
|
|
549
558
|
}
|
|
550
559
|
|
|
551
560
|
export interface Bip21Details {
|
|
@@ -646,6 +655,39 @@ export interface Bolt12OfferDetails {
|
|
|
646
655
|
signingPubkey?: string;
|
|
647
656
|
}
|
|
648
657
|
|
|
658
|
+
export interface BridgeFromCashAppRequest {
|
|
659
|
+
address: string;
|
|
660
|
+
route: CrossChainRoutePair;
|
|
661
|
+
amount: bigint;
|
|
662
|
+
feePolicy?: FeePolicy;
|
|
663
|
+
maxSlippageBps?: number;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
export interface BridgeFromCashAppResponse {
|
|
667
|
+
url: string;
|
|
668
|
+
amountSats: number;
|
|
669
|
+
estimatedOut: bigint;
|
|
670
|
+
asset: string;
|
|
671
|
+
serviceFeeAmount: bigint;
|
|
672
|
+
serviceFeeAsset?: string;
|
|
673
|
+
serviceFeeAssetDecimals?: number;
|
|
674
|
+
expiresAt: number;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
export interface BridgeToCashAppRequest {
|
|
678
|
+
recipient: string;
|
|
679
|
+
route: CrossChainRoutePair;
|
|
680
|
+
amount: bigint;
|
|
681
|
+
feePolicy?: FeePolicy;
|
|
682
|
+
refundAddress: string;
|
|
683
|
+
maxSlippageBps?: number;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
export interface BridgeToCashAppResponse {
|
|
687
|
+
paymentRequest: string;
|
|
688
|
+
info: CrossChainReceiveInfo;
|
|
689
|
+
}
|
|
690
|
+
|
|
649
691
|
export interface BuildUnsignedBatchPackageRequest {
|
|
650
692
|
prepareResponse: PrepareSendBatchResponse;
|
|
651
693
|
}
|
|
@@ -654,6 +696,10 @@ export interface BuildUnsignedLnurlPayPackageRequest {
|
|
|
654
696
|
prepareResponse: PrepareLnurlPayResponse;
|
|
655
697
|
}
|
|
656
698
|
|
|
699
|
+
export interface BuildUnsignedPullPackageRequest {
|
|
700
|
+
prepareResponse: PreparePullPaymentResponse;
|
|
701
|
+
}
|
|
702
|
+
|
|
657
703
|
export interface BuildUnsignedTransferPackageRequest {
|
|
658
704
|
prepareResponse: PrepareSendPaymentResponse;
|
|
659
705
|
options?: BuildTransferPackageOptions;
|
|
@@ -665,6 +711,12 @@ export interface BurnIssuerTokenRequest {
|
|
|
665
711
|
|
|
666
712
|
export interface BuyBitcoinResponse {
|
|
667
713
|
url: string;
|
|
714
|
+
crossChainInfo?: CrossChainReceiveInfo;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
export interface ChainTransaction {
|
|
718
|
+
txid: string;
|
|
719
|
+
blockHeight: number;
|
|
668
720
|
}
|
|
669
721
|
|
|
670
722
|
export interface CheckLightningAddressRequest {
|
|
@@ -681,20 +733,20 @@ export interface CheckMessageResponse {
|
|
|
681
733
|
isValid: boolean;
|
|
682
734
|
}
|
|
683
735
|
|
|
684
|
-
export interface
|
|
685
|
-
|
|
736
|
+
export interface CheckRecoverFundsRequest {
|
|
737
|
+
recovery: RecoverFundsResponse;
|
|
686
738
|
}
|
|
687
739
|
|
|
688
|
-
export interface
|
|
689
|
-
|
|
690
|
-
verdict:
|
|
740
|
+
export interface CheckRecoverFundsResponse {
|
|
741
|
+
recovery: RecoverFundsResponse;
|
|
742
|
+
verdict: RecoveryVerdict;
|
|
691
743
|
}
|
|
692
744
|
|
|
693
745
|
export interface ClaimDepositQuote {
|
|
694
746
|
confirmationsRequired: number;
|
|
695
747
|
creditAmountSats: number;
|
|
696
748
|
feeSats: number;
|
|
697
|
-
|
|
749
|
+
maxFeeSats?: number;
|
|
698
750
|
isEstimate: boolean;
|
|
699
751
|
}
|
|
700
752
|
|
|
@@ -729,6 +781,7 @@ export interface Config {
|
|
|
729
781
|
lnurlDomain?: string;
|
|
730
782
|
preferSparkOverLightning: boolean;
|
|
731
783
|
exitChainAutoFetchEnabled: boolean;
|
|
784
|
+
watchtowerFeeLadderEnabled?: boolean;
|
|
732
785
|
externalInputParsers?: ExternalInputParser[];
|
|
733
786
|
useDefaultExternalInputParsers: boolean;
|
|
734
787
|
realTimeSyncServerUrl?: string;
|
|
@@ -811,8 +864,15 @@ export interface ConversionOptions {
|
|
|
811
864
|
export interface ConversionSide {
|
|
812
865
|
chain: ConversionChain;
|
|
813
866
|
asset: ConversionAsset;
|
|
814
|
-
amount:
|
|
815
|
-
fee:
|
|
867
|
+
amount: bigint;
|
|
868
|
+
fee: bigint;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
export interface CooperativeRecoveryFailure {
|
|
872
|
+
leafId: string;
|
|
873
|
+
outputTxid: string;
|
|
874
|
+
outputVout: number;
|
|
875
|
+
error: CooperativeRecoveryError;
|
|
816
876
|
}
|
|
817
877
|
|
|
818
878
|
export interface CpfpSigner {
|
|
@@ -827,6 +887,19 @@ export interface CreateIssuerTokenRequest {
|
|
|
827
887
|
maxSupply: bigint;
|
|
828
888
|
}
|
|
829
889
|
|
|
890
|
+
export interface CreateTokenAllowanceRequest {
|
|
891
|
+
spenderAddress: string;
|
|
892
|
+
tokenIdentifier: string;
|
|
893
|
+
maxPerPayment: TokenAllowanceLimit;
|
|
894
|
+
maxTotal: TokenAllowanceLimit;
|
|
895
|
+
expiryTime: number;
|
|
896
|
+
allowedRecipients: string[];
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
export interface CreateTokenAllowanceResponse {
|
|
900
|
+
allowance: TokenAllowance;
|
|
901
|
+
}
|
|
902
|
+
|
|
830
903
|
export interface Credentials {
|
|
831
904
|
username: string;
|
|
832
905
|
password: string;
|
|
@@ -842,7 +915,7 @@ export interface CrossChainAddressDetails {
|
|
|
842
915
|
addressFamily: CrossChainAddressFamily;
|
|
843
916
|
contractAddress?: string;
|
|
844
917
|
chainId?: number;
|
|
845
|
-
amount?:
|
|
918
|
+
amount?: bigint;
|
|
846
919
|
}
|
|
847
920
|
|
|
848
921
|
export interface CrossChainConfig {
|
|
@@ -852,19 +925,19 @@ export interface CrossChainConfig {
|
|
|
852
925
|
|
|
853
926
|
export interface CrossChainReceiveInfo {
|
|
854
927
|
depositAddress: string;
|
|
855
|
-
depositAmount:
|
|
856
|
-
expectedReceivedAmount:
|
|
928
|
+
depositAmount: bigint;
|
|
929
|
+
expectedReceivedAmount: bigint;
|
|
857
930
|
destinationAsset: string;
|
|
858
931
|
tokenIdentifier?: string;
|
|
859
|
-
serviceFeeAmount:
|
|
932
|
+
serviceFeeAmount: bigint;
|
|
860
933
|
serviceFeeAsset?: string;
|
|
861
934
|
serviceFeeAssetDecimals?: number;
|
|
862
935
|
expiresAt: number;
|
|
863
936
|
}
|
|
864
937
|
|
|
865
938
|
export interface CrossChainRouteLimits {
|
|
866
|
-
minAmount?:
|
|
867
|
-
maxAmount?:
|
|
939
|
+
minAmount?: bigint;
|
|
940
|
+
maxAmount?: bigint;
|
|
868
941
|
minUsdCents?: number;
|
|
869
942
|
maxUsdCents?: number;
|
|
870
943
|
}
|
|
@@ -948,7 +1021,6 @@ export interface ExternalClaimLeafInput {
|
|
|
948
1021
|
export interface ExternalFrostCommitments {
|
|
949
1022
|
hidingCommitment: number[];
|
|
950
1023
|
bindingCommitment: number[];
|
|
951
|
-
noncesCiphertext: number[];
|
|
952
1024
|
}
|
|
953
1025
|
|
|
954
1026
|
export interface ExternalFrostJob {
|
|
@@ -1083,6 +1155,16 @@ export interface ExternalSignStaticDepositRefundRequest {
|
|
|
1083
1155
|
statechainPublicKeys: IdentifierPublicKeyPair[];
|
|
1084
1156
|
}
|
|
1085
1157
|
|
|
1158
|
+
export interface ExternalSignWatchtowerExitRecoveryRequest {
|
|
1159
|
+
leafId: ExternalTreeNodeId;
|
|
1160
|
+
sighash: number[];
|
|
1161
|
+
verifyingKey: number[];
|
|
1162
|
+
nonceCommitment: ExternalFrostCommitments;
|
|
1163
|
+
statechainCommitments: IdentifierCommitmentPair[];
|
|
1164
|
+
statechainSignatures: IdentifierSignaturePair[];
|
|
1165
|
+
statechainPublicKeys: IdentifierPublicKeyPair[];
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1086
1168
|
export interface ExternalSignedSparkInvoice {
|
|
1087
1169
|
signature: SchnorrSignatureBytes;
|
|
1088
1170
|
}
|
|
@@ -1103,6 +1185,7 @@ export interface ExternalSparkSigner {
|
|
|
1103
1185
|
getIdentityPublicKey(): Promise<PublicKeyBytes>;
|
|
1104
1186
|
getPublicKeyForLeaf(leafId: ExternalTreeNodeId): Promise<PublicKeyBytes>;
|
|
1105
1187
|
getStaticDepositPublicKey(index: number): Promise<PublicKeyBytes>;
|
|
1188
|
+
isRemote?(): boolean;
|
|
1106
1189
|
signAuthenticationChallenge(challenge: Uint8Array): Promise<EcdsaSignatureBytes>;
|
|
1107
1190
|
signMessage(message: Uint8Array): Promise<EcdsaSignatureBytes>;
|
|
1108
1191
|
signLeafRefundSpend(leafId: ExternalTreeNodeId, sighash: Uint8Array): Promise<SchnorrSignatureBytes>;
|
|
@@ -1113,6 +1196,8 @@ export interface ExternalSparkSigner {
|
|
|
1113
1196
|
prepareStaticDeposit(request: ExternalPrepareStaticDepositRequest): Promise<ExternalPreparedStaticDeposit>;
|
|
1114
1197
|
startStaticDepositRefund(request: ExternalStartStaticDepositRefundRequest): Promise<ExternalStartedStaticDepositRefund>;
|
|
1115
1198
|
signStaticDepositRefund(request: ExternalSignStaticDepositRefundRequest): Promise<ExternalFrostSignature>;
|
|
1199
|
+
startWatchtowerExitRecovery(request: ExternalStartWatchtowerExitRecoveryRequest): Promise<ExternalStartedWatchtowerExitRecovery>;
|
|
1200
|
+
signWatchtowerExitRecovery(request: ExternalSignWatchtowerExitRecoveryRequest): Promise<ExternalFrostSignature>;
|
|
1116
1201
|
signSparkInvoice(request: ExternalSignSparkInvoiceRequest): Promise<ExternalSignedSparkInvoice>;
|
|
1117
1202
|
prepareTokenTransaction(request: ExternalPrepareTokenTransactionRequest): Promise<ExternalPreparedTokenTransaction>;
|
|
1118
1203
|
prepareStaticDepositClaim(request: ExternalPrepareStaticDepositClaimRequest): Promise<ExternalPreparedStaticDepositClaim>;
|
|
@@ -1123,12 +1208,23 @@ export interface ExternalStartStaticDepositRefundRequest {
|
|
|
1123
1208
|
userStatement: number[];
|
|
1124
1209
|
}
|
|
1125
1210
|
|
|
1211
|
+
export interface ExternalStartWatchtowerExitRecoveryRequest {
|
|
1212
|
+
leafId: ExternalTreeNodeId;
|
|
1213
|
+
userStatement: number[];
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1126
1216
|
export interface ExternalStartedStaticDepositRefund {
|
|
1127
1217
|
signingPublicKey: number[];
|
|
1128
1218
|
nonceCommitment: ExternalFrostCommitments;
|
|
1129
1219
|
userSignature: EcdsaSignatureBytes;
|
|
1130
1220
|
}
|
|
1131
1221
|
|
|
1222
|
+
export interface ExternalStartedWatchtowerExitRecovery {
|
|
1223
|
+
signingPublicKey: number[];
|
|
1224
|
+
nonceCommitment: ExternalFrostCommitments;
|
|
1225
|
+
userSignature: EcdsaSignatureBytes;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1132
1228
|
export interface ExternalTransferLeafInput {
|
|
1133
1229
|
nodeId: ExternalTreeNodeId;
|
|
1134
1230
|
newLeafId: ExternalTreeNodeId;
|
|
@@ -1188,6 +1284,7 @@ export interface GetInfoResponse {
|
|
|
1188
1284
|
identityPubkey: string;
|
|
1189
1285
|
balanceSats: number;
|
|
1190
1286
|
tokenBalances: Map<string, TokenBalance>;
|
|
1287
|
+
recoverableFundsSats: number;
|
|
1191
1288
|
}
|
|
1192
1289
|
|
|
1193
1290
|
export interface GetPaymentRequest {
|
|
@@ -1246,6 +1343,15 @@ export interface LeafOptimizationConfig {
|
|
|
1246
1343
|
multiplicity: number;
|
|
1247
1344
|
}
|
|
1248
1345
|
|
|
1346
|
+
export interface LeafRecovery {
|
|
1347
|
+
leafId: string;
|
|
1348
|
+
chainCheckedAt?: number;
|
|
1349
|
+
watchtowerExitOutput?: StoredWatchtowerExitOutput;
|
|
1350
|
+
watchtowerExitRecoveries: WatchtowerExitRecovery[];
|
|
1351
|
+
watchtowerExitSpend?: ChainTransaction;
|
|
1352
|
+
unilateralExitSweep?: ChainTransaction;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1249
1355
|
export interface LightningAddressDetails {
|
|
1250
1356
|
address: string;
|
|
1251
1357
|
payRequest: LnurlPayRequestDetails;
|
|
@@ -1287,6 +1393,19 @@ export interface ListPaymentsResponse {
|
|
|
1287
1393
|
payments: Payment[];
|
|
1288
1394
|
}
|
|
1289
1395
|
|
|
1396
|
+
export interface ListTokenAllowancesRequest {
|
|
1397
|
+
role: TokenAllowanceRole;
|
|
1398
|
+
counterpartyAddress?: string;
|
|
1399
|
+
tokenIdentifier?: string;
|
|
1400
|
+
includeInactive?: boolean;
|
|
1401
|
+
offset?: number;
|
|
1402
|
+
limit?: number;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
export interface ListTokenAllowancesResponse {
|
|
1406
|
+
allowances: TokenAllowance[];
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1290
1409
|
export interface ListUnclaimedDepositsRequest {}
|
|
1291
1410
|
|
|
1292
1411
|
export interface ListUnclaimedDepositsResponse {
|
|
@@ -1397,12 +1516,18 @@ export interface LocalizedName {
|
|
|
1397
1516
|
export interface LogEntry {
|
|
1398
1517
|
line: string;
|
|
1399
1518
|
level: string;
|
|
1519
|
+
instanceId?: string;
|
|
1400
1520
|
}
|
|
1401
1521
|
|
|
1402
1522
|
export interface Logger {
|
|
1403
1523
|
log: (l: LogEntry) => void;
|
|
1404
1524
|
}
|
|
1405
1525
|
|
|
1526
|
+
export interface MaxFee {
|
|
1527
|
+
onchain: MaxOnchainFee;
|
|
1528
|
+
proportionalPpm?: number;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1406
1531
|
export interface MessageBytes {
|
|
1407
1532
|
bytes: number[];
|
|
1408
1533
|
}
|
|
@@ -1466,7 +1591,7 @@ export interface PaymentRequestSource {
|
|
|
1466
1591
|
|
|
1467
1592
|
export interface PerBranchFunding {
|
|
1468
1593
|
leafId: string;
|
|
1469
|
-
|
|
1594
|
+
fundingSats: number;
|
|
1470
1595
|
}
|
|
1471
1596
|
|
|
1472
1597
|
export interface PrepareLnurlPayRequest {
|
|
@@ -1509,6 +1634,45 @@ export interface PreparePaymentLinkResponse {
|
|
|
1509
1634
|
expiresAt: string;
|
|
1510
1635
|
}
|
|
1511
1636
|
|
|
1637
|
+
export interface PreparePullPaymentRequest {
|
|
1638
|
+
payerAddress: string;
|
|
1639
|
+
tokenIdentifier: string;
|
|
1640
|
+
receivers: PullReceiver[];
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
export interface PreparePullPaymentResponse {
|
|
1644
|
+
payerAddress: string;
|
|
1645
|
+
tokenIdentifier: string;
|
|
1646
|
+
receivers: PullReceiver[];
|
|
1647
|
+
amount: bigint;
|
|
1648
|
+
allowanceId: string;
|
|
1649
|
+
expiryTime: number;
|
|
1650
|
+
pullContext: number[];
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
export interface PrepareRecoverFundsRequest {
|
|
1654
|
+
feeRateSatPerVbyte: number;
|
|
1655
|
+
fundingKind?: CpfpFundingKind;
|
|
1656
|
+
destination: string;
|
|
1657
|
+
selection: ExitLeafSelection;
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
export interface PrepareRecoverFundsResponse {
|
|
1661
|
+
leaves: RecoverFundsLeaf[];
|
|
1662
|
+
skipped: SkippedLeaf[];
|
|
1663
|
+
recoverableValueSats: number;
|
|
1664
|
+
totalFeeSats: number;
|
|
1665
|
+
cooperativeFeeSats: number;
|
|
1666
|
+
cpfpFeeSats: number;
|
|
1667
|
+
fanoutFeeSats: number;
|
|
1668
|
+
refundFeeSats: number;
|
|
1669
|
+
sweepFeeSats: number;
|
|
1670
|
+
funding?: RecoveryFunding;
|
|
1671
|
+
feeRateSatPerVbyte: number;
|
|
1672
|
+
destination: string;
|
|
1673
|
+
exitChainState: ExitChainState;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1512
1676
|
export interface PrepareSendBatchRequest {
|
|
1513
1677
|
recipients: BatchRecipient[];
|
|
1514
1678
|
}
|
|
@@ -1534,27 +1698,6 @@ export interface PrepareSendPaymentResponse {
|
|
|
1534
1698
|
feePolicy: FeePolicy;
|
|
1535
1699
|
}
|
|
1536
1700
|
|
|
1537
|
-
export interface PrepareUnilateralExitRequest {
|
|
1538
|
-
feeRateSatPerVbyte: number;
|
|
1539
|
-
fundingKind: CpfpFundingKind;
|
|
1540
|
-
destination: string;
|
|
1541
|
-
selection: ExitLeafSelection;
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
export interface PrepareUnilateralExitResponse {
|
|
1545
|
-
leaves: UnilateralExitLeaf[];
|
|
1546
|
-
recoverableValueSat: number;
|
|
1547
|
-
totalFeeSat: number;
|
|
1548
|
-
cpfpFeeSat: number;
|
|
1549
|
-
fanoutFeeSat: number;
|
|
1550
|
-
sweepFeeSat: number;
|
|
1551
|
-
singleUtxoFundingSat: number;
|
|
1552
|
-
perBranchFunding: PerBranchFunding[];
|
|
1553
|
-
feeRateSatPerVbyte: number;
|
|
1554
|
-
destination: string;
|
|
1555
|
-
exitChainState: ExitChainState;
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
1701
|
export interface ProvisionalPayment {
|
|
1559
1702
|
paymentId: string;
|
|
1560
1703
|
amount: bigint;
|
|
@@ -1576,10 +1719,29 @@ export interface PublishSignedLnurlPayPackageRequest {
|
|
|
1576
1719
|
signedPackage: SignedTransferPackage;
|
|
1577
1720
|
}
|
|
1578
1721
|
|
|
1722
|
+
export interface PublishSignedPullPackageRequest {
|
|
1723
|
+
signedPackage: SignedTransferPackage;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1579
1726
|
export interface PublishSignedTransferPackageRequest {
|
|
1580
1727
|
signedPackage: SignedTransferPackage;
|
|
1581
1728
|
}
|
|
1582
1729
|
|
|
1730
|
+
export interface PullPaymentRequest {
|
|
1731
|
+
prepareResponse: PreparePullPaymentResponse;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
export interface PullPaymentResponse {
|
|
1735
|
+
txHash: string;
|
|
1736
|
+
status: PaymentStatus;
|
|
1737
|
+
payment?: Payment;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
export interface PullReceiver {
|
|
1741
|
+
amount: bigint;
|
|
1742
|
+
receiverAddress?: string;
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1583
1745
|
export interface Rate {
|
|
1584
1746
|
coin: string;
|
|
1585
1747
|
value: number;
|
|
@@ -1622,10 +1784,53 @@ export interface RecordId {
|
|
|
1622
1784
|
dataId: string;
|
|
1623
1785
|
}
|
|
1624
1786
|
|
|
1787
|
+
export interface RecoverFundsLeaf {
|
|
1788
|
+
leafId: string;
|
|
1789
|
+
valueSats: number;
|
|
1790
|
+
method: RecoveryMethod;
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
export interface RecoverFundsRequest {
|
|
1794
|
+
prepared: PrepareRecoverFundsResponse;
|
|
1795
|
+
fundingInputs?: CpfpInput[];
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
export interface RecoverFundsResponse {
|
|
1799
|
+
recoverableValueSats: number;
|
|
1800
|
+
totalFeeSats: number;
|
|
1801
|
+
cooperativeFeeSats: number;
|
|
1802
|
+
cpfpFeeSats: number;
|
|
1803
|
+
fanoutFeeSats: number;
|
|
1804
|
+
refundFeeSats: number;
|
|
1805
|
+
sweepFeeSats: number;
|
|
1806
|
+
leaves: RecoverFundsLeaf[];
|
|
1807
|
+
failed: CooperativeRecoveryFailure[];
|
|
1808
|
+
transactions: RecoveryTransaction[];
|
|
1809
|
+
fundingInputs: CpfpInput[];
|
|
1810
|
+
feeRateSatPerVbyte: number;
|
|
1811
|
+
destination: string;
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1625
1814
|
export interface RecoverableEcdsaSignatureBytes {
|
|
1626
1815
|
bytes: number[];
|
|
1627
1816
|
}
|
|
1628
1817
|
|
|
1818
|
+
export interface RecoveryFunding {
|
|
1819
|
+
singleUtxoSats: number;
|
|
1820
|
+
perBranch: PerBranchFunding[];
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
export interface RecoveryTransaction {
|
|
1824
|
+
kind: RecoveryTxKind;
|
|
1825
|
+
nodeId?: string;
|
|
1826
|
+
txid: string;
|
|
1827
|
+
txHex: string;
|
|
1828
|
+
cpfpTxHex?: string;
|
|
1829
|
+
csvTimelockBlocks?: number;
|
|
1830
|
+
dependsOn: string[];
|
|
1831
|
+
status: ExitTransactionStatus;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1629
1834
|
export interface RefundDepositRequest {
|
|
1630
1835
|
txid: string;
|
|
1631
1836
|
vout: number;
|
|
@@ -1676,6 +1881,10 @@ export interface RestResponse {
|
|
|
1676
1881
|
body: string;
|
|
1677
1882
|
}
|
|
1678
1883
|
|
|
1884
|
+
export interface RevokeTokenAllowanceRequest {
|
|
1885
|
+
allowanceId: string;
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1679
1888
|
export interface SchnorrSignatureBytes {
|
|
1680
1889
|
bytes: number[];
|
|
1681
1890
|
}
|
|
@@ -1754,6 +1963,12 @@ export interface SilentPaymentAddressDetails {
|
|
|
1754
1963
|
source: PaymentRequestSource;
|
|
1755
1964
|
}
|
|
1756
1965
|
|
|
1966
|
+
export interface SkippedLeaf {
|
|
1967
|
+
leafId: string;
|
|
1968
|
+
valueSats: number;
|
|
1969
|
+
reason: SkippedLeafReason;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1757
1972
|
export interface SparkAddressDetails {
|
|
1758
1973
|
address: string;
|
|
1759
1974
|
identityPublicKey: string;
|
|
@@ -1787,7 +2002,7 @@ export interface SparkInvoiceDetails {
|
|
|
1787
2002
|
invoice: string;
|
|
1788
2003
|
identityPublicKey: string;
|
|
1789
2004
|
network: BitcoinNetwork;
|
|
1790
|
-
amount?:
|
|
2005
|
+
amount?: bigint;
|
|
1791
2006
|
tokenIdentifier?: string;
|
|
1792
2007
|
expiryTime?: number;
|
|
1793
2008
|
description?: string;
|
|
@@ -1853,6 +2068,8 @@ export interface Storage {
|
|
|
1853
2068
|
updateDeposit: (txid: string, vout: number, payload: UpdateDepositPayload) => Promise<void>;
|
|
1854
2069
|
listWatchedDepositAddresses: () => Promise<WatchedDepositAddress[]>;
|
|
1855
2070
|
updateWatchedDepositAddress: (address: string, payload: UpdateWatchedAddressPayload) => Promise<void>;
|
|
2071
|
+
listLeafRecoveries: () => Promise<LeafRecovery[]>;
|
|
2072
|
+
updateLeafRecovery: (update: UpdateLeafRecovery) => Promise<void>;
|
|
1856
2073
|
setLnurlMetadata: (metadata: SetLnurlMetadataItem[]) => Promise<void>;
|
|
1857
2074
|
getPaymentsByParentIds: (parentPaymentIds: string[]) => Promise<{ [parentId: string]: RelatedPayment[] }>;
|
|
1858
2075
|
listContacts: (request: ListContactsRequest) => Promise<Contact[]>;
|
|
@@ -1894,6 +2111,14 @@ export interface StoredCrossChainSwap {
|
|
|
1894
2111
|
secrets: string;
|
|
1895
2112
|
}
|
|
1896
2113
|
|
|
2114
|
+
export interface StoredWatchtowerExitOutput {
|
|
2115
|
+
txid: string;
|
|
2116
|
+
vout: number;
|
|
2117
|
+
amountSats: number;
|
|
2118
|
+
scriptPubkey: string;
|
|
2119
|
+
blockHeight: number;
|
|
2120
|
+
}
|
|
2121
|
+
|
|
1897
2122
|
export interface Symbol {
|
|
1898
2123
|
grapheme?: string;
|
|
1899
2124
|
template?: string;
|
|
@@ -1905,6 +2130,21 @@ export interface SyncWalletRequest {}
|
|
|
1905
2130
|
|
|
1906
2131
|
export interface SyncWalletResponse {}
|
|
1907
2132
|
|
|
2133
|
+
export interface TokenAllowance {
|
|
2134
|
+
id: string;
|
|
2135
|
+
ownerAddress: string;
|
|
2136
|
+
spenderAddress: string;
|
|
2137
|
+
tokenIdentifier: string;
|
|
2138
|
+
maxPerPayment: TokenAllowanceLimit;
|
|
2139
|
+
maxTotal: TokenAllowanceLimit;
|
|
2140
|
+
spentAmount: bigint;
|
|
2141
|
+
allowedRecipients: string[];
|
|
2142
|
+
expiryTime: number;
|
|
2143
|
+
createdAt: number;
|
|
2144
|
+
revokedAt?: number;
|
|
2145
|
+
status: TokenAllowanceStatus;
|
|
2146
|
+
}
|
|
2147
|
+
|
|
1908
2148
|
export interface TokenBalance {
|
|
1909
2149
|
balance: bigint;
|
|
1910
2150
|
tokenMetadata: TokenMetadata;
|
|
@@ -1916,7 +2156,7 @@ export interface TokenMetadata {
|
|
|
1916
2156
|
name: string;
|
|
1917
2157
|
ticker: string;
|
|
1918
2158
|
decimals: number;
|
|
1919
|
-
maxSupply:
|
|
2159
|
+
maxSupply: bigint;
|
|
1920
2160
|
isFreezable: boolean;
|
|
1921
2161
|
}
|
|
1922
2162
|
|
|
@@ -1974,38 +2214,6 @@ export interface UnfreezeIssuerTokenResponse {
|
|
|
1974
2214
|
impactedTokenAmount: bigint;
|
|
1975
2215
|
}
|
|
1976
2216
|
|
|
1977
|
-
export interface UnilateralExitLeaf {
|
|
1978
|
-
leafId: string;
|
|
1979
|
-
value: number;
|
|
1980
|
-
}
|
|
1981
|
-
|
|
1982
|
-
export interface UnilateralExitRequest {
|
|
1983
|
-
prepared: PrepareUnilateralExitResponse;
|
|
1984
|
-
fundingInputs: CpfpInput[];
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
export interface UnilateralExitResponse {
|
|
1988
|
-
recoverableValueSat: number;
|
|
1989
|
-
totalFeeSat: number;
|
|
1990
|
-
cpfpFeeSat: number;
|
|
1991
|
-
fanoutFeeSat: number;
|
|
1992
|
-
sweepFeeSat: number;
|
|
1993
|
-
leaves: UnilateralExitLeaf[];
|
|
1994
|
-
transactions: UnilateralExitTransaction[];
|
|
1995
|
-
fundingInputs: CpfpInput[];
|
|
1996
|
-
}
|
|
1997
|
-
|
|
1998
|
-
export interface UnilateralExitTransaction {
|
|
1999
|
-
kind: UnilateralExitTxKind;
|
|
2000
|
-
nodeId?: string;
|
|
2001
|
-
txid: string;
|
|
2002
|
-
txHex: string;
|
|
2003
|
-
cpfpTxHex?: string;
|
|
2004
|
-
csvTimelockBlocks?: number;
|
|
2005
|
-
dependsOn: string[];
|
|
2006
|
-
status: ExitTransactionStatus;
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
2217
|
export interface UnregisterWebhookRequest {
|
|
2010
2218
|
webhookId: string;
|
|
2011
2219
|
}
|
|
@@ -2022,6 +2230,15 @@ export interface UpdateContactRequest {
|
|
|
2022
2230
|
paymentIdentifier: string;
|
|
2023
2231
|
}
|
|
2024
2232
|
|
|
2233
|
+
export interface UpdateLeafRecovery {
|
|
2234
|
+
leafId: string;
|
|
2235
|
+
chainCheckedAt?: number;
|
|
2236
|
+
watchtowerExitOutput?: StoredWatchtowerExitOutput;
|
|
2237
|
+
watchtowerExitRecovery?: WatchtowerExitRecovery;
|
|
2238
|
+
watchtowerExitSpend?: ChainTransaction;
|
|
2239
|
+
unilateralExitSweep?: ChainTransaction;
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2025
2242
|
export interface UpdateUserSettingsRequest {
|
|
2026
2243
|
sparkPrivateModeEnabled?: boolean;
|
|
2027
2244
|
stableBalanceActiveLabel?: StableBalanceActiveLabel;
|
|
@@ -2053,6 +2270,12 @@ export interface WatchedDepositAddress {
|
|
|
2053
2270
|
seen: boolean;
|
|
2054
2271
|
}
|
|
2055
2272
|
|
|
2273
|
+
export interface WatchtowerExitRecovery {
|
|
2274
|
+
txid: string;
|
|
2275
|
+
transactionHex: string;
|
|
2276
|
+
outputAmountSats: number;
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2056
2279
|
export interface Webhook {
|
|
2057
2280
|
id: string;
|
|
2058
2281
|
url: string;
|
|
@@ -2075,7 +2298,7 @@ export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "r
|
|
|
2075
2298
|
|
|
2076
2299
|
export type BuildTransferPackageOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number };
|
|
2077
2300
|
|
|
2078
|
-
export type BuyBitcoinRequest = { type: "moonpay";
|
|
2301
|
+
export type BuyBitcoinRequest = { type: "moonpay"; delivery?: MoonpayDelivery; redirectUrl?: string } | { type: "cashApp"; amountSats: number };
|
|
2079
2302
|
|
|
2080
2303
|
export type ChainApiType = "esplora" | "mempoolSpace";
|
|
2081
2304
|
|
|
@@ -2087,7 +2310,7 @@ export type ConversionChain = { type: "spark" } | { type: "lightning" } | { type
|
|
|
2087
2310
|
|
|
2088
2311
|
export type ConversionFilter = "ammRefundNeeded" | "orchestraPending" | "boltzPending";
|
|
2089
2312
|
|
|
2090
|
-
export type ConversionInfo = { type: "amm"; poolId: string; conversionId: string; status: ConversionStatus; fee?:
|
|
2313
|
+
export type ConversionInfo = { type: "amm"; poolId: string; conversionId: string; status: ConversionStatus; fee?: bigint; purpose?: ConversionPurpose; amountAdjustment?: AmountAdjustmentReason; degradation?: SwapDegradation } | { type: "orchestra"; chain: string; chainId?: string; asset?: string; assetContract?: string; recipientAddress: string; assetAmountIn?: bigint; estimatedOut: bigint; deliveredAmount?: bigint; externalTxHash?: string; status: ConversionStatus; feeAmount?: bigint; serviceFeeAmount?: bigint; serviceFeeAsset?: string; serviceFeeAssetDecimals?: number; assetDecimals: number; orderId: string; quoteId: string; readToken?: string } | { type: "boltz"; chain: string; chainId?: string; asset?: string; assetContract?: string; recipientAddress: string; assetAmountIn?: bigint; estimatedOut: bigint; deliveredAmount?: bigint; status: ConversionStatus; feeAmount?: bigint; serviceFeeAmount?: bigint; serviceFeeAsset?: string; assetDecimals: number; swapId: string; invoice: string; invoiceAmountSats: number; bridgeRef?: string; maxSlippageBps: number; quoteDegraded?: boolean };
|
|
2091
2314
|
|
|
2092
2315
|
export type ConversionProvider = "amm" | "orchestra" | "boltz";
|
|
2093
2316
|
|
|
@@ -2097,9 +2320,11 @@ export type ConversionStatus = "pending" | "completed" | "failed" | "refundNeede
|
|
|
2097
2320
|
|
|
2098
2321
|
export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
|
|
2099
2322
|
|
|
2323
|
+
export type CooperativeRecoveryError = { type: "replacementFeeTooLow"; requiredFeeSats: number; requiredFeeRateSatPerVbyte: number } | { type: "operatorsUnavailable"; message: string } | { type: "generic"; message: string };
|
|
2324
|
+
|
|
2100
2325
|
export type CpfpFundingKind = { type: "p2wpkh" } | { type: "p2tr" } | { type: "custom"; scriptPubkeyHex: string; signedInputWeight: number };
|
|
2101
2326
|
|
|
2102
|
-
export type CpfpInput = { type: "p2wpkh"; txid: string; vout: number;
|
|
2327
|
+
export type CpfpInput = { type: "p2wpkh"; txid: string; vout: number; valueSats: number; pubkey: string } | { type: "p2tr"; txid: string; vout: number; valueSats: number; pubkey: string } | { type: "custom"; txid: string; vout: number; valueSats: number; scriptPubkeyHex: string; signedInputWeight: number };
|
|
2103
2328
|
|
|
2104
2329
|
export type CrossChainAddressFamily = "evm" | "solana" | "tron";
|
|
2105
2330
|
|
|
@@ -2107,19 +2332,19 @@ export type CrossChainFeeMode = "feesExcluded" | "feesIncluded";
|
|
|
2107
2332
|
|
|
2108
2333
|
export type CrossChainProvider = "orchestra" | "boltz";
|
|
2109
2334
|
|
|
2110
|
-
export type CrossChainProviderContext = { type: "orchestra"; quoteId: string; depositAddress: string; depositAmount?:
|
|
2335
|
+
export type CrossChainProviderContext = { type: "orchestra"; quoteId: string; depositAddress: string; depositAmount?: bigint } | { type: "boltz"; swapId: string; invoice: string; invoiceAmountSats?: number; maxSlippageBps: number };
|
|
2111
2336
|
|
|
2112
|
-
export type CrossChainRouteFilter = { type: "send"; addressDetails: CrossChainAddressDetails } | { type: "receive"; contractAddress?: string } | { type: "paymentLink"; addressDetails: CrossChainAddressDetails };
|
|
2337
|
+
export type CrossChainRouteFilter = { type: "send"; addressDetails: CrossChainAddressDetails; deliveryMethod?: DeliveryMethod } | { type: "receive"; contractAddress?: string; deliveryMethod?: DeliveryMethod } | { type: "paymentLink"; addressDetails: CrossChainAddressDetails };
|
|
2113
2338
|
|
|
2114
2339
|
export type DeliveryMethod = "spark" | "lightning" | "bitcoin";
|
|
2115
2340
|
|
|
2116
|
-
export type DepositClaimError = { type: "maxDepositClaimFeeExceeded"; tx: string; vout: number;
|
|
2341
|
+
export type DepositClaimError = { type: "maxDepositClaimFeeExceeded"; tx: string; vout: number; maxFeeSats?: number; requiredFeeSats: number } | { type: "missingUtxo"; tx: string; vout: number } | { type: "depositTooSmall"; tx: string; vout: number } | { type: "generic"; message: string };
|
|
2117
2342
|
|
|
2118
|
-
export type ExitLeafSelection = { type: "
|
|
2343
|
+
export type ExitLeafSelection = { type: "all" } | { type: "recoverableOnly" } | { type: "specific"; leafIds: string[] };
|
|
2119
2344
|
|
|
2120
2345
|
export type ExitNodeConfirmation = "cpfp" | "direct";
|
|
2121
2346
|
|
|
2122
|
-
export type ExitRefundState = { type: "onChain"; txHex: string; vout: number;
|
|
2347
|
+
export type ExitRefundState = { type: "onChain"; txHex: string; vout: number; valueSats: number; blockHeight?: number } | { type: "swept" };
|
|
2123
2348
|
|
|
2124
2349
|
export type ExitTransactionStatus = { type: "confirmed"; blockHeight?: number } | { type: "ready" } | { type: "waitingForDependencies" } | { type: "waitingForTimelock"; spendableAtHeight?: number } | { type: "unverified" };
|
|
2125
2350
|
|
|
@@ -2127,7 +2352,7 @@ export type ExternalFrostDerivation = { type: "signingLeaf"; leafId: ExternalTre
|
|
|
2127
2352
|
|
|
2128
2353
|
export type ExternalSparkInvoiceKind = "sats" | "tokens";
|
|
2129
2354
|
|
|
2130
|
-
export type ExternalTokenTransactionKind = "freeze" | "partial" | "final";
|
|
2355
|
+
export type ExternalTokenTransactionKind = "freeze" | "partial" | "final" | "allowanceGrant" | "allowanceRevoke" | "allowanceSpend";
|
|
2131
2356
|
|
|
2132
2357
|
export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
|
|
2133
2358
|
|
|
@@ -2139,7 +2364,9 @@ export type InstantClaimStatus = { type: "declined"; maxFeeSats?: number; confir
|
|
|
2139
2364
|
|
|
2140
2365
|
export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
|
|
2141
2366
|
|
|
2142
|
-
export type
|
|
2367
|
+
export type MaxOnchainFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
|
|
2368
|
+
|
|
2369
|
+
export type MoonpayDelivery = { type: "bitcoin"; amountSat?: number } | { type: "crossChain"; amount: bigint; feeMode?: CrossChainFeeMode };
|
|
2143
2370
|
|
|
2144
2371
|
export type Network = "mainnet" | "regtest" | "signet";
|
|
2145
2372
|
|
|
@@ -2169,15 +2396,23 @@ export type PublishSignedLnurlPayResponse = { type: "swapCompleted" } | { type:
|
|
|
2169
2396
|
|
|
2170
2397
|
export type PublishSignedTransferPackageResponse = { type: "swapCompleted" } | { type: "paymentSent"; payment: Payment } | { type: "paymentsSent"; payments: Payment[] };
|
|
2171
2398
|
|
|
2172
|
-
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?:
|
|
2399
|
+
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: bigint; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress"; newAddress?: boolean } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number; paymentHash?: string; receiverIdentityPublicKey?: string } | { type: "crossChain"; route: CrossChainRoutePair; amount: bigint; destination?: SparkAsset; feeMode?: CrossChainFeeMode; maxSlippageBps?: number; targetOverpayBps?: number };
|
|
2400
|
+
|
|
2401
|
+
export type RecoveryMethod = "cooperative" | "unilateral";
|
|
2402
|
+
|
|
2403
|
+
export type RecoveryRedoReason = "onChainStateDiverged";
|
|
2404
|
+
|
|
2405
|
+
export type RecoveryTxKind = "cooperative" | "fanOut" | "node" | "refund" | "sweep";
|
|
2406
|
+
|
|
2407
|
+
export type RecoveryVerdict = { type: "valid" } | { type: "done" } | { type: "redo"; reason: RecoveryRedoReason };
|
|
2173
2408
|
|
|
2174
2409
|
export type RefundState = { type: "broadcastPending"; lastError?: string } | { type: "broadcast" };
|
|
2175
2410
|
|
|
2176
|
-
export type SdkEvent = { type: "synced" } | { type: "unclaimedDeposits"; unclaimedDeposits: DepositInfo[] } | { type: "claimedDeposits"; claimedDeposits: DepositInfo[] } | { type: "paymentSucceeded"; payment: Payment } | { type: "paymentPending"; payment: Payment } | { type: "paymentFailed"; payment: Payment } | { type: "paymentMetadataUpdated"; payment: Payment } | { type: "autoOptimization"; optimizationEvent: AutoOptimizationEvent } | { type: "lightningAddressChanged"; lightningAddress?: LightningAddressInfo } | { type: "newDeposits"; newDeposits: DepositInfo[] } | { type: "unilateralExitStateChanged" } | { type: "stableBalanceConversionFailed"; conversion: StableBalanceConversionKind; error: string; retryInSecs?: number };
|
|
2411
|
+
export type SdkEvent = { type: "synced" } | { type: "unclaimedDeposits"; unclaimedDeposits: DepositInfo[] } | { type: "claimedDeposits"; claimedDeposits: DepositInfo[] } | { type: "paymentSucceeded"; payment: Payment } | { type: "paymentPending"; payment: Payment } | { type: "paymentFailed"; payment: Payment } | { type: "paymentMetadataUpdated"; payment: Payment } | { type: "autoOptimization"; optimizationEvent: AutoOptimizationEvent } | { type: "lightningAddressChanged"; lightningAddress?: LightningAddressInfo } | { type: "newDeposits"; newDeposits: DepositInfo[] } | { type: "unilateralExitStateChanged" } | { type: "stableBalanceConversionFailed"; conversion: StableBalanceConversionKind; error: string; retryInSecs?: number } | { type: "recoverableFunds"; recoverableFundsSats: number };
|
|
2177
2412
|
|
|
2178
2413
|
export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
|
|
2179
2414
|
|
|
2180
|
-
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee:
|
|
2415
|
+
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: bigint; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: bigint; tokenIdentifier?: string } | { type: "crossChainAddress"; route: CrossChainRoutePair; recipientAddress: string; amountIn: bigint; assetAmountIn: bigint; estimatedOut: bigint; feeAmount: bigint; serviceFeeAmount: bigint; serviceFeeAsset?: string; serviceFeeAssetDecimals?: number; sourceTransferFeeSats: number; feeMode: CrossChainFeeMode; expiresAt: string; providerContext: CrossChainProviderContext };
|
|
2181
2416
|
|
|
2182
2417
|
export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
|
|
2183
2418
|
|
|
@@ -2185,6 +2420,8 @@ export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" |
|
|
|
2185
2420
|
|
|
2186
2421
|
export type SessionStoreError = { type: "notFound" } | ({ type: "generic" } & string);
|
|
2187
2422
|
|
|
2423
|
+
export type SkippedLeafReason = { type: "feeExceedsValue" } | { type: "fundsNotFound" } | { type: "unverified" } | { type: "notRecoverable"; message: string };
|
|
2424
|
+
|
|
2188
2425
|
export type SparkAsset = { type: "bitcoin" } | { type: "token"; tokenIdentifier: string };
|
|
2189
2426
|
|
|
2190
2427
|
export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
|
|
@@ -2203,19 +2440,19 @@ export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionData
|
|
|
2203
2440
|
|
|
2204
2441
|
export type SwapDegradation = "belowMinimum" | "unexpectedAsset" | "missingInfo";
|
|
2205
2442
|
|
|
2206
|
-
export type
|
|
2443
|
+
export type TokenAllowanceLimit = { type: "unlimited" } | { type: "amount"; amount: bigint };
|
|
2207
2444
|
|
|
2208
|
-
export type
|
|
2445
|
+
export type TokenAllowanceRole = "owner" | "spender";
|
|
2209
2446
|
|
|
2210
|
-
export type
|
|
2447
|
+
export type TokenAllowanceStatus = "active" | "exhausted" | "expired" | "revoked";
|
|
2211
2448
|
|
|
2212
|
-
export type
|
|
2449
|
+
export type TokenTransactionType = "transfer" | "mint" | "burn";
|
|
2213
2450
|
|
|
2214
|
-
export type
|
|
2451
|
+
export type TransferSignature = { type: "transfer"; signed: ExternalPreparedTransfer } | { type: "token"; signed: ExternalPreparedTokenTransaction };
|
|
2215
2452
|
|
|
2216
|
-
export type
|
|
2453
|
+
export type TransferTarget = { type: "spark"; address: string; sparkInvoice?: string } | { type: "lightning"; bolt11: string; lnurlPay?: LnurlPayContext; feePolicy: FeePolicy; completionTimeoutSecs?: number } | { type: "coopExit"; address: string; feeQuote: SendOnchainFeeQuote; confirmationSpeed: OnchainConfirmationSpeed };
|
|
2217
2454
|
|
|
2218
|
-
export type UnsignedTransferPackage = { type: "swap"; prepareTransfer: ExternalPrepareTransferRequest; targetAmounts: number[]; amountSat: number; feeSat: number } | { type: "transfer"; prepareTransfer: ExternalPrepareTransferRequest; amountSat: number; feeSat: number; target: TransferTarget } | { type: "token"; prepareTokenTransaction: ExternalPrepareTokenTransactionRequest; tokenContext: number[]; tokenIdentifier: string; amount:
|
|
2455
|
+
export type UnsignedTransferPackage = { type: "swap"; prepareTransfer: ExternalPrepareTransferRequest; targetAmounts: number[]; amountSat: number; feeSat: number } | { type: "transfer"; prepareTransfer: ExternalPrepareTransferRequest; amountSat: number; feeSat: number; target: TransferTarget } | { type: "token"; prepareTokenTransaction: ExternalPrepareTokenTransactionRequest; tokenContext: number[]; tokenIdentifier: string; amount: bigint; fee: bigint; isSwap: boolean } | { type: "tokenBatch"; prepareTokenTransaction: ExternalPrepareTokenTransactionRequest; tokenContext: number[]; totals: BatchTotal[]; isSwap: boolean } | { type: "tokenPull"; prepareTokenTransaction: ExternalPrepareTokenTransactionRequest; pullContext: number[]; payerAddress: string; tokenIdentifier: string; receivers: PullReceiver[]; amount: bigint; expiryTime: number };
|
|
2219
2456
|
|
|
2220
2457
|
export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string; state: RefundState } | { type: "instantClaim"; status: InstantClaimStatus } | { type: "refundBroadcastState"; refundTxid: string; state: RefundState } | { type: "maxClaimFee"; maxFee?: MaxFee };
|
|
2221
2458
|
|
|
@@ -2253,16 +2490,20 @@ export class BreezSdk {
|
|
|
2253
2490
|
addContact(request: AddContactRequest): Promise<Contact>;
|
|
2254
2491
|
addEventListener(listener: EventListener): Promise<string>;
|
|
2255
2492
|
authorizeLightningAddressTransfer(request: AuthorizeTransferRequest): Promise<TransferAuthorization>;
|
|
2493
|
+
bridgeFromCashApp(request: BridgeFromCashAppRequest): Promise<BridgeFromCashAppResponse>;
|
|
2494
|
+
bridgeToCashApp(request: BridgeToCashAppRequest): Promise<BridgeToCashAppResponse>;
|
|
2256
2495
|
buildUnsignedBatchPackage(request: BuildUnsignedBatchPackageRequest): Promise<UnsignedTransferPackage>;
|
|
2257
2496
|
buildUnsignedLnurlPayPackage(request: BuildUnsignedLnurlPayPackageRequest): Promise<UnsignedTransferPackage>;
|
|
2497
|
+
buildUnsignedPullPackage(request: BuildUnsignedPullPackageRequest): Promise<UnsignedTransferPackage>;
|
|
2258
2498
|
buildUnsignedTransferPackage(request: BuildUnsignedTransferPackageRequest): Promise<UnsignedTransferPackage>;
|
|
2259
2499
|
buyBitcoin(request: BuyBitcoinRequest): Promise<BuyBitcoinResponse>;
|
|
2260
2500
|
checkLightningAddressAvailable(request: CheckLightningAddressRequest): Promise<boolean>;
|
|
2261
2501
|
checkMessage(request: CheckMessageRequest): Promise<CheckMessageResponse>;
|
|
2262
|
-
|
|
2502
|
+
checkRecoverFunds(request: CheckRecoverFundsRequest): Promise<CheckRecoverFundsResponse>;
|
|
2263
2503
|
claimDeposit(request: ClaimDepositRequest): Promise<ClaimDepositResponse>;
|
|
2264
2504
|
claimHtlcPayment(request: ClaimHtlcPaymentRequest): Promise<ClaimHtlcPaymentResponse>;
|
|
2265
2505
|
claimLightningAddressTransfer(request: ClaimTransferRequest): Promise<LightningAddressInfo>;
|
|
2506
|
+
createTokenAllowance(request: CreateTokenAllowanceRequest): Promise<CreateTokenAllowanceResponse>;
|
|
2266
2507
|
deleteContact(id: string): Promise<void>;
|
|
2267
2508
|
deleteLightningAddress(): Promise<void>;
|
|
2268
2509
|
disconnect(): Promise<void>;
|
|
@@ -2281,6 +2522,7 @@ export class BreezSdk {
|
|
|
2281
2522
|
listFiatCurrencies(): Promise<ListFiatCurrenciesResponse>;
|
|
2282
2523
|
listFiatRates(): Promise<ListFiatRatesResponse>;
|
|
2283
2524
|
listPayments(request: ListPaymentsRequest): Promise<ListPaymentsResponse>;
|
|
2525
|
+
listTokenAllowances(request: ListTokenAllowancesRequest): Promise<ListTokenAllowancesResponse>;
|
|
2284
2526
|
listUnclaimedDeposits(request: ListUnclaimedDepositsRequest): Promise<ListUnclaimedDepositsResponse>;
|
|
2285
2527
|
listWebhooks(): Promise<Webhook[]>;
|
|
2286
2528
|
lnurlAuth(request_data: LnurlAuthRequestDetails): Promise<LnurlCallbackStatus>;
|
|
@@ -2289,24 +2531,31 @@ export class BreezSdk {
|
|
|
2289
2531
|
optimizeLeaves(request: OptimizeLeavesRequest): Promise<OptimizeLeavesResponse>;
|
|
2290
2532
|
parse(input: string): Promise<InputType>;
|
|
2291
2533
|
prepareLnurlPay(request: PrepareLnurlPayRequest): Promise<PrepareLnurlPayResponse>;
|
|
2534
|
+
/**
|
|
2535
|
+
* @deprecated Use `bridgeFromCashApp`.
|
|
2536
|
+
*/
|
|
2292
2537
|
preparePaymentLink(request: PreparePaymentLinkRequest): Promise<PreparePaymentLinkResponse>;
|
|
2538
|
+
preparePullPayment(request: PreparePullPaymentRequest): Promise<PreparePullPaymentResponse>;
|
|
2539
|
+
prepareRecoverFunds(request: PrepareRecoverFundsRequest): Promise<PrepareRecoverFundsResponse>;
|
|
2293
2540
|
prepareSendBatch(request: PrepareSendBatchRequest): Promise<PrepareSendBatchResponse>;
|
|
2294
2541
|
prepareSendPayment(request: PrepareSendPaymentRequest): Promise<PrepareSendPaymentResponse>;
|
|
2295
|
-
prepareUnilateralExit(request: PrepareUnilateralExitRequest): Promise<PrepareUnilateralExitResponse>;
|
|
2296
2542
|
publishSignedLnurlPayPackage(request: PublishSignedLnurlPayPackageRequest): Promise<PublishSignedLnurlPayResponse>;
|
|
2543
|
+
publishSignedPullPackage(request: PublishSignedPullPackageRequest): Promise<PullPaymentResponse>;
|
|
2297
2544
|
publishSignedTransferPackage(request: PublishSignedTransferPackageRequest): Promise<PublishSignedTransferPackageResponse>;
|
|
2545
|
+
pullPayment(request: PullPaymentRequest): Promise<PullPaymentResponse>;
|
|
2298
2546
|
receivePayment(request: ReceivePaymentRequest): Promise<ReceivePaymentResponse>;
|
|
2299
2547
|
recommendedFees(): Promise<RecommendedFees>;
|
|
2548
|
+
recoverFunds(request: RecoverFundsRequest, signer?: CpfpSigner | null): Promise<RecoverFundsResponse>;
|
|
2300
2549
|
refundDeposit(request: RefundDepositRequest): Promise<RefundDepositResponse>;
|
|
2301
2550
|
refundPendingConversions(): Promise<RefundPendingConversionsResponse>;
|
|
2302
2551
|
registerLightningAddress(request: RegisterLightningAddressRequest): Promise<LightningAddressInfo>;
|
|
2303
2552
|
registerWebhook(request: RegisterWebhookRequest): Promise<RegisterWebhookResponse>;
|
|
2304
2553
|
removeEventListener(id: string): Promise<boolean>;
|
|
2554
|
+
revokeTokenAllowance(request: RevokeTokenAllowanceRequest): Promise<void>;
|
|
2305
2555
|
sendBatch(request: SendBatchRequest): Promise<SendBatchResponse>;
|
|
2306
2556
|
sendPayment(request: SendPaymentRequest): Promise<SendPaymentResponse>;
|
|
2307
2557
|
signMessage(request: SignMessageRequest): Promise<SignMessageResponse>;
|
|
2308
2558
|
syncWallet(request: SyncWalletRequest): Promise<SyncWalletResponse>;
|
|
2309
|
-
unilateralExit(request: UnilateralExitRequest, signer: CpfpSigner): Promise<UnilateralExitResponse>;
|
|
2310
2559
|
unregisterWebhook(request: UnregisterWebhookRequest): Promise<void>;
|
|
2311
2560
|
updateContact(request: UpdateContactRequest): Promise<Contact>;
|
|
2312
2561
|
updateUserSettings(request: UpdateUserSettingsRequest): Promise<void>;
|
|
@@ -2409,6 +2658,7 @@ export class ExternalSparkSignerHandle {
|
|
|
2409
2658
|
getIdentityPublicKey(): Promise<PublicKeyBytes>;
|
|
2410
2659
|
getPublicKeyForLeaf(leaf_id: ExternalTreeNodeId): Promise<PublicKeyBytes>;
|
|
2411
2660
|
getStaticDepositPublicKey(index: number): Promise<PublicKeyBytes>;
|
|
2661
|
+
isRemote(): boolean;
|
|
2412
2662
|
prepareClaim(request: ExternalPrepareClaimRequest): Promise<ExternalPreparedClaim>;
|
|
2413
2663
|
prepareLightningReceive(request: ExternalPrepareLightningReceiveRequest): Promise<ExternalPreparedLightningReceive>;
|
|
2414
2664
|
prepareStaticDeposit(request: ExternalPrepareStaticDepositRequest): Promise<ExternalPreparedStaticDeposit>;
|
|
@@ -2421,7 +2671,9 @@ export class ExternalSparkSignerHandle {
|
|
|
2421
2671
|
signMessage(message: Uint8Array): Promise<EcdsaSignatureBytes>;
|
|
2422
2672
|
signSparkInvoice(request: ExternalSignSparkInvoiceRequest): Promise<ExternalSignedSparkInvoice>;
|
|
2423
2673
|
signStaticDepositRefund(request: ExternalSignStaticDepositRefundRequest): Promise<ExternalFrostSignature>;
|
|
2674
|
+
signWatchtowerExitRecovery(request: ExternalSignWatchtowerExitRecoveryRequest): Promise<ExternalFrostSignature>;
|
|
2424
2675
|
startStaticDepositRefund(request: ExternalStartStaticDepositRefundRequest): Promise<ExternalStartedStaticDepositRefund>;
|
|
2676
|
+
startWatchtowerExitRecovery(request: ExternalStartWatchtowerExitRecoveryRequest): Promise<ExternalStartedWatchtowerExitRecovery>;
|
|
2425
2677
|
}
|
|
2426
2678
|
|
|
2427
2679
|
export class IntoUnderlyingByteSource {
|