@lightsparkdev/lightspark-sdk 1.5.11 → 1.5.13

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 (45) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{chunk-X7VPX3F3.js → chunk-FGFVWCTL.js} +234 -161
  3. package/dist/{index-dd1501fa.d.ts → index-2b493387.d.ts} +147 -17
  4. package/dist/index.cjs +227 -152
  5. package/dist/index.d.cts +2 -2
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +7 -3
  8. package/dist/objects/index.cjs +226 -151
  9. package/dist/objects/index.d.cts +1 -1
  10. package/dist/objects/index.d.ts +1 -1
  11. package/dist/objects/index.js +5 -1
  12. package/package.json +2 -2
  13. package/src/env.ts +3 -3
  14. package/src/objects/Account.ts +5 -0
  15. package/src/objects/ApiToken.ts +6 -0
  16. package/src/objects/AuditLogActor.ts +96 -0
  17. package/src/objects/CancelInvoiceInput.ts +4 -0
  18. package/src/objects/CancelInvoiceOutput.ts +4 -0
  19. package/src/objects/ChannelSnapshot.ts +68 -17
  20. package/src/objects/ClaimUmaInvitationInput.ts +5 -0
  21. package/src/objects/ClaimUmaInvitationOutput.ts +1 -0
  22. package/src/objects/ClaimUmaInvitationWithIncentivesInput.ts +7 -0
  23. package/src/objects/ClaimUmaInvitationWithIncentivesOutput.ts +1 -0
  24. package/src/objects/CreateApiTokenOutput.ts +1 -0
  25. package/src/objects/CreateInvitationWithIncentivesInput.ts +6 -0
  26. package/src/objects/CreateInvitationWithIncentivesOutput.ts +1 -0
  27. package/src/objects/CreateInvoiceInput.ts +4 -1
  28. package/src/objects/CreateNodeWalletAddressOutput.ts +34 -0
  29. package/src/objects/CreateUmaInvitationInput.ts +4 -0
  30. package/src/objects/CreateUmaInvitationOutput.ts +1 -0
  31. package/src/objects/Entity.ts +57 -45
  32. package/src/objects/IncomingPayment.ts +13 -0
  33. package/src/objects/IncomingPaymentsForInvoiceQueryInput.ts +31 -0
  34. package/src/objects/IncomingPaymentsForInvoiceQueryOutput.ts +71 -0
  35. package/src/objects/LightningTransaction.ts +12 -0
  36. package/src/objects/MultiSigAddressValidationParameters.ts +45 -0
  37. package/src/objects/OutgoingPayment.ts +14 -45
  38. package/src/objects/OutgoingPaymentAttempt.ts +5 -59
  39. package/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts +343 -1
  40. package/src/objects/PaymentFailureReason.ts +2 -0
  41. package/src/objects/Transaction.ts +12 -0
  42. package/src/objects/Wallet.ts +4 -0
  43. package/src/objects/WebhookEventType.ts +2 -0
  44. package/src/objects/WithdrawalRequestStatus.ts +2 -0
  45. package/src/objects/index.ts +11 -1
@@ -1,9 +1,23 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
+ import type MultiSigAddressValidationParameters from "./MultiSigAddressValidationParameters.js";
4
+ import {
5
+ MultiSigAddressValidationParametersFromJson,
6
+ MultiSigAddressValidationParametersToJson,
7
+ } from "./MultiSigAddressValidationParameters.js";
8
+
3
9
  interface CreateNodeWalletAddressOutput {
4
10
  nodeId: string;
5
11
 
6
12
  walletAddress: string;
13
+
14
+ /**
15
+ * Vaildation parameters for the 2-of-2 multisig address. None if the address is not a 2-of-2
16
+ * multisig address.
17
+ **/
18
+ multisigWalletAddressValidationParameters?:
19
+ | MultiSigAddressValidationParameters
20
+ | undefined;
7
21
  }
8
22
 
