@lightsparkdev/lightspark-sdk 1.8.0 → 1.8.2

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 (48) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/{chunk-J7GJGYME.js → chunk-4KFNQOMH.js} +84 -39
  3. package/dist/{index-9a69ef6a.d.ts → index-27dad75b.d.ts} +22 -1
  4. package/dist/index.cjs +240 -91
  5. package/dist/index.d.cts +2 -2
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +103 -3
  8. package/dist/objects/index.cjs +97 -52
  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 +89 -8
  14. package/src/graphql/IncomingPaymentsForInvoice.ts +21 -0
  15. package/src/graphql/OutgoingPaymentsForInvoice.ts +21 -0
  16. package/src/objects/Account.ts +4 -2
  17. package/src/objects/ApiToken.ts +2 -2
  18. package/src/objects/AuditLogActor.ts +2 -2
  19. package/src/objects/Channel.ts +2 -2
  20. package/src/objects/ChannelClosingTransaction.ts +2 -2
  21. package/src/objects/ChannelOpeningTransaction.ts +2 -2
  22. package/src/objects/ChannelSnapshot.ts +2 -2
  23. package/src/objects/Deposit.ts +2 -2
  24. package/src/objects/GraphNode.ts +2 -2
  25. package/src/objects/Hop.ts +2 -2
  26. package/src/objects/IncomingPayment.ts +2 -2
  27. package/src/objects/IncomingPaymentAttempt.ts +2 -2
  28. package/src/objects/Invoice.ts +2 -2
  29. package/src/objects/LightningTransaction.ts +2 -2
  30. package/src/objects/LightsparkNode.ts +2 -2
  31. package/src/objects/LightsparkNodeOwner.ts +2 -2
  32. package/src/objects/LightsparkNodeWithOSK.ts +2 -2
  33. package/src/objects/LightsparkNodeWithRemoteSigning.ts +2 -2
  34. package/src/objects/Node.ts +2 -2
  35. package/src/objects/OnChainTransaction.ts +2 -2
  36. package/src/objects/OutgoingPayment.ts +2 -2
  37. package/src/objects/OutgoingPaymentAttempt.ts +2 -2
  38. package/src/objects/PaymentRequest.ts +2 -2
  39. package/src/objects/RoutingTransaction.ts +2 -2
  40. package/src/objects/Signable.ts +2 -2
  41. package/src/objects/SignablePayload.ts +2 -2
  42. package/src/objects/Transaction.ts +2 -2
  43. package/src/objects/UmaInvitation.ts +2 -2
  44. package/src/objects/Wallet.ts +2 -2
  45. package/src/objects/Withdrawal.ts +2 -2
  46. package/src/objects/WithdrawalRequest.ts +2 -2
  47. package/src/tests/generated-objects.test.ts +93 -0
  48. package/src/tests/serialization.test.ts +0 -21
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @lightsparkdev/lightspark-sdk
2
2
 
3
+ ## 1.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 9d2f78a: - adds IncomingPaymentsForInvoice and OutgoingPaymentsForInvoice
8
+ - 9d2f78a: - Enable setting logging level on client
9
+
10
+ ## 1.8.1
11
+
12
+ ### Patch Changes
13
+
14
+ - b43609d: - Fix property null check
15
+ - Updated dependencies [b43609d]
16
+ - @lightsparkdev/core@1.2.1
17
+
3
18
  ## 1.8.0
4
19
 
5
20
  ### Minor 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) => data && typeof data === "object" && "entity" in data ? ApiTokenFromJson(data.entity) : null
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) => data && typeof data === "object" && "entity" in data ? ChannelFromJson(data.entity) : null
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) => data && typeof data === "object" && "entity" in data ? LightsparkNodeWithOSKFromJson(data.entity) : null
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) => data && typeof data === "object" && "entity" in data ? LightsparkNodeWithRemoteSigningFromJson(data.entity) : null
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) => data && typeof data === "object" && "entity" in data ? LightsparkNodeFromJson(data.entity) : null
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) => data && typeof data === "object" && "entity" in data ? GraphNodeFromJson(data.entity) : null
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) => data && typeof data === "object" && "entity" in data ? NodeFromJson(data.entity) : null
2433
+ constructObject: (data) => isObject7(data) && "entity" in data && isObject7(data.entity) ? NodeFromJson(data.entity) : null
2420
2434
  };
