@breeztech/breez-sdk-spark 0.25.0 → 0.26.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 +44 -10
- package/bundler/breez_sdk_spark_wasm_bg.js +40 -24
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -5
- package/bundler/storage/index.js +145 -1
- package/deno/breez_sdk_spark_wasm.d.ts +44 -10
- package/deno/breez_sdk_spark_wasm.js +40 -24
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -5
- package/nodejs/breez_sdk_spark_wasm.d.ts +44 -10
- package/nodejs/breez_sdk_spark_wasm.js +40 -24
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -5
- package/nodejs/mysql-storage/index.cjs +67 -1
- package/nodejs/mysql-storage/migrations.cjs +23 -0
- package/nodejs/postgres-storage/index.cjs +67 -1
- package/nodejs/postgres-storage/migrations.cjs +23 -0
- package/nodejs/storage/index.cjs +81 -1
- package/nodejs/storage/migrations.cjs +21 -0
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +49 -15
- package/web/breez_sdk_spark_wasm.js +40 -24
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -5
- package/web/storage/index.js +145 -1
package/breez-sdk-spark.tgz
CHANGED
|
Binary file
|
|
@@ -545,7 +545,7 @@ export interface BatchRecipient {
|
|
|
545
545
|
|
|
546
546
|
export interface BatchTotal {
|
|
547
547
|
tokenIdentifier?: string;
|
|
548
|
-
amount:
|
|
548
|
+
amount: string;
|
|
549
549
|
}
|
|
550
550
|
|
|
551
551
|
export interface Bip21Details {
|
|
@@ -705,7 +705,7 @@ export interface ClaimDepositRequest {
|
|
|
705
705
|
}
|
|
706
706
|
|
|
707
707
|
export interface ClaimDepositResponse {
|
|
708
|
-
|
|
708
|
+
outcome: ClaimDepositOutcome;
|
|
709
709
|
}
|
|
710
710
|
|
|
711
711
|
export interface ClaimHtlcPaymentRequest {
|
|
@@ -832,12 +832,17 @@ export interface Credentials {
|
|
|
832
832
|
password: string;
|
|
833
833
|
}
|
|
834
834
|
|
|
835
|
+
export interface CrossChainAcceptedAsset {
|
|
836
|
+
asset: SparkAsset;
|
|
837
|
+
limits?: CrossChainRouteLimits;
|
|
838
|
+
}
|
|
839
|
+
|
|
835
840
|
export interface CrossChainAddressDetails {
|
|
836
841
|
address: string;
|
|
837
842
|
addressFamily: CrossChainAddressFamily;
|
|
838
843
|
contractAddress?: string;
|
|
839
844
|
chainId?: number;
|
|
840
|
-
amount?:
|
|
845
|
+
amount?: string;
|
|
841
846
|
}
|
|
842
847
|
|
|
843
848
|
export interface CrossChainConfig {
|
|
@@ -853,9 +858,17 @@ export interface CrossChainReceiveInfo {
|
|
|
853
858
|
tokenIdentifier?: string;
|
|
854
859
|
serviceFeeAmount: string;
|
|
855
860
|
serviceFeeAsset?: string;
|
|
861
|
+
serviceFeeAssetDecimals?: number;
|
|
856
862
|
expiresAt: number;
|
|
857
863
|
}
|
|
858
864
|
|
|
865
|
+
export interface CrossChainRouteLimits {
|
|
866
|
+
minAmount?: string;
|
|
867
|
+
maxAmount?: string;
|
|
868
|
+
minUsdCents?: number;
|
|
869
|
+
maxUsdCents?: number;
|
|
870
|
+
}
|
|
871
|
+
|
|
859
872
|
export interface CrossChainRoutePair {
|
|
860
873
|
provider: CrossChainProvider;
|
|
861
874
|
chain: string;
|
|
@@ -864,7 +877,7 @@ export interface CrossChainRoutePair {
|
|
|
864
877
|
contractAddress?: string;
|
|
865
878
|
decimals: number;
|
|
866
879
|
exactOutEligible: boolean;
|
|
867
|
-
acceptedAssets:
|
|
880
|
+
acceptedAssets: CrossChainAcceptedAsset[];
|
|
868
881
|
deliveryMethods: DeliveryMethod[];
|
|
869
882
|
}
|
|
870
883
|
|
|
@@ -888,6 +901,7 @@ export interface DepositInfo {
|
|
|
888
901
|
claimError?: DepositClaimError;
|
|
889
902
|
instantClaimStatus?: InstantClaimStatus;
|
|
890
903
|
refundState?: RefundState;
|
|
904
|
+
maxClaimFee?: MaxFee;
|
|
891
905
|
}
|
|
892
906
|
|
|
893
907
|
export interface EcdsaSignatureBytes {
|
|
@@ -968,6 +982,10 @@ export interface ExternalInputParser {
|
|
|
968
982
|
parserUrl: string;
|
|
969
983
|
}
|
|
970
984
|
|
|
985
|
+
export interface ExternalLeafSigningKey {
|
|
986
|
+
derivedFrom: ExternalTreeNodeId;
|
|
987
|
+
}
|
|
988
|
+
|
|
971
989
|
export interface ExternalNewLeafKey {
|
|
972
990
|
nodeId: ExternalTreeNodeId;
|
|
973
991
|
newSigningPublicKey: number[];
|
|
@@ -1114,6 +1132,7 @@ export interface ExternalStartedStaticDepositRefund {
|
|
|
1114
1132
|
export interface ExternalTransferLeafInput {
|
|
1115
1133
|
nodeId: ExternalTreeNodeId;
|
|
1116
1134
|
newLeafId: ExternalTreeNodeId;
|
|
1135
|
+
signingKey: ExternalLeafSigningKey;
|
|
1117
1136
|
}
|
|
1118
1137
|
|
|
1119
1138
|
export interface ExternalTreeNodeId {
|
|
@@ -1486,6 +1505,7 @@ export interface PreparePaymentLinkResponse {
|
|
|
1486
1505
|
asset: string;
|
|
1487
1506
|
serviceFeeAmount: bigint;
|
|
1488
1507
|
serviceFeeAsset?: string;
|
|
1508
|
+
serviceFeeAssetDecimals?: number;
|
|
1489
1509
|
expiresAt: string;
|
|
1490
1510
|
}
|
|
1491
1511
|
|
|
@@ -1831,6 +1851,8 @@ export interface Storage {
|
|
|
1831
1851
|
deleteDeposit: (txid: string, vout: number) => Promise<void>;
|
|
1832
1852
|
listDeposits: () => Promise<DepositInfo[]>;
|
|
1833
1853
|
updateDeposit: (txid: string, vout: number, payload: UpdateDepositPayload) => Promise<void>;
|
|
1854
|
+
listWatchedDepositAddresses: () => Promise<WatchedDepositAddress[]>;
|
|
1855
|
+
updateWatchedDepositAddress: (address: string, payload: UpdateWatchedAddressPayload) => Promise<void>;
|
|
1834
1856
|
setLnurlMetadata: (metadata: SetLnurlMetadataItem[]) => Promise<void>;
|
|
1835
1857
|
getPaymentsByParentIds: (parentPaymentIds: string[]) => Promise<{ [parentId: string]: RelatedPayment[] }>;
|
|
1836
1858
|
listContacts: (request: ListContactsRequest) => Promise<Contact[]>;
|
|
@@ -2025,6 +2047,12 @@ export interface Utxo {
|
|
|
2025
2047
|
status: TxStatus;
|
|
2026
2048
|
}
|
|
2027
2049
|
|
|
2050
|
+
export interface WatchedDepositAddress {
|
|
2051
|
+
address: string;
|
|
2052
|
+
issuedAt: number;
|
|
2053
|
+
seen: boolean;
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2028
2056
|
export interface Webhook {
|
|
2029
2057
|
id: string;
|
|
2030
2058
|
url: string;
|
|
@@ -2051,11 +2079,15 @@ export type BuyBitcoinRequest = { type: "moonpay"; lockedAmountSat?: number; red
|
|
|
2051
2079
|
|
|
2052
2080
|
export type ChainApiType = "esplora" | "mempoolSpace";
|
|
2053
2081
|
|
|
2082
|
+
export type ClaimDeferredReason = { type: "maxFeeExceeded"; requiredFeeSats: number; maxFeeSats: number } | { type: "noEarlyClaimAvailable" } | { type: "providerDeclined"; message: string };
|
|
2083
|
+
|
|
2084
|
+
export type ClaimDepositOutcome = { type: "settled"; payment: Payment } | { type: "submitted" } | { type: "deferred"; reason: ClaimDeferredReason };
|
|
2085
|
+
|
|
2054
2086
|
export type ConversionChain = { type: "spark" } | { type: "lightning" } | { type: "external"; name: string; chainId?: string };
|
|
2055
2087
|
|
|
2056
2088
|
export type ConversionFilter = "ammRefundNeeded" | "orchestraPending" | "boltzPending";
|
|
2057
2089
|
|
|
2058
|
-
export type ConversionInfo = { type: "amm"; poolId: string; conversionId: string; status: ConversionStatus; fee?: string; purpose?: ConversionPurpose; amountAdjustment?: AmountAdjustmentReason; degradation?: SwapDegradation } | { type: "orchestra"; chain: string; chainId?: string; asset?: string; assetContract?: string; recipientAddress: string; assetAmountIn?: string; estimatedOut: string; deliveredAmount?: string; externalTxHash?: string; status: ConversionStatus; feeAmount?: string; serviceFeeAmount?: string; serviceFeeAsset?: string; assetDecimals: number; orderId: string; quoteId: string; readToken?: string } | { type: "boltz"; chain: string; chainId?: string; asset?: string; assetContract?: string; recipientAddress: string; assetAmountIn?: string; estimatedOut: string; deliveredAmount?: string; status: ConversionStatus; feeAmount?: string; serviceFeeAmount?: string; serviceFeeAsset?: string; assetDecimals: number; swapId: string; invoice: string; invoiceAmountSats: number; bridgeRef?: string; maxSlippageBps: number; quoteDegraded?: boolean };
|
|
2090
|
+
export type ConversionInfo = { type: "amm"; poolId: string; conversionId: string; status: ConversionStatus; fee?: string; purpose?: ConversionPurpose; amountAdjustment?: AmountAdjustmentReason; degradation?: SwapDegradation } | { type: "orchestra"; chain: string; chainId?: string; asset?: string; assetContract?: string; recipientAddress: string; assetAmountIn?: string; estimatedOut: string; deliveredAmount?: string; externalTxHash?: string; status: ConversionStatus; feeAmount?: string; serviceFeeAmount?: string; 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?: string; estimatedOut: string; deliveredAmount?: string; status: ConversionStatus; feeAmount?: string; serviceFeeAmount?: string; serviceFeeAsset?: string; assetDecimals: number; swapId: string; invoice: string; invoiceAmountSats: number; bridgeRef?: string; maxSlippageBps: number; quoteDegraded?: boolean };
|
|
2059
2091
|
|
|
2060
2092
|
export type ConversionProvider = "amm" | "orchestra" | "boltz";
|
|
2061
2093
|
|
|
@@ -2103,13 +2135,13 @@ export type FeePolicy = "feesExcluded" | "feesIncluded";
|
|
|
2103
2135
|
|
|
2104
2136
|
export type InputType = ({ type: "bitcoinAddress" } & BitcoinAddressDetails) | ({ type: "bolt11Invoice" } & Bolt11InvoiceDetails) | ({ type: "bolt12Invoice" } & Bolt12InvoiceDetails) | ({ type: "bolt12Offer" } & Bolt12OfferDetails) | ({ type: "lightningAddress" } & LightningAddressDetails) | ({ type: "lnurlPay" } & LnurlPayRequestDetails) | ({ type: "silentPaymentAddress" } & SilentPaymentAddressDetails) | ({ type: "lnurlAuth" } & LnurlAuthRequestDetails) | ({ type: "url" } & string) | ({ type: "bip21" } & Bip21Details) | ({ type: "bolt12InvoiceRequest" } & Bolt12InvoiceRequestDetails) | ({ type: "lnurlWithdraw" } & LnurlWithdrawRequestDetails) | ({ type: "sparkAddress" } & SparkAddressDetails) | ({ type: "sparkInvoice" } & SparkInvoiceDetails) | ({ type: "crossChainAddress" } & CrossChainAddressDetails);
|
|
2105
2137
|
|
|
2106
|
-
export type InstantClaimStatus = { type: "declined"; maxFeeSats?: number; confirmations?: number } | { type: "submitted"; claimId: string };
|
|
2138
|
+
export type InstantClaimStatus = { type: "declined"; maxFeeSats?: number; confirmations?: number } | { type: "submitted"; claimId: string } | { type: "claimed" };
|
|
2107
2139
|
|
|
2108
2140
|
export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
|
|
2109
2141
|
|
|
2110
2142
|
export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
|
|
2111
2143
|
|
|
2112
|
-
export type Network = "mainnet" | "regtest";
|
|
2144
|
+
export type Network = "mainnet" | "regtest" | "signet";
|
|
2113
2145
|
|
|
2114
2146
|
export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
|
|
2115
2147
|
|
|
@@ -2141,11 +2173,11 @@ export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvo
|
|
|
2141
2173
|
|
|
2142
2174
|
export type RefundState = { type: "broadcastPending"; lastError?: string } | { type: "broadcast" };
|
|
2143
2175
|
|
|
2144
|
-
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: "autoOptimization"; optimizationEvent: AutoOptimizationEvent } | { type: "lightningAddressChanged"; lightningAddress?: LightningAddressInfo } | { type: "newDeposits"; newDeposits: DepositInfo[] } | { type: "unilateralExitStateChanged" };
|
|
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" };
|
|
2145
2177
|
|
|
2146
2178
|
export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
|
|
2147
2179
|
|
|
2148
|
-
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string } | { type: "crossChainAddress"; route: CrossChainRoutePair; recipientAddress: string; amountIn: string; assetAmountIn: string; estimatedOut: string; feeAmount: string; serviceFeeAmount: string; serviceFeeAsset?: string; sourceTransferFeeSats: number; feeMode: CrossChainFeeMode; expiresAt: string; providerContext: CrossChainProviderContext };
|
|
2180
|
+
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string } | { type: "crossChainAddress"; route: CrossChainRoutePair; recipientAddress: string; amountIn: string; assetAmountIn: string; estimatedOut: string; feeAmount: string; serviceFeeAmount: string; serviceFeeAsset?: string; serviceFeeAssetDecimals?: number; sourceTransferFeeSats: number; feeMode: CrossChainFeeMode; expiresAt: string; providerContext: CrossChainProviderContext };
|
|
2149
2181
|
|
|
2150
2182
|
export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
|
|
2151
2183
|
|
|
@@ -2183,7 +2215,9 @@ export type UnilateralExitVerdict = { type: "valid" } | { type: "done" } | { typ
|
|
|
2183
2215
|
|
|
2184
2216
|
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: string; fee: string; isSwap: boolean } | { type: "tokenBatch"; prepareTokenTransaction: ExternalPrepareTokenTransactionRequest; tokenContext: number[]; totals: BatchTotal[]; isSwap: boolean };
|
|
2185
2217
|
|
|
2186
|
-
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 };
|
|
2218
|
+
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 };
|
|
2219
|
+
|
|
2220
|
+
export type UpdateWatchedAddressPayload = { type: "watch"; issuedAt: number } | { type: "seen" } | { type: "unwatch"; issuedAt: number };
|
|
2187
2221
|
|
|
2188
2222
|
export type WebhookEventType = { type: "lightningReceiveFinished" } | { type: "lightningSendFinished" } | { type: "coopExitFinished" } | { type: "staticDepositFinished" } | ({ type: "unknown" } & string);
|
|
2189
2223
|
|
|
@@ -2891,6 +2891,10 @@ export function __wbg_listTokensOutputs_3fecc3251ae7b71c() { return handleError(
|
|
|
2891
2891
|
const ret = arg0.listTokensOutputs();
|
|
2892
2892
|
return ret;
|
|
2893
2893
|
}, arguments); }
|
|
2894
|
+
export function __wbg_listWatchedDepositAddresses_55fe8af0643e3ea9() { return handleError(function (arg0) {
|
|
2895
|
+
const ret = arg0.listWatchedDepositAddresses();
|
|
2896
|
+
return ret;
|
|
2897
|
+
}, arguments); }
|
|
2894
2898
|
export function __wbg_log_cf86719f8acabfda(arg0, arg1) {
|
|
2895
2899
|
arg0.log(arg1);
|
|
2896
2900
|
}
|
|
@@ -3590,6 +3594,18 @@ export function __wbg_updateTokenOutputs_d978e01c817e8230() { return handleError
|
|
|
3590
3594
|
const ret = arg0.updateTokenOutputs(arg1, arg2);
|
|
3591
3595
|
return ret;
|
|
3592
3596
|
}, arguments); }
|
|
3597
|
+
export function __wbg_updateWatchedDepositAddress_260322f77dee1443() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
3598
|
+
let deferred0_0;
|
|
3599
|
+
let deferred0_1;
|
|
3600
|
+
try {
|
|
3601
|
+
deferred0_0 = arg1;
|
|
3602
|
+
deferred0_1 = arg2;
|
|
3603
|
+
const ret = arg0.updateWatchedDepositAddress(getStringFromWasm0(arg1, arg2), arg3);
|
|
3604
|
+
return ret;
|
|
3605
|
+
} finally {
|
|
3606
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
3607
|
+
}
|
|
3608
|
+
}, arguments); }
|
|
3593
3609
|
export function __wbg_url_68fd9a221360e0db(arg0, arg1) {
|
|
3594
3610
|
const ret = arg1.url;
|
|
3595
3611
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -3625,47 +3641,47 @@ export function __wbg_wasmsdkcontext_new(arg0) {
|
|
|
3625
3641
|
return ret;
|
|
3626
3642
|
}
|
|
3627
3643
|
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
3628
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
3629
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3644
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3645
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a);
|
|
3630
3646
|
return ret;
|
|
3631
3647
|
}
|
|
3632
3648
|
export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
|
3633
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
3649
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3634
3650
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25);
|
|
3635
3651
|
return ret;
|
|
3636
3652
|
}
|
|
3637
3653
|
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
|
3638
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx:
|
|
3654
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3639
3655
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2);
|
|
3640
3656
|
return ret;
|
|
3641
3657
|
}
|
|
3642
3658
|
export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
|
3643
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx:
|
|
3659
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3644
3660
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3);
|
|
3645
3661
|
return ret;
|
|
3646
3662
|
}
|
|
3647
3663
|
export function __wbindgen_cast_0000000000000005(arg0, arg1) {
|
|
3648
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("SessionStore")], shim_idx:
|
|
3649
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3664
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("SessionStore")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3665
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4);
|
|
3650
3666
|
return ret;
|
|
3651
3667
|
}
|
|
3652
3668
|
export function __wbindgen_cast_0000000000000006(arg0, arg1) {
|
|
3653
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Storage")], shim_idx:
|
|
3654
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3669
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Storage")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3670
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5);
|
|
3655
3671
|
return ret;
|
|
3656
3672
|
}
|
|
3657
3673
|
export function __wbindgen_cast_0000000000000007(arg0, arg1) {
|
|
3658
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TokenStore")], shim_idx:
|
|
3659
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3674
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TokenStore")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3675
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6);
|
|
3660
3676
|
return ret;
|
|
3661
3677
|
}
|
|
3662
3678
|
export function __wbindgen_cast_0000000000000008(arg0, arg1) {
|
|
3663
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TreeStore")], shim_idx:
|
|
3664
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3679
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TreeStore")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3680
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7);
|
|
3665
3681
|
return ret;
|
|
3666
3682
|
}
|
|
3667
3683
|
export function __wbindgen_cast_0000000000000009(arg0, arg1) {
|
|
3668
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
3684
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 409, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3669
3685
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7);
|
|
3670
3686
|
return ret;
|
|
3671
3687
|
}
|
|
@@ -3766,36 +3782,36 @@ function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3(arg0, a
|
|
|
3766
3782
|
wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3(arg0, arg1, arg2);
|
|
3767
3783
|
}
|
|
3768
3784
|
|
|
3769
|
-
function
|
|
3770
|
-
const ret = wasm.
|
|
3785
|
+
function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a(arg0, arg1, arg2) {
|
|
3786
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a(arg0, arg1, arg2);
|
|
3771
3787
|
if (ret[1]) {
|
|
3772
3788
|
throw takeFromExternrefTable0(ret[0]);
|
|
3773
3789
|
}
|
|
3774
3790
|
}
|
|
3775
3791
|
|
|
3776
|
-
function
|
|
3777
|
-
const ret = wasm.
|
|
3792
|
+
function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4(arg0, arg1, arg2) {
|
|
3793
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4(arg0, arg1, arg2);
|
|
3778
3794
|
if (ret[1]) {
|
|
3779
3795
|
throw takeFromExternrefTable0(ret[0]);
|
|
3780
3796
|
}
|
|
3781
3797
|
}
|
|
3782
3798
|
|
|
3783
|
-
function
|
|
3784
|
-
const ret = wasm.
|
|
3799
|
+
function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5(arg0, arg1, arg2) {
|
|
3800
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5(arg0, arg1, arg2);
|
|
3785
3801
|
if (ret[1]) {
|
|
3786
3802
|
throw takeFromExternrefTable0(ret[0]);
|
|
3787
3803
|
}
|
|
3788
3804
|
}
|
|
3789
3805
|
|
|
3790
|
-
function
|
|
3791
|
-
const ret = wasm.
|
|
3806
|
+
function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6(arg0, arg1, arg2) {
|
|
3807
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6(arg0, arg1, arg2);
|
|
3792
3808
|
if (ret[1]) {
|
|
3793
3809
|
throw takeFromExternrefTable0(ret[0]);
|
|
3794
3810
|
}
|
|
3795
3811
|
}
|
|
3796
3812
|
|
|
3797
|
-
function
|
|
3798
|
-
const ret = wasm.
|
|
3813
|
+
function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7(arg0, arg1, arg2) {
|
|
3814
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7(arg0, arg1, arg2);
|
|
3799
3815
|
if (ret[1]) {
|
|
3800
3816
|
throw takeFromExternrefTable0(ret[0]);
|
|
3801
3817
|
}
|
|
Binary file
|
|
@@ -189,11 +189,11 @@ export const __wbg_externalsparksignerhandle_free: (a: number, b: number) => voi
|
|
|
189
189
|
export const __wbg_signingonlyexternalsigners_free: (a: number, b: number) => void;
|
|
190
190
|
export const signingonlyexternalsigners_breezSigner: (a: number) => number;
|
|
191
191
|
export const signingonlyexternalsigners_sparkSigner: (a: number) => number;
|
|
192
|
-
export const
|
|
193
|
-
export const
|
|
194
|
-
export const
|
|
195
|
-
export const
|
|
196
|
-
export const
|
|
192
|
+
export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a: (a: number, b: number, c: any) => [number, number];
|
|
193
|
+
export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4: (a: number, b: number, c: any) => [number, number];
|
|
194
|
+
export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5: (a: number, b: number, c: any) => [number, number];
|
|
195
|
+
export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6: (a: number, b: number, c: any) => [number, number];
|
|
196
|
+
export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7: (a: number, b: number, c: any) => [number, number];
|
|
197
197
|
export const wasm_bindgen__convert__closures_____invoke__h41057d61edf43a32: (a: number, b: number, c: any, d: any) => void;
|
|
198
198
|
export const wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25: (a: number, b: number, c: any) => void;
|
|
199
199
|
export const wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2: (a: number, b: number, c: any) => void;
|
package/bundler/storage/index.js
CHANGED
|
@@ -611,6 +611,19 @@ class MigrationManager {
|
|
|
611
611
|
};
|
|
612
612
|
},
|
|
613
613
|
},
|
|
614
|
+
{
|
|
615
|
+
// Deposit addresses polled on-chain for deposits still in the mempool.
|
|
616
|
+
// Entries are removed once watching them can no longer lead to an early
|
|
617
|
+
// claim, so the store holds only the live watch set.
|
|
618
|
+
name: "Create watched_deposit_addresses store",
|
|
619
|
+
upgrade: (db) => {
|
|
620
|
+
if (!db.objectStoreNames.contains("watched_deposit_addresses")) {
|
|
621
|
+
db.createObjectStore("watched_deposit_addresses", {
|
|
622
|
+
keyPath: "address",
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
},
|
|
614
627
|
];
|
|
615
628
|
}
|
|
616
629
|
}
|
|
@@ -639,7 +652,7 @@ class IndexedDBStorage {
|
|
|
639
652
|
// so existing databases depend on indices never shifting. Never insert,
|
|
640
653
|
// reorder, or delete a migration — only append. dbVersion MUST equal the
|
|
641
654
|
// number of migrations (enforced by the guard in initialize()).
|
|
642
|
-
this.dbVersion =
|
|
655
|
+
this.dbVersion = 22; // Current schema version (= migration count)
|
|
643
656
|
}
|
|
644
657
|
|
|
645
658
|
/**
|
|
@@ -1445,6 +1458,7 @@ class IndexedDBStorage {
|
|
|
1445
1458
|
refundTxId: existing?.refundTxId ?? null,
|
|
1446
1459
|
instantClaimStatus: existing?.instantClaimStatus ?? null,
|
|
1447
1460
|
refundState: existing?.refundState ?? null,
|
|
1461
|
+
maxClaimFee: existing?.maxClaimFee ?? null,
|
|
1448
1462
|
};
|
|
1449
1463
|
|
|
1450
1464
|
const putRequest = store.put(depositToStore);
|
|
@@ -1521,6 +1535,7 @@ class IndexedDBStorage {
|
|
|
1521
1535
|
? JSON.parse(row.instantClaimStatus)
|
|
1522
1536
|
: null,
|
|
1523
1537
|
refundState: row.refundState ? JSON.parse(row.refundState) : null,
|
|
1538
|
+
maxClaimFee: row.maxClaimFee ? JSON.parse(row.maxClaimFee) : null,
|
|
1524
1539
|
}));
|
|
1525
1540
|
resolve(deposits);
|
|
1526
1541
|
};
|
|
@@ -1576,6 +1591,10 @@ class IndexedDBStorage {
|
|
|
1576
1591
|
if (existingDeposit.refundTxId === payload.refundTxid) {
|
|
1577
1592
|
updatedDeposit.refundState = JSON.stringify(payload.state);
|
|
1578
1593
|
}
|
|
1594
|
+
} else if (payload.type === "maxClaimFee") {
|
|
1595
|
+
updatedDeposit.maxClaimFee = payload.maxFee
|
|
1596
|
+
? JSON.stringify(payload.maxFee)
|
|
1597
|
+
: null;
|
|
1579
1598
|
} else {
|
|
1580
1599
|
reject(new StorageError(`Unknown payload type: ${payload.type}`));
|
|
1581
1600
|
return;
|
|
@@ -1606,6 +1625,131 @@ class IndexedDBStorage {
|
|
|
1606
1625
|
});
|
|
1607
1626
|
}
|
|
1608
1627
|
|
|
1628
|
+
async listWatchedDepositAddresses() {
|
|
1629
|
+
if (!this.db) {
|
|
1630
|
+
throw new StorageError("Database not initialized");
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
return new Promise((resolve, reject) => {
|
|
1634
|
+
const transaction = this.db.transaction(
|
|
1635
|
+
"watched_deposit_addresses",
|
|
1636
|
+
"readonly"
|
|
1637
|
+
);
|
|
1638
|
+
const store = transaction.objectStore("watched_deposit_addresses");
|
|
1639
|
+
const request = store.getAll();
|
|
1640
|
+
|
|
1641
|
+
request.onsuccess = () => {
|
|
1642
|
+
const watched = (request.result || []).map((entry) => ({
|
|
1643
|
+
address: entry.address,
|
|
1644
|
+
issuedAt: entry.issuedAt,
|
|
1645
|
+
seen: Boolean(entry.seen),
|
|
1646
|
+
}));
|
|
1647
|
+
// The store is keyed by address, so ordering is applied here rather
|
|
1648
|
+
// than by an index.
|
|
1649
|
+
watched.sort((a, b) => Number(b.issuedAt) - Number(a.issuedAt));
|
|
1650
|
+
resolve(watched);
|
|
1651
|
+
};
|
|
1652
|
+
request.onerror = () =>
|
|
1653
|
+
reject(
|
|
1654
|
+
new StorageError(
|
|
1655
|
+
`Failed to list watched deposit addresses: ${request.error}`
|
|
1656
|
+
)
|
|
1657
|
+
);
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
async updateWatchedDepositAddress(address, payload) {
|
|
1662
|
+
if (!this.db) {
|
|
1663
|
+
throw new StorageError("Database not initialized");
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
return new Promise((resolve, reject) => {
|
|
1667
|
+
const transaction = this.db.transaction(
|
|
1668
|
+
"watched_deposit_addresses",
|
|
1669
|
+
"readwrite"
|
|
1670
|
+
);
|
|
1671
|
+
const store = transaction.objectStore("watched_deposit_addresses");
|
|
1672
|
+
|
|
1673
|
+
if (payload.type === "watch") {
|
|
1674
|
+
const request = store.put({
|
|
1675
|
+
address,
|
|
1676
|
+
issuedAt: payload.issuedAt,
|
|
1677
|
+
seen: false,
|
|
1678
|
+
});
|
|
1679
|
+
request.onsuccess = () => resolve();
|
|
1680
|
+
request.onerror = () =>
|
|
1681
|
+
reject(
|
|
1682
|
+
new StorageError(
|
|
1683
|
+
`Failed to watch deposit address '${address}': ${request.error}`
|
|
1684
|
+
)
|
|
1685
|
+
);
|
|
1686
|
+
return;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
if (payload.type === "unwatch") {
|
|
1690
|
+
// Conditional on issuedAt, so an address handed out again since the
|
|
1691
|
+
// caller read it is not retired by a decision taken before that. The
|
|
1692
|
+
// get and the delete share one readwrite transaction, so nothing can
|
|
1693
|
+
// interleave between them.
|
|
1694
|
+
const getRequest = store.get(address);
|
|
1695
|
+
getRequest.onsuccess = () => {
|
|
1696
|
+
const existing = getRequest.result;
|
|
1697
|
+
const stale =
|
|
1698
|
+
!existing || String(existing.issuedAt) !== String(payload.issuedAt);
|
|
1699
|
+
if (stale) {
|
|
1700
|
+
resolve();
|
|
1701
|
+
return;
|
|
1702
|
+
}
|
|
1703
|
+
const request = store.delete(address);
|
|
1704
|
+
request.onsuccess = () => resolve();
|
|
1705
|
+
request.onerror = () =>
|
|
1706
|
+
reject(
|
|
1707
|
+
new StorageError(
|
|
1708
|
+
`Failed to unwatch deposit address '${address}': ${request.error}`
|
|
1709
|
+
)
|
|
1710
|
+
);
|
|
1711
|
+
};
|
|
1712
|
+
getRequest.onerror = () =>
|
|
1713
|
+
reject(
|
|
1714
|
+
new StorageError(
|
|
1715
|
+
`Failed to read watched deposit address '${address}': ${getRequest.error}`
|
|
1716
|
+
)
|
|
1717
|
+
);
|
|
1718
|
+
return;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
if (payload.type === "seen") {
|
|
1722
|
+
const getRequest = store.get(address);
|
|
1723
|
+
getRequest.onsuccess = () => {
|
|
1724
|
+
const existing = getRequest.result;
|
|
1725
|
+
if (!existing) {
|
|
1726
|
+
// Not watched, so there is nothing to mark (matches the SQL stores,
|
|
1727
|
+
// whose UPDATE affects no rows).
|
|
1728
|
+
resolve();
|
|
1729
|
+
return;
|
|
1730
|
+
}
|
|
1731
|
+
const request = store.put({ ...existing, seen: true });
|
|
1732
|
+
request.onsuccess = () => resolve();
|
|
1733
|
+
request.onerror = () =>
|
|
1734
|
+
reject(
|
|
1735
|
+
new StorageError(
|
|
1736
|
+
`Failed to mark deposit address '${address}' seen: ${request.error}`
|
|
1737
|
+
)
|
|
1738
|
+
);
|
|
1739
|
+
};
|
|
1740
|
+
getRequest.onerror = () =>
|
|
1741
|
+
reject(
|
|
1742
|
+
new StorageError(
|
|
1743
|
+
`Failed to read watched deposit address '${address}': ${getRequest.error}`
|
|
1744
|
+
)
|
|
1745
|
+
);
|
|
1746
|
+
return;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
reject(new StorageError(`Unknown payload type: ${payload.type}`));
|
|
1750
|
+
});
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1609
1753
|
async setLnurlMetadata(metadata) {
|
|
1610
1754
|
if (!this.db) {
|
|
1611
1755
|
throw new StorageError("Database not initialized");
|