9
23
  export const CreateNodeWalletAddressOutputFromJson = (
@@ -12,6 +26,15 @@ export const CreateNodeWalletAddressOutputFromJson = (
12
26
  return {
13
27
  nodeId: obj["create_node_wallet_address_output_node"].id,
14
28
  walletAddress: obj["create_node_wallet_address_output_wallet_address"],
29
+ multisigWalletAddressValidationParameters: !!obj[
30
+ "create_node_wallet_address_output_multisig_wallet_address_validation_parameters"
31
+ ]
32
+ ? MultiSigAddressValidationParametersFromJson(
33
+ obj[
34
+ "create_node_wallet_address_output_multisig_wallet_address_validation_parameters"
35
+ ],
36
+ )
37
+ : undefined,
15
38
  } as CreateNodeWalletAddressOutput;
16
39
  };
17
40
  export const CreateNodeWalletAddressOutputToJson = (
@@ -20,6 +43,12 @@ export const CreateNodeWalletAddressOutputToJson = (
20
43
  return {
21
44
  create_node_wallet_address_output_node: { id: obj.nodeId },
22
45
  create_node_wallet_address_output_wallet_address: obj.walletAddress,
46
+ create_node_wallet_address_output_multisig_wallet_address_validation_parameters:
47
+ obj.multisigWalletAddressValidationParameters
48
+ ? MultiSigAddressValidationParametersToJson(
49
+ obj.multisigWalletAddressValidationParameters,
50
+ )
51
+ : undefined,
23
52
  };
24
53
  };
25
54
 
@@ -30,6 +59,11 @@ fragment CreateNodeWalletAddressOutputFragment on CreateNodeWalletAddressOutput
30
59
  id
31
60
  }
32
61
  create_node_wallet_address_output_wallet_address: wallet_address
62
+ create_node_wallet_address_output_multisig_wallet_address_validation_parameters: multisig_wallet_address_validation_parameters {
63
+ __typename
64
+ multi_sig_address_validation_parameters_counterparty_funding_pubkey: counterparty_funding_pubkey
65
+ multi_sig_address_validation_parameters_funding_pubkey_derivation_path: funding_pubkey_derivation_path
66
+ }
33
67
  }`;
34
68
 
35
69
  export default CreateNodeWalletAddressOutput;
@@ -1,6 +1,10 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
3
  interface CreateUmaInvitationInput {
4
+ /**
5
+ * The UMA of the user creating the invitation. It will be used to identify the inviter when
6
+ * receiving the invitation.
7
+ **/
4
8
  inviterUma: string;
5
9
  }
6
10
 
@@ -1,6 +1,7 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
3
  interface CreateUmaInvitationOutput {
4
+ /** The created invitation in the form of a string identifier. **/
4
5
  invitationId: string;
5
6
  }
6
7
 
@@ -40,6 +40,7 @@ fragment EntityFragment on Entity {
40
40
  api_token_client_id: client_id
41
41
  api_token_name: name
42
42
  api_token_permissions: permissions
43
+ api_token_is_deleted: is_deleted
43
44
  }
44
45
  ... on Channel {
45
46
  __typename
@@ -199,6 +200,57 @@ fragment EntityFragment on Entity {
199
200
  id
200
201
  }
201
202
  }
203
+ ... on ChannelSnapshot {
204
+ __typename
205
+ channel_snapshot_id: id
206
+ channel_snapshot_created_at: created_at
207
+ channel_snapshot_updated_at: updated_at
208
+ channel_snapshot_local_balance: local_balance {
209
+ __typename
210
+ currency_amount_original_value: original_value
211
+ currency_amount_original_unit: original_unit
212
+ currency_amount_preferred_currency_unit: preferred_currency_unit
213
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
214
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
215
+ }
216
+ channel_snapshot_local_unsettled_balance: local_unsettled_balance {
217
+ __typename
218
+ currency_amount_original_value: original_value
219
+ currency_amount_original_unit: original_unit
220
+ currency_amount_preferred_currency_unit: preferred_currency_unit
221
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
222
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
223
+ }
224
+ channel_snapshot_remote_balance: remote_balance {
225
+ __typename
226
+ currency_amount_original_value: original_value
227
+ currency_amount_original_unit: original_unit
228
+ currency_amount_preferred_currency_unit: preferred_currency_unit
229
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
230
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
231
+ }
232
+ channel_snapshot_remote_unsettled_balance: remote_unsettled_balance {
233
+ __typename
234
+ currency_amount_original_value: original_value
235
+ currency_amount_original_unit: original_unit
236
+ currency_amount_preferred_currency_unit: preferred_currency_unit
237
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
238
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
239
+ }
240
+ channel_snapshot_status: status
241
+ channel_snapshot_channel: channel {
242
+ id
243
+ }
244
+ channel_snapshot_local_channel_reserve: local_channel_reserve {
245
+ __typename
246
+ currency_amount_original_value: original_value
247
+ currency_amount_original_unit: original_unit
248
+ currency_amount_preferred_currency_unit: preferred_currency_unit
249
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
250
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
251
+ }
252
+ channel_snapshot_timestamp: timestamp
253
+ }
202
254
  ... on Deposit {
203
255
  __typename
204
256
  deposit_id: id
@@ -287,6 +339,7 @@ fragment EntityFragment on Entity {
287
339
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
288
340
  }
289
341
  incoming_payment_transaction_hash: transaction_hash
342
+ incoming_payment_is_uma: is_uma
290
343
  incoming_payment_destination: destination {
291
344
  id
292
345
  }
@@ -305,6 +358,7 @@ fragment EntityFragment on Entity {
305
358
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
306
359
  }
307
360
  }
361
+ incoming_payment_is_internal_payment: is_internal_payment
308
362
  }
309
363
  ... on IncomingPaymentAttempt {
310
364
  __typename
@@ -906,6 +960,7 @@ fragment EntityFragment on Entity {
906
960
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
907
961
  }
908
962
  outgoing_payment_transaction_hash: transaction_hash
963
+ outgoing_payment_is_uma: is_uma
909
964
  outgoing_payment_origin: origin {
910
965
  id
911
966
  }
@@ -1232,6 +1287,7 @@ fragment EntityFragment on Entity {
1232
1287
  }
1233
1288
  }
1234
1289
  outgoing_payment_payment_preimage: payment_preimage
1290
+ outgoing_payment_is_internal_payment: is_internal_payment
1235
1291
  }
1236
1292
  ... on OutgoingPaymentAttempt {
1237
1293
  __typename
@@ -1263,51 +1319,7 @@ fragment EntityFragment on Entity {
1263
1319
  id
1264
1320
  }
1265
1321
  outgoing_payment_attempt_channel_snapshot: channel_snapshot {
1266
- __typename
1267
- channel_snapshot_channel: channel {
1268
- id
1269
- }
1270
- channel_snapshot_timestamp: timestamp
1271
- channel_snapshot_local_balance: local_balance {
1272
- __typename
1273
- currency_amount_original_value: original_value
1274
- currency_amount_original_unit: original_unit
1275
- currency_amount_preferred_currency_unit: preferred_currency_unit
1276
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1277
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1278
- }
1279
- channel_snapshot_local_unsettled_balance: local_unsettled_balance {
1280
- __typename
1281
- currency_amount_original_value: original_value
1282
- currency_amount_original_unit: original_unit
1283
- currency_amount_preferred_currency_unit: preferred_currency_unit
1284
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1285
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1286
- }
1287
- channel_snapshot_local_channel_reserve: local_channel_reserve {
1288
- __typename
1289
- currency_amount_original_value: original_value
1290
- currency_amount_original_unit: original_unit
1291
- currency_amount_preferred_currency_unit: preferred_currency_unit
1292
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1293
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1294
- }
1295
- channel_snapshot_remote_balance: remote_balance {
1296
- __typename
1297
- currency_amount_original_value: original_value
1298
- currency_amount_original_unit: original_unit
1299
- currency_amount_preferred_currency_unit: preferred_currency_unit
1300
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1301
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1302
- }
1303
- channel_snapshot_remote_unsettled_balance: remote_unsettled_balance {
1304
- __typename
1305
- currency_amount_original_value: original_value
1306
- currency_amount_original_unit: original_unit
1307
- currency_amount_preferred_currency_unit: preferred_currency_unit
1308
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1309
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1310
- }
1322
+ id
1311
1323
  }
1312
1324
  }
1313
1325
  ... on RoutingTransaction {
@@ -41,8 +41,15 @@ class IncomingPayment implements LightningTransaction, Transaction, Entity {
41
41
  public readonly status: TransactionStatus,
42
42
  /** The amount of money involved in this transaction. **/
43
43
  public readonly amount: CurrencyAmount,
44
+ /**
45
+ * Whether this payment is an UMA payment or not. NOTE: this field is only set if the invoice
46
+ * that is being paid has been created using the recommended `create_uma_invoice` function.
47
+ **/
48
+ public readonly isUma: boolean,
44
49
  /** The recipient Lightspark node this payment was sent to. **/
45
50
  public readonly destinationId: string,
51
+ /** Whether the payment is made from the same node. **/
52
+ public readonly isInternalPayment: boolean,
46
53
  /** The typename of the object **/
47
54
  public readonly typename: string,
48
55
  /** The date and time when this transaction was completed or failed. **/
@@ -146,11 +153,13 @@ ${FRAGMENT}
146
153
  incoming_payment_resolved_at: this.resolvedAt,
147
154
  incoming_payment_amount: CurrencyAmountToJson(this.amount),
148
155
  incoming_payment_transaction_hash: this.transactionHash,
156
+ incoming_payment_is_uma: this.isUma,
149
157
  incoming_payment_destination: { id: this.destinationId },
150
158
  incoming_payment_payment_request:
151
159
  { id: this.paymentRequestId } ?? undefined,
152
160
  incoming_payment_uma_post_transaction_data:
153
161
  this.umaPostTransactionData?.map((e) => PostTransactionDataToJson(e)),
162
+ incoming_payment_is_internal_payment: this.isInternalPayment,
154
163
  };
155
164
  }
156
165
  }
@@ -163,7 +172,9 @@ export const IncomingPaymentFromJson = (obj: any): IncomingPayment => {
163
172
  TransactionStatus[obj["incoming_payment_status"]] ??
164
173
  TransactionStatus.FUTURE_VALUE,
165
174
  CurrencyAmountFromJson(obj["incoming_payment_amount"]),
175
+ obj["incoming_payment_is_uma"],
166
176
  obj["incoming_payment_destination"].id,
177
+ obj["incoming_payment_is_internal_payment"],
167
178
  "IncomingPayment",
168
179
  obj["incoming_payment_resolved_at"],
169
180
  obj["incoming_payment_transaction_hash"],
@@ -191,6 +202,7 @@ fragment IncomingPaymentFragment on IncomingPayment {
191
202
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
192
203
  }
193
204
  incoming_payment_transaction_hash: transaction_hash
205
+ incoming_payment_is_uma: is_uma
194
206
  incoming_payment_destination: destination {
195
207
  id
196
208
  }
@@ -209,6 +221,7 @@ fragment IncomingPaymentFragment on IncomingPayment {
209
221
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
210
222
  }
211
223
  }
224
+ incoming_payment_is_internal_payment: is_internal_payment
212
225
  }`;
