@lightsparkdev/lightspark-sdk 1.7.1 → 1.8.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/{chunk-DSWMAFFH.js → chunk-4KFNQOMH.js} +99 -41
  3. package/dist/{index-85107c9f.d.ts → index-9a69ef6a.d.ts} +18 -6
  4. package/dist/index.cjs +158 -94
  5. package/dist/index.d.cts +2 -2
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +4 -4
  8. package/dist/objects/index.cjs +112 -54
  9. package/dist/objects/index.d.cts +1 -1
  10. package/dist/objects/index.d.ts +1 -1
  11. package/dist/objects/index.js +1 -1
  12. package/package.json +2 -2
  13. package/src/client.ts +1 -1
  14. package/src/objects/Account.ts +9 -2
  15. package/src/objects/ApiToken.ts +5 -2
  16. package/src/objects/AuditLogActor.ts +5 -2
  17. package/src/objects/Channel.ts +5 -2
  18. package/src/objects/ChannelClosingTransaction.ts +5 -3
  19. package/src/objects/ChannelOpeningTransaction.ts +5 -3
  20. package/src/objects/ChannelSnapshot.ts +5 -2
  21. package/src/objects/CurrencyUnit.ts +1 -1
  22. package/src/objects/Deposit.ts +5 -2
  23. package/src/objects/Entity.ts +2 -0
  24. package/src/objects/GraphNode.ts +5 -2
  25. package/src/objects/Hop.ts +5 -2
  26. package/src/objects/IncomingPayment.ts +5 -2
  27. package/src/objects/IncomingPaymentAttempt.ts +5 -2
  28. package/src/objects/Invoice.ts +23 -2
  29. package/src/objects/LightningTransaction.ts +5 -2
  30. package/src/objects/LightsparkNode.ts +5 -2
  31. package/src/objects/LightsparkNodeOwner.ts +5 -2
  32. package/src/objects/LightsparkNodeWithOSK.ts +5 -3
  33. package/src/objects/LightsparkNodeWithRemoteSigning.ts +5 -3
  34. package/src/objects/Node.ts +5 -2
  35. package/src/objects/OnChainTransaction.ts +5 -2
  36. package/src/objects/OutgoingPayment.ts +5 -2
  37. package/src/objects/OutgoingPaymentAttempt.ts +5 -3
  38. package/src/objects/PaymentRequest.ts +11 -2
  39. package/src/objects/RegionCode.ts +2 -0
  40. package/src/objects/RoutingTransaction.ts +5 -2
  41. package/src/objects/Signable.ts +5 -2
  42. package/src/objects/SignablePayload.ts +5 -2
  43. package/src/objects/Transaction.ts +5 -2
  44. package/src/objects/TransactionStatus.ts +1 -1
  45. package/src/objects/UmaInvitation.ts +5 -2
  46. package/src/objects/Wallet.ts +7 -2
  47. package/src/objects/WalletStatus.ts +2 -2
  48. package/src/objects/Withdrawal.ts +5 -2
  49. package/src/objects/WithdrawalRequest.ts +5 -2
  50. package/src/tests/generated-objects.test.ts +93 -0
  51. package/src/tests/serialization.test.ts +0 -21
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @lightsparkdev/lightspark-sdk
2
2
 
3
+ ## 1.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b43609d: - Fix property null check
8
+ - Updated dependencies [b43609d]
9
+ - @lightsparkdev/core@1.2.1
10
+
11
+ ## 1.8.0
12
+
13
+ ### Minor Changes
14
+
15
+ - c17a851: - Fix error where constructObject can reference properties from non-object argument type
16
+ - Regenerate SDKs
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [c17a851]
21
+ - @lightsparkdev/core@1.2.0
22
+
3
23
  ## 1.7.1
4
24
 
5
25
  ### Patch Changes
@@ -2,6 +2,9 @@ import {
2
2
  BitcoinNetwork_default
3
3
  } from "./chunk-K6SAUSAX.js";
4
4
 
5
+ // src/objects/Account.ts
6
+ import { isObject as isObject20 } from "@lightsparkdev/core";
7
+
5
8
  // ../../node_modules/auto-bind/index.js
