@lightsparkdev/lightspark-sdk 0.3.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -35,7 +35,7 @@ var require_package = __commonJS({
35
35
  "package.json"(exports, module2) {
36
36
  module2.exports = {
37
37
  name: "@lightsparkdev/lightspark-sdk",
38
- version: "0.3.3",
38
+ version: "0.4.0",
39
39
  description: "Lightspark JS SDK",
40
40
  author: "Lightspark Inc.",
41
41
  keywords: [
@@ -104,7 +104,7 @@ var require_package = __commonJS({
104
104
  },
105
105
  license: "Apache-2.0",
106
106
  dependencies: {
107
- "@lightsparkdev/core": "0.3.2",
107
+ "@lightsparkdev/core": "0.3.3",
108
108
  "auto-bind": "^5.0.1",
109
109
  crypto: "^1.0.1",
110
110
  "crypto-browserify": "^3.12.0",
@@ -120,6 +120,7 @@ var require_package = __commonJS({
120
120
  "@types/ws": "^8.5.4",
121
121
  jest: "^29.4.1",
122
122
  prettier: "2.8.7",
123
+ "prettier-plugin-organize-imports": "^3.2.2",
123
124
  "ts-jest": "^29.0.5",
124
125
  "ts-node": "^10.9.1",
125
126
  tsconfig: "*",
@@ -1967,6 +1968,7 @@ __export(src_exports, {
1967
1968
  TransactionType: () => TransactionType_default,
1968
1969
  WEBHOOKS_SIGNATURE_HEADER: () => WEBHOOKS_SIGNATURE_HEADER,
1969
1970
  Wallet: () => Wallet_default,
1971
+ WalletStatus: () => WalletStatus_default,
1970
1972
  WebhookEventType: () => WebhookEventType_default,
1971
1973
  WithdrawalMode: () => WithdrawalMode_default,
1972
1974
  WithdrawalRequest: () => WithdrawalRequest_default,
@@ -1979,6 +1981,7 @@ __export(src_exports, {
1979
1981
  getIncomingPaymentAttemptQuery: () => getIncomingPaymentAttemptQuery,
1980
1982
  getInvoiceQuery: () => getInvoiceQuery,
1981
1983
  getLightningTransactionQuery: () => getLightningTransactionQuery,
1984
+ getLightsparkNodeOwnerQuery: () => getLightsparkNodeOwnerQuery,
1982
1985
  getOnChainTransactionQuery: () => getOnChainTransactionQuery,
1983
1986
  getPaymentRequestQuery: () => getPaymentRequestQuery,
1984
1987
  getRoutingTransactionQuery: () => getRoutingTransactionQuery,
@@ -2021,6 +2024,7 @@ var AccountTokenAuthProvider_default = AccountTokenAuthProvider;
2021
2024
  // src/client.ts
2022
2025
  var import_auto_bind13 = __toESM(require("auto-bind"), 1);
2023
2026
  var import_core6 = require("@lightsparkdev/core");
2027
+ var import_crypto = require("crypto");
2024
2028
 
2025
2029
  // src/objects/CurrencyUnit.ts
2026
2030
  var CurrencyUnit = /* @__PURE__ */ ((CurrencyUnit2) => {
@@ -2194,430 +2198,117 @@ var CreateInvoice = `
2194
2198
  }
2195
2199
  `;
2196
2200
 
2197
- // src/graphql/CreateNodeWalletAddress.ts
2198
- var CreateNodeWalletAddress = `
2199
- mutation CreateNodeWalletAddress(
2200
- $node_id: ID!
2201
- ) {
2202
- create_node_wallet_address(input: {
2203
- node_id: $node_id
2204
- }) {
2205
- wallet_address
2206
- }
2207
- }
2208
- `;
2201
+ // src/objects/BitcoinNetwork.ts
2202
+ var BitcoinNetwork = /* @__PURE__ */ ((BitcoinNetwork2) => {
2203
+ BitcoinNetwork2["FUTURE_VALUE"] = "FUTURE_VALUE";
2204
+ BitcoinNetwork2["MAINNET"] = "MAINNET";
2205
+ BitcoinNetwork2["REGTEST"] = "REGTEST";
2206
+ BitcoinNetwork2["SIGNET"] = "SIGNET";
2207
+ BitcoinNetwork2["TESTNET"] = "TESTNET";
2208
+ return BitcoinNetwork2;
2209
+ })(BitcoinNetwork || {});
2210
+ var BitcoinNetwork_default = BitcoinNetwork;
2209
2211
 
2210
- // src/graphql/CreateTestModeInvoice.ts
2211
- var CreateTestModeInvoice = `
2212
- mutation CreateTestModeInvoice(
2213
- $local_node_id: ID!
2214
- $amount_msats: Long!
2215
- $memo: String
2216
- $invoice_type: InvoiceType
2217
- ) {
2218
- create_test_mode_invoice(input: {
2219
- local_node_id: $local_node_id
2220
- amount_msats: $amount_msats
2221
- memo: $memo
2222
- invoice_type: $invoice_type
2223
- }) {
2224
- encoded_payment_request
2225
- }
2226
- }
2227
- `;
2212
+ // src/objects/Node.ts
2213
+ var import_core2 = require("@lightsparkdev/core");
2214
+ var import_auto_bind5 = __toESM(require("auto-bind"), 1);
2228
2215
 
2229
- // src/objects/OutgoingPayment.ts
2230
- var import_auto_bind7 = __toESM(require("auto-bind"), 1);
2216
+ // src/objects/BlockchainBalance.ts
2217
+ var BlockchainBalanceFromJson = (obj) => {
2218
+ return {
2219
+ totalBalance: !!obj["blockchain_balance_total_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_total_balance"]) : void 0,
2220
+ confirmedBalance: !!obj["blockchain_balance_confirmed_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_confirmed_balance"]) : void 0,
2221
+ unconfirmedBalance: !!obj["blockchain_balance_unconfirmed_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_unconfirmed_balance"]) : void 0,
2222
+ lockedBalance: !!obj["blockchain_balance_locked_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_locked_balance"]) : void 0,
2223
+ requiredReserve: !!obj["blockchain_balance_required_reserve"] ? CurrencyAmountFromJson(obj["blockchain_balance_required_reserve"]) : void 0,
2224
+ availableBalance: !!obj["blockchain_balance_available_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_available_balance"]) : void 0
2225
+ };
2226
+ };
2231
2227
 
2232
- // src/objects/OutgoingPaymentAttempt.ts
2228
+ // src/objects/GraphNode.ts
2233
2229
  var import_auto_bind2 = __toESM(require("auto-bind"), 1);
2234
2230
 
2235
- // src/objects/HtlcAttemptFailureCode.ts
2236
- var HtlcAttemptFailureCode = /* @__PURE__ */ ((HtlcAttemptFailureCode2) => {
2237
- HtlcAttemptFailureCode2["FUTURE_VALUE"] = "FUTURE_VALUE";
2238
- HtlcAttemptFailureCode2["INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS"] = "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS";
2239
- HtlcAttemptFailureCode2["INCORRECT_PAYMENT_AMOUNT"] = "INCORRECT_PAYMENT_AMOUNT";
2240
- HtlcAttemptFailureCode2["FINAL_INCORRECT_CLTV_EXPIRY"] = "FINAL_INCORRECT_CLTV_EXPIRY";
2241
- HtlcAttemptFailureCode2["FINAL_INCORRECT_HTLC_AMOUNT"] = "FINAL_INCORRECT_HTLC_AMOUNT";
2242
- HtlcAttemptFailureCode2["FINAL_EXPIRY_TOO_SOON"] = "FINAL_EXPIRY_TOO_SOON";
2243
- HtlcAttemptFailureCode2["INVALID_REALM"] = "INVALID_REALM";
2244
- HtlcAttemptFailureCode2["EXPIRY_TOO_SOON"] = "EXPIRY_TOO_SOON";
2245
- HtlcAttemptFailureCode2["INVALID_ONION_VERSION"] = "INVALID_ONION_VERSION";
2246
- HtlcAttemptFailureCode2["INVALID_ONION_HMAC"] = "INVALID_ONION_HMAC";
2247
- HtlcAttemptFailureCode2["INVALID_ONION_KEY"] = "INVALID_ONION_KEY";
2248
- HtlcAttemptFailureCode2["AMOUNT_BELOW_MINIMUM"] = "AMOUNT_BELOW_MINIMUM";
2249
- HtlcAttemptFailureCode2["FEE_INSUFFICIENT"] = "FEE_INSUFFICIENT";
2250
- HtlcAttemptFailureCode2["INCORRECT_CLTV_EXPIRY"] = "INCORRECT_CLTV_EXPIRY";
2251
- HtlcAttemptFailureCode2["CHANNEL_DISABLED"] = "CHANNEL_DISABLED";
2252
- HtlcAttemptFailureCode2["TEMPORARY_CHANNEL_FAILURE"] = "TEMPORARY_CHANNEL_FAILURE";
2253
- HtlcAttemptFailureCode2["REQUIRED_NODE_FEATURE_MISSING"] = "REQUIRED_NODE_FEATURE_MISSING";
2254
- HtlcAttemptFailureCode2["REQUIRED_CHANNEL_FEATURE_MISSING"] = "REQUIRED_CHANNEL_FEATURE_MISSING";
2255
- HtlcAttemptFailureCode2["UNKNOWN_NEXT_PEER"] = "UNKNOWN_NEXT_PEER";
2256
- HtlcAttemptFailureCode2["TEMPORARY_NODE_FAILURE"] = "TEMPORARY_NODE_FAILURE";
2257
- HtlcAttemptFailureCode2["PERMANENT_NODE_FAILURE"] = "PERMANENT_NODE_FAILURE";
2258
- HtlcAttemptFailureCode2["PERMANENT_CHANNEL_FAILURE"] = "PERMANENT_CHANNEL_FAILURE";
2259
- HtlcAttemptFailureCode2["EXPIRY_TOO_FAR"] = "EXPIRY_TOO_FAR";
2260
- HtlcAttemptFailureCode2["MPP_TIMEOUT"] = "MPP_TIMEOUT";
2261
- HtlcAttemptFailureCode2["INVALID_ONION_PAYLOAD"] = "INVALID_ONION_PAYLOAD";
2262
- HtlcAttemptFailureCode2["INTERNAL_FAILURE"] = "INTERNAL_FAILURE";
2263
- HtlcAttemptFailureCode2["UNKNOWN_FAILURE"] = "UNKNOWN_FAILURE";
2264
- HtlcAttemptFailureCode2["UNREADABLE_FAILURE"] = "UNREADABLE_FAILURE";
2265
- return HtlcAttemptFailureCode2;
2266
- })(HtlcAttemptFailureCode || {});
2267
- var HtlcAttemptFailureCode_default = HtlcAttemptFailureCode;
2268
-
2269
- // src/objects/OutgoingPaymentAttemptStatus.ts
2270
- var OutgoingPaymentAttemptStatus = /* @__PURE__ */ ((OutgoingPaymentAttemptStatus2) => {
2271
- OutgoingPaymentAttemptStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
2272
- OutgoingPaymentAttemptStatus2["IN_FLIGHT"] = "IN_FLIGHT";
2273
- OutgoingPaymentAttemptStatus2["SUCCEEDED"] = "SUCCEEDED";
2274
- OutgoingPaymentAttemptStatus2["FAILED"] = "FAILED";
2275
- return OutgoingPaymentAttemptStatus2;
2276
- })(OutgoingPaymentAttemptStatus || {});
2277
- var OutgoingPaymentAttemptStatus_default = OutgoingPaymentAttemptStatus;
2231
+ // src/objects/NodeAddressType.ts
2232
+ var NodeAddressType = /* @__PURE__ */ ((NodeAddressType2) => {
2233
+ NodeAddressType2["FUTURE_VALUE"] = "FUTURE_VALUE";
2234
+ NodeAddressType2["IPV4"] = "IPV4";
2235
+ NodeAddressType2["IPV6"] = "IPV6";
2236
+ NodeAddressType2["TOR"] = "TOR";
2237
+ return NodeAddressType2;
2238
+ })(NodeAddressType || {});
2239
+ var NodeAddressType_default = NodeAddressType;
2278
2240
 
2279
- // src/objects/Hop.ts
2280
- var HopFromJson = (obj) => {
2281
- return {
2282
- id: obj["hop_id"],
2283
- createdAt: obj["hop_created_at"],
2284
- updatedAt: obj["hop_updated_at"],
2285
- index: obj["hop_index"],
2286
- typename: "Hop",
2287
- destinationId: obj["hop_destination"]?.id ?? void 0,
2288
- publicKey: obj["hop_public_key"],
2289
- amountToForward: !!obj["hop_amount_to_forward"] ? CurrencyAmountFromJson(obj["hop_amount_to_forward"]) : void 0,
2290
- fee: !!obj["hop_fee"] ? CurrencyAmountFromJson(obj["hop_fee"]) : void 0,
2291
- expiryBlockHeight: obj["hop_expiry_block_height"]
2292
- };
2293
- };
2294
- var FRAGMENT4 = `
2295
- fragment HopFragment on Hop {
2296
- __typename
2297
- hop_id: id
2298
- hop_created_at: created_at
2299
- hop_updated_at: updated_at
2300
- hop_destination: destination {
2301
- id
2302
- }
2303
- hop_index: index
2304
- hop_public_key: public_key
2305
- hop_amount_to_forward: amount_to_forward {
2306
- __typename
2307
- currency_amount_original_value: original_value
2308
- currency_amount_original_unit: original_unit
2309
- currency_amount_preferred_currency_unit: preferred_currency_unit
2310
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
2311
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
2312
- }
2313
- hop_fee: fee {
2314
- __typename
2315
- currency_amount_original_value: original_value
2316
- currency_amount_original_unit: original_unit
2317
- currency_amount_preferred_currency_unit: preferred_currency_unit
2318
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
2319
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
2320
- }
2321
- hop_expiry_block_height: expiry_block_height
2322
- }`;
2323
- var getHopQuery = (id) => {
2241
+ // src/objects/NodeAddress.ts
2242
+ var NodeAddressFromJson = (obj) => {
2324
2243
  return {
2325
- queryPayload: `
2326
- query GetHop($id: ID!) {
2327
- entity(id: $id) {
2328
- ... on Hop {
2329
- ...HopFragment
2330
- }
2331
- }
2332
- }
2333
-
2334
- ${FRAGMENT4}
2335
- `,
2336
- variables: { id },
2337
- constructObject: (data) => HopFromJson(data.entity)
2244
+ address: obj["node_address_address"],
2245
+ type: NodeAddressType_default[obj["node_address_type"]] ?? NodeAddressType_default.FUTURE_VALUE
2338
2246
  };
2339
2247
  };
2340
2248
 
2341
- // src/objects/OutgoingPaymentAttemptToHopsConnection.ts
2342
- var OutgoingPaymentAttemptToHopsConnectionFromJson = (obj) => {
2249
+ // src/objects/NodeToAddressesConnection.ts
2250
+ var NodeToAddressesConnectionFromJson = (obj) => {
2343
2251
  return {
2344
- count: obj["outgoing_payment_attempt_to_hops_connection_count"],
2345
- entities: obj["outgoing_payment_attempt_to_hops_connection_entities"].map(
2346
- (e) => HopFromJson(e)
2252
+ count: obj["node_to_addresses_connection_count"],
2253
+ entities: obj["node_to_addresses_connection_entities"].map(
2254
+ (e) => NodeAddressFromJson(e)
2347
2255
  )
2348
2256
  };
2349
2257
  };
2350
2258
 
2351
- // src/objects/OutgoingPaymentAttempt.ts
2352
- var OutgoingPaymentAttempt = class {
2353
- constructor(id, createdAt, updatedAt, status, outgoingPaymentId, typename, failureCode, failureSourceIndex, resolvedAt, amount, fees) {
2259
+ // src/objects/GraphNode.ts
2260
+ var GraphNode = class {
2261
+ constructor(id, createdAt, updatedAt, bitcoinNetwork, displayName, typename, alias, color, conductivity, publicKey) {
2354
2262
  this.id = id;
2355
2263
  this.createdAt = createdAt;
2356
2264
  this.updatedAt = updatedAt;
2357
- this.status = status;
2358
- this.outgoingPaymentId = outgoingPaymentId;
2265
+ this.bitcoinNetwork = bitcoinNetwork;
2266
+ this.displayName = displayName;
2359
2267
  this.typename = typename;
2360
- this.failureCode = failureCode;
2361
- this.failureSourceIndex = failureSourceIndex;
2362
- this.resolvedAt = resolvedAt;
2363
- this.amount = amount;
2364
- this.fees = fees;
2268
+ this.alias = alias;
2269
+ this.color = color;
2270
+ this.conductivity = conductivity;
2271
+ this.publicKey = publicKey;
2365
2272
  (0, import_auto_bind2.default)(this);
2366
2273
  }
2367
- async getHops(client, first = void 0) {
2274
+ async getAddresses(client, first = void 0, types = void 0) {
2368
2275
  return await client.executeRawQuery({
2369
2276
  queryPayload: `
2370
- query FetchOutgoingPaymentAttemptToHopsConnection($entity_id: ID!, $first: Int) {
2277
+ query FetchNodeToAddressesConnection($entity_id: ID!, $first: Int, $types: [NodeAddressType!]) {
2371
2278
  entity(id: $entity_id) {
2372
- ... on OutgoingPaymentAttempt {
2373
- hops(, first: $first) {
2279
+ ... on GraphNode {
2280
+ addresses(, first: $first, types: $types) {
2374
2281
  __typename
2375
- outgoing_payment_attempt_to_hops_connection_count: count
2376
- outgoing_payment_attempt_to_hops_connection_entities: entities {
2282
+ node_to_addresses_connection_count: count
2283
+ node_to_addresses_connection_entities: entities {
2377
2284
  __typename
2378
- hop_id: id
2379
- hop_created_at: created_at
2380
- hop_updated_at: updated_at
2381
- hop_destination: destination {
2382
- id
2383
- }
2384
- hop_index: index
2385
- hop_public_key: public_key
2386
- hop_amount_to_forward: amount_to_forward {
2387
- __typename
2388
- currency_amount_original_value: original_value
2389
- currency_amount_original_unit: original_unit
2390
- currency_amount_preferred_currency_unit: preferred_currency_unit
2391
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
2392
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
2393
- }
2394
- hop_fee: fee {
2395
- __typename
2396
- currency_amount_original_value: original_value
2397
- currency_amount_original_unit: original_unit
2398
- currency_amount_preferred_currency_unit: preferred_currency_unit
2399
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
2400
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
2401
- }
2402
- hop_expiry_block_height: expiry_block_height
2285
+ node_address_address: address
2286
+ node_address_type: type
2403
2287
  }
2404
2288
  }
2405
2289
  }
2406
2290
  }
2407
2291
  }
2408
2292
  `,
2409
- variables: { entity_id: this.id, first },
2293
+ variables: { entity_id: this.id, first, types },
2410
2294
  constructObject: (json) => {
2411
- const connection = json["entity"]["hops"];
2412
- return OutgoingPaymentAttemptToHopsConnectionFromJson(connection);
2295
+ const connection = json["entity"]["addresses"];
2296
+ return NodeToAddressesConnectionFromJson(connection);
2413
2297
  }
2414
2298
  });
2415
2299
  }
2416
- static getOutgoingPaymentAttemptQuery(id) {
2300
+ static getGraphNodeQuery(id) {
2417
2301
  return {
2418
2302
  queryPayload: `
2419
- query GetOutgoingPaymentAttempt($id: ID!) {
2303
+ query GetGraphNode($id: ID!) {
2420
2304
  entity(id: $id) {
2421
- ... on OutgoingPaymentAttempt {
2422
- ...OutgoingPaymentAttemptFragment
2305
+ ... on GraphNode {
2306
+ ...GraphNodeFragment
2423
2307
  }
2424
2308
  }
2425
2309
  }
2426
2310
 
2427
- ${FRAGMENT5}
2428
- `,
2429
- variables: { id },
2430
- constructObject: (data) => OutgoingPaymentAttemptFromJson(data.entity)
2431
- };
2432
- }
2433
- };
2434
- var OutgoingPaymentAttemptFromJson = (obj) => {
2435
- return new OutgoingPaymentAttempt(
2436
- obj["outgoing_payment_attempt_id"],
2437
- obj["outgoing_payment_attempt_created_at"],
2438
- obj["outgoing_payment_attempt_updated_at"],
2439
- OutgoingPaymentAttemptStatus_default[obj["outgoing_payment_attempt_status"]] ?? OutgoingPaymentAttemptStatus_default.FUTURE_VALUE,
2440
- obj["outgoing_payment_attempt_outgoing_payment"].id,
2441
- "OutgoingPaymentAttempt",
2442
- !!obj["outgoing_payment_attempt_failure_code"] ? HtlcAttemptFailureCode_default[obj["outgoing_payment_attempt_failure_code"]] ?? HtlcAttemptFailureCode_default.FUTURE_VALUE : null,
2443
- obj["outgoing_payment_attempt_failure_source_index"],
2444
- obj["outgoing_payment_attempt_resolved_at"],
2445
- !!obj["outgoing_payment_attempt_amount"] ? CurrencyAmountFromJson(obj["outgoing_payment_attempt_amount"]) : void 0,
2446
- !!obj["outgoing_payment_attempt_fees"] ? CurrencyAmountFromJson(obj["outgoing_payment_attempt_fees"]) : void 0
2447
- );
2448
- };
2449
- var FRAGMENT5 = `
2450
- fragment OutgoingPaymentAttemptFragment on OutgoingPaymentAttempt {
2451
- __typename
2452
- outgoing_payment_attempt_id: id
2453
- outgoing_payment_attempt_created_at: created_at
2454
- outgoing_payment_attempt_updated_at: updated_at
2455
- outgoing_payment_attempt_status: status
2456
- outgoing_payment_attempt_failure_code: failure_code
2457
- outgoing_payment_attempt_failure_source_index: failure_source_index
2458
- outgoing_payment_attempt_resolved_at: resolved_at
2459
- outgoing_payment_attempt_amount: amount {
2460
- __typename
2461
- currency_amount_original_value: original_value
2462
- currency_amount_original_unit: original_unit
2463
- currency_amount_preferred_currency_unit: preferred_currency_unit
2464
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
2465
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
2466
- }
2467
- outgoing_payment_attempt_fees: fees {
2468
- __typename
2469
- currency_amount_original_value: original_value
2470
- currency_amount_original_unit: original_unit
2471
- currency_amount_preferred_currency_unit: preferred_currency_unit
2472
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
2473
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
2474
- }
2475
- outgoing_payment_attempt_outgoing_payment: outgoing_payment {
2476
- id
2477
- }
2478
- }`;
2479
- var OutgoingPaymentAttempt_default = OutgoingPaymentAttempt;
2480
-
2481
- // src/objects/OutgoingPaymentToAttemptsConnection.ts
2482
- var OutgoingPaymentToAttemptsConnectionFromJson = (obj) => {
2483
- return {
2484
- count: obj["outgoing_payment_to_attempts_connection_count"],
2485
- entities: obj["outgoing_payment_to_attempts_connection_entities"].map(
2486
- (e) => OutgoingPaymentAttemptFromJson(e)
2487
- )
2488
- };
2489
- };
2490
-
2491
- // src/objects/PaymentFailureReason.ts
2492
- var PaymentFailureReason = /* @__PURE__ */ ((PaymentFailureReason2) => {
2493
- PaymentFailureReason2["FUTURE_VALUE"] = "FUTURE_VALUE";
2494
- PaymentFailureReason2["NONE"] = "NONE";
2495
- PaymentFailureReason2["TIMEOUT"] = "TIMEOUT";
2496
- PaymentFailureReason2["NO_ROUTE"] = "NO_ROUTE";
2497
- PaymentFailureReason2["ERROR"] = "ERROR";
2498
- PaymentFailureReason2["INCORRECT_PAYMENT_DETAILS"] = "INCORRECT_PAYMENT_DETAILS";
2499
- PaymentFailureReason2["INSUFFICIENT_BALANCE"] = "INSUFFICIENT_BALANCE";
2500
- PaymentFailureReason2["INVOICE_ALREADY_PAID"] = "INVOICE_ALREADY_PAID";
2501
- PaymentFailureReason2["SELF_PAYMENT"] = "SELF_PAYMENT";
2502
- PaymentFailureReason2["INVOICE_EXPIRED"] = "INVOICE_EXPIRED";
2503
- return PaymentFailureReason2;
2504
- })(PaymentFailureReason || {});
2505
- var PaymentFailureReason_default = PaymentFailureReason;
2506
-
2507
- // src/objects/PaymentRequestData.ts
2508
- var import_core3 = require("@lightsparkdev/core");
2509
-
2510
- // src/objects/BitcoinNetwork.ts
2511
- var BitcoinNetwork = /* @__PURE__ */ ((BitcoinNetwork2) => {
2512
- BitcoinNetwork2["FUTURE_VALUE"] = "FUTURE_VALUE";
2513
- BitcoinNetwork2["MAINNET"] = "MAINNET";
2514
- BitcoinNetwork2["REGTEST"] = "REGTEST";
2515
- BitcoinNetwork2["SIGNET"] = "SIGNET";
2516
- BitcoinNetwork2["TESTNET"] = "TESTNET";
2517
- return BitcoinNetwork2;
2518
- })(BitcoinNetwork || {});
2519
- var BitcoinNetwork_default = BitcoinNetwork;
2520
-
2521
- // src/objects/Node.ts
2522
- var import_core2 = require("@lightsparkdev/core");
2523
- var import_auto_bind6 = __toESM(require("auto-bind"), 1);
2524
-
2525
- // src/objects/BlockchainBalance.ts
2526
- var BlockchainBalanceFromJson = (obj) => {
2527
- return {
2528
- totalBalance: !!obj["blockchain_balance_total_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_total_balance"]) : void 0,
2529
- confirmedBalance: !!obj["blockchain_balance_confirmed_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_confirmed_balance"]) : void 0,
2530
- unconfirmedBalance: !!obj["blockchain_balance_unconfirmed_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_unconfirmed_balance"]) : void 0,
2531
- lockedBalance: !!obj["blockchain_balance_locked_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_locked_balance"]) : void 0,
2532
- requiredReserve: !!obj["blockchain_balance_required_reserve"] ? CurrencyAmountFromJson(obj["blockchain_balance_required_reserve"]) : void 0,
2533
- availableBalance: !!obj["blockchain_balance_available_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_available_balance"]) : void 0
2534
- };
2535
- };
2536
-
2537
- // src/objects/GraphNode.ts
2538
- var import_auto_bind3 = __toESM(require("auto-bind"), 1);
2539
-
2540
- // src/objects/NodeAddressType.ts
2541
- var NodeAddressType = /* @__PURE__ */ ((NodeAddressType2) => {
2542
- NodeAddressType2["FUTURE_VALUE"] = "FUTURE_VALUE";
2543
- NodeAddressType2["IPV4"] = "IPV4";
2544
- NodeAddressType2["IPV6"] = "IPV6";
2545
- NodeAddressType2["TOR"] = "TOR";
2546
- return NodeAddressType2;
2547
- })(NodeAddressType || {});
2548
- var NodeAddressType_default = NodeAddressType;
2549
-
2550
- // src/objects/NodeAddress.ts
2551
- var NodeAddressFromJson = (obj) => {
2552
- return {
2553
- address: obj["node_address_address"],
2554
- type: NodeAddressType_default[obj["node_address_type"]] ?? NodeAddressType_default.FUTURE_VALUE
2555
- };
2556
- };
2557
-
2558
- // src/objects/NodeToAddressesConnection.ts
2559
- var NodeToAddressesConnectionFromJson = (obj) => {
2560
- return {
2561
- count: obj["node_to_addresses_connection_count"],
2562
- entities: obj["node_to_addresses_connection_entities"].map(
2563
- (e) => NodeAddressFromJson(e)
2564
- )
2565
- };
2566
- };
2567
-
2568
- // src/objects/GraphNode.ts
2569
- var GraphNode = class {
2570
- constructor(id, createdAt, updatedAt, bitcoinNetwork, displayName, typename, alias, color, conductivity, publicKey) {
2571
- this.id = id;
2572
- this.createdAt = createdAt;
2573
- this.updatedAt = updatedAt;
2574
- this.bitcoinNetwork = bitcoinNetwork;
2575
- this.displayName = displayName;
2576
- this.typename = typename;
2577
- this.alias = alias;
2578
- this.color = color;
2579
- this.conductivity = conductivity;
2580
- this.publicKey = publicKey;
2581
- (0, import_auto_bind3.default)(this);
2582
- }
2583
- async getAddresses(client, first = void 0, types = void 0) {
2584
- return await client.executeRawQuery({
2585
- queryPayload: `
2586
- query FetchNodeToAddressesConnection($entity_id: ID!, $first: Int, $types: [NodeAddressType!]) {
2587
- entity(id: $entity_id) {
2588
- ... on GraphNode {
2589
- addresses(, first: $first, types: $types) {
2590
- __typename
2591
- node_to_addresses_connection_count: count
2592
- node_to_addresses_connection_entities: entities {
2593
- __typename
2594
- node_address_address: address
2595
- node_address_type: type
2596
- }
2597
- }
2598
- }
2599
- }
2600
- }
2601
- `,
2602
- variables: { entity_id: this.id, first, types },
2603
- constructObject: (json) => {
2604
- const connection = json["entity"]["addresses"];
2605
- return NodeToAddressesConnectionFromJson(connection);
2606
- }
2607
- });
2608
- }
2609
- static getGraphNodeQuery(id) {
2610
- return {
2611
- queryPayload: `
2612
- query GetGraphNode($id: ID!) {
2613
- entity(id: $id) {
2614
- ... on GraphNode {
2615
- ...GraphNodeFragment
2616
- }
2617
- }
2618
- }
2619
-
2620
- ${FRAGMENT6}
2311
+ ${FRAGMENT4}
2621
2312
  `,
2622
2313
  variables: { id },
2623
2314
  constructObject: (data) => GraphNodeFromJson(data.entity)
@@ -2638,7 +2329,7 @@ var GraphNodeFromJson = (obj) => {
2638
2329
  obj["graph_node_public_key"]
2639
2330
  );
2640
2331
  };
2641
- var FRAGMENT6 = `
2332
+ var FRAGMENT4 = `
2642
2333
  fragment GraphNodeFragment on GraphNode {
2643
2334
  __typename
2644
2335
  graph_node_id: id
@@ -2654,7 +2345,7 @@ fragment GraphNodeFragment on GraphNode {
2654
2345
  var GraphNode_default = GraphNode;
2655
2346
 
2656
2347
  // src/objects/LightsparkNode.ts
2657
- var import_auto_bind5 = __toESM(require("auto-bind"), 1);
2348
+ var import_auto_bind4 = __toESM(require("auto-bind"), 1);
2658
2349
 
2659
2350
  // src/objects/LightsparkNodePurpose.ts
2660
2351
  var LightsparkNodePurpose = /* @__PURE__ */ ((LightsparkNodePurpose2) => {
@@ -2684,7 +2375,7 @@ var LightsparkNodeStatus = /* @__PURE__ */ ((LightsparkNodeStatus2) => {
2684
2375
  var LightsparkNodeStatus_default = LightsparkNodeStatus;
2685
2376
 
2686
2377
  // src/objects/Channel.ts
2687
- var import_auto_bind4 = __toESM(require("auto-bind"), 1);
2378
+ var import_auto_bind3 = __toESM(require("auto-bind"), 1);
2688
2379
 
2689
2380
  // src/objects/ChannelFees.ts
2690
2381
  var ChannelFeesFromJson = (obj) => {
@@ -2746,7 +2437,7 @@ var Channel = class {
2746
2437
  this.fees = fees;
2747
2438
  this.remoteNodeId = remoteNodeId;
2748
2439
  this.shortChannelId = shortChannelId;
2749
- (0, import_auto_bind4.default)(this);
2440
+ (0, import_auto_bind3.default)(this);
2750
2441
  }
2751
2442
  async getUptimePercentage(client, afterDate = void 0, beforeDate = void 0) {
2752
2443
  return await client.executeRawQuery({
@@ -2831,7 +2522,7 @@ query GetChannel($id: ID!) {
2831
2522
  }
2832
2523
  }
2833
2524
 
2834
- ${FRAGMENT7}
2525
+ ${FRAGMENT5}
2835
2526
  `,
2836
2527
  variables: { id },
2837
2528
  constructObject: (data) => ChannelFromJson(data.entity)
@@ -2861,7 +2552,7 @@ var ChannelFromJson = (obj) => {
2861
2552
  obj["channel_short_channel_id"]
2862
2553
  );
2863
2554
  };
2864
- var FRAGMENT7 = `
2555
+ var FRAGMENT5 = `
2865
2556
  fragment ChannelFragment on Channel {
2866
2557
  __typename
2867
2558
  channel_id: id
@@ -2991,13 +2682,14 @@ var SecretFromJson = (obj) => {
2991
2682
 
2992
2683
  // src/objects/LightsparkNode.ts
2993
2684
  var LightsparkNode = class {
2994
- constructor(id, createdAt, updatedAt, bitcoinNetwork, displayName, accountId, typename, alias, color, conductivity, publicKey, blockchainBalance, encryptedSigningPrivateKey, totalBalance, totalLocalBalance, localBalance, purpose, remoteBalance, status) {
2685
+ constructor(id, createdAt, updatedAt, bitcoinNetwork, displayName, accountId, ownerId, typename, alias, color, conductivity, publicKey, blockchainBalance, encryptedSigningPrivateKey, totalBalance, totalLocalBalance, localBalance, purpose, remoteBalance, status) {
2995
2686
  this.id = id;
2996
2687
  this.createdAt = createdAt;
2997
2688
  this.updatedAt = updatedAt;
2998
2689
  this.bitcoinNetwork = bitcoinNetwork;
2999
2690
  this.displayName = displayName;
3000
2691
  this.accountId = accountId;
2692
+ this.ownerId = ownerId;
3001
2693
  this.typename = typename;
3002
2694
  this.alias = alias;
3003
2695
  this.color = color;
@@ -3011,7 +2703,7 @@ var LightsparkNode = class {
3011
2703
  this.purpose = purpose;
3012
2704
  this.remoteBalance = remoteBalance;
3013
2705
  this.status = status;
3014
- (0, import_auto_bind5.default)(this);
2706
+ (0, import_auto_bind4.default)(this);
3015
2707
  }
3016
2708
  async getAddresses(client, first = void 0, types = void 0) {
3017
2709
  return await client.executeRawQuery({
@@ -3172,7 +2864,7 @@ query GetLightsparkNode($id: ID!) {
3172
2864
  }
3173
2865
  }
3174
2866
 
3175
- ${FRAGMENT8}
2867
+ ${FRAGMENT6}
3176
2868
  `,
3177
2869
  variables: { id },
3178
2870
  constructObject: (data) => LightsparkNodeFromJson(data.entity)
@@ -3187,6 +2879,7 @@ var LightsparkNodeFromJson = (obj) => {
3187
2879
  BitcoinNetwork_default[obj["lightspark_node_bitcoin_network"]] ?? BitcoinNetwork_default.FUTURE_VALUE,
3188
2880
  obj["lightspark_node_display_name"],
3189
2881
  obj["lightspark_node_account"].id,
2882
+ obj["lightspark_node_owner"].id,
3190
2883
  "LightsparkNode",
3191
2884
  obj["lightspark_node_alias"],
3192
2885
  obj["lightspark_node_color"],
@@ -3202,7 +2895,7 @@ var LightsparkNodeFromJson = (obj) => {
3202
2895
  !!obj["lightspark_node_status"] ? LightsparkNodeStatus_default[obj["lightspark_node_status"]] ?? LightsparkNodeStatus_default.FUTURE_VALUE : null
3203
2896
  );
3204
2897
  };
3205
- var FRAGMENT8 = `
2898
+ var FRAGMENT6 = `
3206
2899
  fragment LightsparkNodeFragment on LightsparkNode {
3207
2900
  __typename
3208
2901
  lightspark_node_id: id
@@ -3217,6 +2910,9 @@ fragment LightsparkNodeFragment on LightsparkNode {
3217
2910
  lightspark_node_account: account {
3218
2911
  id
3219
2912
  }
2913
+ lightspark_node_owner: owner {
2914
+ id
2915
+ }
3220
2916
  lightspark_node_blockchain_balance: blockchain_balance {
3221
2917
  __typename
3222
2918
  blockchain_balance_total_balance: total_balance {
@@ -3323,7 +3019,7 @@ var Node = class {
3323
3019
  this.color = color;
3324
3020
  this.conductivity = conductivity;
3325
3021
  this.publicKey = publicKey;
3326
- (0, import_auto_bind6.default)(this);
3022
+ (0, import_auto_bind5.default)(this);
3327
3023
  }
3328
3024
  async getAddresses(client, first = void 0, types = void 0) {
3329
3025
  return await client.executeRawQuery({
@@ -3362,7 +3058,7 @@ query GetNode($id: ID!) {
3362
3058
  }
3363
3059
  }
3364
3060
 
3365
- ${FRAGMENT9}
3061
+ ${FRAGMENT7}
3366
3062
  `,
3367
3063
  variables: { id },
3368
3064
  constructObject: (data) => NodeFromJson(data.entity)
@@ -3392,6 +3088,7 @@ var NodeFromJson = (obj) => {
3392
3088
  BitcoinNetwork_default[obj["lightspark_node_bitcoin_network"]] ?? BitcoinNetwork_default.FUTURE_VALUE,
3393
3089
  obj["lightspark_node_display_name"],
3394
3090
  obj["lightspark_node_account"].id,
3091
+ obj["lightspark_node_owner"].id,
3395
3092
  "LightsparkNode",
3396
3093
  obj["lightspark_node_alias"],
3397
3094
  obj["lightspark_node_color"],
@@ -3412,7 +3109,7 @@ var NodeFromJson = (obj) => {
3412
3109
  `Couldn't find a concrete type for interface Node corresponding to the typename=${obj["__typename"]}`
3413
3110
  );
3414
3111
  };
3415
- var FRAGMENT9 = `
3112
+ var FRAGMENT7 = `
3416
3113
  fragment NodeFragment on Node {
3417
3114
  __typename
3418
3115
  ... on GraphNode {
@@ -3441,6 +3138,9 @@ fragment NodeFragment on Node {
3441
3138
  lightspark_node_account: account {
3442
3139
  id
3443
3140
  }
3141
+ lightspark_node_owner: owner {
3142
+ id
3143
+ }
3444
3144
  lightspark_node_blockchain_balance: blockchain_balance {
3445
3145
  __typename
3446
3146
  blockchain_balance_total_balance: total_balance {
@@ -3535,7 +3235,689 @@ fragment NodeFragment on Node {
3535
3235
  }`;
3536
3236
  var Node_default = Node;
3537
3237
 
3238
+ // src/objects/InvoiceData.ts
3239
+ var InvoiceDataFromJson = (obj) => {
3240
+ return {
3241
+ encodedPaymentRequest: obj["invoice_data_encoded_payment_request"],
3242
+ bitcoinNetwork: BitcoinNetwork_default[obj["invoice_data_bitcoin_network"]] ?? BitcoinNetwork_default.FUTURE_VALUE,
3243
+ paymentHash: obj["invoice_data_payment_hash"],
3244
+ amount: CurrencyAmountFromJson(obj["invoice_data_amount"]),
3245
+ createdAt: obj["invoice_data_created_at"],
3246
+ expiresAt: obj["invoice_data_expires_at"],
3247
+ destination: NodeFromJson(obj["invoice_data_destination"]),
3248
+ typename: "InvoiceData",
3249
+ memo: obj["invoice_data_memo"]
3250
+ };
3251
+ };
3252
+ var FRAGMENT8 = `
3253
+ fragment InvoiceDataFragment on InvoiceData {
3254
+ __typename
3255
+ invoice_data_encoded_payment_request: encoded_payment_request
3256
+ invoice_data_bitcoin_network: bitcoin_network
3257
+ invoice_data_payment_hash: payment_hash
3258
+ invoice_data_amount: amount {
3259
+ __typename
3260
+ currency_amount_original_value: original_value
3261
+ currency_amount_original_unit: original_unit
3262
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3263
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3264
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3265
+ }
3266
+ invoice_data_created_at: created_at
3267
+ invoice_data_expires_at: expires_at
3268
+ invoice_data_memo: memo
3269
+ invoice_data_destination: destination {
3270
+ __typename
3271
+ ... on GraphNode {
3272
+ __typename
3273
+ graph_node_id: id
3274
+ graph_node_created_at: created_at
3275
+ graph_node_updated_at: updated_at
3276
+ graph_node_alias: alias
3277
+ graph_node_bitcoin_network: bitcoin_network
3278
+ graph_node_color: color
3279
+ graph_node_conductivity: conductivity
3280
+ graph_node_display_name: display_name
3281
+ graph_node_public_key: public_key
3282
+ }
3283
+ ... on LightsparkNode {
3284
+ __typename
3285
+ lightspark_node_id: id
3286
+ lightspark_node_created_at: created_at
3287
+ lightspark_node_updated_at: updated_at
3288
+ lightspark_node_alias: alias
3289
+ lightspark_node_bitcoin_network: bitcoin_network
3290
+ lightspark_node_color: color
3291
+ lightspark_node_conductivity: conductivity
3292
+ lightspark_node_display_name: display_name
3293
+ lightspark_node_public_key: public_key
3294
+ lightspark_node_account: account {
3295
+ id
3296
+ }
3297
+ lightspark_node_owner: owner {
3298
+ id
3299
+ }
3300
+ lightspark_node_blockchain_balance: blockchain_balance {
3301
+ __typename
3302
+ blockchain_balance_total_balance: total_balance {
3303
+ __typename
3304
+ currency_amount_original_value: original_value
3305
+ currency_amount_original_unit: original_unit
3306
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3307
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3308
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3309
+ }
3310
+ blockchain_balance_confirmed_balance: confirmed_balance {
3311
+ __typename
3312
+ currency_amount_original_value: original_value
3313
+ currency_amount_original_unit: original_unit
3314
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3315
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3316
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3317
+ }
3318
+ blockchain_balance_unconfirmed_balance: unconfirmed_balance {
3319
+ __typename
3320
+ currency_amount_original_value: original_value
3321
+ currency_amount_original_unit: original_unit
3322
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3323
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3324
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3325
+ }
3326
+ blockchain_balance_locked_balance: locked_balance {
3327
+ __typename
3328
+ currency_amount_original_value: original_value
3329
+ currency_amount_original_unit: original_unit
3330
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3331
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3332
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3333
+ }
3334
+ blockchain_balance_required_reserve: required_reserve {
3335
+ __typename
3336
+ currency_amount_original_value: original_value
3337
+ currency_amount_original_unit: original_unit
3338
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3339
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3340
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3341
+ }
3342
+ blockchain_balance_available_balance: available_balance {
3343
+ __typename
3344
+ currency_amount_original_value: original_value
3345
+ currency_amount_original_unit: original_unit
3346
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3347
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3348
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3349
+ }
3350
+ }
3351
+ lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key {
3352
+ __typename
3353
+ secret_encrypted_value: encrypted_value
3354
+ secret_cipher: cipher
3355
+ }
3356
+ lightspark_node_total_balance: total_balance {
3357
+ __typename
3358
+ currency_amount_original_value: original_value
3359
+ currency_amount_original_unit: original_unit
3360
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3361
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3362
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3363
+ }
3364
+ lightspark_node_total_local_balance: total_local_balance {
3365
+ __typename
3366
+ currency_amount_original_value: original_value
3367
+ currency_amount_original_unit: original_unit
3368
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3369
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3370
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3371
+ }
3372
+ lightspark_node_local_balance: local_balance {
3373
+ __typename
3374
+ currency_amount_original_value: original_value
3375
+ currency_amount_original_unit: original_unit
3376
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3377
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3378
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3379
+ }
3380
+ lightspark_node_purpose: purpose
3381
+ lightspark_node_remote_balance: remote_balance {
3382
+ __typename
3383
+ currency_amount_original_value: original_value
3384
+ currency_amount_original_unit: original_unit
3385
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3386
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3387
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3388
+ }
3389
+ lightspark_node_status: status
3390
+ }
3391
+ }
3392
+ }`;
3393
+
3394
+ // src/objects/PaymentRequestStatus.ts
3395
+ var PaymentRequestStatus = /* @__PURE__ */ ((PaymentRequestStatus2) => {
3396
+ PaymentRequestStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
3397
+ PaymentRequestStatus2["OPEN"] = "OPEN";
3398
+ PaymentRequestStatus2["CLOSED"] = "CLOSED";
3399
+ return PaymentRequestStatus2;
3400
+ })(PaymentRequestStatus || {});
3401
+ var PaymentRequestStatus_default = PaymentRequestStatus;
3402
+
3403
+ // src/objects/Invoice.ts
3404
+ var InvoiceFromJson = (obj) => {
3405
+ return {
3406
+ id: obj["invoice_id"],
3407
+ createdAt: obj["invoice_created_at"],
3408
+ updatedAt: obj["invoice_updated_at"],
3409
+ data: InvoiceDataFromJson(obj["invoice_data"]),
3410
+ status: PaymentRequestStatus_default[obj["invoice_status"]] ?? PaymentRequestStatus_default.FUTURE_VALUE,
3411
+ typename: "Invoice",
3412
+ amountPaid: !!obj["invoice_amount_paid"] ? CurrencyAmountFromJson(obj["invoice_amount_paid"]) : void 0
3413
+ };
3414
+ };
3415
+ var FRAGMENT9 = `
3416
+ fragment InvoiceFragment on Invoice {
3417
+ __typename
3418
+ invoice_id: id
3419
+ invoice_created_at: created_at
3420
+ invoice_updated_at: updated_at
3421
+ invoice_data: data {
3422
+ __typename
3423
+ invoice_data_encoded_payment_request: encoded_payment_request
3424
+ invoice_data_bitcoin_network: bitcoin_network
3425
+ invoice_data_payment_hash: payment_hash
3426
+ invoice_data_amount: amount {
3427
+ __typename
3428
+ currency_amount_original_value: original_value
3429
+ currency_amount_original_unit: original_unit
3430
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3431
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3432
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3433
+ }
3434
+ invoice_data_created_at: created_at
3435
+ invoice_data_expires_at: expires_at
3436
+ invoice_data_memo: memo
3437
+ invoice_data_destination: destination {
3438
+ __typename
3439
+ ... on GraphNode {
3440
+ __typename
3441
+ graph_node_id: id
3442
+ graph_node_created_at: created_at
3443
+ graph_node_updated_at: updated_at
3444
+ graph_node_alias: alias
3445
+ graph_node_bitcoin_network: bitcoin_network
3446
+ graph_node_color: color
3447
+ graph_node_conductivity: conductivity
3448
+ graph_node_display_name: display_name
3449
+ graph_node_public_key: public_key
3450
+ }
3451
+ ... on LightsparkNode {
3452
+ __typename
3453
+ lightspark_node_id: id
3454
+ lightspark_node_created_at: created_at
3455
+ lightspark_node_updated_at: updated_at
3456
+ lightspark_node_alias: alias
3457
+ lightspark_node_bitcoin_network: bitcoin_network
3458
+ lightspark_node_color: color
3459
+ lightspark_node_conductivity: conductivity
3460
+ lightspark_node_display_name: display_name
3461
+ lightspark_node_public_key: public_key
3462
+ lightspark_node_account: account {
3463
+ id
3464
+ }
3465
+ lightspark_node_owner: owner {
3466
+ id
3467
+ }
3468
+ lightspark_node_blockchain_balance: blockchain_balance {
3469
+ __typename
3470
+ blockchain_balance_total_balance: total_balance {
3471
+ __typename
3472
+ currency_amount_original_value: original_value
3473
+ currency_amount_original_unit: original_unit
3474
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3475
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3476
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3477
+ }
3478
+ blockchain_balance_confirmed_balance: confirmed_balance {
3479
+ __typename
3480
+ currency_amount_original_value: original_value
3481
+ currency_amount_original_unit: original_unit
3482
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3483
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3484
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3485
+ }
3486
+ blockchain_balance_unconfirmed_balance: unconfirmed_balance {
3487
+ __typename
3488
+ currency_amount_original_value: original_value
3489
+ currency_amount_original_unit: original_unit
3490
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3491
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3492
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3493
+ }
3494
+ blockchain_balance_locked_balance: locked_balance {
3495
+ __typename
3496
+ currency_amount_original_value: original_value
3497
+ currency_amount_original_unit: original_unit
3498
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3499
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3500
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3501
+ }
3502
+ blockchain_balance_required_reserve: required_reserve {
3503
+ __typename
3504
+ currency_amount_original_value: original_value
3505
+ currency_amount_original_unit: original_unit
3506
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3507
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3508
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3509
+ }
3510
+ blockchain_balance_available_balance: available_balance {
3511
+ __typename
3512
+ currency_amount_original_value: original_value
3513
+ currency_amount_original_unit: original_unit
3514
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3515
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3516
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3517
+ }
3518
+ }
3519
+ lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key {
3520
+ __typename
3521
+ secret_encrypted_value: encrypted_value
3522
+ secret_cipher: cipher
3523
+ }
3524
+ lightspark_node_total_balance: total_balance {
3525
+ __typename
3526
+ currency_amount_original_value: original_value
3527
+ currency_amount_original_unit: original_unit
3528
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3529
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3530
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3531
+ }
3532
+ lightspark_node_total_local_balance: total_local_balance {
3533
+ __typename
3534
+ currency_amount_original_value: original_value
3535
+ currency_amount_original_unit: original_unit
3536
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3537
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3538
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3539
+ }
3540
+ lightspark_node_local_balance: local_balance {
3541
+ __typename
3542
+ currency_amount_original_value: original_value
3543
+ currency_amount_original_unit: original_unit
3544
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3545
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3546
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3547
+ }
3548
+ lightspark_node_purpose: purpose
3549
+ lightspark_node_remote_balance: remote_balance {
3550
+ __typename
3551
+ currency_amount_original_value: original_value
3552
+ currency_amount_original_unit: original_unit
3553
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3554
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3555
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3556
+ }
3557
+ lightspark_node_status: status
3558
+ }
3559
+ }
3560
+ }
3561
+ invoice_status: status
3562
+ invoice_amount_paid: amount_paid {
3563
+ __typename
3564
+ currency_amount_original_value: original_value
3565
+ currency_amount_original_unit: original_unit
3566
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3567
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3568
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3569
+ }
3570
+ }`;
3571
+ var getInvoiceQuery = (id) => {
3572
+ return {
3573
+ queryPayload: `
3574
+ query GetInvoice($id: ID!) {
3575
+ entity(id: $id) {
3576
+ ... on Invoice {
3577
+ ...InvoiceFragment
3578
+ }
3579
+ }
3580
+ }
3581
+
3582
+ ${FRAGMENT9}
3583
+ `,
3584
+ variables: { id },
3585
+ constructObject: (data) => InvoiceFromJson(data.entity)
3586
+ };
3587
+ };
3588
+
3589
+ // src/graphql/CreateLnurlInvoice.ts
3590
+ var CreateLnurlInvoice = `
3591
+ mutation CreateLnurlInvoice(
3592
+ $node_id: ID!
3593
+ $amount_msats: Long!
3594
+ $metadata_hash: String!
3595
+ ) {
3596
+ create_lnurl_invoice(input: {
3597
+ node_id: $node_id
3598
+ amount_msats: $amount_msats
3599
+ metadata_hash: $metadata_hash
3600
+ }) {
3601
+ invoice {
3602
+ ...InvoiceFragment
3603
+ }
3604
+ }
3605
+ }
3606
+ ${FRAGMENT9}
3607
+ `;
3608
+
3609
+ // src/graphql/CreateNodeWalletAddress.ts
3610
+ var CreateNodeWalletAddress = `
3611
+ mutation CreateNodeWalletAddress(
3612
+ $node_id: ID!
3613
+ ) {
3614
+ create_node_wallet_address(input: {
3615
+ node_id: $node_id
3616
+ }) {
3617
+ wallet_address
3618
+ }
3619
+ }
3620
+ `;
3621
+
3622
+ // src/graphql/CreateTestModeInvoice.ts
3623
+ var CreateTestModeInvoice = `
3624
+ mutation CreateTestModeInvoice(
3625
+ $local_node_id: ID!
3626
+ $amount_msats: Long!
3627
+ $memo: String
3628
+ $invoice_type: InvoiceType
3629
+ ) {
3630
+ create_test_mode_invoice(input: {
3631
+ local_node_id: $local_node_id
3632
+ amount_msats: $amount_msats
3633
+ memo: $memo
3634
+ invoice_type: $invoice_type
3635
+ }) {
3636
+ encoded_payment_request
3637
+ }
3638
+ }
3639
+ `;
3640
+
3641
+ // src/objects/OutgoingPayment.ts
3642
+ var import_auto_bind7 = __toESM(require("auto-bind"), 1);
3643
+
3644
+ // src/objects/OutgoingPaymentAttempt.ts
3645
+ var import_auto_bind6 = __toESM(require("auto-bind"), 1);
3646
+
3647
+ // src/objects/HtlcAttemptFailureCode.ts
3648
+ var HtlcAttemptFailureCode = /* @__PURE__ */ ((HtlcAttemptFailureCode2) => {
3649
+ HtlcAttemptFailureCode2["FUTURE_VALUE"] = "FUTURE_VALUE";
3650
+ HtlcAttemptFailureCode2["INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS"] = "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS";
3651
+ HtlcAttemptFailureCode2["INCORRECT_PAYMENT_AMOUNT"] = "INCORRECT_PAYMENT_AMOUNT";
3652
+ HtlcAttemptFailureCode2["FINAL_INCORRECT_CLTV_EXPIRY"] = "FINAL_INCORRECT_CLTV_EXPIRY";
3653
+ HtlcAttemptFailureCode2["FINAL_INCORRECT_HTLC_AMOUNT"] = "FINAL_INCORRECT_HTLC_AMOUNT";
3654
+ HtlcAttemptFailureCode2["FINAL_EXPIRY_TOO_SOON"] = "FINAL_EXPIRY_TOO_SOON";
3655
+ HtlcAttemptFailureCode2["INVALID_REALM"] = "INVALID_REALM";
3656
+ HtlcAttemptFailureCode2["EXPIRY_TOO_SOON"] = "EXPIRY_TOO_SOON";
3657
+ HtlcAttemptFailureCode2["INVALID_ONION_VERSION"] = "INVALID_ONION_VERSION";
3658
+ HtlcAttemptFailureCode2["INVALID_ONION_HMAC"] = "INVALID_ONION_HMAC";
3659
+ HtlcAttemptFailureCode2["INVALID_ONION_KEY"] = "INVALID_ONION_KEY";
3660
+ HtlcAttemptFailureCode2["AMOUNT_BELOW_MINIMUM"] = "AMOUNT_BELOW_MINIMUM";
3661
+ HtlcAttemptFailureCode2["FEE_INSUFFICIENT"] = "FEE_INSUFFICIENT";
3662
+ HtlcAttemptFailureCode2["INCORRECT_CLTV_EXPIRY"] = "INCORRECT_CLTV_EXPIRY";
3663
+ HtlcAttemptFailureCode2["CHANNEL_DISABLED"] = "CHANNEL_DISABLED";
3664
+ HtlcAttemptFailureCode2["TEMPORARY_CHANNEL_FAILURE"] = "TEMPORARY_CHANNEL_FAILURE";
3665
+ HtlcAttemptFailureCode2["REQUIRED_NODE_FEATURE_MISSING"] = "REQUIRED_NODE_FEATURE_MISSING";
3666
+ HtlcAttemptFailureCode2["REQUIRED_CHANNEL_FEATURE_MISSING"] = "REQUIRED_CHANNEL_FEATURE_MISSING";
3667
+ HtlcAttemptFailureCode2["UNKNOWN_NEXT_PEER"] = "UNKNOWN_NEXT_PEER";
3668
+ HtlcAttemptFailureCode2["TEMPORARY_NODE_FAILURE"] = "TEMPORARY_NODE_FAILURE";
3669
+ HtlcAttemptFailureCode2["PERMANENT_NODE_FAILURE"] = "PERMANENT_NODE_FAILURE";
3670
+ HtlcAttemptFailureCode2["PERMANENT_CHANNEL_FAILURE"] = "PERMANENT_CHANNEL_FAILURE";
3671
+ HtlcAttemptFailureCode2["EXPIRY_TOO_FAR"] = "EXPIRY_TOO_FAR";
3672
+ HtlcAttemptFailureCode2["MPP_TIMEOUT"] = "MPP_TIMEOUT";
3673
+ HtlcAttemptFailureCode2["INVALID_ONION_PAYLOAD"] = "INVALID_ONION_PAYLOAD";
3674
+ HtlcAttemptFailureCode2["INTERNAL_FAILURE"] = "INTERNAL_FAILURE";
3675
+ HtlcAttemptFailureCode2["UNKNOWN_FAILURE"] = "UNKNOWN_FAILURE";
3676
+ HtlcAttemptFailureCode2["UNREADABLE_FAILURE"] = "UNREADABLE_FAILURE";
3677
+ return HtlcAttemptFailureCode2;
3678
+ })(HtlcAttemptFailureCode || {});
3679
+ var HtlcAttemptFailureCode_default = HtlcAttemptFailureCode;
3680
+
3681
+ // src/objects/OutgoingPaymentAttemptStatus.ts
3682
+ var OutgoingPaymentAttemptStatus = /* @__PURE__ */ ((OutgoingPaymentAttemptStatus2) => {
3683
+ OutgoingPaymentAttemptStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
3684
+ OutgoingPaymentAttemptStatus2["IN_FLIGHT"] = "IN_FLIGHT";
3685
+ OutgoingPaymentAttemptStatus2["SUCCEEDED"] = "SUCCEEDED";
3686
+ OutgoingPaymentAttemptStatus2["FAILED"] = "FAILED";
3687
+ return OutgoingPaymentAttemptStatus2;
3688
+ })(OutgoingPaymentAttemptStatus || {});
3689
+ var OutgoingPaymentAttemptStatus_default = OutgoingPaymentAttemptStatus;
3690
+
3691
+ // src/objects/Hop.ts
3692
+ var HopFromJson = (obj) => {
3693
+ return {
3694
+ id: obj["hop_id"],
3695
+ createdAt: obj["hop_created_at"],
3696
+ updatedAt: obj["hop_updated_at"],
3697
+ index: obj["hop_index"],
3698
+ typename: "Hop",
3699
+ destinationId: obj["hop_destination"]?.id ?? void 0,
3700
+ publicKey: obj["hop_public_key"],
3701
+ amountToForward: !!obj["hop_amount_to_forward"] ? CurrencyAmountFromJson(obj["hop_amount_to_forward"]) : void 0,
3702
+ fee: !!obj["hop_fee"] ? CurrencyAmountFromJson(obj["hop_fee"]) : void 0,
3703
+ expiryBlockHeight: obj["hop_expiry_block_height"]
3704
+ };
3705
+ };
3706
+ var FRAGMENT10 = `
3707
+ fragment HopFragment on Hop {
3708
+ __typename
3709
+ hop_id: id
3710
+ hop_created_at: created_at
3711
+ hop_updated_at: updated_at
3712
+ hop_destination: destination {
3713
+ id
3714
+ }
3715
+ hop_index: index
3716
+ hop_public_key: public_key
3717
+ hop_amount_to_forward: amount_to_forward {
3718
+ __typename
3719
+ currency_amount_original_value: original_value
3720
+ currency_amount_original_unit: original_unit
3721
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3722
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3723
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3724
+ }
3725
+ hop_fee: fee {
3726
+ __typename
3727
+ currency_amount_original_value: original_value
3728
+ currency_amount_original_unit: original_unit
3729
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3730
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3731
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3732
+ }
3733
+ hop_expiry_block_height: expiry_block_height
3734
+ }`;
3735
+ var getHopQuery = (id) => {
3736
+ return {
3737
+ queryPayload: `
3738
+ query GetHop($id: ID!) {
3739
+ entity(id: $id) {
3740
+ ... on Hop {
3741
+ ...HopFragment
3742
+ }
3743
+ }
3744
+ }
3745
+
3746
+ ${FRAGMENT10}
3747
+ `,
3748
+ variables: { id },
3749
+ constructObject: (data) => HopFromJson(data.entity)
3750
+ };
3751
+ };
3752
+
3753
+ // src/objects/OutgoingPaymentAttemptToHopsConnection.ts
3754
+ var OutgoingPaymentAttemptToHopsConnectionFromJson = (obj) => {
3755
+ return {
3756
+ count: obj["outgoing_payment_attempt_to_hops_connection_count"],
3757
+ entities: obj["outgoing_payment_attempt_to_hops_connection_entities"].map(
3758
+ (e) => HopFromJson(e)
3759
+ )
3760
+ };
3761
+ };
3762
+
3763
+ // src/objects/OutgoingPaymentAttempt.ts
3764
+ var OutgoingPaymentAttempt = class {
3765
+ constructor(id, createdAt, updatedAt, status, outgoingPaymentId, typename, failureCode, failureSourceIndex, resolvedAt, amount, fees) {
3766
+ this.id = id;
3767
+ this.createdAt = createdAt;
3768
+ this.updatedAt = updatedAt;
3769
+ this.status = status;
3770
+ this.outgoingPaymentId = outgoingPaymentId;
3771
+ this.typename = typename;
3772
+ this.failureCode = failureCode;
3773
+ this.failureSourceIndex = failureSourceIndex;
3774
+ this.resolvedAt = resolvedAt;
3775
+ this.amount = amount;
3776
+ this.fees = fees;
3777
+ (0, import_auto_bind6.default)(this);
3778
+ }
3779
+ async getHops(client, first = void 0) {
3780
+ return await client.executeRawQuery({
3781
+ queryPayload: `
3782
+ query FetchOutgoingPaymentAttemptToHopsConnection($entity_id: ID!, $first: Int) {
3783
+ entity(id: $entity_id) {
3784
+ ... on OutgoingPaymentAttempt {
3785
+ hops(, first: $first) {
3786
+ __typename
3787
+ outgoing_payment_attempt_to_hops_connection_count: count
3788
+ outgoing_payment_attempt_to_hops_connection_entities: entities {
3789
+ __typename
3790
+ hop_id: id
3791
+ hop_created_at: created_at
3792
+ hop_updated_at: updated_at
3793
+ hop_destination: destination {
3794
+ id
3795
+ }
3796
+ hop_index: index
3797
+ hop_public_key: public_key
3798
+ hop_amount_to_forward: amount_to_forward {
3799
+ __typename
3800
+ currency_amount_original_value: original_value
3801
+ currency_amount_original_unit: original_unit
3802
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3803
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3804
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3805
+ }
3806
+ hop_fee: fee {
3807
+ __typename
3808
+ currency_amount_original_value: original_value
3809
+ currency_amount_original_unit: original_unit
3810
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3811
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3812
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3813
+ }
3814
+ hop_expiry_block_height: expiry_block_height
3815
+ }
3816
+ }
3817
+ }
3818
+ }
3819
+ }
3820
+ `,
3821
+ variables: { entity_id: this.id, first },
3822
+ constructObject: (json) => {
3823
+ const connection = json["entity"]["hops"];
3824
+ return OutgoingPaymentAttemptToHopsConnectionFromJson(connection);
3825
+ }
3826
+ });
3827
+ }
3828
+ static getOutgoingPaymentAttemptQuery(id) {
3829
+ return {
3830
+ queryPayload: `
3831
+ query GetOutgoingPaymentAttempt($id: ID!) {
3832
+ entity(id: $id) {
3833
+ ... on OutgoingPaymentAttempt {
3834
+ ...OutgoingPaymentAttemptFragment
3835
+ }
3836
+ }
3837
+ }
3838
+
3839
+ ${FRAGMENT11}
3840
+ `,
3841
+ variables: { id },
3842
+ constructObject: (data) => OutgoingPaymentAttemptFromJson(data.entity)
3843
+ };
3844
+ }
3845
+ };
3846
+ var OutgoingPaymentAttemptFromJson = (obj) => {
3847
+ return new OutgoingPaymentAttempt(
3848
+ obj["outgoing_payment_attempt_id"],
3849
+ obj["outgoing_payment_attempt_created_at"],
3850
+ obj["outgoing_payment_attempt_updated_at"],
3851
+ OutgoingPaymentAttemptStatus_default[obj["outgoing_payment_attempt_status"]] ?? OutgoingPaymentAttemptStatus_default.FUTURE_VALUE,
3852
+ obj["outgoing_payment_attempt_outgoing_payment"].id,
3853
+ "OutgoingPaymentAttempt",
3854
+ !!obj["outgoing_payment_attempt_failure_code"] ? HtlcAttemptFailureCode_default[obj["outgoing_payment_attempt_failure_code"]] ?? HtlcAttemptFailureCode_default.FUTURE_VALUE : null,
3855
+ obj["outgoing_payment_attempt_failure_source_index"],
3856
+ obj["outgoing_payment_attempt_resolved_at"],
3857
+ !!obj["outgoing_payment_attempt_amount"] ? CurrencyAmountFromJson(obj["outgoing_payment_attempt_amount"]) : void 0,
3858
+ !!obj["outgoing_payment_attempt_fees"] ? CurrencyAmountFromJson(obj["outgoing_payment_attempt_fees"]) : void 0
3859
+ );
3860
+ };
3861
+ var FRAGMENT11 = `
3862
+ fragment OutgoingPaymentAttemptFragment on OutgoingPaymentAttempt {
3863
+ __typename
3864
+ outgoing_payment_attempt_id: id
3865
+ outgoing_payment_attempt_created_at: created_at
3866
+ outgoing_payment_attempt_updated_at: updated_at
3867
+ outgoing_payment_attempt_status: status
3868
+ outgoing_payment_attempt_failure_code: failure_code
3869
+ outgoing_payment_attempt_failure_source_index: failure_source_index
3870
+ outgoing_payment_attempt_resolved_at: resolved_at
3871
+ outgoing_payment_attempt_amount: amount {
3872
+ __typename
3873
+ currency_amount_original_value: original_value
3874
+ currency_amount_original_unit: original_unit
3875
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3876
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3877
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3878
+ }
3879
+ outgoing_payment_attempt_fees: fees {
3880
+ __typename
3881
+ currency_amount_original_value: original_value
3882
+ currency_amount_original_unit: original_unit
3883
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3884
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3885
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3886
+ }
3887
+ outgoing_payment_attempt_outgoing_payment: outgoing_payment {
3888
+ id
3889
+ }
3890
+ }`;
3891
+ var OutgoingPaymentAttempt_default = OutgoingPaymentAttempt;
3892
+
3893
+ // src/objects/OutgoingPaymentToAttemptsConnection.ts
3894
+ var OutgoingPaymentToAttemptsConnectionFromJson = (obj) => {
3895
+ return {
3896
+ count: obj["outgoing_payment_to_attempts_connection_count"],
3897
+ entities: obj["outgoing_payment_to_attempts_connection_entities"].map(
3898
+ (e) => OutgoingPaymentAttemptFromJson(e)
3899
+ )
3900
+ };
3901
+ };
3902
+
3903
+ // src/objects/PaymentFailureReason.ts
3904
+ var PaymentFailureReason = /* @__PURE__ */ ((PaymentFailureReason2) => {
3905
+ PaymentFailureReason2["FUTURE_VALUE"] = "FUTURE_VALUE";
3906
+ PaymentFailureReason2["NONE"] = "NONE";
3907
+ PaymentFailureReason2["TIMEOUT"] = "TIMEOUT";
3908
+ PaymentFailureReason2["NO_ROUTE"] = "NO_ROUTE";
3909
+ PaymentFailureReason2["ERROR"] = "ERROR";
3910
+ PaymentFailureReason2["INCORRECT_PAYMENT_DETAILS"] = "INCORRECT_PAYMENT_DETAILS";
3911
+ PaymentFailureReason2["INSUFFICIENT_BALANCE"] = "INSUFFICIENT_BALANCE";
3912
+ PaymentFailureReason2["INVOICE_ALREADY_PAID"] = "INVOICE_ALREADY_PAID";
3913
+ PaymentFailureReason2["SELF_PAYMENT"] = "SELF_PAYMENT";
3914
+ PaymentFailureReason2["INVOICE_EXPIRED"] = "INVOICE_EXPIRED";
3915
+ return PaymentFailureReason2;
3916
+ })(PaymentFailureReason || {});
3917
+ var PaymentFailureReason_default = PaymentFailureReason;
3918
+
3538
3919
  // src/objects/PaymentRequestData.ts
3920
+ var import_core3 = require("@lightsparkdev/core");
3539
3921
  var PaymentRequestDataFromJson = (obj) => {
3540
3922
  if (obj["__typename"] == "InvoiceData") {
3541
3923
  return {
@@ -3656,7 +4038,7 @@ query GetOutgoingPayment($id: ID!) {
3656
4038
  }
3657
4039
  }
3658
4040
 
3659
- ${FRAGMENT10}
4041
+ ${FRAGMENT12}
3660
4042
  `,
3661
4043
  variables: { id },
3662
4044
  constructObject: (data) => OutgoingPaymentFromJson(data.entity)
@@ -3681,7 +4063,7 @@ var OutgoingPaymentFromJson = (obj) => {
3681
4063
  !!obj["outgoing_payment_failure_message"] ? RichTextFromJson(obj["outgoing_payment_failure_message"]) : void 0
3682
4064
  );
3683
4065
  };
3684
- var FRAGMENT10 = `
4066
+ var FRAGMENT12 = `
3685
4067
  fragment OutgoingPaymentFragment on OutgoingPayment {
3686
4068
  __typename
3687
4069
  outgoing_payment_id: id
@@ -3758,6 +4140,9 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
3758
4140
  lightspark_node_account: account {
3759
4141
  id
3760
4142
  }
4143
+ lightspark_node_owner: owner {
4144
+ id
4145
+ }
3761
4146
  lightspark_node_blockchain_balance: blockchain_balance {
3762
4147
  __typename
3763
4148
  blockchain_balance_total_balance: total_balance {
@@ -3878,162 +4263,9 @@ mutation CreateTestModePayment(
3878
4263
  }
3879
4264
  }
3880
4265
 
3881
- ${FRAGMENT10}
4266
+ ${FRAGMENT12}
3882
4267
  `;
3883
4268
 
3884
- // src/objects/InvoiceData.ts
3885
- var InvoiceDataFromJson = (obj) => {
3886
- return {
3887
- encodedPaymentRequest: obj["invoice_data_encoded_payment_request"],
3888
- bitcoinNetwork: BitcoinNetwork_default[obj["invoice_data_bitcoin_network"]] ?? BitcoinNetwork_default.FUTURE_VALUE,
3889
- paymentHash: obj["invoice_data_payment_hash"],
3890
- amount: CurrencyAmountFromJson(obj["invoice_data_amount"]),
3891
- createdAt: obj["invoice_data_created_at"],
3892
- expiresAt: obj["invoice_data_expires_at"],
3893
- destination: NodeFromJson(obj["invoice_data_destination"]),
3894
- typename: "InvoiceData",
3895
- memo: obj["invoice_data_memo"]
3896
- };
3897
- };
3898
- var FRAGMENT11 = `
3899
- fragment InvoiceDataFragment on InvoiceData {
3900
- __typename
3901
- invoice_data_encoded_payment_request: encoded_payment_request
3902
- invoice_data_bitcoin_network: bitcoin_network
3903
- invoice_data_payment_hash: payment_hash
3904
- invoice_data_amount: amount {
3905
- __typename
3906
- currency_amount_original_value: original_value
3907
- currency_amount_original_unit: original_unit
3908
- currency_amount_preferred_currency_unit: preferred_currency_unit
3909
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3910
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3911
- }
3912
- invoice_data_created_at: created_at
3913
- invoice_data_expires_at: expires_at
3914
- invoice_data_memo: memo
3915
- invoice_data_destination: destination {
3916
- __typename
3917
- ... on GraphNode {
3918
- __typename
3919
- graph_node_id: id
3920
- graph_node_created_at: created_at
3921
- graph_node_updated_at: updated_at
3922
- graph_node_alias: alias
3923
- graph_node_bitcoin_network: bitcoin_network
3924
- graph_node_color: color
3925
- graph_node_conductivity: conductivity
3926
- graph_node_display_name: display_name
3927
- graph_node_public_key: public_key
3928
- }
3929
- ... on LightsparkNode {
3930
- __typename
3931
- lightspark_node_id: id
3932
- lightspark_node_created_at: created_at
3933
- lightspark_node_updated_at: updated_at
3934
- lightspark_node_alias: alias
3935
- lightspark_node_bitcoin_network: bitcoin_network
3936
- lightspark_node_color: color
3937
- lightspark_node_conductivity: conductivity
3938
- lightspark_node_display_name: display_name
3939
- lightspark_node_public_key: public_key
3940
- lightspark_node_account: account {
3941
- id
3942
- }
3943
- lightspark_node_blockchain_balance: blockchain_balance {
3944
- __typename
3945
- blockchain_balance_total_balance: total_balance {
3946
- __typename
3947
- currency_amount_original_value: original_value
3948
- currency_amount_original_unit: original_unit
3949
- currency_amount_preferred_currency_unit: preferred_currency_unit
3950
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3951
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3952
- }
3953
- blockchain_balance_confirmed_balance: confirmed_balance {
3954
- __typename
3955
- currency_amount_original_value: original_value
3956
- currency_amount_original_unit: original_unit
3957
- currency_amount_preferred_currency_unit: preferred_currency_unit
3958
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3959
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3960
- }
3961
- blockchain_balance_unconfirmed_balance: unconfirmed_balance {
3962
- __typename
3963
- currency_amount_original_value: original_value
3964
- currency_amount_original_unit: original_unit
3965
- currency_amount_preferred_currency_unit: preferred_currency_unit
3966
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3967
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3968
- }
3969
- blockchain_balance_locked_balance: locked_balance {
3970
- __typename
3971
- currency_amount_original_value: original_value
3972
- currency_amount_original_unit: original_unit
3973
- currency_amount_preferred_currency_unit: preferred_currency_unit
3974
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3975
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3976
- }
3977
- blockchain_balance_required_reserve: required_reserve {
3978
- __typename
3979
- currency_amount_original_value: original_value
3980
- currency_amount_original_unit: original_unit
3981
- currency_amount_preferred_currency_unit: preferred_currency_unit
3982
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3983
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3984
- }
3985
- blockchain_balance_available_balance: available_balance {
3986
- __typename
3987
- currency_amount_original_value: original_value
3988
- currency_amount_original_unit: original_unit
3989
- currency_amount_preferred_currency_unit: preferred_currency_unit
3990
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3991
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3992
- }
3993
- }
3994
- lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key {
3995
- __typename
3996
- secret_encrypted_value: encrypted_value
3997
- secret_cipher: cipher
3998
- }
3999
- lightspark_node_total_balance: total_balance {
4000
- __typename
4001
- currency_amount_original_value: original_value
4002
- currency_amount_original_unit: original_unit
4003
- currency_amount_preferred_currency_unit: preferred_currency_unit
4004
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
4005
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
4006
- }
4007
- lightspark_node_total_local_balance: total_local_balance {
4008
- __typename
4009
- currency_amount_original_value: original_value
4010
- currency_amount_original_unit: original_unit
4011
- currency_amount_preferred_currency_unit: preferred_currency_unit
4012
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
4013
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
4014
- }
4015
- lightspark_node_local_balance: local_balance {
4016
- __typename
4017
- currency_amount_original_value: original_value
4018
- currency_amount_original_unit: original_unit
4019
- currency_amount_preferred_currency_unit: preferred_currency_unit
4020
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
4021
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
4022
- }
4023
- lightspark_node_purpose: purpose
4024
- lightspark_node_remote_balance: remote_balance {
4025
- __typename
4026
- currency_amount_original_value: original_value
4027
- currency_amount_original_unit: original_unit
4028
- currency_amount_preferred_currency_unit: preferred_currency_unit
4029
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
4030
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
4031
- }
4032
- lightspark_node_status: status
4033
- }
4034
- }
4035
- }`;
4036
-
4037
4269
  // src/graphql/DecodeInvoice.ts
4038
4270
  var DecodeInvoice = `
4039
4271
  query DecodeInvoice($encoded_payment_request: String!) {
@@ -4045,7 +4277,7 @@ var DecodeInvoice = `
4045
4277
  }
4046
4278
  }
4047
4279
 
4048
- ${FRAGMENT11}
4280
+ ${FRAGMENT8}
4049
4281
  `;
4050
4282
 
4051
4283
  // src/graphql/DeleteApiToken.ts
@@ -4078,7 +4310,7 @@ ${FRAGMENT}
4078
4310
  `;
4079
4311
 
4080
4312
  // src/objects/LightningFeeEstimateOutput.ts
4081
- var FRAGMENT12 = `
4313
+ var FRAGMENT13 = `
4082
4314
  fragment LightningFeeEstimateOutputFragment on LightningFeeEstimateOutput {
4083
4315
  __typename
4084
4316
  lightning_fee_estimate_output_fee_estimate: fee_estimate {
@@ -4107,7 +4339,7 @@ var LightningFeeEstimateForInvoice = `
4107
4339
  }
4108
4340
  }
4109
4341
 
4110
- ${FRAGMENT12}
4342
+ ${FRAGMENT13}
4111
4343
  `;
4112
4344
 
4113
4345
  // src/graphql/LightningFeeEstimateForNode.ts
@@ -4126,7 +4358,7 @@ var LightningFeeEstimateForNode = `
4126
4358
  }
4127
4359
  }
4128
4360
 
4129
- ${FRAGMENT12}
4361
+ ${FRAGMENT13}
4130
4362
  `;
4131
4363
 
4132
4364
  // src/graphql/MultiNodeDashboard.ts
@@ -4229,7 +4461,7 @@ var PayInvoice = `
4229
4461
  }
4230
4462
  }
4231
4463
 
4232
- ${FRAGMENT10}
4464
+ ${FRAGMENT12}
4233
4465
  `;
4234
4466
 
4235
4467
  // src/graphql/RecoverNodeSigningKey.ts
@@ -4288,7 +4520,7 @@ var ChannelClosingTransactionFromJson = (obj) => {
4288
4520
  channelId: obj["channel_closing_transaction_channel"]?.id ?? void 0
4289
4521
  };
4290
4522
  };
4291
- var FRAGMENT13 = `
4523
+ var FRAGMENT14 = `
4292
4524
  fragment ChannelClosingTransactionFragment on ChannelClosingTransaction {
4293
4525
  __typename
4294
4526
  channel_closing_transaction_id: id
@@ -4332,7 +4564,7 @@ query GetChannelClosingTransaction($id: ID!) {
4332
4564
  }
4333
4565
  }
4334
4566
 
4335
- ${FRAGMENT13}
4567
+ ${FRAGMENT14}
4336
4568
  `,
4337
4569
  variables: { id },
4338
4570
  constructObject: (data) => ChannelClosingTransactionFromJson(data.entity)
@@ -4369,7 +4601,7 @@ var ChannelOpeningTransactionFromJson = (obj) => {
4369
4601
  channelId: obj["channel_opening_transaction_channel"]?.id ?? void 0
4370
4602
  };
4371
4603
  };
4372
- var FRAGMENT14 = `
4604
+ var FRAGMENT15 = `
4373
4605
  fragment ChannelOpeningTransactionFragment on ChannelOpeningTransaction {
4374
4606
  __typename
4375
4607
  channel_opening_transaction_id: id
@@ -4413,7 +4645,7 @@ query GetChannelOpeningTransaction($id: ID!) {
4413
4645
  }
4414
4646
  }
4415
4647
 
4416
- ${FRAGMENT14}
4648
+ ${FRAGMENT15}
4417
4649
  `,
4418
4650
  variables: { id },
4419
4651
  constructObject: (data) => ChannelOpeningTransactionFromJson(data.entity)
@@ -4582,7 +4814,7 @@ query GetWithdrawalRequest($id: ID!) {
4582
4814
  }
4583
4815
  }
4584
4816
 
4585
- ${FRAGMENT15}
4817
+ ${FRAGMENT16}
4586
4818
  `,
4587
4819
  variables: { id },
4588
4820
  constructObject: (data) => WithdrawalRequestFromJson(data.entity)
@@ -4604,7 +4836,7 @@ var WithdrawalRequestFromJson = (obj) => {
4604
4836
  obj["withdrawal_request_withdrawal"]?.id ?? void 0
4605
4837
  );
4606
4838
  };
4607
- var FRAGMENT15 = `
4839
+ var FRAGMENT16 = `
4608
4840
  fragment WithdrawalRequestFragment on WithdrawalRequest {
4609
4841
  __typename
4610
4842
  withdrawal_request_id: id
@@ -4656,7 +4888,7 @@ var RequestWithdrawal = `
4656
4888
  }
4657
4889
  }
4658
4890
 
4659
- ${FRAGMENT15}
4891
+ ${FRAGMENT16}
4660
4892
  `;
4661
4893
 
4662
4894
  // src/graphql/SendPayment.ts
@@ -4683,7 +4915,7 @@ var SendPayment = `
4683
4915
  }
4684
4916
  }
4685
4917
 
4686
- ${FRAGMENT10}
4918
+ ${FRAGMENT12}
4687
4919
  `;
4688
4920
 
4689
4921
  // src/objects/Transaction.ts
@@ -4716,7 +4948,7 @@ var IncomingPaymentAttemptFromJson = (obj) => {
4716
4948
  resolvedAt: obj["incoming_payment_attempt_resolved_at"]
4717
4949
  };
4718
4950
  };
4719
- var FRAGMENT16 = `
4951
+ var FRAGMENT17 = `
4720
4952
  fragment IncomingPaymentAttemptFragment on IncomingPaymentAttempt {
4721
4953
  __typename
4722
4954
  incoming_payment_attempt_id: id
@@ -4747,7 +4979,7 @@ query GetIncomingPaymentAttempt($id: ID!) {
4747
4979
  }
4748
4980
  }
4749
4981
 
4750
- ${FRAGMENT16}
4982
+ ${FRAGMENT17}
4751
4983
  `,
4752
4984
  variables: { id },
4753
4985
  constructObject: (data) => IncomingPaymentAttemptFromJson(data.entity)
@@ -4831,7 +5063,7 @@ query GetIncomingPayment($id: ID!) {
4831
5063
  }
4832
5064
  }
4833
5065
 
4834
- ${FRAGMENT17}
5066
+ ${FRAGMENT18}
4835
5067
  `,
4836
5068
  variables: { id },
4837
5069
  constructObject: (data) => IncomingPaymentFromJson(data.entity)
@@ -4853,7 +5085,7 @@ var IncomingPaymentFromJson = (obj) => {
4853
5085
  obj["incoming_payment_payment_request"]?.id ?? void 0
4854
5086
  );
4855
5087
  };
4856
- var FRAGMENT17 = `
5088
+ var FRAGMENT18 = `
4857
5089
  fragment IncomingPaymentFragment on IncomingPayment {
4858
5090
  __typename
4859
5091
  incoming_payment_id: id
@@ -5023,7 +5255,7 @@ var TransactionFromJson = (obj) => {
5023
5255
  `Couldn't find a concrete type for interface Transaction corresponding to the typename=${obj["__typename"]}`
5024
5256
  );
5025
5257
  };
5026
- var FRAGMENT18 = `
5258
+ var FRAGMENT19 = `
5027
5259
  fragment TransactionFragment on Transaction {
5028
5260
  __typename
5029
5261
  ... on ChannelClosingTransaction {
@@ -5224,6 +5456,9 @@ fragment TransactionFragment on Transaction {
5224
5456
  lightspark_node_account: account {
5225
5457
  id
5226
5458
  }
5459
+ lightspark_node_owner: owner {
5460
+ id
5461
+ }
5227
5462
  lightspark_node_blockchain_balance: blockchain_balance {
5228
5463
  __typename
5229
5464
  blockchain_balance_total_balance: total_balance {
@@ -5404,7 +5639,7 @@ query GetTransaction($id: ID!) {
5404
5639
  }
5405
5640
  }
5406
5641
 
5407
- ${FRAGMENT18}
5642
+ ${FRAGMENT19}
5408
5643
  `,
5409
5644
  variables: { id },
5410
5645
  constructObject: (data) => TransactionFromJson(data.entity)
@@ -5520,7 +5755,7 @@ query SingleNodeDashboard(
5520
5755
  }
5521
5756
  }
5522
5757
 
5523
- ${FRAGMENT18}
5758
+ ${FRAGMENT19}
5524
5759
  ${FRAGMENT}
5525
5760
  `;
5526
5761
 
@@ -5559,7 +5794,7 @@ query TransactionsForNode(
5559
5794
  }
5560
5795
  }
5561
5796
 
5562
- ${FRAGMENT18}
5797
+ ${FRAGMENT19}
5563
5798
  ${FRAGMENT}
5564
5799
  `;
5565
5800
 
@@ -5576,7 +5811,7 @@ var TransactionUpdateFromJson = (obj) => {
5576
5811
  transactionHash: obj["transaction_hash"]
5577
5812
  };
5578
5813
  };
5579
- var FRAGMENT19 = `
5814
+ var FRAGMENT20 = `
5580
5815
  fragment TransactionUpdateFragment on Transaction {
5581
5816
  __typename
5582
5817
  id
@@ -5606,7 +5841,7 @@ subscription TransactionSubscription(
5606
5841
  }
5607
5842
  }
5608
5843
 
5609
- ${FRAGMENT19}
5844
+ ${FRAGMENT20}
5610
5845
  `;
5611
5846
 
5612
5847
  // src/objects/Account.ts
@@ -5658,17 +5893,6 @@ var AccountToNodesConnectionFromJson = (obj) => {
5658
5893
 
5659
5894
  // src/objects/PaymentRequest.ts
5660
5895
  var import_core5 = require("@lightsparkdev/core");
5661
-
5662
- // src/objects/PaymentRequestStatus.ts
5663
- var PaymentRequestStatus = /* @__PURE__ */ ((PaymentRequestStatus2) => {
5664
- PaymentRequestStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
5665
- PaymentRequestStatus2["OPEN"] = "OPEN";
5666
- PaymentRequestStatus2["CLOSED"] = "CLOSED";
5667
- return PaymentRequestStatus2;
5668
- })(PaymentRequestStatus || {});
5669
- var PaymentRequestStatus_default = PaymentRequestStatus;
5670
-
5671
- // src/objects/PaymentRequest.ts
5672
5896
  var PaymentRequestFromJson = (obj) => {
5673
5897
  if (obj["__typename"] == "Invoice") {
5674
5898
  return {
@@ -5686,7 +5910,7 @@ var PaymentRequestFromJson = (obj) => {
5686
5910
  `Couldn't find a concrete type for interface PaymentRequest corresponding to the typename=${obj["__typename"]}`
5687
5911
  );
5688
5912
  };
5689
- var FRAGMENT20 = `
5913
+ var FRAGMENT21 = `
5690
5914
  fragment PaymentRequestFragment on PaymentRequest {
5691
5915
  __typename
5692
5916
  ... on Invoice {
@@ -5738,6 +5962,9 @@ fragment PaymentRequestFragment on PaymentRequest {
5738
5962
  lightspark_node_account: account {
5739
5963
  id
5740
5964
  }
5965
+ lightspark_node_owner: owner {
5966
+ id
5967
+ }
5741
5968
  lightspark_node_blockchain_balance: blockchain_balance {
5742
5969
  __typename
5743
5970
  blockchain_balance_total_balance: total_balance {
@@ -5853,7 +6080,7 @@ query GetPaymentRequest($id: ID!) {
5853
6080
  }
5854
6081
  }
5855
6082
 
5856
- ${FRAGMENT20}
6083
+ ${FRAGMENT21}
5857
6084
  `,
5858
6085
  variables: { id },
5859
6086
  constructObject: (data) => PaymentRequestFromJson(data.entity)
@@ -5911,13 +6138,30 @@ var BalancesFromJson = (obj) => {
5911
6138
  };
5912
6139
  };
5913
6140
 
6141
+ // src/objects/WalletStatus.ts
6142
+ var WalletStatus = /* @__PURE__ */ ((WalletStatus2) => {
6143
+ WalletStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
6144
+ WalletStatus2["NOT_SETUP"] = "NOT_SETUP";
6145
+ WalletStatus2["DEPLOYING"] = "DEPLOYING";
6146
+ WalletStatus2["DEPLOYED"] = "DEPLOYED";
6147
+ WalletStatus2["INITIALIZING"] = "INITIALIZING";
6148
+ WalletStatus2["READY"] = "READY";
6149
+ WalletStatus2["UNAVAILABLE"] = "UNAVAILABLE";
6150
+ WalletStatus2["FAILED"] = "FAILED";
6151
+ WalletStatus2["TERMINATING"] = "TERMINATING";
6152
+ WalletStatus2["TERMINATED"] = "TERMINATED";
6153
+ return WalletStatus2;
6154
+ })(WalletStatus || {});
6155
+ var WalletStatus_default = WalletStatus;
6156
+
5914
6157
  // src/objects/Wallet.ts
5915
6158
  var Wallet = class {
5916
- constructor(id, createdAt, updatedAt, thirdPartyIdentifier, typename, lastLoginAt, balances) {
6159
+ constructor(id, createdAt, updatedAt, thirdPartyIdentifier, status, typename, lastLoginAt, balances) {
5917
6160
  this.id = id;
5918
6161
  this.createdAt = createdAt;
5919
6162
  this.updatedAt = updatedAt;
5920
6163
  this.thirdPartyIdentifier = thirdPartyIdentifier;
6164
+ this.status = status;
5921
6165
  this.typename = typename;
5922
6166
  this.lastLoginAt = lastLoginAt;
5923
6167
  this.balances = balances;
@@ -5979,21 +6223,21 @@ query FetchWalletTotalAmountSent($created_after_date: DateTime, $created_before_
5979
6223
  }
5980
6224
  });
5981
6225
  }
5982
- static getWalletQuery() {
6226
+ static getWalletQuery(id) {
5983
6227
  return {
5984
6228
  queryPayload: `
5985
- query GetWallet {
5986
- current_wallet {
6229
+ query GetWallet($id: ID!) {
6230
+ entity(id: $id) {
5987
6231
  ... on Wallet {
5988
6232
  ...WalletFragment
5989
6233
  }
5990
6234
  }
5991
6235
  }
5992
6236
 
5993
- ${FRAGMENT21}
6237
+ ${FRAGMENT22}
5994
6238
  `,
5995
- variables: {},
5996
- constructObject: (data) => WalletFromJson(data.current_wallet)
6239
+ variables: { id },
6240
+ constructObject: (data) => WalletFromJson(data.entity)
5997
6241
  };
5998
6242
  }
5999
6243
  };
@@ -6003,12 +6247,13 @@ var WalletFromJson = (obj) => {
6003
6247
  obj["wallet_created_at"],
6004
6248
  obj["wallet_updated_at"],
6005
6249
  obj["wallet_third_party_identifier"],
6250
+ WalletStatus_default[obj["wallet_status"]] ?? WalletStatus_default.FUTURE_VALUE,
6006
6251
  "Wallet",
6007
6252
  obj["wallet_last_login_at"],
6008
6253
  !!obj["wallet_balances"] ? BalancesFromJson(obj["wallet_balances"]) : void 0
6009
6254
  );
6010
6255
  };
6011
- var FRAGMENT21 = `
6256
+ var FRAGMENT22 = `
6012
6257
  fragment WalletFragment on Wallet {
6013
6258
  __typename
6014
6259
  wallet_id: id
@@ -6043,6 +6288,7 @@ fragment WalletFragment on Wallet {
6043
6288
  }
6044
6289
  }
6045
6290
  wallet_third_party_identifier: third_party_identifier
6291
+ wallet_status: status
6046
6292
  }`;
6047
6293
  var Wallet_default = Wallet;
6048
6294
 
@@ -6246,6 +6492,9 @@ query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetw
6246
6492
  lightspark_node_account: account {
6247
6493
  id
6248
6494
  }
6495
+ lightspark_node_owner: owner {
6496
+ id
6497
+ }
6249
6498
  lightspark_node_blockchain_balance: blockchain_balance {
6250
6499
  __typename
6251
6500
  blockchain_balance_total_balance: total_balance {
@@ -6755,6 +7004,9 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types:
6755
7004
  lightspark_node_account: account {
6756
7005
  id
6757
7006
  }
7007
+ lightspark_node_owner: owner {
7008
+ id
7009
+ }
6758
7010
  lightspark_node_blockchain_balance: blockchain_balance {
6759
7011
  __typename
6760
7012
  blockchain_balance_total_balance: total_balance {
@@ -7013,6 +7265,9 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte
7013
7265
  lightspark_node_account: account {
7014
7266
  id
7015
7267
  }
7268
+ lightspark_node_owner: owner {
7269
+ id
7270
+ }
7016
7271
  lightspark_node_blockchain_balance: blockchain_balance {
7017
7272
  __typename
7018
7273
  blockchain_balance_total_balance: total_balance {
@@ -7193,6 +7448,7 @@ query FetchAccountToWalletsConnection($first: Int) {
7193
7448
  }
7194
7449
  }
7195
7450
  wallet_third_party_identifier: third_party_identifier
7451
+ wallet_status: status
7196
7452
  }
7197
7453
  }
7198
7454
  }
@@ -7217,7 +7473,7 @@ query GetAccount {
7217
7473
  }
7218
7474
  }
7219
7475
 
7220
- ${FRAGMENT22}
7476
+ ${FRAGMENT23}
7221
7477
  `,
7222
7478
  variables: {},
7223
7479
  constructObject: (data) => AccountFromJson(data.current_account)
@@ -7233,7 +7489,7 @@ var AccountFromJson = (obj) => {
7233
7489
  obj["account_name"]
7234
7490
  );
7235
7491
  };
7236
- var FRAGMENT22 = `
7492
+ var FRAGMENT23 = `
7237
7493
  fragment AccountFragment on Account {
7238
7494
  __typename
7239
7495
  account_id: id
@@ -7507,7 +7763,33 @@ var LightsparkClient = class {
7507
7763
  memo,
7508
7764
  type
7509
7765
  });
7510
- return response.create_invoice?.invoice.data?.encoded_payment_request;
7766
+ return response.create_invoice?.invoice.data?.encoded_payment_request;
7767
+ }
7768
+ /**
7769
+ * Generates a Lightning Invoice (follows the Bolt 11 specification) to request a payment
7770
+ * from another Lightning Node. This should only be used for generating invoices for LNURLs,
7771
+ * with [createInvoice] preferred in the general case.
7772
+ *
7773
+ * Test mode note: You can simulate a payment of this invoice in test move using [createTestModePayment].
7774
+ *
7775
+ * @param nodeId The node ID for which to create an invoice.
7776
+ * @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount.
7777
+ * @param metadata The LNURL metadata payload field in the initial payreq response. This wil be hashed and present in the
7778
+ * h-tag (SHA256 purpose of payment) of the resulting Bolt 11 invoice. See
7779
+ * [this spec](https://github.com/lnurl/luds/blob/luds/06.md#pay-to-static-qrnfclink) for details.
7780
+ * @returns An Invoice object representing the generated invoice.
7781
+ */
7782
+ async createLnurlInvoice(nodeId, amountMsats, metadata) {
7783
+ const response = await this.requester.makeRawRequest(CreateLnurlInvoice, {
7784
+ node_id: nodeId,
7785
+ amount_msats: amountMsats,
7786
+ metadata_hash: (0, import_crypto.createHash)("sha256").update(metadata).digest("hex")
7787
+ });
7788
+ const invoiceJson = response.create_lnurl_invoice?.invoice;
7789
+ if (!invoiceJson) {
7790
+ return void 0;
7791
+ }
7792
+ return InvoiceFromJson(invoiceJson);
7511
7793
  }
7512
7794
  /**
7513
7795
  * Decodes an encoded lightning invoice string.
@@ -7894,7 +8176,7 @@ var DepositFromJson = (obj) => {
7894
8176
  numConfirmations: obj["deposit_num_confirmations"]
7895
8177
  };
7896
8178
  };
7897
- var FRAGMENT23 = `
8179
+ var FRAGMENT24 = `
7898
8180
  fragment DepositFragment on Deposit {
7899
8181
  __typename
7900
8182
  deposit_id: id
@@ -7938,193 +8220,10 @@ query GetDeposit($id: ID!) {
7938
8220
  }
7939
8221
  }
7940
8222
 
7941
- ${FRAGMENT23}
7942
- `,
7943
- variables: { id },
7944
- constructObject: (data) => DepositFromJson(data.entity)
7945
- };
7946
- };
7947
-
7948
- // src/objects/Invoice.ts
7949
- var InvoiceFromJson = (obj) => {
7950
- return {
7951
- id: obj["invoice_id"],
7952
- createdAt: obj["invoice_created_at"],
7953
- updatedAt: obj["invoice_updated_at"],
7954
- data: InvoiceDataFromJson(obj["invoice_data"]),
7955
- status: PaymentRequestStatus_default[obj["invoice_status"]] ?? PaymentRequestStatus_default.FUTURE_VALUE,
7956
- typename: "Invoice",
7957
- amountPaid: !!obj["invoice_amount_paid"] ? CurrencyAmountFromJson(obj["invoice_amount_paid"]) : void 0
7958
- };
7959
- };
7960
- var FRAGMENT24 = `
7961
- fragment InvoiceFragment on Invoice {
7962
- __typename
7963
- invoice_id: id
7964
- invoice_created_at: created_at
7965
- invoice_updated_at: updated_at
7966
- invoice_data: data {
7967
- __typename
7968
- invoice_data_encoded_payment_request: encoded_payment_request
7969
- invoice_data_bitcoin_network: bitcoin_network
7970
- invoice_data_payment_hash: payment_hash
7971
- invoice_data_amount: amount {
7972
- __typename
7973
- currency_amount_original_value: original_value
7974
- currency_amount_original_unit: original_unit
7975
- currency_amount_preferred_currency_unit: preferred_currency_unit
7976
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
7977
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
7978
- }
7979
- invoice_data_created_at: created_at
7980
- invoice_data_expires_at: expires_at
7981
- invoice_data_memo: memo
7982
- invoice_data_destination: destination {
7983
- __typename
7984
- ... on GraphNode {
7985
- __typename
7986
- graph_node_id: id
7987
- graph_node_created_at: created_at
7988
- graph_node_updated_at: updated_at
7989
- graph_node_alias: alias
7990
- graph_node_bitcoin_network: bitcoin_network
7991
- graph_node_color: color
7992
- graph_node_conductivity: conductivity
7993
- graph_node_display_name: display_name
7994
- graph_node_public_key: public_key
7995
- }
7996
- ... on LightsparkNode {
7997
- __typename
7998
- lightspark_node_id: id
7999
- lightspark_node_created_at: created_at
8000
- lightspark_node_updated_at: updated_at
8001
- lightspark_node_alias: alias
8002
- lightspark_node_bitcoin_network: bitcoin_network
8003
- lightspark_node_color: color
8004
- lightspark_node_conductivity: conductivity
8005
- lightspark_node_display_name: display_name
8006
- lightspark_node_public_key: public_key
8007
- lightspark_node_account: account {
8008
- id
8009
- }
8010
- lightspark_node_blockchain_balance: blockchain_balance {
8011
- __typename
8012
- blockchain_balance_total_balance: total_balance {
8013
- __typename
8014
- currency_amount_original_value: original_value
8015
- currency_amount_original_unit: original_unit
8016
- currency_amount_preferred_currency_unit: preferred_currency_unit
8017
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8018
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8019
- }
8020
- blockchain_balance_confirmed_balance: confirmed_balance {
8021
- __typename
8022
- currency_amount_original_value: original_value
8023
- currency_amount_original_unit: original_unit
8024
- currency_amount_preferred_currency_unit: preferred_currency_unit
8025
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8026
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8027
- }
8028
- blockchain_balance_unconfirmed_balance: unconfirmed_balance {
8029
- __typename
8030
- currency_amount_original_value: original_value
8031
- currency_amount_original_unit: original_unit
8032
- currency_amount_preferred_currency_unit: preferred_currency_unit
8033
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8034
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8035
- }
8036
- blockchain_balance_locked_balance: locked_balance {
8037
- __typename
8038
- currency_amount_original_value: original_value
8039
- currency_amount_original_unit: original_unit
8040
- currency_amount_preferred_currency_unit: preferred_currency_unit
8041
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8042
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8043
- }
8044
- blockchain_balance_required_reserve: required_reserve {
8045
- __typename
8046
- currency_amount_original_value: original_value
8047
- currency_amount_original_unit: original_unit
8048
- currency_amount_preferred_currency_unit: preferred_currency_unit
8049
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8050
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8051
- }
8052
- blockchain_balance_available_balance: available_balance {
8053
- __typename
8054
- currency_amount_original_value: original_value
8055
- currency_amount_original_unit: original_unit
8056
- currency_amount_preferred_currency_unit: preferred_currency_unit
8057
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8058
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8059
- }
8060
- }
8061
- lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key {
8062
- __typename
8063
- secret_encrypted_value: encrypted_value
8064
- secret_cipher: cipher
8065
- }
8066
- lightspark_node_total_balance: total_balance {
8067
- __typename
8068
- currency_amount_original_value: original_value
8069
- currency_amount_original_unit: original_unit
8070
- currency_amount_preferred_currency_unit: preferred_currency_unit
8071
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8072
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8073
- }
8074
- lightspark_node_total_local_balance: total_local_balance {
8075
- __typename
8076
- currency_amount_original_value: original_value
8077
- currency_amount_original_unit: original_unit
8078
- currency_amount_preferred_currency_unit: preferred_currency_unit
8079
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8080
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8081
- }
8082
- lightspark_node_local_balance: local_balance {
8083
- __typename
8084
- currency_amount_original_value: original_value
8085
- currency_amount_original_unit: original_unit
8086
- currency_amount_preferred_currency_unit: preferred_currency_unit
8087
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8088
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8089
- }
8090
- lightspark_node_purpose: purpose
8091
- lightspark_node_remote_balance: remote_balance {
8092
- __typename
8093
- currency_amount_original_value: original_value
8094
- currency_amount_original_unit: original_unit
8095
- currency_amount_preferred_currency_unit: preferred_currency_unit
8096
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8097
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8098
- }
8099
- lightspark_node_status: status
8100
- }
8101
- }
8102
- }
8103
- invoice_status: status
8104
- invoice_amount_paid: amount_paid {
8105
- __typename
8106
- currency_amount_original_value: original_value
8107
- currency_amount_original_unit: original_unit
8108
- currency_amount_preferred_currency_unit: preferred_currency_unit
8109
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8110
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8111
- }
8112
- }`;
8113
- var getInvoiceQuery = (id) => {
8114
- return {
8115
- queryPayload: `
8116
- query GetInvoice($id: ID!) {
8117
- entity(id: $id) {
8118
- ... on Invoice {
8119
- ...InvoiceFragment
8120
- }
8121
- }
8122
- }
8123
-
8124
8223
  ${FRAGMENT24}
8125
8224
  `,
8126
8225
  variables: { id },
8127
- constructObject: (data) => InvoiceFromJson(data.entity)
8226
+ constructObject: (data) => DepositFromJson(data.entity)
8128
8227
  };
8129
8228
  };
8130
8229
 
@@ -8293,6 +8392,9 @@ fragment LightningTransactionFragment on LightningTransaction {
8293
8392
  lightspark_node_account: account {
8294
8393
  id
8295
8394
  }
8395
+ lightspark_node_owner: owner {
8396
+ id
8397
+ }
8296
8398
  lightspark_node_blockchain_balance: blockchain_balance {
8297
8399
  __typename
8298
8400
  blockchain_balance_total_balance: total_balance {
@@ -8448,8 +8550,102 @@ ${FRAGMENT25}
8448
8550
  };
8449
8551
  };
8450
8552
 
8451
- // src/objects/OnChainTransaction.ts
8553
+ // src/objects/LightsparkNodeOwner.ts
8452
8554
  var import_core8 = require("@lightsparkdev/core");
8555
+ var LightsparkNodeOwnerFromJson = (obj) => {
8556
+ if (obj["__typename"] == "Account") {
8557
+ return new Account_default(
8558
+ obj["account_id"],
8559
+ obj["account_created_at"],
8560
+ obj["account_updated_at"],
8561
+ "Account",
8562
+ obj["account_name"]
8563
+ );
8564
+ }
8565
+ if (obj["__typename"] == "Wallet") {
8566
+ return new Wallet_default(
8567
+ obj["wallet_id"],
8568
+ obj["wallet_created_at"],
8569
+ obj["wallet_updated_at"],
8570
+ obj["wallet_third_party_identifier"],
8571
+ WalletStatus_default[obj["wallet_status"]] ?? WalletStatus_default.FUTURE_VALUE,
8572
+ "Wallet",
8573
+ obj["wallet_last_login_at"],
8574
+ !!obj["wallet_balances"] ? BalancesFromJson(obj["wallet_balances"]) : void 0
8575
+ );
8576
+ }
8577
+ throw new import_core8.LightsparkException(
8578
+ "DeserializationError",
8579
+ `Couldn't find a concrete type for interface LightsparkNodeOwner corresponding to the typename=${obj["__typename"]}`
8580
+ );
8581
+ };
8582
+ var FRAGMENT26 = `
8583
+ fragment LightsparkNodeOwnerFragment on LightsparkNodeOwner {
8584
+ __typename
8585
+ ... on Account {
8586
+ __typename
8587
+ account_id: id
8588
+ account_created_at: created_at
8589
+ account_updated_at: updated_at
8590
+ account_name: name
8591
+ }
8592
+ ... on Wallet {
8593
+ __typename
8594
+ wallet_id: id
8595
+ wallet_created_at: created_at
8596
+ wallet_updated_at: updated_at
8597
+ wallet_last_login_at: last_login_at
8598
+ wallet_balances: balances {
8599
+ __typename
8600
+ balances_owned_balance: owned_balance {
8601
+ __typename
8602
+ currency_amount_original_value: original_value
8603
+ currency_amount_original_unit: original_unit
8604
+ currency_amount_preferred_currency_unit: preferred_currency_unit
8605
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8606
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8607
+ }
8608
+ balances_available_to_send_balance: available_to_send_balance {
8609
+ __typename
8610
+ currency_amount_original_value: original_value
8611
+ currency_amount_original_unit: original_unit
8612
+ currency_amount_preferred_currency_unit: preferred_currency_unit
8613
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8614
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8615
+ }
8616
+ balances_available_to_withdraw_balance: available_to_withdraw_balance {
8617
+ __typename
8618
+ currency_amount_original_value: original_value
8619
+ currency_amount_original_unit: original_unit
8620
+ currency_amount_preferred_currency_unit: preferred_currency_unit
8621
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8622
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8623
+ }
8624
+ }
8625
+ wallet_third_party_identifier: third_party_identifier
8626
+ wallet_status: status
8627
+ }
8628
+ }`;
8629
+ var getLightsparkNodeOwnerQuery = (id) => {
8630
+ return {
8631
+ queryPayload: `
8632
+ query GetLightsparkNodeOwner($id: ID!) {
8633
+ entity(id: $id) {
8634
+ ... on LightsparkNodeOwner {
8635
+ ...LightsparkNodeOwnerFragment
8636
+ }
8637
+ }
8638
+ }
8639
+
8640
+ ${FRAGMENT26}
8641
+ `,
8642
+ variables: { id },
8643
+ constructObject: (data) => LightsparkNodeOwnerFromJson(data.entity)
8644
+ };
8645
+ };
8646
+
8647
+ // src/objects/OnChainTransaction.ts
8648
+ var import_core9 = require("@lightsparkdev/core");
8453
8649
  var OnChainTransactionFromJson = (obj) => {
8454
8650
  if (obj["__typename"] == "ChannelClosingTransaction") {
8455
8651
  return {
@@ -8523,12 +8719,12 @@ var OnChainTransactionFromJson = (obj) => {
8523
8719
  numConfirmations: obj["withdrawal_num_confirmations"]
8524
8720
  };
8525
8721
  }
8526
- throw new import_core8.LightsparkException(
8722
+ throw new import_core9.LightsparkException(
8527
8723
  "DeserializationError",
8528
8724
  `Couldn't find a concrete type for interface OnChainTransaction corresponding to the typename=${obj["__typename"]}`
8529
8725
  );
8530
8726
  };
8531
- var FRAGMENT26 = `
8727
+ var FRAGMENT27 = `
8532
8728
  fragment OnChainTransactionFragment on OnChainTransaction {
8533
8729
  __typename
8534
8730
  ... on ChannelClosingTransaction {
@@ -8671,7 +8867,7 @@ query GetOnChainTransaction($id: ID!) {
8671
8867
  }
8672
8868
  }
8673
8869
 
8674
- ${FRAGMENT26}
8870
+ ${FRAGMENT27}
8675
8871
  `,
8676
8872
  variables: { id },
8677
8873
  constructObject: (data) => OnChainTransactionFromJson(data.entity)
@@ -8696,7 +8892,7 @@ var RoutingTransactionFromJson = (obj) => {
8696
8892
  failureReason: !!obj["routing_transaction_failure_reason"] ? RoutingTransactionFailureReason_default[obj["routing_transaction_failure_reason"]] ?? RoutingTransactionFailureReason_default.FUTURE_VALUE : null
8697
8893
  };
8698
8894
  };
8699
- var FRAGMENT27 = `
8895
+ var FRAGMENT28 = `
8700
8896
  fragment RoutingTransactionFragment on RoutingTransaction {
8701
8897
  __typename
8702
8898
  routing_transaction_id: id
@@ -8744,7 +8940,7 @@ query GetRoutingTransaction($id: ID!) {
8744
8940
  }
8745
8941
  }
8746
8942
 
8747
- ${FRAGMENT27}
8943
+ ${FRAGMENT28}
8748
8944
  `,
8749
8945
  variables: { id },
8750
8946
  constructObject: (data) => RoutingTransactionFromJson(data.entity)
@@ -8801,7 +8997,7 @@ var WithdrawalFromJson = (obj) => {
8801
8997
  numConfirmations: obj["withdrawal_num_confirmations"]
8802
8998
  };
8803
8999
  };
8804
- var FRAGMENT28 = `
9000
+ var FRAGMENT29 = `
8805
9001
  fragment WithdrawalFragment on Withdrawal {
8806
9002
  __typename
8807
9003
  withdrawal_id: id
@@ -8845,7 +9041,7 @@ query GetWithdrawal($id: ID!) {
8845
9041
  }
8846
9042
  }
8847
9043
 
8848
- ${FRAGMENT28}
9044
+ ${FRAGMENT29}
8849
9045
  `,
8850
9046
  variables: { id },
8851
9047
  constructObject: (data) => WithdrawalFromJson(data.entity)
@@ -8853,10 +9049,10 @@ ${FRAGMENT28}
8853
9049
  };
8854
9050
 
8855
9051
  // src/webhooks.ts
8856
- var import_crypto = require("crypto");
9052
+ var import_crypto2 = require("crypto");
8857
9053
  var WEBHOOKS_SIGNATURE_HEADER = "lightspark-signature";
8858
9054
  var verifyAndParseWebhook = (data, hexdigest, webhook_secret) => {
8859
- const sig = (0, import_crypto.createHmac)("sha256", webhook_secret).update(data).digest("hex");
9055
+ const sig = (0, import_crypto2.createHmac)("sha256", webhook_secret).update(data).digest("hex");
8860
9056
  if (sig.toLowerCase() !== hexdigest.toLowerCase()) {
8861
9057
  throw new Error("Webhook message hash does not match signature");
8862
9058
  }
@@ -8874,7 +9070,8 @@ var parseWebhook = async (data) => {
8874
9070
  event_type: WebhookEventType[event.event_type],
8875
9071
  event_id: event.event_id,
8876
9072
  timestamp: new Date(event.timestamp),
8877
- entity_id: event.entity_id
9073
+ entity_id: event.entity_id,
9074
+ wallet_id: event.wallet_id
8878
9075
  };
8879
9076
  };
8880
9077
  // Annotate the CommonJS export names for ESM import in node:
@@ -8908,6 +9105,7 @@ var parseWebhook = async (data) => {
8908
9105
  TransactionType,
8909
9106
  WEBHOOKS_SIGNATURE_HEADER,
8910
9107
  Wallet,
9108
+ WalletStatus,
8911
9109
  WebhookEventType,
8912
9110
  WithdrawalMode,
8913
9111
  WithdrawalRequest,
@@ -8920,6 +9118,7 @@ var parseWebhook = async (data) => {
8920
9118
  getIncomingPaymentAttemptQuery,
8921
9119
  getInvoiceQuery,
8922
9120
  getLightningTransactionQuery,
9121
+ getLightsparkNodeOwnerQuery,
8923
9122
  getOnChainTransactionQuery,
8924
9123
  getPaymentRequestQuery,
8925
9124
  getRoutingTransactionQuery,