213
226
 
214
227
  export default IncomingPayment;
@@ -0,0 +1,31 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import TransactionStatus from "./TransactionStatus.js";
4
+
5
+ interface IncomingPaymentsForInvoiceQueryInput {
6
+ invoiceId: string;
7
+
8
+ /** An optional filter to only query outgoing payments of given statuses. **/
9
+ statuses?: TransactionStatus[] | undefined;
10
+ }
11
+
12
+ export const IncomingPaymentsForInvoiceQueryInputFromJson = (
13
+ obj: any,
14
+ ): IncomingPaymentsForInvoiceQueryInput => {
15
+ return {
16
+ invoiceId: obj["incoming_payments_for_invoice_query_input_invoice_id"],
17
+ statuses: obj["incoming_payments_for_invoice_query_input_statuses"]?.map(
18
+ (e) => TransactionStatus[e],
19
+ ),
20
+ } as IncomingPaymentsForInvoiceQueryInput;
21
+ };
22
+ export const IncomingPaymentsForInvoiceQueryInputToJson = (
23
+ obj: IncomingPaymentsForInvoiceQueryInput,
24
+ ): any => {
25
+ return {
26
+ incoming_payments_for_invoice_query_input_invoice_id: obj.invoiceId,
27
+ incoming_payments_for_invoice_query_input_statuses: obj.statuses,
28
+ };
29
+ };
30
+
31
+ export default IncomingPaymentsForInvoiceQueryInput;
@@ -0,0 +1,71 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import type IncomingPayment from "./IncomingPayment.js";
4
+ import { IncomingPaymentFromJson } from "./IncomingPayment.js";
5
+
6
+ interface IncomingPaymentsForInvoiceQueryOutput {
7
+ payments: IncomingPayment[];
8
+ }
9
+
10
+ export const IncomingPaymentsForInvoiceQueryOutputFromJson = (
11
+ obj: any,
12
+ ): IncomingPaymentsForInvoiceQueryOutput => {
13
+ return {
14
+ payments: obj["incoming_payments_for_invoice_query_output_payments"].map(
15
+ (e) => IncomingPaymentFromJson(e),
16
+ ),
17
+ } as IncomingPaymentsForInvoiceQueryOutput;
18
+ };
19
+ export const IncomingPaymentsForInvoiceQueryOutputToJson = (
20
+ obj: IncomingPaymentsForInvoiceQueryOutput,
21
+ ): any => {
22
+ return {
23
+ incoming_payments_for_invoice_query_output_payments: obj.payments.map((e) =>
24
+ e.toJson(),
25
+ ),
26
+ };
27
+ };
28
+
29
+ export const FRAGMENT = `
30
+ fragment IncomingPaymentsForInvoiceQueryOutputFragment on IncomingPaymentsForInvoiceQueryOutput {
31
+ __typename
32
+ incoming_payments_for_invoice_query_output_payments: payments {
33
+ __typename
34
+ incoming_payment_id: id
35
+ incoming_payment_created_at: created_at
36
+ incoming_payment_updated_at: updated_at
37
+ incoming_payment_status: status
38
+ incoming_payment_resolved_at: resolved_at
39
+ incoming_payment_amount: amount {
40
+ __typename
41
+ currency_amount_original_value: original_value
42
+ currency_amount_original_unit: original_unit
43
+ currency_amount_preferred_currency_unit: preferred_currency_unit
44
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
45
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
46
+ }
47
+ incoming_payment_transaction_hash: transaction_hash
48
+ incoming_payment_is_uma: is_uma
49
+ incoming_payment_destination: destination {
50
+ id
51
+ }
52
+ incoming_payment_payment_request: payment_request {
53
+ id
54
+ }
55
+ incoming_payment_uma_post_transaction_data: uma_post_transaction_data {
56
+ __typename
57
+ post_transaction_data_utxo: utxo
58
+ post_transaction_data_amount: amount {
59
+ __typename
60
+ currency_amount_original_value: original_value
61
+ currency_amount_original_unit: original_unit
62
+ currency_amount_preferred_currency_unit: preferred_currency_unit
63
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
64
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
65
+ }
66
+ }
67
+ incoming_payment_is_internal_payment: is_internal_payment
68
+ }
69
+ }`;
70
+
71
+ export default IncomingPaymentsForInvoiceQueryOutput;
@@ -67,7 +67,9 @@ export const LightningTransactionFromJson = (
67
67
  TransactionStatus[obj["incoming_payment_status"]] ??
68
68
  TransactionStatus.FUTURE_VALUE,
69
69
  CurrencyAmountFromJson(obj["incoming_payment_amount"]),
70
+ obj["incoming_payment_is_uma"],
70
71
  obj["incoming_payment_destination"].id,
72
+ obj["incoming_payment_is_internal_payment"],
71
73
  "IncomingPayment",
72
74
  obj["incoming_payment_resolved_at"],
73
75
  obj["incoming_payment_transaction_hash"],
@@ -85,7 +87,9 @@ export const LightningTransactionFromJson = (
85
87
  TransactionStatus[obj["outgoing_payment_status"]] ??
86
88
  TransactionStatus.FUTURE_VALUE,
87
89
  CurrencyAmountFromJson(obj["outgoing_payment_amount"]),
90
+ obj["outgoing_payment_is_uma"],
88
91
  obj["outgoing_payment_origin"].id,
92
+ obj["outgoing_payment_is_internal_payment"],
89
93
  "OutgoingPayment",
90
94
  obj["outgoing_payment_resolved_at"],
91
95
  obj["outgoing_payment_transaction_hash"],
@@ -157,6 +161,7 @@ export const LightningTransactionToJson = (obj: LightningTransaction): any => {
157
161
  incoming_payment_resolved_at: incomingPayment.resolvedAt,
158
162
  incoming_payment_amount: CurrencyAmountToJson(incomingPayment.amount),
159
163
  incoming_payment_transaction_hash: incomingPayment.transactionHash,
164
+ incoming_payment_is_uma: incomingPayment.isUma,
160
165
  incoming_payment_destination: { id: incomingPayment.destinationId },
161
166
  incoming_payment_payment_request:
162
167
  { id: incomingPayment.paymentRequestId } ?? undefined,
@@ -164,6 +169,7 @@ export const LightningTransactionToJson = (obj: LightningTransaction): any => {
164
169
  incomingPayment.umaPostTransactionData?.map((e) =>
165
170
  PostTransactionDataToJson(e),
166
171
  ),
172
+ incoming_payment_is_internal_payment: incomingPayment.isInternalPayment,
167
173
  };
168
174
  }
169
175
  if (obj.typename == "OutgoingPayment") {
@@ -177,6 +183,7 @@ export const LightningTransactionToJson = (obj: LightningTransaction): any => {
177
183
  outgoing_payment_resolved_at: outgoingPayment.resolvedAt,
178
184
  outgoing_payment_amount: CurrencyAmountToJson(outgoingPayment.amount),
179
185
  outgoing_payment_transaction_hash: outgoingPayment.transactionHash,
186
+ outgoing_payment_is_uma: outgoingPayment.isUma,
180
187
  outgoing_payment_origin: { id: outgoingPayment.originId },
181
188
  outgoing_payment_destination:
182
189
  { id: outgoingPayment.destinationId } ?? undefined,
@@ -195,6 +202,7 @@ export const LightningTransactionToJson = (obj: LightningTransaction): any => {
195
202
  PostTransactionDataToJson(e),
196
203
  ),
197
204
  outgoing_payment_payment_preimage: outgoingPayment.paymentPreimage,
205
+ outgoing_payment_is_internal_payment: outgoingPayment.isInternalPayment,
198
206
  };
199
207
  }
200
208
  if (obj.typename == "RoutingTransaction") {
@@ -248,6 +256,7 @@ fragment LightningTransactionFragment on LightningTransaction {
248
256
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
249
257
  }
250
258
  incoming_payment_transaction_hash: transaction_hash
259
+ incoming_payment_is_uma: is_uma
251
260
  incoming_payment_destination: destination {
252
261
  id
253
262
  }
@@ -266,6 +275,7 @@ fragment LightningTransactionFragment on LightningTransaction {
266
275
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
267
276
  }
268
277
  }
278
+ incoming_payment_is_internal_payment: is_internal_payment
269
279
  }
270
280
  ... on OutgoingPayment {
271
281
  __typename
@@ -283,6 +293,7 @@ fragment LightningTransactionFragment on LightningTransaction {
283
293
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
284
294
  }
285
295
  outgoing_payment_transaction_hash: transaction_hash
296
+ outgoing_payment_is_uma: is_uma
286
297
  outgoing_payment_origin: origin {
287
298
  id
288
299
  }
@@ -609,6 +620,7 @@ fragment LightningTransactionFragment on LightningTransaction {
609
620
  }
610
621
  }
611
622
  outgoing_payment_payment_preimage: payment_preimage
623
+ outgoing_payment_is_internal_payment: is_internal_payment
612
624
  }
