@buildonspark/spark-sdk 0.1.43 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/{RequestLightningSendInput-D7fZdT4A.d.ts → RequestLightningSendInput-DEPd_fPO.d.ts} +43 -4
- package/dist/{RequestLightningSendInput-Na1mHdWg.d.cts → RequestLightningSendInput-Du0z7Om7.d.cts} +43 -4
- package/dist/address/index.cjs +2 -2
- package/dist/address/index.d.cts +2 -2
- package/dist/address/index.d.ts +2 -2
- package/dist/address/index.js +2 -2
- package/dist/{chunk-IRW5TWMH.js → chunk-5FUB65LX.js} +7 -9
- package/dist/{chunk-BUTZWYBW.js → chunk-6264CGDM.js} +4 -4
- package/dist/{chunk-VFJQNBFX.js → chunk-7V6N75CC.js} +5 -2
- package/dist/{chunk-M6A4KFIG.js → chunk-BGGEVUJK.js} +1505 -445
- package/dist/{chunk-DQYKQJRZ.js → chunk-C2S227QR.js} +675 -52
- package/dist/{chunk-GYQR4B4P.js → chunk-GZ5IPPJ2.js} +2 -2
- package/dist/{chunk-6AFUC5M2.js → chunk-HWJWKEIU.js} +8 -2
- package/dist/{chunk-TOSP3INR.js → chunk-I54FARY2.js} +4 -2
- package/dist/{chunk-WWOTVNPP.js → chunk-J2IE4Z7Y.js} +544 -431
- package/dist/{chunk-O4RYNJNB.js → chunk-KMUMFYFX.js} +3 -3
- package/dist/chunk-LHRD2WT6.js +2374 -0
- package/dist/{chunk-ABZA6R5S.js → chunk-NTFKFRQ2.js} +1 -1
- package/dist/{chunk-MIVX3GHD.js → chunk-OBFKIEMP.js} +1 -1
- package/dist/{chunk-HRQRRDSS.js → chunk-PQN3C2MF.js} +15 -15
- package/dist/{chunk-DOA6QXYQ.js → chunk-R5PXJZQS.js} +3 -1
- package/dist/{chunk-TIUBYNN5.js → chunk-YUPMXTCJ.js} +4 -4
- package/dist/graphql/objects/index.d.cts +6 -43
- package/dist/graphql/objects/index.d.ts +6 -43
- package/dist/graphql/objects/index.js +1 -1
- package/dist/index-B2AwKW5J.d.cts +214 -0
- package/dist/index-CJDi1HWc.d.ts +214 -0
- package/dist/index.cjs +4150 -1026
- package/dist/index.d.cts +764 -19
- package/dist/index.d.ts +764 -19
- package/dist/index.js +17 -21
- package/dist/index.node.cjs +4153 -1033
- package/dist/index.node.d.cts +10 -8
- package/dist/index.node.d.ts +10 -8
- package/dist/index.node.js +20 -28
- package/dist/native/index.cjs +4166 -1042
- package/dist/native/index.d.cts +369 -108
- package/dist/native/index.d.ts +369 -108
- package/dist/native/index.js +4138 -1015
- package/dist/{network-xkBSpaTn.d.ts → network-BTJl-Sul.d.ts} +1 -1
- package/dist/{network-D5lKssVl.d.cts → network-CqgsdUF2.d.cts} +1 -1
- package/dist/proto/lrc20.cjs +222 -19
- package/dist/proto/lrc20.d.cts +1 -1
- package/dist/proto/lrc20.d.ts +1 -1
- package/dist/proto/lrc20.js +2 -2
- package/dist/proto/spark.cjs +1502 -442
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark.js +5 -5
- package/dist/proto/spark_token.cjs +1515 -56
- package/dist/proto/spark_token.d.cts +153 -15
- package/dist/proto/spark_token.d.ts +153 -15
- package/dist/proto/spark_token.js +40 -4
- package/dist/{sdk-types-B-q9py_P.d.cts → sdk-types-B0SwjolI.d.cts} +1 -1
- package/dist/{sdk-types-BPoPgzda.d.ts → sdk-types-Cc4l4kb1.d.ts} +1 -1
- package/dist/services/config.cjs +7 -3
- package/dist/services/config.d.cts +5 -4
- package/dist/services/config.d.ts +5 -4
- package/dist/services/config.js +6 -6
- package/dist/services/connection.cjs +2938 -646
- package/dist/services/connection.d.cts +5 -4
- package/dist/services/connection.d.ts +5 -4
- package/dist/services/connection.js +4 -4
- package/dist/services/index.cjs +6381 -3461
- package/dist/services/index.d.cts +7 -6
- package/dist/services/index.d.ts +7 -6
- package/dist/services/index.js +15 -13
- package/dist/services/lrc-connection.cjs +227 -21
- package/dist/services/lrc-connection.d.cts +5 -4
- package/dist/services/lrc-connection.d.ts +5 -4
- package/dist/services/lrc-connection.js +4 -4
- package/dist/services/token-transactions.cjs +868 -244
- package/dist/services/token-transactions.d.cts +25 -7
- package/dist/services/token-transactions.d.ts +25 -7
- package/dist/services/token-transactions.js +5 -4
- package/dist/services/wallet-config.cjs +4 -1
- package/dist/services/wallet-config.d.cts +7 -5
- package/dist/services/wallet-config.d.ts +7 -5
- package/dist/services/wallet-config.js +3 -1
- package/dist/signer/signer.cjs +5 -2
- package/dist/signer/signer.d.cts +3 -2
- package/dist/signer/signer.d.ts +3 -2
- package/dist/signer/signer.js +2 -2
- package/dist/{signer-wqesWifN.d.ts → signer-BocS_J6B.d.ts} +2 -6
- package/dist/{signer-IO3oMRNj.d.cts → signer-DKS0AJkw.d.cts} +2 -6
- package/dist/{spark-CDm4gqS6.d.cts → spark-dM7EYXYQ.d.cts} +138 -42
- package/dist/{spark-CDm4gqS6.d.ts → spark-dM7EYXYQ.d.ts} +138 -42
- package/dist/spark_bindings/native/index.cjs +183 -0
- package/dist/spark_bindings/native/index.d.cts +14 -0
- package/dist/spark_bindings/native/index.d.ts +14 -0
- package/dist/spark_bindings/native/index.js +141 -0
- package/dist/spark_bindings/wasm/index.cjs +1093 -0
- package/dist/spark_bindings/wasm/index.d.cts +47 -0
- package/dist/spark_bindings/wasm/index.d.ts +47 -0
- package/dist/{chunk-K4C4W5FC.js → spark_bindings/wasm/index.js} +7 -6
- package/dist/types/index.cjs +1503 -443
- package/dist/types/index.d.cts +6 -5
- package/dist/types/index.d.ts +6 -5
- package/dist/types/index.js +3 -3
- package/dist/types-C-Rp0Oo7.d.cts +46 -0
- package/dist/types-C-Rp0Oo7.d.ts +46 -0
- package/dist/utils/index.cjs +358 -36
- package/dist/utils/index.d.cts +14 -134
- package/dist/utils/index.d.ts +14 -134
- package/dist/utils/index.js +8 -8
- package/package.json +21 -1
- package/src/constants.ts +5 -1
- package/src/graphql/client.ts +28 -0
- package/src/graphql/mutations/RequestCoopExit.ts +6 -0
- package/src/graphql/mutations/RequestSwapLeaves.ts +2 -0
- package/src/graphql/queries/GetCoopExitFeeQuote.ts +20 -0
- package/src/index.node.ts +0 -1
- package/src/index.ts +0 -1
- package/src/native/index.ts +1 -2
- package/src/proto/common.ts +5 -5
- package/src/proto/google/protobuf/descriptor.ts +34 -34
- package/src/proto/google/protobuf/duration.ts +2 -2
- package/src/proto/google/protobuf/empty.ts +2 -2
- package/src/proto/google/protobuf/timestamp.ts +2 -2
- package/src/proto/mock.ts +4 -4
- package/src/proto/spark.ts +1924 -525
- package/src/proto/spark_authn.ts +7 -7
- package/src/proto/spark_token.ts +1668 -105
- package/src/proto/validate/validate.ts +24 -24
- package/src/services/bolt11-spark.ts +62 -187
- package/src/services/coop-exit.ts +3 -0
- package/src/services/lrc20.ts +1 -1
- package/src/services/token-transactions.ts +209 -9
- package/src/services/transfer.ts +22 -3
- package/src/services/tree-creation.ts +13 -0
- package/src/services/wallet-config.ts +2 -1
- package/src/spark-wallet/spark-wallet.node.ts +3 -7
- package/src/spark-wallet/spark-wallet.ts +376 -232
- package/src/spark-wallet/types.ts +39 -3
- package/src/tests/bolt11-spark.test.ts +7 -15
- package/src/tests/integration/deposit.test.ts +16 -0
- package/src/tests/integration/ssp/coop-exit.test.ts +85 -21
- package/src/tests/integration/ssp/swap.test.ts +47 -0
- package/src/tests/integration/swap.test.ts +453 -433
- package/src/tests/integration/transfer.test.ts +261 -248
- package/src/tests/token-identifier.test.ts +54 -0
- package/src/tests/tokens.test.ts +218 -22
- package/src/utils/token-hashing.ts +346 -52
- package/src/utils/token-identifier.ts +88 -0
- package/src/utils/token-transaction-validation.ts +350 -5
- package/src/utils/token-transactions.ts +12 -8
- package/src/utils/transaction.ts +2 -8
- package/dist/chunk-VA7MV4MZ.js +0 -1073
- package/dist/index-7RYRH5wc.d.ts +0 -815
- package/dist/index-BJOc8Ur-.d.cts +0 -815
- package/dist/wasm-7OWFHDMS.js +0 -21
- package/src/logger.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @buildonspark/spark-sdk
|
|
2
2
|
|
|
3
|
+
## 0.1.45
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- - Update parsing of spark address from fallback_adress to route_hints
|
|
8
|
+
- Update sdk checks on transactions
|
|
9
|
+
- Add token features
|
|
10
|
+
- Improve stability and cleanup
|
|
11
|
+
|
|
12
|
+
## 0.1.44
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Add fee estimate quote for coop exit requests
|
|
17
|
+
- Allow coop exit fees to be taken from wallet balance instead of withdrawal amount if specified
|
|
18
|
+
|
|
3
19
|
## 0.1.43
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/{RequestLightningSendInput-D7fZdT4A.d.ts → RequestLightningSendInput-DEPd_fPO.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Query } from '@lightsparkdev/core';
|
|
2
2
|
import { B as BitcoinNetwork } from './BitcoinNetwork-TnABML0T.js';
|
|
3
|
-
import { S as SparkSigner } from './signer-
|
|
3
|
+
import { S as SparkSigner } from './signer-BocS_J6B.js';
|
|
4
4
|
|
|
5
5
|
/** This enum identifies the unit of currency associated with a CurrencyAmount. **/
|
|
6
6
|
declare enum CurrencyUnit {
|
|
@@ -90,6 +90,44 @@ interface CoopExitFeeEstimatesOutput {
|
|
|
90
90
|
speedSlow?: CoopExitFeeEstimate | undefined;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
interface CoopExitFeeQuote {
|
|
94
|
+
/**
|
|
95
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
96
|
+
* string.
|
|
97
|
+
**/
|
|
98
|
+
id: string;
|
|
99
|
+
/** The date and time when the entity was first created. **/
|
|
100
|
+
createdAt: string;
|
|
101
|
+
/** The date and time when the entity was last updated. **/
|
|
102
|
+
updatedAt: string;
|
|
103
|
+
/** The network the coop exit fee quote is on. **/
|
|
104
|
+
network: BitcoinNetwork;
|
|
105
|
+
/** The total currency amount of all the nodes user swapped for the coop exit quote. **/
|
|
106
|
+
totalAmount: CurrencyAmount;
|
|
107
|
+
/** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is fast. **/
|
|
108
|
+
userFeeFast: CurrencyAmount;
|
|
109
|
+
/** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is medium. **/
|
|
110
|
+
userFeeMedium: CurrencyAmount;
|
|
111
|
+
/** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is slow. **/
|
|
112
|
+
userFeeSlow: CurrencyAmount;
|
|
113
|
+
/** The L1 broadcast fee user pays for the coop exit when exit speed is fast. **/
|
|
114
|
+
l1BroadcastFeeFast: CurrencyAmount;
|
|
115
|
+
/** The L1 broadcast fee user pays for the coop exit when exit speed is medium. **/
|
|
116
|
+
l1BroadcastFeeMedium: CurrencyAmount;
|
|
117
|
+
/** The L1 broadcast fee user pays for the coop exit when exit speed is slow. **/
|
|
118
|
+
l1BroadcastFeeSlow: CurrencyAmount;
|
|
119
|
+
/** The time when the coop exit fee quote expires. **/
|
|
120
|
+
expiresAt: string;
|
|
121
|
+
/** The typename of the object **/
|
|
122
|
+
typename: string;
|
|
123
|
+
}
|
|
124
|
+
declare const getCoopExitFeeQuoteQuery: (id: string) => Query<CoopExitFeeQuote>;
|
|
125
|
+
|
|
126
|
+
interface CoopExitFeeQuoteInput {
|
|
127
|
+
leafExternalIds: string[];
|
|
128
|
+
withdrawalAddress: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
93
131
|
declare enum ExitSpeed {
|
|
94
132
|
/**
|
|
95
133
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -282,10 +320,10 @@ declare class SspClient {
|
|
|
282
320
|
getCoopExitFeeEstimate({ leafExternalIds, withdrawalAddress, }: CoopExitFeeEstimatesInput): Promise<CoopExitFeeEstimatesOutput | null>;
|
|
283
321
|
getCurrentUser(): Promise<void>;
|
|
284
322
|
completeCoopExit({ userOutboundTransferExternalId, coopExitRequestId, }: CompleteCoopExitInput): Promise<CoopExitRequest | null>;
|
|
285
|
-
requestCoopExit({ leafExternalIds, withdrawalAddress, idempotencyKey, exitSpeed, }: RequestCoopExitInput): Promise<CoopExitRequest | null>;
|
|
323
|
+
requestCoopExit({ leafExternalIds, withdrawalAddress, idempotencyKey, exitSpeed, feeLeafExternalIds, feeQuoteId, withdrawAll, }: RequestCoopExitInput): Promise<CoopExitRequest | null>;
|
|
286
324
|
requestLightningReceive({ amountSats, network, paymentHash, expirySecs, memo, includeSparkAddress, receiverIdentityPubkey, descriptionHash, }: RequestLightningReceiveInput): Promise<LightningReceiveRequest | null>;
|
|
287
325
|
requestLightningSend({ encodedInvoice, idempotencyKey, amountSats, }: RequestLightningSendInput): Promise<LightningSendRequest | null>;
|
|
288
|
-
requestLeaveSwap({ adaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
326
|
+
requestLeaveSwap({ adaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, targetAmountSatsList, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
289
327
|
completeLeaveSwap({ adaptorSecretKey, userOutboundTransferExternalId, leavesSwapRequestId, }: CompleteLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
290
328
|
getLightningReceiveRequest(id: string): Promise<LightningReceiveRequest | null>;
|
|
291
329
|
getLightningSendRequest(id: string): Promise<LightningSendRequest | null>;
|
|
@@ -305,6 +343,7 @@ declare class SspClient {
|
|
|
305
343
|
getChallenge(): Promise<GetChallengeOutput | null>;
|
|
306
344
|
verifyChallenge(signature: string, protectedChallenge: string): Promise<VerifyChallengeOutput | null>;
|
|
307
345
|
authenticate(): Promise<void>;
|
|
346
|
+
getCoopExitFeeQuote({ leafExternalIds, withdrawalAddress, }: CoopExitFeeQuoteInput): Promise<CoopExitFeeQuote | null>;
|
|
308
347
|
}
|
|
309
348
|
|
|
310
349
|
interface Leaf {
|
|
@@ -512,4 +551,4 @@ interface RequestLightningSendInput {
|
|
|
512
551
|
amountSats?: number | undefined;
|
|
513
552
|
}
|
|
514
553
|
|
|
515
|
-
export { type
|
|
554
|
+
export { type SparkTransferToLeavesConnection as A, type StaticDepositQuoteInput as B, type ClaimStaticDepositOutput as C, type StaticDepositQuoteOutput as D, ExitSpeed as E, type SwapLeaf as F, type GetChallengeOutput as G, type HasSspClientOptions as H, type Invoice as I, type SspClientOptions as J, SspClient as K, type Leaf as L, type MayHaveSspClientOptions as M, type PageInfo as P, type RequestCoopExitInput as R, SparkCoopExitRequestStatus as S, Transfer as T, type UserLeafInput as U, type VerifyChallengeOutput as V, type CompleteCoopExitInput as a, type CompleteLeavesSwapInput as b, type CoopExitFeeEstimate as c, type CoopExitFeeEstimatesInput as d, type CoopExitFeeEstimatesOutput as e, type CoopExitFeeQuote as f, getCoopExitFeeQuoteQuery as g, type CoopExitFeeQuoteInput as h, type CoopExitRequest as i, getCoopExitRequestQuery as j, type CurrencyAmount as k, CurrencyUnit as l, type LeavesSwapFeeEstimateOutput as m, getLeavesSwapRequestQuery as n, type LeavesSwapRequest as o, getLightningReceiveRequestQuery as p, type LightningReceiveRequest as q, LightningReceiveRequestStatus as r, type LightningSendFeeEstimateOutput as s, getLightningSendRequestQuery as t, type LightningSendRequest as u, LightningSendRequestStatus as v, type RequestLeavesSwapInput as w, type RequestLightningReceiveInput as x, type RequestLightningSendInput as y, SparkLeavesSwapRequestStatus as z };
|
package/dist/{RequestLightningSendInput-Na1mHdWg.d.cts → RequestLightningSendInput-Du0z7Om7.d.cts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Query } from '@lightsparkdev/core';
|
|
2
2
|
import { B as BitcoinNetwork } from './BitcoinNetwork-TnABML0T.cjs';
|
|
3
|
-
import { S as SparkSigner } from './signer-
|
|
3
|
+
import { S as SparkSigner } from './signer-DKS0AJkw.cjs';
|
|
4
4
|
|
|
5
5
|
/** This enum identifies the unit of currency associated with a CurrencyAmount. **/
|
|
6
6
|
declare enum CurrencyUnit {
|
|
@@ -90,6 +90,44 @@ interface CoopExitFeeEstimatesOutput {
|
|
|
90
90
|
speedSlow?: CoopExitFeeEstimate | undefined;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
interface CoopExitFeeQuote {
|
|
94
|
+
/**
|
|
95
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
96
|
+
* string.
|
|
97
|
+
**/
|
|
98
|
+
id: string;
|
|
99
|
+
/** The date and time when the entity was first created. **/
|
|
100
|
+
createdAt: string;
|
|
101
|
+
/** The date and time when the entity was last updated. **/
|
|
102
|
+
updatedAt: string;
|
|
103
|
+
/** The network the coop exit fee quote is on. **/
|
|
104
|
+
network: BitcoinNetwork;
|
|
105
|
+
/** The total currency amount of all the nodes user swapped for the coop exit quote. **/
|
|
106
|
+
totalAmount: CurrencyAmount;
|
|
107
|
+
/** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is fast. **/
|
|
108
|
+
userFeeFast: CurrencyAmount;
|
|
109
|
+
/** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is medium. **/
|
|
110
|
+
userFeeMedium: CurrencyAmount;
|
|
111
|
+
/** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is slow. **/
|
|
112
|
+
userFeeSlow: CurrencyAmount;
|
|
113
|
+
/** The L1 broadcast fee user pays for the coop exit when exit speed is fast. **/
|
|
114
|
+
l1BroadcastFeeFast: CurrencyAmount;
|
|
115
|
+
/** The L1 broadcast fee user pays for the coop exit when exit speed is medium. **/
|
|
116
|
+
l1BroadcastFeeMedium: CurrencyAmount;
|
|
117
|
+
/** The L1 broadcast fee user pays for the coop exit when exit speed is slow. **/
|
|
118
|
+
l1BroadcastFeeSlow: CurrencyAmount;
|
|
119
|
+
/** The time when the coop exit fee quote expires. **/
|
|
120
|
+
expiresAt: string;
|
|
121
|
+
/** The typename of the object **/
|
|
122
|
+
typename: string;
|
|
123
|
+
}
|
|
124
|
+
declare const getCoopExitFeeQuoteQuery: (id: string) => Query<CoopExitFeeQuote>;
|
|
125
|
+
|
|
126
|
+
interface CoopExitFeeQuoteInput {
|
|
127
|
+
leafExternalIds: string[];
|
|
128
|
+
withdrawalAddress: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
93
131
|
declare enum ExitSpeed {
|
|
94
132
|
/**
|
|
95
133
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -282,10 +320,10 @@ declare class SspClient {
|
|
|
282
320
|
getCoopExitFeeEstimate({ leafExternalIds, withdrawalAddress, }: CoopExitFeeEstimatesInput): Promise<CoopExitFeeEstimatesOutput | null>;
|
|
283
321
|
getCurrentUser(): Promise<void>;
|
|
284
322
|
completeCoopExit({ userOutboundTransferExternalId, coopExitRequestId, }: CompleteCoopExitInput): Promise<CoopExitRequest | null>;
|
|
285
|
-
requestCoopExit({ leafExternalIds, withdrawalAddress, idempotencyKey, exitSpeed, }: RequestCoopExitInput): Promise<CoopExitRequest | null>;
|
|
323
|
+
requestCoopExit({ leafExternalIds, withdrawalAddress, idempotencyKey, exitSpeed, feeLeafExternalIds, feeQuoteId, withdrawAll, }: RequestCoopExitInput): Promise<CoopExitRequest | null>;
|
|
286
324
|
requestLightningReceive({ amountSats, network, paymentHash, expirySecs, memo, includeSparkAddress, receiverIdentityPubkey, descriptionHash, }: RequestLightningReceiveInput): Promise<LightningReceiveRequest | null>;
|
|
287
325
|
requestLightningSend({ encodedInvoice, idempotencyKey, amountSats, }: RequestLightningSendInput): Promise<LightningSendRequest | null>;
|
|
288
|
-
requestLeaveSwap({ adaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
326
|
+
requestLeaveSwap({ adaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, targetAmountSatsList, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
289
327
|
completeLeaveSwap({ adaptorSecretKey, userOutboundTransferExternalId, leavesSwapRequestId, }: CompleteLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
290
328
|
getLightningReceiveRequest(id: string): Promise<LightningReceiveRequest | null>;
|
|
291
329
|
getLightningSendRequest(id: string): Promise<LightningSendRequest | null>;
|
|
@@ -305,6 +343,7 @@ declare class SspClient {
|
|
|
305
343
|
getChallenge(): Promise<GetChallengeOutput | null>;
|
|
306
344
|
verifyChallenge(signature: string, protectedChallenge: string): Promise<VerifyChallengeOutput | null>;
|
|
307
345
|
authenticate(): Promise<void>;
|
|
346
|
+
getCoopExitFeeQuote({ leafExternalIds, withdrawalAddress, }: CoopExitFeeQuoteInput): Promise<CoopExitFeeQuote | null>;
|
|
308
347
|
}
|
|
309
348
|
|
|
310
349
|
interface Leaf {
|
|
@@ -512,4 +551,4 @@ interface RequestLightningSendInput {
|
|
|
512
551
|
amountSats?: number | undefined;
|
|
513
552
|
}
|
|
514
553
|
|
|
515
|
-
export { type
|
|
554
|
+
export { type SparkTransferToLeavesConnection as A, type StaticDepositQuoteInput as B, type ClaimStaticDepositOutput as C, type StaticDepositQuoteOutput as D, ExitSpeed as E, type SwapLeaf as F, type GetChallengeOutput as G, type HasSspClientOptions as H, type Invoice as I, type SspClientOptions as J, SspClient as K, type Leaf as L, type MayHaveSspClientOptions as M, type PageInfo as P, type RequestCoopExitInput as R, SparkCoopExitRequestStatus as S, Transfer as T, type UserLeafInput as U, type VerifyChallengeOutput as V, type CompleteCoopExitInput as a, type CompleteLeavesSwapInput as b, type CoopExitFeeEstimate as c, type CoopExitFeeEstimatesInput as d, type CoopExitFeeEstimatesOutput as e, type CoopExitFeeQuote as f, getCoopExitFeeQuoteQuery as g, type CoopExitFeeQuoteInput as h, type CoopExitRequest as i, getCoopExitRequestQuery as j, type CurrencyAmount as k, CurrencyUnit as l, type LeavesSwapFeeEstimateOutput as m, getLeavesSwapRequestQuery as n, type LeavesSwapRequest as o, getLightningReceiveRequestQuery as p, type LightningReceiveRequest as q, LightningReceiveRequestStatus as r, type LightningSendFeeEstimateOutput as s, getLightningSendRequestQuery as t, type LightningSendRequest as u, LightningSendRequestStatus as v, type RequestLeavesSwapInput as w, type RequestLightningReceiveInput as x, type RequestLightningSendInput as y, SparkLeavesSwapRequestStatus as z };
|
package/dist/address/index.cjs
CHANGED
|
@@ -74,7 +74,7 @@ var SparkAddress = {
|
|
|
74
74
|
},
|
|
75
75
|
decode(input, length) {
|
|
76
76
|
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
77
|
-
|
|
77
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
78
78
|
const message = createBaseSparkAddress();
|
|
79
79
|
while (reader.pos < end) {
|
|
80
80
|
const tag = reader.uint32();
|
|
@@ -148,7 +148,7 @@ var PaymentIntentFields = {
|
|
|
148
148
|
},
|
|
149
149
|
decode(input, length) {
|
|
150
150
|
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
151
|
-
|
|
151
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
152
152
|
const message = createBasePaymentIntentFields();
|
|
153
153
|
while (reader.pos < end) {
|
|
154
154
|
const tag = reader.uint32();
|
package/dist/address/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PaymentIntentFields } from '../spark-
|
|
2
|
-
import { a as NetworkType } from '../network-
|
|
1
|
+
import { P as PaymentIntentFields } from '../spark-dM7EYXYQ.cjs';
|
|
2
|
+
import { a as NetworkType } from '../network-CqgsdUF2.cjs';
|
|
3
3
|
import '@bufbuild/protobuf/wire';
|
|
4
4
|
import 'nice-grpc-common';
|
|
5
5
|
import '@buildonspark/lrc20-sdk';
|
package/dist/address/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PaymentIntentFields } from '../spark-
|
|
2
|
-
import { a as NetworkType } from '../network-
|
|
1
|
+
import { P as PaymentIntentFields } from '../spark-dM7EYXYQ.js';
|
|
2
|
+
import { a as NetworkType } from '../network-BTJl-Sul.js';
|
|
3
3
|
import '@bufbuild/protobuf/wire';
|
|
4
4
|
import 'nice-grpc-common';
|
|
5
5
|
import '@buildonspark/lrc20-sdk';
|
package/dist/address/index.js
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
encodeSparkAddress,
|
|
5
5
|
isValidPublicKey,
|
|
6
6
|
isValidSparkAddress
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-M6A4KFIG.js";
|
|
7
|
+
} from "../chunk-KMUMFYFX.js";
|
|
9
8
|
import "../chunk-VTUGIIWI.js";
|
|
10
9
|
import "../chunk-GSI4OLXZ.js";
|
|
10
|
+
import "../chunk-BGGEVUJK.js";
|
|
11
11
|
import "../chunk-MVRQ5US7.js";
|
|
12
12
|
export {
|
|
13
13
|
decodeSparkAddress,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
encodeSparkAddress
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KMUMFYFX.js";
|
|
4
4
|
import {
|
|
5
5
|
getNetwork,
|
|
6
6
|
getNetworkFromAddress
|
|
@@ -8,16 +8,16 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
ELECTRS_CREDENTIALS,
|
|
10
10
|
getElectrsUrl
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-R5PXJZQS.js";
|
|
12
12
|
import {
|
|
13
13
|
BitcoinNetwork_default
|
|
14
14
|
} from "./chunk-HMLOC6TE.js";
|
|
15
|
-
import {
|
|
16
|
-
TreeNode
|
|
17
|
-
} from "./chunk-M6A4KFIG.js";
|
|
18
15
|
import {
|
|
19
16
|
ValidationError
|
|
20
17
|
} from "./chunk-GSI4OLXZ.js";
|
|
18
|
+
import {
|
|
19
|
+
TreeNode
|
|
20
|
+
} from "./chunk-BGGEVUJK.js";
|
|
21
21
|
import {
|
|
22
22
|
Buffer
|
|
23
23
|
} from "./chunk-MVRQ5US7.js";
|
|
@@ -306,18 +306,16 @@ function checkIfValidSequence(currSequence) {
|
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
function getNextTransactionSequence(currSequence, forRefresh) {
|
|
309
|
-
checkIfValidSequence(currSequence);
|
|
310
309
|
const currentTimelock = getCurrentTimelock(currSequence);
|
|
311
310
|
const nextTimelock = currentTimelock - TIME_LOCK_INTERVAL;
|
|
312
|
-
checkIfValidSequence(nextTimelock);
|
|
313
311
|
if (forRefresh && nextTimelock <= 100 && currentTimelock > 0) {
|
|
314
312
|
return {
|
|
315
313
|
nextSequence: 1 << 30 | nextTimelock,
|
|
316
314
|
needRefresh: true
|
|
317
315
|
};
|
|
318
316
|
}
|
|
319
|
-
if (nextTimelock <
|
|
320
|
-
throw new ValidationError("timelock interval is less than
|
|
317
|
+
if (nextTimelock < 0) {
|
|
318
|
+
throw new ValidationError("timelock interval is less than 0", {
|
|
321
319
|
field: "nextTimelock",
|
|
322
320
|
value: nextTimelock
|
|
323
321
|
});
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DefaultSparkSigner
|
|
3
|
+
} from "./chunk-YUPMXTCJ.js";
|
|
1
4
|
import {
|
|
2
5
|
Network,
|
|
3
6
|
NetworkToProto
|
|
@@ -6,10 +9,7 @@ import {
|
|
|
6
9
|
LOCAL_WALLET_CONFIG,
|
|
7
10
|
MAINNET_WALLET_CONFIG,
|
|
8
11
|
REGTEST_WALLET_CONFIG
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
DefaultSparkSigner
|
|
12
|
-
} from "./chunk-TIUBYNN5.js";
|
|
12
|
+
} from "./chunk-R5PXJZQS.js";
|
|
13
13
|
import {
|
|
14
14
|
ConfigurationError
|
|
15
15
|
} from "./chunk-GSI4OLXZ.js";
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
import { isNode } from "@lightsparkdev/core";
|
|
3
3
|
var isReactNative = typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
4
4
|
var isBun = globalThis.Bun !== void 0;
|
|
5
|
-
var packageVersion = true ? "0.1.
|
|
5
|
+
var packageVersion = true ? "0.1.45" : "unknown";
|
|
6
6
|
var baseEnvStr = "unknown";
|
|
7
|
-
if (
|
|
7
|
+
if (isBun) {
|
|
8
|
+
const bunVersion = "version" in globalThis.Bun ? globalThis.Bun.version : "unknown-version";
|
|
9
|
+
baseEnvStr = `bun/${bunVersion}`;
|
|
10
|
+
} else if (isNode) {
|
|
8
11
|
baseEnvStr = `node/${process.version}`;
|
|
9
12
|
} else if (isReactNative) {
|
|
10
13
|
baseEnvStr = "react-native";
|