6
9
  var getAllProperties = (object) => {
7
10
  const properties = /* @__PURE__ */ new Set();
@@ -35,6 +38,9 @@ function autoBind(self, { include, exclude } = {}) {
35
38
  return self;
36
39
  }
37
40
 
41
+ // src/objects/ApiToken.ts
42
+ import { isObject } from "@lightsparkdev/core";
43
+
38
44
  // src/objects/Permission.ts
39
45
  var Permission = /* @__PURE__ */ ((Permission2) => {
40
46
  Permission2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -94,7 +100,7 @@ query GetApiToken($id: ID!) {
94
100
  ${FRAGMENT}
95
101
  `,
96
102
  variables: { id },
97
- constructObject: (data) => ApiTokenFromJson(data.entity)
103
+ constructObject: (data) => isObject(data) && "entity" in data && isObject(data.entity) ? ApiTokenFromJson(data.entity) : null
98
104
  };
99
105
  };
100
106
 
@@ -122,6 +128,9 @@ var AccountToApiTokensConnectionFromJson = (obj) => {
122
128
  };
123
129
  };
124
130
 
131
+ // src/objects/Channel.ts
132
+ import { isObject as isObject2 } from "@lightsparkdev/core";
133
+
125
134
  // src/objects/CurrencyUnit.ts
126
135
  var CurrencyUnit = /* @__PURE__ */ ((CurrencyUnit2) => {
127
136
  CurrencyUnit2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -319,7 +328,7 @@ query GetChannel($id: ID!) {
319
328
  ${FRAGMENT3}
320
329
  `,
321
330
  variables: { id },
322
- constructObject: (data) => ChannelFromJson(data.entity)
331
+ constructObject: (data) => isObject2(data) && "entity" in data && isObject2(data.entity) ? ChannelFromJson(data.entity) : null
323
332
  };
324
333
  }
325
334
  toJson() {
@@ -479,7 +488,7 @@ var AccountToChannelsConnectionFromJson = (obj) => {
479
488
  };
480
489
 
481
490
  // src/objects/LightsparkNode.ts
482
- import { LightsparkException } from "@lightsparkdev/core";
491
+ import { LightsparkException, isObject as isObject5 } from "@lightsparkdev/core";
483
492
 
484
493
  // src/objects/Balances.ts
485
494
  var BalancesFromJson = (obj) => {
@@ -544,6 +553,9 @@ var LightsparkNodeStatus = /* @__PURE__ */ ((LightsparkNodeStatus2) => {
544
553
  })(LightsparkNodeStatus || {});
545
554
  var LightsparkNodeStatus_default = LightsparkNodeStatus;
546
555
 
556
+ // src/objects/LightsparkNodeWithOSK.ts
557
+ import { isObject as isObject3 } from "@lightsparkdev/core";
558
+
547
559
  // src/objects/LightsparkNodeToChannelsConnection.ts
548
560
  var LightsparkNodeToChannelsConnectionFromJson = (obj) => {
549
561
  return {
@@ -865,7 +877,7 @@ query GetLightsparkNodeWithOSK($id: ID!) {
865
877
  ${FRAGMENT4}
866
878
  `,
867
879
  variables: { id },
868
- constructObject: (data) => LightsparkNodeWithOSKFromJson(data.entity)
880
+ constructObject: (data) => isObject3(data) && "entity" in data && isObject3(data.entity) ? LightsparkNodeWithOSKFromJson(data.entity) : null
869
881
  };
870
882
  }
871
883
  toJson() {
@@ -1059,6 +1071,7 @@ fragment LightsparkNodeWithOSKFragment on LightsparkNodeWithOSK {
1059
1071
  var LightsparkNodeWithOSK_default = LightsparkNodeWithOSK;
1060
1072
 
1061
1073
  // src/objects/LightsparkNodeWithRemoteSigning.ts
1074
+ import { isObject as isObject4 } from "@lightsparkdev/core";
1062
1075
  var LightsparkNodeWithRemoteSigning = class {
1063
1076
  constructor(id, createdAt, updatedAt, bitcoinNetwork, displayName, ownerId, umaPrescreeningUtxos, typename, alias, color, conductivity, publicKey, status, totalBalance, totalLocalBalance, localBalance, remoteBalance, blockchainBalance, balances) {
1064
1077
  this.id = id;
@@ -1294,7 +1307,7 @@ query GetLightsparkNodeWithRemoteSigning($id: ID!) {
1294
1307
  ${FRAGMENT5}
1295
1308
  `,
1296
1309
  variables: { id },
1297
- constructObject: (data) => LightsparkNodeWithRemoteSigningFromJson(data.entity)
1310
+ constructObject: (data) => isObject4(data) && "entity" in data && isObject4(data.entity) ? LightsparkNodeWithRemoteSigningFromJson(data.entity) : null
1298
1311
  };
1299
1312
  }
1300
1313
  toJson() {
@@ -1837,7 +1850,7 @@ query GetLightsparkNode($id: ID!) {
1837
1850
  ${FRAGMENT6}
1838
1851
  `,
1839
1852
  variables: { id },
1840
- constructObject: (data) => LightsparkNodeFromJson(data.entity)
1853
+ constructObject: (data) => isObject5(data) && "entity" in data && isObject5(data.entity) ? LightsparkNodeFromJson(data.entity) : null
1841
1854
  };
1842
1855
  };
1843
1856
 
@@ -1854,12 +1867,13 @@ var AccountToNodesConnectionFromJson = (obj) => {
1854
1867
  };
1855
1868
 
1856
1869
  // src/objects/PaymentRequest.ts
1857
- import { LightsparkException as LightsparkException3 } from "@lightsparkdev/core";
1870
+ import { LightsparkException as LightsparkException3, isObject as isObject8 } from "@lightsparkdev/core";
1858
1871
 
1859
1872
  // src/objects/Node.ts
1860
- import { LightsparkException as LightsparkException2 } from "@lightsparkdev/core";
1873
+ import { LightsparkException as LightsparkException2, isObject as isObject7 } from "@lightsparkdev/core";
1861
1874
 
1862
1875
  // src/objects/GraphNode.ts
1876
+ import { isObject as isObject6 } from "@lightsparkdev/core";
1863
1877
  var GraphNode = class {
1864
1878
  constructor(id, createdAt, updatedAt, bitcoinNetwork, displayName, typename, alias, color, conductivity, publicKey) {
1865
1879
  this.id = id;
@@ -1914,7 +1928,7 @@ query GetGraphNode($id: ID!) {
1914
1928
  ${FRAGMENT7}
1915
1929
  `,
1916
1930
  variables: { id },
1917
- constructObject: (data) => GraphNodeFromJson(data.entity)
1931
+ constructObject: (data) => isObject6(data) && "entity" in data && isObject6(data.entity) ? GraphNodeFromJson(data.entity) : null
1918
1932
  };
1919
1933
  }
1920
1934
  toJson() {
@@ -2416,7 +2430,7 @@ query GetNode($id: ID!) {
2416
2430
  ${FRAGMENT8}
2417
2431
  `,
2418
2432
  variables: { id },
2419
- constructObject: (data) => NodeFromJson(data.entity)
2433
+ constructObject: (data) => isObject7(data) && "entity" in data && isObject7(data.entity) ? NodeFromJson(data.entity) : null
2420
2434
  };
2421
2435
  };
2422
2436
 
@@ -2746,7 +2760,9 @@ var PaymentRequestFromJson = (obj) => {
2746
2760
  data: InvoiceDataFromJson(obj["invoice_data"]),
2747
2761
  status: PaymentRequestStatus_default[obj["invoice_status"]] ?? PaymentRequestStatus_default.FUTURE_VALUE,
2748
2762
  typename: "Invoice",
2749
- amountPaid: !!obj["invoice_amount_paid"] ? CurrencyAmountFromJson(obj["invoice_amount_paid"]) : void 0
2763
+ amountPaid: !!obj["invoice_amount_paid"] ? CurrencyAmountFromJson(obj["invoice_amount_paid"]) : void 0,
2764
+ isUma: obj["invoice_is_uma"],
2765
+ isLnurl: obj["invoice_is_lnurl"]
2750
2766
  };
2751
2767
  }
2752
2768
  throw new LightsparkException3(
@@ -3062,6 +3078,8 @@ fragment PaymentRequestFragment on PaymentRequest {
3062
3078
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3063
3079
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3064
3080
  }
3081
+ invoice_is_uma: is_uma
3082
+ invoice_is_lnurl: is_lnurl
3065
3083
  }
3066
3084
  }`;
3067
3085
  var getPaymentRequestQuery = (id) => {
@@ -3078,7 +3096,7 @@ query GetPaymentRequest($id: ID!) {
3078
3096
  ${FRAGMENT10}
3079
3097
  `,
3080
3098
  variables: { id },
3081
- constructObject: (data) => PaymentRequestFromJson(data.entity)
3099
+ constructObject: (data) => isObject8(data) && "entity" in data && isObject8(data.entity) ? PaymentRequestFromJson(data.entity) : null
3082
3100
  };
3083
3101
  };
3084
3102
 
@@ -3097,7 +3115,13 @@ var AccountToPaymentRequestsConnectionFromJson = (obj) => {
3097
3115
  };
3098
3116
 
3099
3117
  // src/objects/Transaction.ts
3100
- import { LightsparkException as LightsparkException5 } from "@lightsparkdev/core";
3118
+ import { LightsparkException as LightsparkException5, isObject as isObject14 } from "@lightsparkdev/core";
3119
+
3120
+ // src/objects/IncomingPayment.ts
3121
+ import { isObject as isObject10 } from "@lightsparkdev/core";
3122
+
3123
+ // src/objects/IncomingPaymentAttempt.ts
3124
+ import { isObject as isObject9 } from "@lightsparkdev/core";
3101
3125
 
3102
3126
  // src/objects/IncomingPaymentAttemptStatus.ts
3103
3127
  var IncomingPaymentAttemptStatus = /* @__PURE__ */ ((IncomingPaymentAttemptStatus2) => {
@@ -3157,7 +3181,7 @@ query GetIncomingPaymentAttempt($id: ID!) {
3157
3181
  ${FRAGMENT11}
3158
3182
  `,
3159
3183
  variables: { id },
3160
- constructObject: (data) => IncomingPaymentAttemptFromJson(data.entity)
3184
+ constructObject: (data) => isObject9(data) && "entity" in data && isObject9(data.entity) ? IncomingPaymentAttemptFromJson(data.entity) : null
3161
3185
  };
3162
3186
  };
3163
3187
 
@@ -3286,7 +3310,7 @@ query GetIncomingPayment($id: ID!) {
3286
3310
  ${FRAGMENT12}
3287
3311
  `,
3288
3312
  variables: { id },
3289
- constructObject: (data) => IncomingPaymentFromJson(data.entity)
3313
+ constructObject: (data) => isObject10(data) && "entity" in data && isObject10(data.entity) ? IncomingPaymentFromJson(data.entity) : null
3290
3314
  };
3291
3315
  }
3292
3316
  toJson() {
@@ -3366,6 +3390,12 @@ fragment IncomingPaymentFragment on IncomingPayment {
3366
3390
  }`;
3367
3391
  var IncomingPayment_default = IncomingPayment;
3368
3392
 
3393
+ // src/objects/OutgoingPayment.ts
3394
+ import { isObject as isObject13 } from "@lightsparkdev/core";
3395
+
3396
+ // src/objects/OutgoingPaymentAttempt.ts
3397
+ import { isObject as isObject12 } from "@lightsparkdev/core";
3398
+
3369
3399
  // src/objects/HtlcAttemptFailureCode.ts
3370
3400
  var HtlcAttemptFailureCode = /* @__PURE__ */ ((HtlcAttemptFailureCode2) => {
3371
3401
  HtlcAttemptFailureCode2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -3412,6 +3442,7 @@ var OutgoingPaymentAttemptStatus = /* @__PURE__ */ ((OutgoingPaymentAttemptStatu
3412
3442
  var OutgoingPaymentAttemptStatus_default = OutgoingPaymentAttemptStatus;
3413
3443
 
3414
3444
  // src/objects/Hop.ts
3445
+ import { isObject as isObject11 } from "@lightsparkdev/core";
3415
3446
  var HopFromJson = (obj) => {
3416
3447
  return {
3417
3448
  id: obj["hop_id"],
@@ -3469,7 +3500,7 @@ query GetHop($id: ID!) {
3469
3500
  ${FRAGMENT13}
3470
3501
  `,
3471
3502
  variables: { id },
3472
- constructObject: (data) => HopFromJson(data.entity)
3503
+ constructObject: (data) => isObject11(data) && "entity" in data && isObject11(data.entity) ? HopFromJson(data.entity) : null
3473
3504
  };
3474
3505
  };
3475
3506
 
@@ -3575,7 +3606,7 @@ query GetOutgoingPaymentAttempt($id: ID!) {
3575
3606
  ${FRAGMENT14}
3576
3607
  `,
3577
3608
  variables: { id },
3578
- constructObject: (data) => OutgoingPaymentAttemptFromJson(data.entity)
3609
+ constructObject: (data) => isObject12(data) && "entity" in data && isObject12(data.entity) ? OutgoingPaymentAttemptFromJson(data.entity) : null
3579
3610
  };
3580
3611
  }
3581
3612
  toJson() {
@@ -3835,7 +3866,7 @@ query GetOutgoingPayment($id: ID!) {
3835
3866
  ${FRAGMENT15}
3836
3867
  `,
3837
3868
  variables: { id },
3838
- constructObject: (data) => OutgoingPaymentFromJson(data.entity)
3869
+ constructObject: (data) => isObject13(data) && "entity" in data && isObject13(data.entity) ? OutgoingPaymentFromJson(data.entity) : null
3839
3870
  };
3840
3871
  }
3841
3872
  toJson() {
@@ -4953,7 +4984,7 @@ query GetTransaction($id: ID!) {
4953
4984
  ${FRAGMENT16}
4954
4985
  `,
4955
4986
  variables: { id },
4956
- constructObject: (data) => TransactionFromJson(data.entity)
4987
+ constructObject: (data) => isObject14(data) && "entity" in data && isObject14(data.entity) ? TransactionFromJson(data.entity) : null
4957
4988
  };
4958
4989
  };
4959
4990
 
@@ -4980,6 +5011,9 @@ var AccountToTransactionsConnectionFromJson = (obj) => {
4980
5011
  };
4981
5012
  };
4982
5013
 
5014
+ // src/objects/Wallet.ts
5015
+ import { isObject as isObject19 } from "@lightsparkdev/core";
5016
+
4983
5017
  // src/objects/WalletStatus.ts
4984
5018
  var WalletStatus = /* @__PURE__ */ ((WalletStatus2) => {
4985
5019
  WalletStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -5024,6 +5058,9 @@ var WalletToTransactionsConnectionFromJson = (obj) => {
5024
5058
  };
5025
5059
  };
5026
5060
 
5061
+ // src/objects/WithdrawalRequest.ts
5062
+ import { isObject as isObject18 } from "@lightsparkdev/core";
5063
+
5027
5064
  // src/objects/RequestInitiator.ts
5028
5065
  var RequestInitiator = /* @__PURE__ */ ((RequestInitiator2) => {
5029
5066
  RequestInitiator2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -5056,6 +5093,7 @@ var WithdrawalRequestStatus = /* @__PURE__ */ ((WithdrawalRequestStatus2) => {
5056
5093
  var WithdrawalRequestStatus_default = WithdrawalRequestStatus;
5057
5094
 
5058
5095
  // src/objects/ChannelClosingTransaction.ts
5096
+ import { isObject as isObject15 } from "@lightsparkdev/core";
5059
5097
  var ChannelClosingTransactionFromJson = (obj) => {
5060
5098
  return {
5061
5099
  id: obj["channel_closing_transaction_id"],
@@ -5121,7 +5159,7 @@ query GetChannelClosingTransaction($id: ID!) {
5121
5159
  ${FRAGMENT17}
5122
5160
  `,
5123
5161
  variables: { id },
5124
- constructObject: (data) => ChannelClosingTransactionFromJson(data.entity)
5162
+ constructObject: (data) => isObject15(data) && "entity" in data && isObject15(data.entity) ? ChannelClosingTransactionFromJson(data.entity) : null
5125
5163
  };
5126
5164
  };
5127
5165
 
@@ -5138,6 +5176,7 @@ var WithdrawalRequestToChannelClosingTransactionsConnectionFromJson = (obj) => {
5138
5176
  };
5139
5177
 
5140
5178
  // src/objects/ChannelOpeningTransaction.ts
5179
+ import { isObject as isObject16 } from "@lightsparkdev/core";
5141
5180
  var ChannelOpeningTransactionFromJson = (obj) => {
5142
5181
  return {
5143
5182
  id: obj["channel_opening_transaction_id"],
@@ -5203,7 +5242,7 @@ query GetChannelOpeningTransaction($id: ID!) {
5203
5242
  ${FRAGMENT18}
5204
5243
  `,
5205
5244
  variables: { id },
5206
- constructObject: (data) => ChannelOpeningTransactionFromJson(data.entity)
5245
+ constructObject: (data) => isObject16(data) && "entity" in data && isObject16(data.entity) ? ChannelOpeningTransactionFromJson(data.entity) : null
5207
5246
  };
5208
5247
  };
5209
5248
 
@@ -5220,6 +5259,7 @@ var WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson = (obj) => {
5220
5259
  };
5221
5260
 
5222
5261
  // src/objects/Withdrawal.ts
5262
+ import { isObject as isObject17 } from "@lightsparkdev/core";
5223
5263
  var WithdrawalFromJson = (obj) => {
5224
5264
  return {
5225
5265
  id: obj["withdrawal_id"],
@@ -5285,7 +5325,7 @@ query GetWithdrawal($id: ID!) {
5285
5325
  ${FRAGMENT19}
5286
5326
  `,
5287
5327
  variables: { id },
5288
- constructObject: (data) => WithdrawalFromJson(data.entity)
5328
+ constructObject: (data) => isObject17(data) && "entity" in data && isObject17(data.entity) ? WithdrawalFromJson(data.entity) : null
5289
5329
  };
5290
5330
  };
5291
5331
 
@@ -5511,7 +5551,7 @@ query GetWithdrawalRequest($id: ID!) {
5511
5551
  ${FRAGMENT20}
5512
5552
  `,
5513
5553
  variables: { id },
5514
- constructObject: (data) => WithdrawalRequestFromJson(data.entity)
5554
+ constructObject: (data) => isObject18(data) && "entity" in data && isObject18(data.entity) ? WithdrawalRequestFromJson(data.entity) : null
5515
5555
  };
5516
5556
  }
5517
5557
  toJson() {
@@ -6552,6 +6592,8 @@ query FetchWalletToPaymentRequestsConnection($entity_id: ID!, $first: Int, $afte
6552
6592
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
6553
6593
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
6554
6594
  }
6595
+ invoice_is_uma: is_uma
6596
+ invoice_is_lnurl: is_lnurl
6555
6597
  }
6556
6598
  }
6557
6599
  }
@@ -6734,7 +6776,7 @@ query GetWallet($id: ID!) {
6734
6776
  ${FRAGMENT21}
6735
6777
  `,
6736
6778
  variables: { id },
6737
- constructObject: (data) => WalletFromJson(data.entity)
6779
+ constructObject: (data) => isObject19(data) && "entity" in data && isObject19(data.entity) ? WalletFromJson(data.entity) : null
6738
6780
  };
6739
6781
  }
6740
6782
  toJson() {
@@ -8398,6 +8440,8 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte
8398
8440
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8399
8441
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8400
8442
  }
8443
+ invoice_is_uma: is_uma
8444
+ invoice_is_lnurl: is_lnurl
8401
8445
  }
8402
8446
  }
8403
8447
  }
@@ -8592,7 +8636,7 @@ query GetAccount {
8592
8636
  ${FRAGMENT22}
8593
8637
  `,
8594
8638
  variables: {},
8595
- constructObject: (data) => AccountFromJson(data.current_account)
8639
+ constructObject: (data) => isObject20(data) && "current_account" in data && isObject20(data.current_account) ? AccountFromJson(data.current_account) : null
8596
8640
  };
8597
8641
  }
8598
8642
  toJson() {
@@ -8625,7 +8669,7 @@ fragment AccountFragment on Account {
8625
8669
  var Account_default = Account;
8626
8670
 
8627
8671
  // src/objects/AuditLogActor.ts
8628
- import { LightsparkException as LightsparkException6 } from "@lightsparkdev/core";
8672
+ import { LightsparkException as LightsparkException6, isObject as isObject21 } from "@lightsparkdev/core";
8629
8673
  var AuditLogActorFromJson = (obj) => {
8630
8674
  if (obj["__typename"] == "ApiToken") {
8631
8675
  return {
@@ -8672,11 +8716,12 @@ query GetAuditLogActor($id: ID!) {
8672
8716
  ${FRAGMENT23}
8673
8717
  `,
8674
8718
  variables: { id },
8675
- constructObject: (data) => AuditLogActorFromJson(data.entity)
8719
+ constructObject: (data) => isObject21(data) && "entity" in data && isObject21(data.entity) ? AuditLogActorFromJson(data.entity) : null
8676
8720
  };
8677
8721
  };
8678
8722
 
8679
8723
  // src/objects/ChannelSnapshot.ts
8724
+ import { isObject as isObject22 } from "@lightsparkdev/core";
8680
8725
  var ChannelSnapshotFromJson = (obj) => {
8681
8726
  return {
8682
8727
  id: obj["channel_snapshot_id"],
@@ -8759,7 +8804,7 @@ query GetChannelSnapshot($id: ID!) {
8759
8804
  ${FRAGMENT24}
8760
8805
  `,
8761
8806
  variables: { id },
8762
- constructObject: (data) => ChannelSnapshotFromJson(data.entity)
8807
+ constructObject: (data) => isObject22(data) && "entity" in data && isObject22(data.entity) ? ChannelSnapshotFromJson(data.entity) : null
8763
8808
  };
8764
8809
  };
8765
8810
 
@@ -9015,6 +9060,7 @@ var RegionCode = /* @__PURE__ */ ((RegionCode2) => {
9015
9060
  RegionCode2["YE"] = "YE";
9016
9061
  RegionCode2["ZM"] = "ZM";
9017
9062
  RegionCode2["ZW"] = "ZW";
9063
+ RegionCode2["NN"] = "NN";
9018
9064
  return RegionCode2;
9019
9065
  })(RegionCode || {});
9020
9066
  var RegionCode_default = RegionCode;
@@ -9039,6 +9085,9 @@ var InvoiceType = /* @__PURE__ */ ((InvoiceType2) => {
9039
9085
  })(InvoiceType || {});
9040
9086
  var InvoiceType_default = InvoiceType;
9041
9087
 
9088
+ // src/objects/SignablePayload.ts
9089
+ import { isObject as isObject23 } from "@lightsparkdev/core";
9090
+
9042
9091
  // src/objects/SignablePayloadStatus.ts
9043
9092
  var SignablePayloadStatus = /* @__PURE__ */ ((SignablePayloadStatus2) => {
9044
9093
  SignablePayloadStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -9094,11 +9143,12 @@ query GetSignablePayload($id: ID!) {
9094
9143
  ${FRAGMENT25}
9095
9144
  `,
9096
9145
  variables: { id },
9097
- constructObject: (data) => SignablePayloadFromJson(data.entity)
9146
+ constructObject: (data) => isObject23(data) && "entity" in data && isObject23(data.entity) ? SignablePayloadFromJson(data.entity) : null
9098
9147
  };
9099
9148
  };
9100
9149
 
9101
9150
  // src/objects/Deposit.ts
9151
+ import { isObject as isObject24 } from "@lightsparkdev/core";
9102
9152
  var DepositFromJson = (obj) => {
9103
9153
  return {
9104
9154
  id: obj["deposit_id"],
@@ -9164,7 +9214,7 @@ query GetDeposit($id: ID!) {
9164
9214
  ${FRAGMENT26}
9165
9215
  `,
9166
9216
  variables: { id },
9167
- constructObject: (data) => DepositFromJson(data.entity)
9217
+ constructObject: (data) => isObject24(data) && "entity" in data && isObject24(data.entity) ? DepositFromJson(data.entity) : null
9168
9218
  };
9169
9219
  };
9170
9220
 
@@ -9220,6 +9270,7 @@ var IncentivesStatus = /* @__PURE__ */ ((IncentivesStatus2) => {
9220
9270
  var IncentivesStatus_default = IncentivesStatus;
9221
9271
 
9222
9272
  // src/objects/Invoice.ts
9273
+ import { isObject as isObject25 } from "@lightsparkdev/core";
9223
9274
  var InvoiceFromJson = (obj) => {
9224
9275
  return {
9225
9276
  id: obj["invoice_id"],
@@ -9228,7 +9279,9 @@ var InvoiceFromJson = (obj) => {
9228
9279
  data: InvoiceDataFromJson(obj["invoice_data"]),
9229
9280
  status: PaymentRequestStatus_default[obj["invoice_status"]] ?? PaymentRequestStatus_default.FUTURE_VALUE,
9230
9281
  typename: "Invoice",
9231
- amountPaid: !!obj["invoice_amount_paid"] ? CurrencyAmountFromJson(obj["invoice_amount_paid"]) : void 0
9282
+ amountPaid: !!obj["invoice_amount_paid"] ? CurrencyAmountFromJson(obj["invoice_amount_paid"]) : void 0,
9283
+ isUma: obj["invoice_is_uma"],
9284
+ isLnurl: obj["invoice_is_lnurl"]
9232
9285
  };
9233
9286
  };
9234
9287
  var FRAGMENT28 = `
@@ -9537,6 +9590,8 @@ fragment InvoiceFragment on Invoice {
9537
9590
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
9538
9591
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
9539
9592
  }
9593
+ invoice_is_uma: is_uma
9594
+ invoice_is_lnurl: is_lnurl
9540
9595
  }`;
9541
9596
  var getInvoiceQuery = (id) => {
9542
9597
  return {
@@ -9552,7 +9607,7 @@ query GetInvoice($id: ID!) {
9552
9607
  ${FRAGMENT28}
9553
9608
  `,
9554
9609
  variables: { id },
9555
- constructObject: (data) => InvoiceFromJson(data.entity)
9610
+ constructObject: (data) => isObject25(data) && "entity" in data && isObject25(data.entity) ? InvoiceFromJson(data.entity) : null
9556
9611
  };
9557
9612
  };
9558
9613
 
@@ -9571,7 +9626,7 @@ fragment LightningFeeEstimateOutputFragment on LightningFeeEstimateOutput {
9571
9626
  }`;
9572
9627
 
9573
9628
  // src/objects/LightningTransaction.ts
9574
- import { LightsparkException as LightsparkException8 } from "@lightsparkdev/core";
9629
+ import { LightsparkException as LightsparkException8, isObject as isObject26 } from "@lightsparkdev/core";
9575
9630
  var LightningTransactionFromJson = (obj) => {
9576
9631
  if (obj["__typename"] == "IncomingPayment") {
9577
9632
  return new IncomingPayment_default(
@@ -10078,12 +10133,12 @@ query GetLightningTransaction($id: ID!) {
10078
10133
  ${FRAGMENT30}
10079
10134
  `,
10080
10135
  variables: { id },
10081
- constructObject: (data) => LightningTransactionFromJson(data.entity)
10136
+ constructObject: (data) => isObject26(data) && "entity" in data && isObject26(data.entity) ? LightningTransactionFromJson(data.entity) : null
10082
10137
  };
10083
10138
  };
10084
10139
 
10085
10140
  // src/objects/LightsparkNodeOwner.ts
10086
- import { LightsparkException as LightsparkException9 } from "@lightsparkdev/core";
10141
+ import { LightsparkException as LightsparkException9, isObject as isObject27 } from "@lightsparkdev/core";
10087
10142
  var LightsparkNodeOwnerFromJson = (obj) => {
10088
10143
  if (obj["__typename"] == "Account") {
10089
10144
  return new Account_default(
@@ -10176,7 +10231,7 @@ query GetLightsparkNodeOwner($id: ID!) {
10176
10231
  ${FRAGMENT31}
10177
10232
  `,
10178
10233
  variables: { id },
10179
- constructObject: (data) => LightsparkNodeOwnerFromJson(data.entity)
10234
+ constructObject: (data) => isObject27(data) && "entity" in data && isObject27(data.entity) ? LightsparkNodeOwnerFromJson(data.entity) : null
10180
10235
  };
10181
10236
  };
10182
10237
 
@@ -10192,7 +10247,7 @@ var OnChainFeeTarget = /* @__PURE__ */ ((OnChainFeeTarget2) => {
10192
10247
  var OnChainFeeTarget_default = OnChainFeeTarget;
10193
10248
 
10194
10249
  // src/objects/OnChainTransaction.ts
10195
- import { LightsparkException as LightsparkException10 } from "@lightsparkdev/core";
10250
+ import { LightsparkException as LightsparkException10, isObject as isObject28 } from "@lightsparkdev/core";
10196
10251
  var OnChainTransactionFromJson = (obj) => {
10197
10252
  if (obj["__typename"] == "ChannelClosingTransaction") {
10198
10253
  return {
@@ -10417,7 +10472,7 @@ query GetOnChainTransaction($id: ID!) {
10417
10472
  ${FRAGMENT32}
10418
10473
  `,
10419
10474
  variables: { id },
10420
- constructObject: (data) => OnChainTransactionFromJson(data.entity)
10475
+ constructObject: (data) => isObject28(data) && "entity" in data && isObject28(data.entity) ? OnChainTransactionFromJson(data.entity) : null
10421
10476
  };
10422
10477
  };
10423
10478
 
@@ -10457,6 +10512,7 @@ var RiskRating = /* @__PURE__ */ ((RiskRating2) => {
10457
10512
  var RiskRating_default = RiskRating;
10458
10513
 
10459
10514
  // src/objects/RoutingTransaction.ts
10515
+ import { isObject as isObject29 } from "@lightsparkdev/core";
10460
10516
  var RoutingTransactionFromJson = (obj) => {
10461
10517
  return {
10462
10518
  id: obj["routing_transaction_id"],
@@ -10525,11 +10581,12 @@ query GetRoutingTransaction($id: ID!) {
10525
10581
  ${FRAGMENT33}
10526
10582
  `,
10527
10583
  variables: { id },
10528
- constructObject: (data) => RoutingTransactionFromJson(data.entity)
10584
+ constructObject: (data) => isObject29(data) && "entity" in data && isObject29(data.entity) ? RoutingTransactionFromJson(data.entity) : null
10529
10585
  };
10530
10586
  };
10531
10587
 
10532
10588
  // src/objects/Signable.ts
10589
+ import { isObject as isObject30 } from "@lightsparkdev/core";
10533
10590
  var SignableFromJson = (obj) => {
10534
10591
  return {
10535
10592
  id: obj["signable_id"],
@@ -10559,7 +10616,7 @@ query GetSignable($id: ID!) {
10559
10616
  ${FRAGMENT34}
10560
10617
  `,
10561
10618
  variables: { id },
10562
- constructObject: (data) => SignableFromJson(data.entity)
10619
+ constructObject: (data) => isObject30(data) && "entity" in data && isObject30(data.entity) ? SignableFromJson(data.entity) : null
10563
10620
  };
10564
10621
  };
10565
10622
 
@@ -10613,6 +10670,7 @@ fragment TransactionUpdateFragment on Transaction {
10613
10670
  }`;
10614
10671
 
10615
10672
  // src/objects/UmaInvitation.ts
10673
+ import { isObject as isObject31 } from "@lightsparkdev/core";
10616
10674
  var UmaInvitationFromJson = (obj) => {
10617
10675
  return {
10618
10676
  id: obj["uma_invitation_id"],
@@ -10654,7 +10712,7 @@ query GetUmaInvitation($id: ID!) {
10654
10712
  ${FRAGMENT36}
10655
10713
  `,
10656
10714
  variables: { id },
10657
- constructObject: (data) => UmaInvitationFromJson(data.entity)
10715
+ constructObject: (data) => isObject31(data) && "entity" in data && isObject31(data.entity) ? UmaInvitationFromJson(data.entity) : null
10658
10716
  };
10659
10717
  };
10660
10718
 
@@ -44,7 +44,7 @@ declare enum CurrencyUnit {
44
44
  */
45
45
  SATOSHI = "SATOSHI",
46
46
  /**
47
- * 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible.
47
+ * 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible. *
48
48
  */
49
49
  MILLISATOSHI = "MILLISATOSHI",
50
50
  /** United States Dollar. **/
@@ -836,7 +836,7 @@ declare enum TransactionStatus {
836
836
  /** Transaction has been initiated and is currently in-flight. **/
837
837
  PENDING = "PENDING",
838
838
  /**
839
- * For transaction type PAYMENT_REQUEST only. No payments have been made to a payment request.
839
+ * For transaction type PAYMENT_REQUEST only. No payments have been made to a payment request. *
840
840
  */
841
841
  NOT_STARTED = "NOT_STARTED",
842
842
  /** For transaction type PAYMENT_REQUEST only. A payment request has expired. **/
@@ -951,8 +951,8 @@ declare enum WalletStatus {
951
951
  TERMINATING = "TERMINATING",
952
952
  /**
953
953
  * The wallet has been terminated and is not available in the Lightspark infrastructure anymore.
954
- * It is not connected to the Lightning network and its funds can only be accessed using the Funds
955
- * Recovery flow. *
954
+ * It is not connected to the Lightning network and its funds can only be accessed using the
955
+ * Funds Recovery flow. *
956
956
  */
957
957
  TERMINATED = "TERMINATED"
958
958
  }
@@ -1882,6 +1882,16 @@ interface Invoice {
1882
1882
  typename: string;
1883
1883
  /** The total amount that has been paid to this invoice. **/
1884
1884
  amountPaid?: CurrencyAmount | undefined;
1885
+ /**
1886
+ * Whether this invoice is an UMA invoice or not. NOTE: this field is only set if the invoice
1887
+ * was created using the recommended `create_uma_invoice` function.
1888
+ **/
1889
+ isUma?: boolean | undefined;
1890
+ /**
1891
+ * Whether this invoice is an LNURL invoice or not. NOTE: this field is only set if the invoice
1892
+ * was created using the recommended `create_lnurl_invoice` function.
1893
+ **/
1894
+ isLnurl?: boolean | undefined;
1885
1895
  }
1886
1896
  declare const getInvoiceQuery: (id: string) => Query<Invoice>;
1887
1897
 
@@ -2769,7 +2779,9 @@ declare enum RegionCode {
2769
2779
  /** The code representing the country of Zambia. **/
2770
2780
  ZM = "ZM",
2771
2781
  /** The code representing the country of Zimbabwe. **/
2772
- ZW = "ZW"
2782
+ ZW = "ZW",
2783
+ /** The code representing a fake region for testing. **/
2784
+ NN = "NN"
2773
2785
  }
2774
2786
 
2775
2787
  type SingleNodeDashboard = {
@@ -2940,7 +2952,7 @@ declare class LightsparkClient {
2940
2952
  * @param authProvider The auth provider to use for authentication. Defaults to a stub auth provider.
2941
2953
  * For server-side
2942
2954
  * use, you should use the `AccountTokenAuthProvider`.
2943
- * @param serverUrl The base URL of the server to connect to. Defaults to lightspark production.
2955
+ * @param serverUrl The base URL for the Lightspark environment you want to connect to. Your API credentials determine whether you're in test mode or live mode. Typically, you won't need to set this parameter unless you want to connect to a different Lightspark environment than the default production environment.
2944
2956
  * @param cryptoImpl The crypto implementation to use. Defaults to web and node compatible crypto.
2945
2957
  * For React Native, you should use the `ReactNativeCrypto`
2946
2958
  * implementation from `@lightsparkdev/react-native`.