613
625
  ... on RoutingTransaction {
614
626
  __typename
@@ -0,0 +1,45 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ interface MultiSigAddressValidationParameters {
4
+ /** The counterparty funding public key used to create the 2-of-2 multisig for the address. **/
5
+ counterpartyFundingPubkey: string;
6
+
7
+ /**
8
+ * The derivation path used to derive the funding public key for the 2-of-2 multisig address. *
9
+ */
10
+ fundingPubkeyDerivationPath: string;
11
+ }
12
+
13
+ export const MultiSigAddressValidationParametersFromJson = (
14
+ obj: any,
15
+ ): MultiSigAddressValidationParameters => {
16
+ return {
17
+ counterpartyFundingPubkey:
18
+ obj[
19
+ "multi_sig_address_validation_parameters_counterparty_funding_pubkey"
20
+ ],
21
+ fundingPubkeyDerivationPath:
22
+ obj[
23
+ "multi_sig_address_validation_parameters_funding_pubkey_derivation_path"
24
+ ],
25
+ } as MultiSigAddressValidationParameters;
26
+ };
27
+ export const MultiSigAddressValidationParametersToJson = (
28
+ obj: MultiSigAddressValidationParameters,
29
+ ): any => {
30
+ return {
31
+ multi_sig_address_validation_parameters_counterparty_funding_pubkey:
32
+ obj.counterpartyFundingPubkey,
33
+ multi_sig_address_validation_parameters_funding_pubkey_derivation_path:
34
+ obj.fundingPubkeyDerivationPath,
35
+ };
36
+ };
37
+
38
+ export const FRAGMENT = `
39
+ fragment MultiSigAddressValidationParametersFragment on MultiSigAddressValidationParameters {
40
+ __typename
41
+ multi_sig_address_validation_parameters_counterparty_funding_pubkey: counterparty_funding_pubkey
42
+ multi_sig_address_validation_parameters_funding_pubkey_derivation_path: funding_pubkey_derivation_path
43
+ }`;
44
+
45
+ export default MultiSigAddressValidationParameters;
@@ -48,8 +48,15 @@ class OutgoingPayment implements LightningTransaction, Transaction, Entity {
48
48
  public readonly status: TransactionStatus,
49
49
  /** The amount of money involved in this transaction. **/
50
50
  public readonly amount: CurrencyAmount,
51
+ /**
52
+ * Whether this payment is an UMA payment or not. NOTE: this field is only set if the payment
53
+ * has been sent using the recommended `pay_uma_invoice` function.
54
+ **/
55
+ public readonly isUma: boolean,
51
56
  /** The Lightspark node this payment originated from. **/
52
57
  public readonly originId: string,
58
+ /** Whether the payment is made to the same node. **/
59
+ public readonly isInternalPayment: boolean,
53
60
  /** The typename of the object **/
54
61
  public readonly typename: string,
55
62
  /** The date and time when this transaction was completed or failed. **/
@@ -124,51 +131,7 @@ query FetchOutgoingPaymentToAttemptsConnection($entity_id: ID!, $first: Int, $af
124
131
  id
125
132
  }
126
133
  outgoing_payment_attempt_channel_snapshot: channel_snapshot {
127
- __typename
128
- channel_snapshot_channel: channel {
129
- id
130
- }
131
- channel_snapshot_timestamp: timestamp
132
- channel_snapshot_local_balance: local_balance {
133
- __typename
134
- currency_amount_original_value: original_value
135
- currency_amount_original_unit: original_unit
136
- currency_amount_preferred_currency_unit: preferred_currency_unit
137
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
138
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
139
- }
140
- channel_snapshot_local_unsettled_balance: local_unsettled_balance {
141
- __typename
142
- currency_amount_original_value: original_value
143
- currency_amount_original_unit: original_unit
144
- currency_amount_preferred_currency_unit: preferred_currency_unit
145
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
146
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
147
- }
148
- channel_snapshot_local_channel_reserve: local_channel_reserve {
149
- __typename
150
- currency_amount_original_value: original_value
151
- currency_amount_original_unit: original_unit
152
- currency_amount_preferred_currency_unit: preferred_currency_unit
153
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
154
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
155
- }
156
- channel_snapshot_remote_balance: remote_balance {
157
- __typename
158
- currency_amount_original_value: original_value
159
- currency_amount_original_unit: original_unit
160
- currency_amount_preferred_currency_unit: preferred_currency_unit
161
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
162
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
163
- }
164
- channel_snapshot_remote_unsettled_balance: remote_unsettled_balance {
165
- __typename
166
- currency_amount_original_value: original_value
167
- currency_amount_original_unit: original_unit
168
- currency_amount_preferred_currency_unit: preferred_currency_unit
169
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
170
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
171
- }
134
+ id
172
135
  }
173
136
  }
174
137
  }