2421
2435
  };
2422
2436
 
@@ -3082,7 +3096,7 @@ query GetPaymentRequest($id: ID!) {
3082
3096
  ${FRAGMENT10}
3083
3097
  `,
3084
3098
  variables: { id },
3085
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? PaymentRequestFromJson(data.entity) : null
3099
+ constructObject: (data) => isObject8(data) && "entity" in data && isObject8(data.entity) ? PaymentRequestFromJson(data.entity) : null
3086
3100
  };
3087
3101
  };
3088
3102
 
@@ -3101,7 +3115,13 @@ var AccountToPaymentRequestsConnectionFromJson = (obj) => {
3101
3115
  };
3102
3116
 
3103
3117
  // src/objects/Transaction.ts
3104
- 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";
3105
3125
 
3106
3126
  // src/objects/IncomingPaymentAttemptStatus.ts
3107
3127
  var IncomingPaymentAttemptStatus = /* @__PURE__ */ ((IncomingPaymentAttemptStatus2) => {
@@ -3161,7 +3181,7 @@ query GetIncomingPaymentAttempt($id: ID!) {
3161
3181
  ${FRAGMENT11}
3162
3182
  `,
3163
3183
  variables: { id },
3164
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? IncomingPaymentAttemptFromJson(data.entity) : null
3184
+ constructObject: (data) => isObject9(data) && "entity" in data && isObject9(data.entity) ? IncomingPaymentAttemptFromJson(data.entity) : null
3165
3185
  };
3166
3186
  };
3167
3187
 
