@lightsparkdev/lightspark-sdk 0.2.8 → 0.3.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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @lightsparkdev/lightspark-sdk
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b21bf7b: Release
8
+ - Updated dependencies [b21bf7b]
9
+ - @lightsparkdev/core@0.3.1
10
+
11
+ ## 0.3.0
12
+
13
+ ### Minor Changes
14
+
15
+ - d14f64e: Release
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [d14f64e]
20
+ - @lightsparkdev/core@0.3.0
21
+
3
22
  ## 0.2.8
4
23
 
5
24
  ### Patch Changes
@@ -5702,6 +5702,11 @@ export {
5702
5702
  ApiTokenFromJson,
5703
5703
  FRAGMENT as FRAGMENT3,
5704
5704
  getApiTokenQuery,
5705
+ HtlcAttemptFailureCode_default,
5706
+ OutgoingPaymentAttemptStatus_default,
5707
+ getHopQuery,
5708
+ OutgoingPaymentAttempt_default,
5709
+ PaymentFailureReason_default,
5705
5710
  BitcoinNetwork_default,
5706
5711
  NodeAddressType_default,
5707
5712
  GraphNode_default,
@@ -5711,18 +5716,13 @@ export {
5711
5716
  Channel_default,
5712
5717
  LightsparkNode_default,
5713
5718
  Node_default,
5714
- InvoiceDataFromJson,
5715
- FRAGMENT7 as FRAGMENT4,
5716
- FRAGMENT22 as FRAGMENT5,
5717
- HtlcAttemptFailureCode_default,
5718
- OutgoingPaymentAttemptStatus_default,
5719
- getHopQuery,
5720
- OutgoingPaymentAttempt_default,
5721
- PaymentFailureReason_default,
5722
5719
  TransactionStatus_default,
5723
5720
  OutgoingPaymentFromJson,
5724
- FRAGMENT13 as FRAGMENT6,
5721
+ FRAGMENT13 as FRAGMENT4,
5725
5722
  OutgoingPayment_default,
5723
+ InvoiceDataFromJson,
5724
+ FRAGMENT7 as FRAGMENT5,
5725
+ FRAGMENT22 as FRAGMENT6,
5726
5726
  WithdrawalMode_default,
5727
5727
  WithdrawalRequestStatus_default,
5728
5728
  getChannelClosingTransactionQuery,
@@ -1,4 +1,4 @@
1
- import { Maybe, Query, AuthProvider, CryptoInterface } from '@lightsparkdev/core';
1
+ import { Maybe, Query, AuthProvider, CryptoInterface, KeyOrAliasType } from '@lightsparkdev/core';
2
2
  import Observable from 'zen-observable';
3
3
 
4
4
  declare enum CurrencyUnit {
@@ -1138,7 +1138,7 @@ declare class WithdrawalRequest implements Entity {
1138
1138
  * const invoiceDetails = await lightsparkClient.decodeInvoice(encodedInvoice);
1139
1139
  * console.log(invoiceDetails);
1140
1140
  *
1141
- * const payment = await lightsparkClient.payInvoice(PAYING_NODE_ID, encodedInvoice, 1000);
1141
+ * const payment = await lightsparkClient.payInvoice(PAYING_NODE_ID, encodedInvoice, 100000);
1142
1142
  * console.log(payment);
1143
1143
  * ```
1144
1144
  *
@@ -1156,8 +1156,8 @@ declare class LightsparkClient {
1156
1156
  * @param authProvider The auth provider to use for authentication. Defaults to a stub auth provider. For server-side
1157
1157
  * use, you should use the `AccountTokenAuthProvider`.
1158
1158
  * @param serverUrl The base URL of the server to connect to. Defaults to lightspark production.
1159
- * @param nodeKeyCache This is used to cache node keys for the duration of the session. Defaults to a new instance of
1160
- * `NodeKeyCache`. You should not need to change this.
1159
+ * @param cryptoImpl The crypto implementation to use. Defaults to web and node compatible crypto.
1160
+ * For React Native, you should use the `ReactNativeCrypto` implementation from `@lightsparkdev/react-native`.
1161
1161
  */
1162
1162
  constructor(authProvider?: AuthProvider, serverUrl?: string, cryptoImpl?: CryptoInterface);
1163
1163
  /**
@@ -1216,6 +1216,8 @@ declare class LightsparkClient {
1216
1216
  /**
1217
1217
  * Creates an invoice for the given node.
1218
1218
  *
1219
+ * Test mode note: You can simulate a payment of this invoice in test move using [createTestModePayment].
1220
+ *
1219
1221
  * @param nodeId The node ID for which to create an invoice.
1220
1222
  * @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount.
1221
1223
  * @param memo A string memo to include in the invoice as a description.
@@ -1268,15 +1270,18 @@ declare class LightsparkClient {
1268
1270
  unlockNode(nodeId: string, password: string): Promise<boolean>;
1269
1271
  private recoverNodeSigningKey;
1270
1272
  /**
1271
- * Directly unlocks a node with a signing private key.
1273
+ * Directly unlocks a node with a signing private key or alias.
1272
1274
  *
1273
1275
  * @param nodeId The ID of the node to unlock.
1274
1276
  * @param signingPrivateKeyPEM The PEM-encoded signing private key.
1275
1277
  */
1276
- loadNodeKey(nodeId: string, signingPrivateKeyPEM: string): Promise<void>;
1278
+ loadNodeKey(nodeId: string, signingPrivateKeyOrAlias: KeyOrAliasType): Promise<void>;
1277
1279
  /**
1278
1280
  * Sends a lightning payment for a given invoice.
1279
1281
  *
1282
+ * Test mode note: For test mode, you can use the [createTestModeInvoice] function to create an invoice you can
1283
+ * pay in test mode.
1284
+ *
1280
1285
  * @param payerNodeId The ID of the node that will pay the invoice.
1281
1286
  * @param encodedInvoice The encoded invoice to pay.
1282
1287
  * @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required.
@@ -1349,6 +1354,26 @@ declare class LightsparkClient {
1349
1354
  * @param id The ID of the API token to delete.
1350
1355
  */
1351
1356
  deleteApiToken(id: string): Promise<void>;
1357
+ /**
1358
+ * In test mode, generates a Lightning Invoice which can be paid by a local node.
1359
+ * This call is only valid in test mode. You can then pay the invoice using [payInvoice].
1360
+ *
1361
+ * @param localNodeId The ID of the node that will pay the invoice.
1362
+ * @param amountMsats The amount to pay in milli-satoshis.
1363
+ * @param memo An optional memo to attach to the invoice.
1364
+ * @param invoiceType The type of invoice to create.
1365
+ */
1366
+ createTestModeInvoice(localNodeId: string, amountMsats: number, memo?: string | undefined, invoiceType?: InvoiceType): Promise<string | null>;
1367
+ /**
1368
+ * In test mode, simulates a payment of a Lightning Invoice from another node.
1369
+ * This can only be used in test mode and should be used with invoices generated by [createInvoice].
1370
+ *
1371
+ * @param localNodeId The ID of the node that will receive the payment.
1372
+ * @param encodedInvoice The encoded invoice to pay.
1373
+ * @param amountMsats The amount to pay in milli-satoshis for 0-amount invoices. This should be null for non-zero
1374
+ * amount invoices.
1375
+ */
1376
+ createTestModePayment(localNodeId: string, encodedInvoice: string, amountMsats?: number | undefined): Promise<OutgoingPayment | null>;
1352
1377
  /**
1353
1378
  * Executes a raw `Query` against the Lightspark API.
1354
1379
  *