@buildonspark/spark-sdk 0.5.0 → 0.5.1
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 +26 -0
- package/dist/bare/index.cjs +1608 -3635
- package/dist/bare/index.d.cts +27 -435
- package/dist/bare/index.d.ts +27 -435
- package/dist/bare/index.js +1608 -3634
- package/dist/{chunk-RU434ZAE.js → chunk-F3BFSHVR.js} +357 -391
- package/dist/{chunk-UYEB2VPG.js → chunk-IOIEBLMK.js} +7 -1
- package/dist/{chunk-EU3I7GFB.js → chunk-STB6WMU7.js} +1 -1
- package/dist/{chunk-JE3MXMPW.js → chunk-UTECVGQQ.js} +93 -202
- package/dist/{chunk-ZP6Z6DFX.js → chunk-YFVVYZCS.js} +37 -5
- package/dist/{client-D1dLzWu0.d.ts → client-C9kc4cog.d.cts} +9 -3
- package/dist/{client-CVn0R_eM.d.cts → client-eyjf4knu.d.ts} +9 -3
- package/dist/graphql/objects/index.cjs +7 -1
- package/dist/graphql/objects/index.d.cts +3 -3
- package/dist/graphql/objects/index.d.ts +3 -3
- package/dist/graphql/objects/index.js +1 -1
- package/dist/index.browser.d.ts +27 -435
- package/dist/index.browser.js +1613 -3639
- package/dist/index.node.cjs +1613 -3640
- package/dist/index.node.d.cts +7 -8
- package/dist/index.node.d.ts +7 -8
- package/dist/index.node.js +5 -7
- package/dist/native/index.react-native.cjs +1613 -3640
- package/dist/native/index.react-native.d.cts +27 -435
- package/dist/native/index.react-native.d.ts +27 -435
- package/dist/native/index.react-native.js +1613 -3639
- package/dist/proto/spark.cjs +93 -202
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark.js +1 -1
- package/dist/proto/spark_token.cjs +36 -4
- package/dist/proto/spark_token.d.cts +4 -1
- package/dist/proto/spark_token.d.ts +4 -1
- package/dist/proto/spark_token.js +2 -2
- package/dist/{spark-2Fxnvl8K.d.cts → spark-d6w3BLGZ.d.cts} +10 -328
- package/dist/{spark-2Fxnvl8K.d.ts → spark-d6w3BLGZ.d.ts} +10 -328
- package/dist/{spark-wallet.node-DlhZiDgY.d.ts → spark-wallet.node-MReThHBY.d.ts} +6 -7
- package/dist/{spark-wallet.node-xKJXzAEd.d.cts → spark-wallet.node-eR0svGws.d.cts} +6 -7
- package/dist/tests/test-utils.cjs +409 -2429
- package/dist/tests/test-utils.d.cts +3 -3
- package/dist/tests/test-utils.d.ts +3 -3
- package/dist/tests/test-utils.js +5 -5
- package/dist/types/index.cjs +100 -203
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +3 -3
- package/package.json +3 -3
- package/src/graphql/client.ts +36 -1
- package/src/graphql/objects/LightningSendRequestStatus.ts +25 -13
- package/src/proto/common.ts +1 -1
- package/src/proto/google/protobuf/descriptor.ts +1 -1
- package/src/proto/google/protobuf/duration.ts +1 -1
- package/src/proto/google/protobuf/empty.ts +1 -1
- package/src/proto/google/protobuf/timestamp.ts +1 -1
- package/src/proto/mock.ts +1 -1
- package/src/proto/spark.ts +113 -446
- package/src/proto/spark_authn.ts +1 -1
- package/src/proto/spark_token.ts +41 -2
- package/src/proto/validate/validate.ts +1 -1
- package/src/services/connection/connection.ts +23 -60
- package/src/services/coop-exit.ts +3 -5
- package/src/services/deposit.ts +1 -1
- package/src/services/lightning.ts +1 -1
- package/src/services/signing.ts +5 -6
- package/src/services/transfer.ts +250 -240
- package/src/services/wallet-config.ts +22 -5
- package/src/spark-wallet/proto-descriptors.ts +1 -1
- package/src/spark-wallet/proto-reflection.ts +0 -2
- package/src/spark-wallet/spark-wallet.ts +2 -2
- package/src/spark_descriptors.pb +0 -0
- package/src/tests/bufbuild-reflection.test.ts +2 -3
- package/src/tests/integration/coop-exit.test.ts +6 -1
- package/src/tests/integration/htlc.test.ts +5 -0
- package/src/tests/integration/lightning.test.ts +24 -4
- package/src/tests/integration/time-sync.test.ts +18 -0
- package/src/tests/integration/transfer.test.ts +42 -7
- package/src/tests/ssp-client-retry.test.ts +161 -0
- package/src/tests/token-hashing.test.ts +92 -0
- package/src/utils/token-hashing.ts +4 -51
- package/src/utils/transaction.ts +1 -2
- package/src/utils/unilateral-exit.ts +139 -142
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Query } from '@lightsparkdev/core';
|
|
2
2
|
import { Transaction } from '@scure/btc-signer';
|
|
3
3
|
import { HDKey } from '@scure/bip32';
|
|
4
|
-
import { S as SigningKeyshare, N as Network, p as TransferStatus, q as TransferType, W as WalletSetting, b as TreeNode, r as TransferLeaf, T as Transfer$1 } from './spark-
|
|
4
|
+
import { S as SigningKeyshare, N as Network, p as TransferStatus, q as TransferType, W as WalletSetting, b as TreeNode, r as TransferLeaf, T as Transfer$1 } from './spark-d6w3BLGZ.js';
|
|
5
5
|
|
|
6
6
|
/** This is an enum identifying a particular Bitcoin Network. **/
|
|
7
7
|
declare enum BitcoinNetwork {
|
|
@@ -589,12 +589,18 @@ declare enum LightningSendRequestStatus {
|
|
|
589
589
|
*/
|
|
590
590
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
591
591
|
CREATED = "CREATED",
|
|
592
|
-
|
|
592
|
+
USER_TRANSFER_VALIDATION_FAILED = "USER_TRANSFER_VALIDATION_FAILED",
|
|
593
593
|
LIGHTNING_PAYMENT_INITIATED = "LIGHTNING_PAYMENT_INITIATED",
|
|
594
594
|
LIGHTNING_PAYMENT_FAILED = "LIGHTNING_PAYMENT_FAILED",
|
|
595
595
|
LIGHTNING_PAYMENT_SUCCEEDED = "LIGHTNING_PAYMENT_SUCCEEDED",
|
|
596
596
|
PREIMAGE_PROVIDED = "PREIMAGE_PROVIDED",
|
|
597
|
-
|
|
597
|
+
PREIMAGE_PROVIDING_FAILED = "PREIMAGE_PROVIDING_FAILED",
|
|
598
|
+
TRANSFER_COMPLETED = "TRANSFER_COMPLETED",
|
|
599
|
+
TRANSFER_FAILED = "TRANSFER_FAILED",
|
|
600
|
+
PENDING_USER_SWAP_RETURN = "PENDING_USER_SWAP_RETURN",
|
|
601
|
+
USER_SWAP_RETURNED = "USER_SWAP_RETURNED",
|
|
602
|
+
USER_SWAP_RETURN_FAILED = "USER_SWAP_RETURN_FAILED",
|
|
603
|
+
REQUEST_VALIDATED = "REQUEST_VALIDATED"
|
|
598
604
|
}
|
|
599
605
|
|
|
600
606
|
interface LightningSendRequest {
|
|
@@ -665,12 +665,18 @@ var import_core5 = require("@lightsparkdev/core");
|
|
|
665
665
|
var LightningSendRequestStatus = /* @__PURE__ */ ((LightningSendRequestStatus2) => {
|
|
666
666
|
LightningSendRequestStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
|
|
667
667
|
LightningSendRequestStatus2["CREATED"] = "CREATED";
|
|
668
|
-
LightningSendRequestStatus2["
|
|
668
|
+
LightningSendRequestStatus2["USER_TRANSFER_VALIDATION_FAILED"] = "USER_TRANSFER_VALIDATION_FAILED";
|
|
669
669
|
LightningSendRequestStatus2["LIGHTNING_PAYMENT_INITIATED"] = "LIGHTNING_PAYMENT_INITIATED";
|
|
670
670
|
LightningSendRequestStatus2["LIGHTNING_PAYMENT_FAILED"] = "LIGHTNING_PAYMENT_FAILED";
|
|
671
671
|
LightningSendRequestStatus2["LIGHTNING_PAYMENT_SUCCEEDED"] = "LIGHTNING_PAYMENT_SUCCEEDED";
|
|
672
672
|
LightningSendRequestStatus2["PREIMAGE_PROVIDED"] = "PREIMAGE_PROVIDED";
|
|
673
|
+
LightningSendRequestStatus2["PREIMAGE_PROVIDING_FAILED"] = "PREIMAGE_PROVIDING_FAILED";
|
|
673
674
|
LightningSendRequestStatus2["TRANSFER_COMPLETED"] = "TRANSFER_COMPLETED";
|
|
675
|
+
LightningSendRequestStatus2["TRANSFER_FAILED"] = "TRANSFER_FAILED";
|
|
676
|
+
LightningSendRequestStatus2["PENDING_USER_SWAP_RETURN"] = "PENDING_USER_SWAP_RETURN";
|
|
677
|
+
LightningSendRequestStatus2["USER_SWAP_RETURNED"] = "USER_SWAP_RETURNED";
|
|
678
|
+
LightningSendRequestStatus2["USER_SWAP_RETURN_FAILED"] = "USER_SWAP_RETURN_FAILED";
|
|
679
|
+
LightningSendRequestStatus2["REQUEST_VALIDATED"] = "REQUEST_VALIDATED";
|
|
674
680
|
return LightningSendRequestStatus2;
|
|
675
681
|
})(LightningSendRequestStatus || {});
|
|
676
682
|
var LightningSendRequestStatus_default = LightningSendRequestStatus;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { B as BitcoinNetwork, P as PageInfo, aF as SspClient, M as SparkUserRequestType, K as SparkUserRequestStatus, N as SparkWalletUserToUserRequestsConnection } from '../../client-
|
|
2
|
-
export { C as ClaimStaticDeposit, a as ClaimStaticDepositOutput, b as ClaimStaticDepositStatus, c as CompleteCoopExitInput, d as CompleteLeavesSwapInput, e as CoopExitFeeEstimate, f as CoopExitFeeEstimatesInput, h as CoopExitFeeEstimatesOutput, j as CoopExitFeeQuote, k as CoopExitFeeQuoteInput, l as CoopExitRequest, n as CurrencyAmount, o as CurrencyUnit, E as ExitSpeed, G as GetChallengeOutput, I as Invoice, L as Leaf, p as LeavesSwapFeeEstimateOutput, r as LeavesSwapRequest, t as LightningReceiveRequest, u as LightningReceiveRequestStatus, v as LightningSendFeeEstimateInput, w as LightningSendFeeEstimateOutput, y as LightningSendRequest, z as LightningSendRequestStatus, R as RequestCoopExitInput, A as RequestLeavesSwapInput, D as RequestLightningReceiveInput, F as RequestLightningSendInput, S as SparkCoopExitRequestStatus, H as SparkLeavesSwapRequestStatus, J as SparkTransferToLeavesConnection, O as StaticDepositQuoteInput, Q as StaticDepositQuoteOutput, T as SwapLeaf, U as Transfer, V as UserLeafInput, X as UserRequest, Y as VerifyChallengeOutput, g as getClaimStaticDepositQuery, i as getCoopExitFeeQuoteQuery, m as getCoopExitRequestQuery, q as getLeavesSwapRequestQuery, s as getLightningReceiveRequestQuery, x as getLightningSendRequestQuery, W as getUserRequestQuery } from '../../client-
|
|
1
|
+
import { B as BitcoinNetwork, P as PageInfo, aF as SspClient, M as SparkUserRequestType, K as SparkUserRequestStatus, N as SparkWalletUserToUserRequestsConnection } from '../../client-C9kc4cog.cjs';
|
|
2
|
+
export { C as ClaimStaticDeposit, a as ClaimStaticDepositOutput, b as ClaimStaticDepositStatus, c as CompleteCoopExitInput, d as CompleteLeavesSwapInput, e as CoopExitFeeEstimate, f as CoopExitFeeEstimatesInput, h as CoopExitFeeEstimatesOutput, j as CoopExitFeeQuote, k as CoopExitFeeQuoteInput, l as CoopExitRequest, n as CurrencyAmount, o as CurrencyUnit, E as ExitSpeed, G as GetChallengeOutput, I as Invoice, L as Leaf, p as LeavesSwapFeeEstimateOutput, r as LeavesSwapRequest, t as LightningReceiveRequest, u as LightningReceiveRequestStatus, v as LightningSendFeeEstimateInput, w as LightningSendFeeEstimateOutput, y as LightningSendRequest, z as LightningSendRequestStatus, R as RequestCoopExitInput, A as RequestLeavesSwapInput, D as RequestLightningReceiveInput, F as RequestLightningSendInput, S as SparkCoopExitRequestStatus, H as SparkLeavesSwapRequestStatus, J as SparkTransferToLeavesConnection, O as StaticDepositQuoteInput, Q as StaticDepositQuoteOutput, T as SwapLeaf, U as Transfer, V as UserLeafInput, X as UserRequest, Y as VerifyChallengeOutput, g as getClaimStaticDepositQuery, i as getCoopExitFeeQuoteQuery, m as getCoopExitRequestQuery, q as getLeavesSwapRequestQuery, s as getLightningReceiveRequestQuery, x as getLightningSendRequestQuery, W as getUserRequestQuery } from '../../client-C9kc4cog.cjs';
|
|
3
3
|
import { Query } from '@lightsparkdev/core';
|
|
4
4
|
import '@scure/btc-signer';
|
|
5
5
|
import '@scure/bip32';
|
|
6
|
-
import '../../spark-
|
|
6
|
+
import '../../spark-d6w3BLGZ.cjs';
|
|
7
7
|
import '@bufbuild/protobuf/wire';
|
|
8
8
|
import 'nice-grpc-common';
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { B as BitcoinNetwork, P as PageInfo, aF as SspClient, M as SparkUserRequestType, K as SparkUserRequestStatus, N as SparkWalletUserToUserRequestsConnection } from '../../client-
|
|
2
|
-
export { C as ClaimStaticDeposit, a as ClaimStaticDepositOutput, b as ClaimStaticDepositStatus, c as CompleteCoopExitInput, d as CompleteLeavesSwapInput, e as CoopExitFeeEstimate, f as CoopExitFeeEstimatesInput, h as CoopExitFeeEstimatesOutput, j as CoopExitFeeQuote, k as CoopExitFeeQuoteInput, l as CoopExitRequest, n as CurrencyAmount, o as CurrencyUnit, E as ExitSpeed, G as GetChallengeOutput, I as Invoice, L as Leaf, p as LeavesSwapFeeEstimateOutput, r as LeavesSwapRequest, t as LightningReceiveRequest, u as LightningReceiveRequestStatus, v as LightningSendFeeEstimateInput, w as LightningSendFeeEstimateOutput, y as LightningSendRequest, z as LightningSendRequestStatus, R as RequestCoopExitInput, A as RequestLeavesSwapInput, D as RequestLightningReceiveInput, F as RequestLightningSendInput, S as SparkCoopExitRequestStatus, H as SparkLeavesSwapRequestStatus, J as SparkTransferToLeavesConnection, O as StaticDepositQuoteInput, Q as StaticDepositQuoteOutput, T as SwapLeaf, U as Transfer, V as UserLeafInput, X as UserRequest, Y as VerifyChallengeOutput, g as getClaimStaticDepositQuery, i as getCoopExitFeeQuoteQuery, m as getCoopExitRequestQuery, q as getLeavesSwapRequestQuery, s as getLightningReceiveRequestQuery, x as getLightningSendRequestQuery, W as getUserRequestQuery } from '../../client-
|
|
1
|
+
import { B as BitcoinNetwork, P as PageInfo, aF as SspClient, M as SparkUserRequestType, K as SparkUserRequestStatus, N as SparkWalletUserToUserRequestsConnection } from '../../client-eyjf4knu.js';
|
|
2
|
+
export { C as ClaimStaticDeposit, a as ClaimStaticDepositOutput, b as ClaimStaticDepositStatus, c as CompleteCoopExitInput, d as CompleteLeavesSwapInput, e as CoopExitFeeEstimate, f as CoopExitFeeEstimatesInput, h as CoopExitFeeEstimatesOutput, j as CoopExitFeeQuote, k as CoopExitFeeQuoteInput, l as CoopExitRequest, n as CurrencyAmount, o as CurrencyUnit, E as ExitSpeed, G as GetChallengeOutput, I as Invoice, L as Leaf, p as LeavesSwapFeeEstimateOutput, r as LeavesSwapRequest, t as LightningReceiveRequest, u as LightningReceiveRequestStatus, v as LightningSendFeeEstimateInput, w as LightningSendFeeEstimateOutput, y as LightningSendRequest, z as LightningSendRequestStatus, R as RequestCoopExitInput, A as RequestLeavesSwapInput, D as RequestLightningReceiveInput, F as RequestLightningSendInput, S as SparkCoopExitRequestStatus, H as SparkLeavesSwapRequestStatus, J as SparkTransferToLeavesConnection, O as StaticDepositQuoteInput, Q as StaticDepositQuoteOutput, T as SwapLeaf, U as Transfer, V as UserLeafInput, X as UserRequest, Y as VerifyChallengeOutput, g as getClaimStaticDepositQuery, i as getCoopExitFeeQuoteQuery, m as getCoopExitRequestQuery, q as getLeavesSwapRequestQuery, s as getLightningReceiveRequestQuery, x as getLightningSendRequestQuery, W as getUserRequestQuery } from '../../client-eyjf4knu.js';
|
|
3
3
|
import { Query } from '@lightsparkdev/core';
|
|
4
4
|
import '@scure/btc-signer';
|
|
5
5
|
import '@scure/bip32';
|
|
6
|
-
import '../../spark-
|
|
6
|
+
import '../../spark-d6w3BLGZ.js';
|
|
7
7
|
import '@bufbuild/protobuf/wire';
|
|
8
8
|
import 'nice-grpc-common';
|
|
9
9
|
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
getLightningReceiveRequestQuery,
|
|
19
19
|
getLightningSendRequestQuery,
|
|
20
20
|
getUserRequestQuery
|
|
21
|
-
} from "../../chunk-
|
|
21
|
+
} from "../../chunk-IOIEBLMK.js";
|
|
22
22
|
import "../../chunk-MVRQ5US7.js";
|
|
23
23
|
export {
|
|
24
24
|
BitcoinNetwork_default as BitcoinNetwork,
|