@@ -3290,7 +3310,7 @@ query GetIncomingPayment($id: ID!) {
3290
3310
  ${FRAGMENT12}
3291
3311
  `,
3292
3312
  variables: { id },
3293
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? IncomingPaymentFromJson(data.entity) : null
3313
+ constructObject: (data) => isObject10(data) && "entity" in data && isObject10(data.entity) ? IncomingPaymentFromJson(data.entity) : null
3294
3314
  };
3295
3315
  }
3296
3316
  toJson() {
@@ -3370,6 +3390,12 @@ fragment IncomingPaymentFragment on IncomingPayment {
3370
3390
  }`;
3371
3391
  var IncomingPayment_default = IncomingPayment;
3372
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
+
3373
3399
  // src/objects/HtlcAttemptFailureCode.ts
3374
3400
  var HtlcAttemptFailureCode = /* @__PURE__ */ ((HtlcAttemptFailureCode2) => {
3375
3401
  HtlcAttemptFailureCode2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -3416,6 +3442,7 @@ var OutgoingPaymentAttemptStatus = /* @__PURE__ */ ((OutgoingPaymentAttemptStatu
3416
3442
  var OutgoingPaymentAttemptStatus_default = OutgoingPaymentAttemptStatus;
3417
3443
 
3418
3444
  // src/objects/Hop.ts
3445
+ import { isObject as isObject11 } from "@lightsparkdev/core";
3419
3446
  var HopFromJson = (obj) => {
3420
3447
  return {
3421
3448
  id: obj["hop_id"],
@@ -3473,7 +3500,7 @@ query GetHop($id: ID!) {
3473
3500
  ${FRAGMENT13}
3474
3501
  `,
3475
3502
  variables: { id },
3476
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? HopFromJson(data.entity) : null
3503
+ constructObject: (data) => isObject11(data) && "entity" in data && isObject11(data.entity) ? HopFromJson(data.entity) : null
3477
3504
  };
3478
3505
  };
3479
3506
 
@@ -3579,7 +3606,7 @@ query GetOutgoingPaymentAttempt($id: ID!) {
3579
3606
  ${FRAGMENT14}
3580
3607
  `,
3581
3608
  variables: { id },
3582
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? OutgoingPaymentAttemptFromJson(data.entity) : null
3609
+ constructObject: (data) => isObject12(data) && "entity" in data && isObject12(data.entity) ? OutgoingPaymentAttemptFromJson(data.entity) : null
3583
3610
  };
3584
3611
  }
3585
3612
  toJson() {
@@ -3839,7 +3866,7 @@ query GetOutgoingPayment($id: ID!) {
3839
3866
  ${FRAGMENT15}
3840
3867
  `,
3841
3868
  variables: { id },
3842
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? OutgoingPaymentFromJson(data.entity) : null
3869
+ constructObject: (data) => isObject13(data) && "entity" in data && isObject13(data.entity) ? OutgoingPaymentFromJson(data.entity) : null
3843
3870
  };
3844
3871
  }
3845
3872
  toJson() {
@@ -4957,7 +4984,7 @@ query GetTransaction($id: ID!) {
4957
4984
  ${FRAGMENT16}
4958
4985
  `,
4959
4986
  variables: { id },
4960
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? TransactionFromJson(data.entity) : null
4987
+ constructObject: (data) => isObject14(data) && "entity" in data && isObject14(data.entity) ? TransactionFromJson(data.entity) : null
4961
4988
  };
4962
4989
  };
4963
4990
 
@@ -4984,6 +5011,9 @@ var AccountToTransactionsConnectionFromJson = (obj) => {
4984
5011
  };
4985
5012
  };
4986
5013
 
5014
+ // src/objects/Wallet.ts
5015
+ import { isObject as isObject19 } from "@lightsparkdev/core";
5016
+
4987
5017
  // src/objects/WalletStatus.ts
4988
5018
  var WalletStatus = /* @__PURE__ */ ((WalletStatus2) => {
4989
5019
  WalletStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -5028,6 +5058,9 @@ var WalletToTransactionsConnectionFromJson = (obj) => {
5028
5058
  };
5029
5059
  };
5030
5060
 
5061
+ // src/objects/WithdrawalRequest.ts
5062
+ import { isObject as isObject18 } from "@lightsparkdev/core";
5063
+
5031
5064
  // src/objects/RequestInitiator.ts
5032
5065
  var RequestInitiator = /* @__PURE__ */ ((RequestInitiator2) => {
5033
5066
  RequestInitiator2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -5060,6 +5093,7 @@ var WithdrawalRequestStatus = /* @__PURE__ */ ((WithdrawalRequestStatus2) => {
5060
5093
  var WithdrawalRequestStatus_default = WithdrawalRequestStatus;
5061
5094
 
5062
5095
  // src/objects/ChannelClosingTransaction.ts
5096
+ import { isObject as isObject15 } from "@lightsparkdev/core";
5063
5097
  var ChannelClosingTransactionFromJson = (obj) => {
5064
5098
  return {
5065
5099
  id: obj["channel_closing_transaction_id"],
@@ -5125,7 +5159,7 @@ query GetChannelClosingTransaction($id: ID!) {
5125
5159
  ${FRAGMENT17}
5126
5160
  `,
5127
5161
  variables: { id },
5128
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? ChannelClosingTransactionFromJson(data.entity) : null
5162
+ constructObject: (data) => isObject15(data) && "entity" in data && isObject15(data.entity) ? ChannelClosingTransactionFromJson(data.entity) : null
5129
5163
  };
5130
5164
  };
5131
5165
 
@@ -5142,6 +5176,7 @@ var WithdrawalRequestToChannelClosingTransactionsConnectionFromJson = (obj) => {
5142
5176
  };
5143
5177
 
5144
5178
  // src/objects/ChannelOpeningTransaction.ts
5179
+ import { isObject as isObject16 } from "@lightsparkdev/core";
5145
5180
  var ChannelOpeningTransactionFromJson = (obj) => {
5146
5181
  return {
5147
5182
  id: obj["channel_opening_transaction_id"],
@@ -5207,7 +5242,7 @@ query GetChannelOpeningTransaction($id: ID!) {
5207
5242
  ${FRAGMENT18}
5208
5243
  `,
5209
5244
  variables: { id },
5210
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? ChannelOpeningTransactionFromJson(data.entity) : null
5245
+ constructObject: (data) => isObject16(data) && "entity" in data && isObject16(data.entity) ? ChannelOpeningTransactionFromJson(data.entity) : null
5211
5246
  };
5212
5247
  };
5213
5248
 
@@ -5224,6 +5259,7 @@ var WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson = (obj) => {
5224
5259
  };
5225
5260
 
5226
5261
  // src/objects/Withdrawal.ts
5262
+ import { isObject as isObject17 } from "@lightsparkdev/core";
5227
5263
  var WithdrawalFromJson = (obj) => {
5228
5264
  return {
5229
5265
  id: obj["withdrawal_id"],
@@ -5289,7 +5325,7 @@ query GetWithdrawal($id: ID!) {
5289
5325
  ${FRAGMENT19}
5290
5326
  `,
5291
5327
  variables: { id },
5292
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? WithdrawalFromJson(data.entity) : null
5328
+ constructObject: (data) => isObject17(data) && "entity" in data && isObject17(data.entity) ? WithdrawalFromJson(data.entity) : null
5293
5329
  };
5294
5330
  };
5295
5331
 
@@ -5515,7 +5551,7 @@ query GetWithdrawalRequest($id: ID!) {
5515
5551
  ${FRAGMENT20}
5516
5552
  `,
5517
5553
  variables: { id },
5518
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? WithdrawalRequestFromJson(data.entity) : null
5554
+ constructObject: (data) => isObject18(data) && "entity" in data && isObject18(data.entity) ? WithdrawalRequestFromJson(data.entity) : null
5519
5555
  };
5520
5556
  }
5521
5557
  toJson() {
@@ -6740,7 +6776,7 @@ query GetWallet($id: ID!) {
6740
6776
  ${FRAGMENT21}
6741
6777
  `,
6742
6778
  variables: { id },
6743
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? WalletFromJson(data.entity) : null
6779
+ constructObject: (data) => isObject19(data) && "entity" in data && isObject19(data.entity) ? WalletFromJson(data.entity) : null
6744
6780
  };
6745
6781
  }
6746
6782
  toJson() {
@@ -8600,7 +8636,7 @@ query GetAccount {
8600
8636
  ${FRAGMENT22}
8601
8637
  `,
8602
8638
  variables: {},
8603
- constructObject: (data) => data && typeof data === "object" && "current_account" in data ? AccountFromJson(data.current_account) : null
8639
+ constructObject: (data) => isObject20(data) && "current_account" in data && isObject20(data.current_account) ? AccountFromJson(data.current_account) : null
8604
8640
  };
8605
8641
  }
8606
8642
  toJson() {
@@ -8633,7 +8669,7 @@ fragment AccountFragment on Account {
8633
8669
  var Account_default = Account;
8634
8670
 
8635
8671
  // src/objects/AuditLogActor.ts
8636
- import { LightsparkException as LightsparkException6 } from "@lightsparkdev/core";
8672
+ import { LightsparkException as LightsparkException6, isObject as isObject21 } from "@lightsparkdev/core";
8637
8673
  var AuditLogActorFromJson = (obj) => {
8638
8674
  if (obj["__typename"] == "ApiToken") {
8639
8675
  return {
@@ -8680,11 +8716,12 @@ query GetAuditLogActor($id: ID!) {
8680
8716
  ${FRAGMENT23}
8681
8717
  `,
8682
8718
  variables: { id },
8683
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? AuditLogActorFromJson(data.entity) : null
8719
+ constructObject: (data) => isObject21(data) && "entity" in data && isObject21(data.entity) ? AuditLogActorFromJson(data.entity) : null
8684
8720
  };
8685
8721
  };
8686
8722
 
8687
8723
  // src/objects/ChannelSnapshot.ts
8724
+ import { isObject as isObject22 } from "@lightsparkdev/core";
8688
8725
  var ChannelSnapshotFromJson = (obj) => {
8689
8726
  return {
8690
8727
  id: obj["channel_snapshot_id"],
@@ -8767,7 +8804,7 @@ query GetChannelSnapshot($id: ID!) {
8767
8804
  ${FRAGMENT24}
8768
8805
  `,
8769
8806
  variables: { id },
8770
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? ChannelSnapshotFromJson(data.entity) : null
8807
+ constructObject: (data) => isObject22(data) && "entity" in data && isObject22(data.entity) ? ChannelSnapshotFromJson(data.entity) : null
8771
8808
  };
8772
8809
  };
8773
8810
 
@@ -9048,6 +9085,9 @@ var InvoiceType = /* @__PURE__ */ ((InvoiceType2) => {
9048
9085
  })(InvoiceType || {});
9049
9086
  var InvoiceType_default = InvoiceType;
9050
9087
 
9088
+ // src/objects/SignablePayload.ts
9089
+ import { isObject as isObject23 } from "@lightsparkdev/core";
9090
+
9051
9091
  // src/objects/SignablePayloadStatus.ts
9052
9092
  var SignablePayloadStatus = /* @__PURE__ */ ((SignablePayloadStatus2) => {
9053
9093
  SignablePayloadStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -9103,11 +9143,12 @@ query GetSignablePayload($id: ID!) {
9103
9143
  ${FRAGMENT25}
9104
9144
  `,
9105
9145
  variables: { id },
9106
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? SignablePayloadFromJson(data.entity) : null
9146
+ constructObject: (data) => isObject23(data) && "entity" in data && isObject23(data.entity) ? SignablePayloadFromJson(data.entity) : null
9107
9147
  };
9108
9148
  };
9109
9149
 
9110
9150
  // src/objects/Deposit.ts
9151
+ import { isObject as isObject24 } from "@lightsparkdev/core";
9111
9152
  var DepositFromJson = (obj) => {
9112
9153
  return {
9113
9154
  id: obj["deposit_id"],
@@ -9173,7 +9214,7 @@ query GetDeposit($id: ID!) {
9173
9214
  ${FRAGMENT26}
9174
9215
  `,
9175
9216
  variables: { id },
9176
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? DepositFromJson(data.entity) : null
9217
+ constructObject: (data) => isObject24(data) && "entity" in data && isObject24(data.entity) ? DepositFromJson(data.entity) : null
9177
9218
  };
9178
9219
  };
9179
9220
 
@@ -9229,6 +9270,7 @@ var IncentivesStatus = /* @__PURE__ */ ((IncentivesStatus2) => {
9229
9270
  var IncentivesStatus_default = IncentivesStatus;
9230
9271
 
9231
9272
  // src/objects/Invoice.ts
9273
+ import { isObject as isObject25 } from "@lightsparkdev/core";
9232
9274
  var InvoiceFromJson = (obj) => {
9233
9275
  return {
9234
9276
  id: obj["invoice_id"],
@@ -9565,7 +9607,7 @@ query GetInvoice($id: ID!) {
9565
9607
  ${FRAGMENT28}
9566
9608
  `,
9567
9609
  variables: { id },
9568
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? InvoiceFromJson(data.entity) : null
9610
+ constructObject: (data) => isObject25(data) && "entity" in data && isObject25(data.entity) ? InvoiceFromJson(data.entity) : null
9569
9611
  };
9570
9612
  };
9571
9613
 
@@ -9584,7 +9626,7 @@ fragment LightningFeeEstimateOutputFragment on LightningFeeEstimateOutput {
9584
9626
  }`;
9585
9627
 
9586
9628
  // src/objects/LightningTransaction.ts
9587
- import { LightsparkException as LightsparkException8 } from "@lightsparkdev/core";
9629
+ import { LightsparkException as LightsparkException8, isObject as isObject26 } from "@lightsparkdev/core";
9588
9630
  var LightningTransactionFromJson = (obj) => {
9589
9631
  if (obj["__typename"] == "IncomingPayment") {
9590
9632
  return new IncomingPayment_default(
@@ -10091,12 +10133,12 @@ query GetLightningTransaction($id: ID!) {
10091
10133
  ${FRAGMENT30}
10092
10134
  `,
10093
10135
  variables: { id },
10094
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? LightningTransactionFromJson(data.entity) : null
10136
+ constructObject: (data) => isObject26(data) && "entity" in data && isObject26(data.entity) ? LightningTransactionFromJson(data.entity) : null
10095
10137
  };
10096
10138
  };
10097
10139
 
10098
10140
  // src/objects/LightsparkNodeOwner.ts
10099
- import { LightsparkException as LightsparkException9 } from "@lightsparkdev/core";
10141
+ import { LightsparkException as LightsparkException9, isObject as isObject27 } from "@lightsparkdev/core";
10100
10142
  var LightsparkNodeOwnerFromJson = (obj) => {
10101
10143
  if (obj["__typename"] == "Account") {
10102
10144
  return new Account_default(
@@ -10189,7 +10231,7 @@ query GetLightsparkNodeOwner($id: ID!) {
10189
10231
  ${FRAGMENT31}
10190
10232
  `,
10191
10233
  variables: { id },
10192
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? LightsparkNodeOwnerFromJson(data.entity) : null
10234
+ constructObject: (data) => isObject27(data) && "entity" in data && isObject27(data.entity) ? LightsparkNodeOwnerFromJson(data.entity) : null
10193
10235
  };
10194
10236
  };
10195
10237
 
@@ -10205,7 +10247,7 @@ var OnChainFeeTarget = /* @__PURE__ */ ((OnChainFeeTarget2) => {
10205
10247
  var OnChainFeeTarget_default = OnChainFeeTarget;
10206
10248
 
10207
10249
  // src/objects/OnChainTransaction.ts
10208
- import { LightsparkException as LightsparkException10 } from "@lightsparkdev/core";
10250
+ import { LightsparkException as LightsparkException10, isObject as isObject28 } from "@lightsparkdev/core";
10209
10251
  var OnChainTransactionFromJson = (obj) => {
10210
10252
  if (obj["__typename"] == "ChannelClosingTransaction") {
10211
10253
  return {
@@ -10430,7 +10472,7 @@ query GetOnChainTransaction($id: ID!) {
10430
10472
  ${FRAGMENT32}
10431
10473
  `,
10432
10474
  variables: { id },
10433
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? OnChainTransactionFromJson(data.entity) : null
10475
+ constructObject: (data) => isObject28(data) && "entity" in data && isObject28(data.entity) ? OnChainTransactionFromJson(data.entity) : null
10434
10476
  };
10435
10477
  };
10436
10478
 
@@ -10470,6 +10512,7 @@ var RiskRating = /* @__PURE__ */ ((RiskRating2) => {
10470
10512
  var RiskRating_default = RiskRating;
10471
10513
 
10472
10514
  // src/objects/RoutingTransaction.ts
10515
+ import { isObject as isObject29 } from "@lightsparkdev/core";
10473
10516
  var RoutingTransactionFromJson = (obj) => {
10474
10517
  return {
10475
10518
  id: obj["routing_transaction_id"],
@@ -10538,11 +10581,12 @@ query GetRoutingTransaction($id: ID!) {
10538
10581
  ${FRAGMENT33}
10539
10582
  `,
10540
10583
  variables: { id },
10541
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? RoutingTransactionFromJson(data.entity) : null
10584
+ constructObject: (data) => isObject29(data) && "entity" in data && isObject29(data.entity) ? RoutingTransactionFromJson(data.entity) : null
10542
10585
  };
10543
10586
  };
10544
10587
 
10545
10588
  // src/objects/Signable.ts
10589
+ import { isObject as isObject30 } from "@lightsparkdev/core";
10546
10590
  var SignableFromJson = (obj) => {
10547
10591
  return {
10548
10592
  id: obj["signable_id"],
@@ -10572,7 +10616,7 @@ query GetSignable($id: ID!) {
10572
10616
  ${FRAGMENT34}
10573
10617
  `,
10574
10618
  variables: { id },
10575
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? SignableFromJson(data.entity) : null
10619
+ constructObject: (data) => isObject30(data) && "entity" in data && isObject30(data.entity) ? SignableFromJson(data.entity) : null
10576
10620
  };
10577
10621
  };
10578
10622
 
@@ -10626,6 +10670,7 @@ fragment TransactionUpdateFragment on Transaction {
10626
10670
  }`;
10627
10671
 
10628
10672
  // src/objects/UmaInvitation.ts
10673
+ import { isObject as isObject31 } from "@lightsparkdev/core";
10629
10674
  var UmaInvitationFromJson = (obj) => {
10630
10675
  return {
10631
10676
  id: obj["uma_invitation_id"],
@@ -10667,7 +10712,7 @@ query GetUmaInvitation($id: ID!) {
10667
10712
  ${FRAGMENT36}
10668
10713
  `,
10669
10714
  variables: { id },
10670
- constructObject: (data) => data && typeof data === "object" && "entity" in data ? UmaInvitationFromJson(data.entity) : null
10715
+ constructObject: (data) => isObject31(data) && "entity" in data && isObject31(data.entity) ? UmaInvitationFromJson(data.entity) : null
10671
10716
  };
10672
10717
  };
10673
10718
 
@@ -1,4 +1,4 @@
1
- import { Maybe, Query, AuthProvider, CryptoInterface, SigningKey, KeyOrAliasType } from '@lightsparkdev/core';
1
+ import { Maybe, Query, AuthProvider, CryptoInterface, SigningKey, KeyOrAliasType, LoggingLevel } from '@lightsparkdev/core';
2
2
  import Observable from 'zen-observable';
3
3
  import { B as BitcoinNetwork } from './BitcoinNetwork-4f6ea015.js';
4
4
 
@@ -3376,6 +3376,20 @@ declare class LightsparkClient {
3376
3376
  * @param statuses Filter to only include payments with the given statuses. If not provided, all statuses are included.
3377
3377
  */
3378
3378
  outgoingPaymentsForPaymentHash(paymentHash: string, statuses?: TransactionStatus[] | undefined): Promise<OutgoingPayment[]>;
3379
+ /**
3380
+ * Fetches Outgoing payments for a given invoice if there are any.
3381
+ *
3382
+ * @param encodedInvoice encoded invoice associated with outgoing payment
3383
+ * @param statuses Filter to only include payments with the given statuses. If not provided, all statuses are included.
3384
+ */
3385
+ outgoingPaymentsForInvoice(encodedInvoice: string, statuses?: TransactionStatus[] | undefined): Promise<OutgoingPayment[]>;
3386
+ /**
3387
+ * Fetches Incoming payments for a given invoice if there are any.
3388
+ *
3389
+ * @param invoiceId id of associated invoice
3390
+ * @param statuses Filter to only include payments with the given statuses. If not provided, all statuses are included.
3391
+ */
3392
+ incomingPaymentsForInvoice(invoiceId: string, statuses?: TransactionStatus[] | undefined): Promise<IncomingPayment[]>;
3379
3393
  private hashPhoneNumber;
3380
3394
  hashUmaIdentifier(identifier: string, signingPrivateKey: Uint8Array): Promise<string>;
3381
3395
  getUtcDateTime(): Date;
@@ -3390,6 +3404,13 @@ declare class LightsparkClient {
3390
3404
  * @returns The result of the query.
3391
3405
  */
3392
3406
  executeRawQuery<T>(query: Query<T>): Promise<T | null>;
3407
+ /**
3408
+ * Enable logging for debugging purposes
3409
+ *
3410
+ * @param enabled Whether logging should be enabled.
3411
+ * @param level The logging level to use.
3412
+ * */
3413
+ setLoggingEnabled(enabled: boolean, level?: LoggingLevel): void;
3393
3414
  }
3394
3415
 
3395
3416
  /** Audit log actor who called the GraphQL mutation **/