@lendasat/lendaswap-sdk-native 0.1.70 → 0.1.72
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/index.d.ts +30 -4
- package/lendaswap-sdk-native.darwin-arm64.node +0 -0
- package/lendaswap-sdk-native.darwin-x64.node +0 -0
- package/lendaswap-sdk-native.linux-arm64-gnu.node +0 -0
- package/lendaswap-sdk-native.linux-x64-gnu.node +0 -0
- package/lendaswap-sdk-native.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -82,6 +82,10 @@ export interface BtcToEvmSwapResponse {
|
|
|
82
82
|
evmHtlcClaimTxid?: string
|
|
83
83
|
/** EVM HTLC fund transaction ID */
|
|
84
84
|
evmHtlcFundTxid?: string
|
|
85
|
+
/** Amount user will receive of target asset */
|
|
86
|
+
targetAmount?: number
|
|
87
|
+
/** Amount user must send in satoshis */
|
|
88
|
+
sourceAmount?: number
|
|
85
89
|
}
|
|
86
90
|
/** EVM to BTC swap response. */
|
|
87
91
|
export interface EvmToBtcSwapResponse {
|
|
@@ -107,6 +111,10 @@ export interface EvmToBtcSwapResponse {
|
|
|
107
111
|
evmHtlcClaimTxid?: string
|
|
108
112
|
/** EVM HTLC fund transaction ID */
|
|
109
113
|
evmHtlcFundTxid?: string
|
|
114
|
+
/** Amount user will receive in sats */
|
|
115
|
+
targetAmount: number
|
|
116
|
+
/** Amount user must send of the source asset */
|
|
117
|
+
sourceAmount: number
|
|
110
118
|
}
|
|
111
119
|
/** BTC to Arkade swap response. */
|
|
112
120
|
export interface BtcToArkadeSwapResponse {
|
|
@@ -130,6 +138,10 @@ export interface BtcToArkadeSwapResponse {
|
|
|
130
138
|
arkadeFundTxid?: string
|
|
131
139
|
/** Arkade VHTLC claim transaction ID. */
|
|
132
140
|
arkadeClaimTxid?: string
|
|
141
|
+
/** Amount user will receive on Arkade in satoshis */
|
|
142
|
+
targetAmount: number
|
|
143
|
+
/** Amount user must send in satoshis */
|
|
144
|
+
sourceAmount: number
|
|
133
145
|
}
|
|
134
146
|
/** On-chain BTC to EVM swap response. */
|
|
135
147
|
export interface OnchainToEvmSwapResponse {
|
|
@@ -175,9 +187,9 @@ export interface ExtendedSwapStorageData {
|
|
|
175
187
|
/** SQLite storage handle for Node.js. */
|
|
176
188
|
export declare class SqliteStorageHandle {
|
|
177
189
|
/** Open or create a SQLite database at the given path. */
|
|
178
|
-
static open(path: string): SqliteStorageHandle
|
|
190
|
+
static open(path: string): Promise<SqliteStorageHandle>
|
|
179
191
|
/** Create an in-memory SQLite database (useful for testing). */
|
|
180
|
-
static inMemory(): SqliteStorageHandle
|
|
192
|
+
static inMemory(): Promise<SqliteStorageHandle>
|
|
181
193
|
}
|
|
182
194
|
/** Lendaswap client for Node.js with SQLite storage. */
|
|
183
195
|
export declare class Client {
|
|
@@ -185,6 +197,14 @@ export declare class Client {
|
|
|
185
197
|
constructor(storage: SqliteStorageHandle, url: string, network: string, arkadeUrl: string, esploraUrl: string)
|
|
186
198
|
/** Initialize the client (generates or loads mnemonic). */
|
|
187
199
|
init(mnemonic?: string | undefined | null): Promise<void>
|
|
200
|
+
/**
|
|
201
|
+
* Set the API key for tracking swap creation.
|
|
202
|
+
*
|
|
203
|
+
* When set, the API key will be sent as the `X-API-Key` header on swap creation requests.
|
|
204
|
+
*/
|
|
205
|
+
setApiKey(apiKey?: string | undefined | null): Promise<void>
|
|
206
|
+
/** Get the current API key. */
|
|
207
|
+
getApiKey(): Promise<string | null>
|
|
188
208
|
/** Get the current mnemonic. */
|
|
189
209
|
getMnemonic(): Promise<string>
|
|
190
210
|
/** Get the user ID xpub. */
|
|
@@ -218,8 +238,8 @@ export declare class Client {
|
|
|
218
238
|
getSwap(id: string): Promise<ExtendedSwapStorageData>
|
|
219
239
|
/** List all swaps. */
|
|
220
240
|
listAll(): Promise<Array<ExtendedSwapStorageData>>
|
|
221
|
-
/** Claim
|
|
222
|
-
|
|
241
|
+
/** Claim a swap (server-sponsored, gasless). */
|
|
242
|
+
claim(swapId: string, secret?: string | undefined | null): Promise<void>
|
|
223
243
|
/** Claim VHTLC. */
|
|
224
244
|
claimVhtlc(swapId: string): Promise<string>
|
|
225
245
|
/** Refund VHTLC. */
|
|
@@ -249,6 +269,12 @@ export declare class ClientBuilder {
|
|
|
249
269
|
arkadeUrl(url: string): this
|
|
250
270
|
/** Set the Esplora URL. */
|
|
251
271
|
esploraUrl(url: string): this
|
|
272
|
+
/**
|
|
273
|
+
* Set the API key for tracking swap creation.
|
|
274
|
+
*
|
|
275
|
+
* When set, the API key will be sent as the `X-API-Key` header on swap creation requests.
|
|
276
|
+
*/
|
|
277
|
+
apiKey(apiKey: string): this
|
|
252
278
|
/** Build the client. */
|
|
253
279
|
build(): Client
|
|
254
280
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|