@@ -212,6 +175,7 @@ ${FRAGMENT}
212
175
  outgoing_payment_resolved_at: this.resolvedAt,
213
176
  outgoing_payment_amount: CurrencyAmountToJson(this.amount),
214
177
  outgoing_payment_transaction_hash: this.transactionHash,
178
+ outgoing_payment_is_uma: this.isUma,
215
179
  outgoing_payment_origin: { id: this.originId },
216
180
  outgoing_payment_destination: { id: this.destinationId } ?? undefined,
217
181
  outgoing_payment_fees: this.fees
@@ -227,6 +191,7 @@ ${FRAGMENT}
227
191
  outgoing_payment_uma_post_transaction_data:
228
192
  this.umaPostTransactionData?.map((e) => PostTransactionDataToJson(e)),
229
193
  outgoing_payment_payment_preimage: this.paymentPreimage,
194
+ outgoing_payment_is_internal_payment: this.isInternalPayment,
230
195
  };
231
196
  }
232
197
  }
@@ -239,7 +204,9 @@ export const OutgoingPaymentFromJson = (obj: any): OutgoingPayment => {
239
204
  TransactionStatus[obj["outgoing_payment_status"]] ??
240
205
  TransactionStatus.FUTURE_VALUE,
241
206
  CurrencyAmountFromJson(obj["outgoing_payment_amount"]),
207
+ obj["outgoing_payment_is_uma"],
242
208
  obj["outgoing_payment_origin"].id,
209
+ obj["outgoing_payment_is_internal_payment"],
243
210
  "OutgoingPayment",
244
211
  obj["outgoing_payment_resolved_at"],
245
212
  obj["outgoing_payment_transaction_hash"],
@@ -281,6 +248,7 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
281
248
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
282
249
  }
283
250
  outgoing_payment_transaction_hash: transaction_hash
251
+ outgoing_payment_is_uma: is_uma
284
252
  outgoing_payment_origin: origin {
285
253
  id
286
254
  }
@@ -607,6 +575,7 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
607
575
  }
608
576
  }
609
577
  outgoing_payment_payment_preimage: payment_preimage
578
+ outgoing_payment_is_internal_payment: is_internal_payment
610
579
  }`;
611
580
 
612
581
  export default OutgoingPayment;