@buildonspark/spark-sdk 0.0.7 → 0.0.9
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/dist/LightningSendRequest-CNJFhLVc.d.cts +374 -0
- package/dist/LightningSendRequest-CNJFhLVc.d.ts +374 -0
- package/dist/auto-bind.d.ts +7 -0
- package/dist/auto-bind.js +41 -0
- package/dist/auto-bind.js.map +1 -0
- package/dist/chunk-5SAJ52IV.js +10309 -0
- package/dist/chunk-COXVABEU.js +1524 -0
- package/dist/chunk-F4JW24C4.js +78 -0
- package/dist/chunk-H4A2WXR3.js +331 -0
- package/dist/chunk-HTNOFUHX.js +1547 -0
- package/dist/chunk-JQFHUW4I.js +21 -0
- package/dist/chunk-K3Y7DVLD.js +19 -0
- package/dist/chunk-NDKNVHGP.js +127 -0
- package/dist/chunk-PMVJGQCP.js +627 -0
- package/dist/chunk-QX3ZJH2S.js +527 -0
- package/dist/chunk-SL2YOBVM.js +127 -0
- package/dist/chunk-SWCOMKD6.js +333 -0
- package/dist/chunk-SWFFNBSR.js +1244 -0
- package/dist/chunk-WLK5POBV.js +527 -0
- package/dist/chunk-WZ74TD7N.js +660 -0
- package/dist/chunk-WZYVI3M3.js +1244 -0
- package/dist/chunk-ZGU3XW7W.js +78 -0
- package/dist/connection-BgWj7Hnd.d.cts +77 -0
- package/dist/connection-BgbVJtzh.d.ts +77 -0
- package/dist/connection-DX-9yFl8.d.ts +77 -0
- package/dist/connection-hITj9Mgk.d.cts +77 -0
- package/dist/graphql/objects/index.cjs +626 -0
- package/dist/graphql/objects/index.d.cts +140 -0
- package/dist/index.cjs +17202 -0
- package/dist/index.d.cts +413 -0
- package/dist/index.d.ts +413 -0
- package/dist/index.js +3390 -0
- package/dist/proto/spark.cjs +10451 -0
- package/dist/proto/spark.d.cts +3 -0
- package/dist/services/config.d.ts +2 -0
- package/dist/services/config.js +5 -0
- package/dist/services/config.js.map +1 -1
- package/dist/services/connection.d.ts +2 -1
- package/dist/services/connection.js +25 -13
- package/dist/services/connection.js.map +1 -1
- package/dist/services/index.cjs +12503 -0
- package/dist/services/index.d.cts +23 -0
- package/dist/services/index.d.ts +23 -0
- package/dist/services/index.js +17 -0
- package/dist/services/lightning.js +16 -4
- package/dist/services/lightning.js.map +1 -1
- package/dist/services/lrc20.d.ts +5 -0
- package/dist/services/lrc20.js +27 -0
- package/dist/services/lrc20.js.map +1 -0
- package/dist/services/token-transactions.js +27 -3
- package/dist/services/token-transactions.js.map +1 -1
- package/dist/services/transfer.d.ts +1 -0
- package/dist/services/transfer.js +109 -3
- package/dist/services/transfer.js.map +1 -1
- package/dist/services/tree-creation.d.ts +0 -1
- package/dist/services/tree-creation.js +4 -9
- package/dist/services/tree-creation.js.map +1 -1
- package/dist/signer/signer.cjs +894 -0
- package/dist/signer/signer.d.cts +5 -0
- package/dist/signer/signer.d.ts +2 -0
- package/dist/signer/signer.js +9 -3
- package/dist/signer/signer.js.map +1 -1
- package/dist/signer-BaC_ZP1g.d.ts +138 -0
- package/dist/signer-C6h1OnSQ.d.cts +138 -0
- package/dist/signer-CO4owhHI.d.ts +154 -0
- package/dist/signer-DDkpXvNZ.d.cts +154 -0
- package/dist/spark-BUTdOtMz.d.cts +1170 -0
- package/dist/spark-BUTdOtMz.d.ts +1170 -0
- package/dist/spark-sdk.d.ts +25 -18
- package/dist/spark-sdk.js +257 -142
- package/dist/spark-sdk.js.map +1 -1
- package/dist/tests/adaptor-signature.test.js +1 -2
- package/dist/tests/adaptor-signature.test.js.map +1 -1
- package/dist/tests/coop-exit.test.js.map +1 -1
- package/dist/tests/lightning.test.js.map +1 -1
- package/dist/tests/test-util.cjs +12269 -0
- package/dist/tests/test-util.d.cts +90 -0
- package/dist/tests/test-util.d.ts +19 -0
- package/dist/tests/test-util.js +19 -0
- package/dist/tests/test-util.js.map +1 -1
- package/dist/tests/transfer.test.js.map +1 -1
- package/dist/types/grpc.d.ts +6 -0
- package/dist/types/grpc.js +2 -0
- package/dist/types/grpc.js.map +1 -0
- package/dist/utils/index.cjs +1825 -0
- package/dist/utils/index.d.cts +280 -0
- package/dist/utils/keys.d.ts +2 -0
- package/dist/utils/keys.js +4 -0
- package/dist/utils/keys.js.map +1 -1
- package/dist/utils/network.d.ts +17 -0
- package/dist/utils/network.js +16 -0
- package/dist/utils/network.js.map +1 -1
- package/dist/utils/response-validation.js.map +1 -1
- package/dist/utils/token-hashing.js +1 -2
- package/dist/utils/token-hashing.js.map +1 -1
- package/dist/utils/transaction.d.ts +3 -5
- package/dist/utils/transaction.js +14 -16
- package/dist/utils/transaction.js.map +1 -1
- package/dist/utils/wasm-wrapper.js +4 -4
- package/dist/utils/wasm-wrapper.js.map +1 -1
- package/dist/wasm/spark_bindings.js +7 -3
- package/dist/wasm/spark_bindings.js.map +1 -1
- package/dist/wasm/spark_bindings_bg.wasm +0 -0
- package/package.json +14 -2
- package/dist/tests/jest.setup.d.ts +0 -1
- package/dist/tests/jest.setup.js +0 -8
- package/dist/tests/jest.setup.js.map +0 -1
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { Query } from '@lightsparkdev/core';
|
|
2
|
+
|
|
3
|
+
declare enum SparkCoopExitRequestStatus {
|
|
4
|
+
/**
|
|
5
|
+
* This is an enum value that represents values that could be added in the future.
|
|
6
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
7
|
+
*/
|
|
8
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
9
|
+
INITIATED = "INITIATED",
|
|
10
|
+
FAILED = "FAILED",
|
|
11
|
+
SUCCEEDED = "SUCCEEDED"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** This enum identifies the unit of currency associated with a CurrencyAmount. **/
|
|
15
|
+
declare enum CurrencyUnit {
|
|
16
|
+
/**
|
|
17
|
+
* This is an enum value that represents values that could be added in the future.
|
|
18
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
19
|
+
*/
|
|
20
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
21
|
+
/** Bitcoin is the cryptocurrency native to the Bitcoin network. It is used as the native medium for value transfer for the Lightning Network. **/
|
|
22
|
+
BITCOIN = "BITCOIN",
|
|
23
|
+
/** 0.00000001 (10e-8) Bitcoin or one hundred millionth of a Bitcoin. This is the unit most commonly used in Lightning transactions. **/
|
|
24
|
+
SATOSHI = "SATOSHI",
|
|
25
|
+
/** 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible. **/
|
|
26
|
+
MILLISATOSHI = "MILLISATOSHI",
|
|
27
|
+
/** United States Dollar. **/
|
|
28
|
+
USD = "USD",
|
|
29
|
+
/** Mexican Peso. **/
|
|
30
|
+
MXN = "MXN",
|
|
31
|
+
/** Philippine Peso. **/
|
|
32
|
+
PHP = "PHP",
|
|
33
|
+
/** 0.000000001 (10e-9) Bitcoin or a billionth of a Bitcoin. We recommend using the Satoshi unit instead when possible. **/
|
|
34
|
+
NANOBITCOIN = "NANOBITCOIN",
|
|
35
|
+
/** 0.000001 (10e-6) Bitcoin or a millionth of a Bitcoin. We recommend using the Satoshi unit instead when possible. **/
|
|
36
|
+
MICROBITCOIN = "MICROBITCOIN",
|
|
37
|
+
/** 0.001 (10e-3) Bitcoin or a thousandth of a Bitcoin. We recommend using the Satoshi unit instead when possible. **/
|
|
38
|
+
MILLIBITCOIN = "MILLIBITCOIN"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** This object represents the value and unit for an amount of currency. **/
|
|
42
|
+
interface CurrencyAmount {
|
|
43
|
+
/** The original numeric value for this CurrencyAmount. **/
|
|
44
|
+
originalValue: number;
|
|
45
|
+
/** The original unit of currency for this CurrencyAmount. **/
|
|
46
|
+
originalUnit: CurrencyUnit;
|
|
47
|
+
/** The unit of user's preferred currency. **/
|
|
48
|
+
preferredCurrencyUnit: CurrencyUnit;
|
|
49
|
+
/**
|
|
50
|
+
* The rounded numeric value for this CurrencyAmount in the very base level of user's preferred
|
|
51
|
+
* currency. For example, for USD, the value will be in cents.
|
|
52
|
+
**/
|
|
53
|
+
preferredCurrencyValueRounded: number;
|
|
54
|
+
/**
|
|
55
|
+
* The approximate float value for this CurrencyAmount in the very base level of user's preferred
|
|
56
|
+
* currency. For example, for USD, the value will be in cents.
|
|
57
|
+
**/
|
|
58
|
+
preferredCurrencyValueApprox: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface CoopExitRequest {
|
|
62
|
+
/**
|
|
63
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
64
|
+
* string.
|
|
65
|
+
**/
|
|
66
|
+
id: string;
|
|
67
|
+
/** The date and time when the entity was first created. **/
|
|
68
|
+
createdAt: string;
|
|
69
|
+
/** The date and time when the entity was last updated. **/
|
|
70
|
+
updatedAt: string;
|
|
71
|
+
/**
|
|
72
|
+
* The fee includes what user pays for the coop exit and the L1 broadcast fee. The amount user will
|
|
73
|
+
* receive on L1 is total_amount - fee.
|
|
74
|
+
**/
|
|
75
|
+
fee: CurrencyAmount;
|
|
76
|
+
/** The status of the request. **/
|
|
77
|
+
status: SparkCoopExitRequestStatus;
|
|
78
|
+
/** The time when the coop exit request expires and the UTXOs are released. **/
|
|
79
|
+
expiresAt: string;
|
|
80
|
+
/** The raw connector transaction. **/
|
|
81
|
+
rawConnectorTransaction: string;
|
|
82
|
+
/** The typename of the object **/
|
|
83
|
+
typename: string;
|
|
84
|
+
}
|
|
85
|
+
declare const getCoopExitRequestQuery: (id: string) => Query<CoopExitRequest>;
|
|
86
|
+
|
|
87
|
+
declare enum LightningSendRequestStatus {
|
|
88
|
+
/**
|
|
89
|
+
* This is an enum value that represents values that could be added in the future.
|
|
90
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
91
|
+
*/
|
|
92
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
93
|
+
CREATED = "CREATED",
|
|
94
|
+
REQUEST_VALIDATED = "REQUEST_VALIDATED",
|
|
95
|
+
LIGHTNING_PAYMENT_INITIATED = "LIGHTNING_PAYMENT_INITIATED",
|
|
96
|
+
LIGHTNING_PAYMENT_FAILED = "LIGHTNING_PAYMENT_FAILED",
|
|
97
|
+
LIGHTNING_PAYMENT_SUCCEEDED = "LIGHTNING_PAYMENT_SUCCEEDED",
|
|
98
|
+
PREIMAGE_PROVIDED = "PREIMAGE_PROVIDED",
|
|
99
|
+
TRANSFER_COMPLETED = "TRANSFER_COMPLETED"
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** This is an enum identifying a particular Bitcoin Network. **/
|
|
103
|
+
declare enum BitcoinNetwork {
|
|
104
|
+
/**
|
|
105
|
+
* This is an enum value that represents values that could be added in the future.
|
|
106
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
107
|
+
*/
|
|
108
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
109
|
+
/** The production version of the Bitcoin Blockchain. **/
|
|
110
|
+
MAINNET = "MAINNET",
|
|
111
|
+
/** A test version of the Bitcoin Blockchain, maintained by Lightspark. **/
|
|
112
|
+
REGTEST = "REGTEST",
|
|
113
|
+
/** A test version of the Bitcoin Blockchain, maintained by a centralized organization. Not in use at Lightspark. **/
|
|
114
|
+
SIGNET = "SIGNET",
|
|
115
|
+
/** A test version of the Bitcoin Blockchain, publicly available. **/
|
|
116
|
+
TESTNET = "TESTNET"
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface CompleteCoopExitInput {
|
|
120
|
+
userOutboundTransferExternalId: string;
|
|
121
|
+
coopExitRequestId: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
interface CompleteLeavesSwapInput {
|
|
125
|
+
adaptorSecretKey: string;
|
|
126
|
+
userOutboundTransferExternalId: string;
|
|
127
|
+
leavesSwapRequestId: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** This is an object representing information about a page returned by the Lightspark API. For more information, please see the “Pagination” section of our API docs for more information about its usage. **/
|
|
131
|
+
interface PageInfo {
|
|
132
|
+
hasNextPage?: boolean | undefined;
|
|
133
|
+
hasPreviousPage?: boolean | undefined;
|
|
134
|
+
startCursor?: string | undefined;
|
|
135
|
+
endCursor?: string | undefined;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
interface CoopExitFeeEstimateInput {
|
|
139
|
+
leafExternalIds: string[];
|
|
140
|
+
withdrawalAddress: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
interface CoopExitFeeEstimateOutput {
|
|
144
|
+
feeEstimate: CurrencyAmount;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
interface Invoice {
|
|
148
|
+
encodedEnvoice: string;
|
|
149
|
+
bitcoinNetwork: BitcoinNetwork;
|
|
150
|
+
paymentHash: string;
|
|
151
|
+
amount: CurrencyAmount;
|
|
152
|
+
createdAt: string;
|
|
153
|
+
expiresAt: string;
|
|
154
|
+
memo?: string | undefined;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
interface Leaf {
|
|
158
|
+
/** The amount of the leaf. **/
|
|
159
|
+
amount: CurrencyAmount;
|
|
160
|
+
/** The id of the leaf known at signing operators. **/
|
|
161
|
+
sparkNodeId: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
declare enum SparkLeavesSwapRequestStatus {
|
|
165
|
+
/**
|
|
166
|
+
* This is an enum value that represents values that could be added in the future.
|
|
167
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
168
|
+
*/
|
|
169
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
170
|
+
INITIATED = "INITIATED",
|
|
171
|
+
FAILED = "FAILED",
|
|
172
|
+
SUCCEEDED = "SUCCEEDED"
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
interface SwapLeaf {
|
|
176
|
+
leafId: string;
|
|
177
|
+
rawUnsignedRefundTransaction: string;
|
|
178
|
+
adaptorSignedSignature: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
interface LeavesSwapRequest {
|
|
182
|
+
/**
|
|
183
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
184
|
+
* string.
|
|
185
|
+
**/
|
|
186
|
+
id: string;
|
|
187
|
+
/** The date and time when the entity was first created. **/
|
|
188
|
+
createdAt: string;
|
|
189
|
+
/** The date and time when the entity was last updated. **/
|
|
190
|
+
updatedAt: string;
|
|
191
|
+
/** The status of the request. **/
|
|
192
|
+
status: SparkLeavesSwapRequestStatus;
|
|
193
|
+
/** The total amount of leaves user sent for swap. **/
|
|
194
|
+
totalAmount: CurrencyAmount;
|
|
195
|
+
/** The target amount of leaves user wanted to get from the swap. **/
|
|
196
|
+
targetAmount: CurrencyAmount;
|
|
197
|
+
/** The fee user needs to pay for swap. **/
|
|
198
|
+
fee: CurrencyAmount;
|
|
199
|
+
/** The leaves transfer to user. **/
|
|
200
|
+
inboundTransfer: Transfer;
|
|
201
|
+
/** The time when the leaves swap request expires. **/
|
|
202
|
+
expiresAt: string;
|
|
203
|
+
/** The swap leaves returned to the user **/
|
|
204
|
+
swapLeaves: SwapLeaf[];
|
|
205
|
+
/** The typename of the object **/
|
|
206
|
+
typename: string;
|
|
207
|
+
/** The leaves transfer out from user. **/
|
|
208
|
+
outboundTransfer?: Transfer | undefined;
|
|
209
|
+
}
|
|
210
|
+
declare const getLeavesSwapRequestQuery: (id: string) => Query<LeavesSwapRequest>;
|
|
211
|
+
|
|
212
|
+
interface LightningReceiveFeeEstimateOutput {
|
|
213
|
+
feeEstimate: CurrencyAmount;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
declare enum LightningReceiveRequestStatus {
|
|
217
|
+
/**
|
|
218
|
+
* This is an enum value that represents values that could be added in the future.
|
|
219
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
220
|
+
*/
|
|
221
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
222
|
+
INVOICE_CREATED = "INVOICE_CREATED",
|
|
223
|
+
TRANSFER_CREATED = "TRANSFER_CREATED",
|
|
224
|
+
TRANSFER_CREATION_FAILED = "TRANSFER_CREATION_FAILED",
|
|
225
|
+
REFUND_SIGNING_COMMITMENTS_QUERYING_FAILED = "REFUND_SIGNING_COMMITMENTS_QUERYING_FAILED",
|
|
226
|
+
REFUND_SIGNING_FAILED = "REFUND_SIGNING_FAILED",
|
|
227
|
+
PAYMENT_PREIMAGE_RECOVERED = "PAYMENT_PREIMAGE_RECOVERED",
|
|
228
|
+
PAYMENT_PREIMAGE_RECOVERING_FAILED = "PAYMENT_PREIMAGE_RECOVERING_FAILED",
|
|
229
|
+
LIGHTNING_PAYMENT_RECEIVED = "LIGHTNING_PAYMENT_RECEIVED",
|
|
230
|
+
TRANSFER_FAILED = "TRANSFER_FAILED",
|
|
231
|
+
TRANSFER_COMPLETED = "TRANSFER_COMPLETED"
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
interface LightningReceiveRequest {
|
|
235
|
+
/**
|
|
236
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
237
|
+
* string.
|
|
238
|
+
**/
|
|
239
|
+
id: string;
|
|
240
|
+
/** The date and time when the entity was first created. **/
|
|
241
|
+
createdAt: string;
|
|
242
|
+
/** The date and time when the entity was last updated. **/
|
|
243
|
+
updatedAt: string;
|
|
244
|
+
/** The lightning invoice generated to receive lightning payment. **/
|
|
245
|
+
invoice: Invoice;
|
|
246
|
+
/** The fee charged for receiving the lightning invoice. **/
|
|
247
|
+
fee: CurrencyAmount;
|
|
248
|
+
/** The status of the request. **/
|
|
249
|
+
status: LightningReceiveRequestStatus;
|
|
250
|
+
/** The typename of the object **/
|
|
251
|
+
typename: string;
|
|
252
|
+
/** The leaves transfer after lightning payment was received. **/
|
|
253
|
+
transfer?: Transfer | undefined;
|
|
254
|
+
}
|
|
255
|
+
declare const getLightningReceiveRequestQuery: (id: string) => Query<LightningReceiveRequest>;
|
|
256
|
+
|
|
257
|
+
interface LightningSendFeeEstimateOutput {
|
|
258
|
+
feeEstimate: CurrencyAmount;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
interface RequestCoopExitInput {
|
|
262
|
+
leafExternalIds: string[];
|
|
263
|
+
withdrawalAddress: string;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
interface UserLeafInput {
|
|
267
|
+
leaf_id: string;
|
|
268
|
+
raw_unsigned_refund_transaction: string;
|
|
269
|
+
adaptor_added_signature: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
interface RequestLeavesSwapInput {
|
|
273
|
+
adaptorPubkey: string;
|
|
274
|
+
totalAmountSats: number;
|
|
275
|
+
targetAmountSats: number;
|
|
276
|
+
feeSats: number;
|
|
277
|
+
userLeaves: UserLeafInput[];
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
interface RequestLightningReceiveInput {
|
|
281
|
+
/** The bitcoin network the lightning invoice is created on. **/
|
|
282
|
+
network: BitcoinNetwork;
|
|
283
|
+
/** The amount for which the lightning invoice should be created in satoshis. **/
|
|
284
|
+
amountSats: number;
|
|
285
|
+
/** The 32-byte hash of the payment preimage to use when generating the lightning invoice. **/
|
|
286
|
+
paymentHash: string;
|
|
287
|
+
/** The expiry of the lightning invoice in seconds. Default value is 3600 (1 hour). **/
|
|
288
|
+
expirySecs?: number | undefined;
|
|
289
|
+
/** The memo to include in the lightning invoice. **/
|
|
290
|
+
memo?: string | undefined;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
interface RequestLightningSendInput {
|
|
294
|
+
encodedInvoice: string;
|
|
295
|
+
idempotencyKey: string;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
interface SparkTransferToLeavesConnection {
|
|
299
|
+
/**
|
|
300
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
301
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
302
|
+
**/
|
|
303
|
+
count: number;
|
|
304
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
305
|
+
pageInfo: PageInfo;
|
|
306
|
+
/** The leaves for the current page of this connection. **/
|
|
307
|
+
entities: Leaf[];
|
|
308
|
+
/** The typename of the object **/
|
|
309
|
+
typename: string;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
declare class SspClient {
|
|
313
|
+
private readonly requester;
|
|
314
|
+
private identityPublicKey;
|
|
315
|
+
private readonly signingKey?;
|
|
316
|
+
constructor(identityPublicKey: string);
|
|
317
|
+
executeRawQuery<T>(query: Query<T>): Promise<T | null>;
|
|
318
|
+
getLightningReceiveFeeEstimate(amountSats: number, network: BitcoinNetwork): Promise<LightningReceiveFeeEstimateOutput | null>;
|
|
319
|
+
getLightningSendFeeEstimate(encodedInvoice: string): Promise<LightningSendFeeEstimateOutput | null>;
|
|
320
|
+
getCoopExitFeeEstimate({ leafExternalIds, withdrawalAddress, }: CoopExitFeeEstimateInput): Promise<CoopExitFeeEstimateOutput | null>;
|
|
321
|
+
getCurrentUser(): Promise<void>;
|
|
322
|
+
completeCoopExit({ userOutboundTransferExternalId, coopExitRequestId, }: CompleteCoopExitInput): Promise<CoopExitRequest | null>;
|
|
323
|
+
requestCoopExit({ leafExternalIds, withdrawalAddress, }: RequestCoopExitInput): Promise<CoopExitRequest | null>;
|
|
324
|
+
requestLightningReceive({ amountSats, network, paymentHash, expirySecs, memo, }: RequestLightningReceiveInput): Promise<LightningReceiveRequest | null>;
|
|
325
|
+
requestLightningSend({ encodedInvoice, idempotencyKey, }: RequestLightningSendInput): Promise<LightningSendRequest | null>;
|
|
326
|
+
requestLeaveSwap({ adaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
327
|
+
completeLeaveSwap({ adaptorSecretKey, userOutboundTransferExternalId, leavesSwapRequestId, }: CompleteLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
declare class Transfer {
|
|
331
|
+
/** The total amount of the transfer. **/
|
|
332
|
+
readonly totalAmount: CurrencyAmount;
|
|
333
|
+
/** The id of the transfer known at signing operators. If not set, the transfer hasn't been
|
|
334
|
+
* initialized. **/
|
|
335
|
+
readonly sparkId?: string | undefined;
|
|
336
|
+
constructor(
|
|
337
|
+
/** The total amount of the transfer. **/
|
|
338
|
+
totalAmount: CurrencyAmount,
|
|
339
|
+
/** The id of the transfer known at signing operators. If not set, the transfer hasn't been
|
|
340
|
+
* initialized. **/
|
|
341
|
+
sparkId?: string | undefined);
|
|
342
|
+
getLeaves(client: SspClient, first?: number | undefined, after?: string | undefined): Promise<SparkTransferToLeavesConnection>;
|
|
343
|
+
toJson(): {
|
|
344
|
+
transfer_total_amount: any;
|
|
345
|
+
transfer_spark_id: string | undefined;
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
interface LightningSendRequest {
|
|
350
|
+
/**
|
|
351
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
352
|
+
* string.
|
|
353
|
+
**/
|
|
354
|
+
id: string;
|
|
355
|
+
/** The date and time when the entity was first created. **/
|
|
356
|
+
createdAt: string;
|
|
357
|
+
/** The date and time when the entity was last updated. **/
|
|
358
|
+
updatedAt: string;
|
|
359
|
+
/** The lightning invoice user requested to pay. **/
|
|
360
|
+
encodedInvoice: string;
|
|
361
|
+
/** The fee charged for paying the lightning invoice. **/
|
|
362
|
+
fee: CurrencyAmount;
|
|
363
|
+
/** The idempotency key of the request. **/
|
|
364
|
+
idempotencyKey: string;
|
|
365
|
+
/** The status of the request. **/
|
|
366
|
+
status: LightningSendRequestStatus;
|
|
367
|
+
/** The typename of the object **/
|
|
368
|
+
typename: string;
|
|
369
|
+
/** The leaves transfer after lightning payment was sent. **/
|
|
370
|
+
transfer?: Transfer | undefined;
|
|
371
|
+
}
|
|
372
|
+
declare const getLightningSendRequestQuery: (id: string) => Query<LightningSendRequest>;
|
|
373
|
+
|
|
374
|
+
export { BitcoinNetwork as B, type CurrencyAmount as C, type Invoice as I, type Leaf as L, type PageInfo as P, type RequestCoopExitInput as R, SparkCoopExitRequestStatus as S, Transfer as T, type UserLeafInput as U, type CompleteCoopExitInput as a, type CompleteLeavesSwapInput as b, type CoopExitFeeEstimateInput as c, type CoopExitFeeEstimateOutput as d, type CoopExitRequest as e, CurrencyUnit as f, getCoopExitRequestQuery as g, getLeavesSwapRequestQuery as h, type LeavesSwapRequest as i, type LightningReceiveFeeEstimateOutput as j, getLightningReceiveRequestQuery as k, type LightningReceiveRequest as l, LightningReceiveRequestStatus as m, type LightningSendFeeEstimateOutput as n, getLightningSendRequestQuery as o, type LightningSendRequest as p, LightningSendRequestStatus as q, type RequestLeavesSwapInput as r, type RequestLightningReceiveInput as s, type RequestLightningSendInput as t, SparkLeavesSwapRequestStatus as u, type SparkTransferToLeavesConnection as v, type SwapLeaf as w };
|