@lightsparkdev/lightspark-sdk 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{BitcoinNetwork-a816c0be.d.ts → BitcoinNetwork-37e9f091.d.ts} +8 -3
  3. package/dist/{chunk-VTPDR6P4.js → chunk-NCPWHRFO.js} +353 -15
  4. package/dist/env.d.cts +1 -1
  5. package/dist/env.d.ts +1 -1
  6. package/dist/{index-5acc6526.d.ts → index-449c9f58.d.ts} +2089 -644
  7. package/dist/index.cjs +1082 -470
  8. package/dist/index.d.cts +3 -3
  9. package/dist/index.d.ts +3 -3
  10. package/dist/index.js +584 -302
  11. package/dist/objects/index.cjs +345 -5
  12. package/dist/objects/index.d.cts +2 -2
  13. package/dist/objects/index.d.ts +2 -2
  14. package/dist/objects/index.js +9 -1
  15. package/package.json +4 -4
  16. package/src/NodeKeyLoaderCache.ts +4 -3
  17. package/src/SigningKeyLoader.ts +12 -7
  18. package/src/client.ts +287 -60
  19. package/src/env.ts +3 -1
  20. package/src/graphql/ClaimUmaInvitation.ts +21 -0
  21. package/src/graphql/ClaimUmaInvitationWithIncentives.ts +25 -0
  22. package/src/graphql/CreateUmaInvitation.ts +19 -0
  23. package/src/graphql/CreateUmaInvitationWithIncentives.ts +23 -0
  24. package/src/graphql/FetchUmaInvitation.ts +15 -0
  25. package/src/objects/Account.ts +7 -3
  26. package/src/objects/AccountToApiTokensConnection.ts +7 -3
  27. package/src/objects/AccountToChannelsConnection.ts +3 -2
  28. package/src/objects/AccountToNodesConnection.ts +7 -3
  29. package/src/objects/AccountToPaymentRequestsConnection.ts +7 -3
  30. package/src/objects/AccountToTransactionsConnection.ts +13 -9
  31. package/src/objects/AccountToWalletsConnection.ts +7 -3
  32. package/src/objects/ApiToken.ts +13 -7
  33. package/src/objects/Balances.ts +22 -12
  34. package/src/objects/BitcoinNetwork.ts +8 -3
  35. package/src/objects/BlockchainBalance.ts +4 -1
  36. package/src/objects/Channel.ts +37 -14
  37. package/src/objects/ChannelClosingTransaction.ts +22 -11
  38. package/src/objects/ChannelFees.ts +4 -1
  39. package/src/objects/ChannelOpeningTransaction.ts +22 -11
  40. package/src/objects/ChannelStatus.ts +33 -8
  41. package/src/objects/ChannelToTransactionsConnection.ts +9 -8
  42. package/src/objects/ClaimUmaInvitationInput.ts +26 -0
  43. package/src/objects/ClaimUmaInvitationOutput.ts +30 -0
  44. package/src/objects/ClaimUmaInvitationWithIncentivesInput.ts +44 -0
  45. package/src/objects/ClaimUmaInvitationWithIncentivesOutput.ts +33 -0
  46. package/src/objects/ComplianceProvider.ts +3 -2
  47. package/src/objects/Connection.ts +7 -3
  48. package/src/objects/CreateApiTokenInput.ts +4 -1
  49. package/src/objects/CreateApiTokenOutput.ts +3 -3
  50. package/src/objects/CreateInvitationWithIncentivesInput.ts +37 -0
  51. package/src/objects/CreateInvitationWithIncentivesOutput.ts +32 -0
  52. package/src/objects/CreateLnurlInvoiceInput.ts +3 -2
  53. package/src/objects/CreateTestModePaymentInput.ts +2 -2
  54. package/src/objects/CreateTestModePaymentoutput.ts +5 -1
  55. package/src/objects/CreateUmaInvitationInput.ts +22 -0
  56. package/src/objects/CreateUmaInvitationOutput.ts +30 -0
  57. package/src/objects/CurrencyAmount.ts +6 -4
  58. package/src/objects/CurrencyUnit.ts +36 -9
  59. package/src/objects/Deposit.ts +22 -11
  60. package/src/objects/Entity.ts +21 -3
  61. package/src/objects/FeeEstimate.ts +5 -1
  62. package/src/objects/GraphNode.ts +30 -14
  63. package/src/objects/Hop.ts +12 -4
  64. package/src/objects/HtlcAttemptFailureCode.ts +7 -3
  65. package/src/objects/IncentivesIneligibilityReason.ts +48 -0
  66. package/src/objects/IncentivesStatus.ts +28 -0
  67. package/src/objects/IncomingPayment.ts +18 -7
  68. package/src/objects/IncomingPaymentAttempt.ts +8 -3
  69. package/src/objects/IncomingPaymentAttemptStatus.ts +7 -3
  70. package/src/objects/IncomingPaymentToAttemptsConnection.ts +7 -3
  71. package/src/objects/Invoice.ts +2 -2
  72. package/src/objects/InvoiceData.ts +7 -3
  73. package/src/objects/InvoiceType.ts +3 -2
  74. package/src/objects/LightningFeeEstimateForInvoiceInput.ts +2 -2
  75. package/src/objects/LightningTransaction.ts +12 -4
  76. package/src/objects/LightsparkNode.ts +33 -18
  77. package/src/objects/LightsparkNodeOwner.ts +2 -2
  78. package/src/objects/LightsparkNodeStatus.ts +3 -2
  79. package/src/objects/LightsparkNodeToChannelsConnection.ts +7 -3
  80. package/src/objects/LightsparkNodeWithOSK.ts +35 -19
  81. package/src/objects/LightsparkNodeWithRemoteSigning.ts +31 -18
  82. package/src/objects/Node.ts +28 -14
  83. package/src/objects/NodeAddressType.ts +7 -3
  84. package/src/objects/NodeToAddressesConnection.ts +7 -3
  85. package/src/objects/OnChainTransaction.ts +23 -11
  86. package/src/objects/OutgoingPayment.ts +25 -7
  87. package/src/objects/OutgoingPaymentAttempt.ts +34 -14
  88. package/src/objects/OutgoingPaymentAttemptStatus.ts +7 -3
  89. package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +12 -4
  90. package/src/objects/OutgoingPaymentToAttemptsConnection.ts +7 -3
  91. package/src/objects/PageInfo.ts +6 -1
  92. package/src/objects/PayInvoiceInput.ts +6 -3
  93. package/src/objects/PaymentDirection.ts +3 -2
  94. package/src/objects/PaymentFailureReason.ts +7 -3
  95. package/src/objects/PaymentRequest.ts +8 -3
  96. package/src/objects/PaymentRequestData.ts +5 -1
  97. package/src/objects/PaymentRequestStatus.ts +7 -3
  98. package/src/objects/Permission.ts +7 -3
  99. package/src/objects/PostTransactionData.ts +6 -3
  100. package/src/objects/RegionCode.ts +541 -0
  101. package/src/objects/RegisterPaymentInput.ts +12 -7
  102. package/src/objects/RemoteSigningSubEventType.ts +7 -3
  103. package/src/objects/RequestWithdrawalInput.ts +2 -2
  104. package/src/objects/RiskRating.ts +8 -3
  105. package/src/objects/RoutingTransaction.ts +20 -7
  106. package/src/objects/RoutingTransactionFailureReason.ts +8 -3
  107. package/src/objects/ScreenNodeInput.ts +3 -2
  108. package/src/objects/SendPaymentInput.ts +4 -1
  109. package/src/objects/SetInvoicePaymentHashInput.ts +3 -2
  110. package/src/objects/Signable.ts +2 -2
  111. package/src/objects/SignablePayload.ts +6 -3
  112. package/src/objects/SignablePayloadStatus.ts +3 -2
  113. package/src/objects/Transaction.ts +14 -4
  114. package/src/objects/TransactionFailures.ts +4 -1
  115. package/src/objects/TransactionStatus.ts +16 -5
  116. package/src/objects/TransactionType.ts +30 -8
  117. package/src/objects/TransactionUpdate.ts +6 -3
  118. package/src/objects/UmaInvitation.ts +119 -0
  119. package/src/objects/Wallet.ts +13 -4
  120. package/src/objects/WalletStatus.ts +36 -9
  121. package/src/objects/WalletToPaymentRequestsConnection.ts +7 -3
  122. package/src/objects/WalletToTransactionsConnection.ts +7 -3
  123. package/src/objects/WebhookEventType.ts +11 -3
  124. package/src/objects/Withdrawal.ts +22 -11
  125. package/src/objects/WithdrawalMode.ts +7 -3
  126. package/src/objects/WithdrawalRequest.ts +15 -6
  127. package/src/objects/WithdrawalRequestStatus.ts +3 -2
  128. package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +11 -4
  129. package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +11 -4
  130. package/src/objects/index.ts +21 -6
  131. package/src/tests/integration/constants.ts +0 -3
  132. package/src/tests/integration/general-regtest.test.ts +178 -197
package/dist/index.cjs CHANGED
@@ -1850,6 +1850,8 @@ __export(src_exports, {
1850
1850
  CurrencyUnit: () => CurrencyUnit_default,
1851
1851
  GraphNode: () => GraphNode_default,
1852
1852
  HtlcAttemptFailureCode: () => HtlcAttemptFailureCode_default,
1853
+ IncentivesIneligibilityReason: () => IncentivesIneligibilityReason_default,
1854
+ IncentivesStatus: () => IncentivesStatus_default,
1853
1855
  IncomingPayment: () => IncomingPayment_default,
1854
1856
  IncomingPaymentAttemptStatus: () => IncomingPaymentAttemptStatus_default,
1855
1857
  InvoiceType: () => InvoiceType_default,
@@ -1865,6 +1867,7 @@ __export(src_exports, {
1865
1867
  PaymentFailureReason: () => PaymentFailureReason_default,
1866
1868
  PaymentRequestStatus: () => PaymentRequestStatus_default,
1867
1869
  Permission: () => Permission_default,
1870
+ RegionCode: () => RegionCode_default,
1868
1871
  RemoteSigningSubEventType: () => RemoteSigningSubEventType_default,
1869
1872
  RemoteSigningWebhookHandler: () => RemoteSigningWebhookHandler,
1870
1873
  RiskRating: () => RiskRating_default,
@@ -1898,6 +1901,7 @@ __export(src_exports, {
1898
1901
  getSignablePayloadQuery: () => getSignablePayloadQuery,
1899
1902
  getSignableQuery: () => getSignableQuery,
1900
1903
  getTransactionQuery: () => getTransactionQuery,
1904
+ getUmaInvitationQuery: () => getUmaInvitationQuery,
1901
1905
  getWithdrawalQuery: () => getWithdrawalQuery,
1902
1906
  isBitcoinNetwork: () => isBitcoinNetwork,
1903
1907
  verifyAndParseWebhook: () => verifyAndParseWebhook
@@ -1945,7 +1949,7 @@ var import_core9 = require("@lightsparkdev/core");
1945
1949
  // package.json
1946
1950
  var package_default = {
1947
1951
  name: "@lightsparkdev/lightspark-sdk",
1948
- version: "1.2.1",
1952
+ version: "1.2.3",
1949
1953
  description: "Lightspark JS SDK",
1950
1954
  author: "Lightspark Inc.",
1951
1955
  keywords: [
@@ -2014,7 +2018,7 @@ var package_default = {
2014
2018
  ],
2015
2019
  scripts: {
2016
2020
  build: "yarn tsc && tsup",
2017
- "build:watch": "yarn build --watch",
2021
+ "build:watch": "yarn build --watch --clean=false",
2018
2022
  clean: "rm -rf .turbo && rm -rf dist",
2019
2023
  dev: "yarn build -- --watch",
2020
2024
  docs: "typedoc src",
@@ -2033,7 +2037,7 @@ var package_default = {
2033
2037
  },
2034
2038
  license: "Apache-2.0",
2035
2039
  dependencies: {
2036
- "@lightsparkdev/core": "1.0.10",
2040
+ "@lightsparkdev/core": "1.0.11",
2037
2041
  "@lightsparkdev/crypto-wasm": "0.1.2",
2038
2042
  "auto-bind": "^5.0.1",
2039
2043
  "crypto-browserify": "^3.12.0",
@@ -2060,7 +2064,184 @@ var package_default = {
2060
2064
  "tsc-absolute": "^1.0.1",
2061
2065
  tsup: "^7.2.0",
2062
2066
  typedoc: "^0.24.7",
2063
- typescript: "^4.9.5"
2067
+ typescript: "^5.0.0"
2068
+ }
2069
+ };
2070
+
2071
+ // src/NodeKeyLoaderCache.ts
2072
+ var import_core3 = require("@lightsparkdev/core");
2073
+
2074
+ // src/SigningKeyLoader.ts
2075
+ var import_core2 = require("@lightsparkdev/core");
2076
+
2077
+ // src/graphql/RecoverNodeSigningKey.ts
2078
+ var RecoverNodeSigningKey = `
2079
+ query RecoverNodeSigningKey($nodeId: ID!) {
2080
+ entity(id: $nodeId) {
2081
+ __typename
2082
+ ... on LightsparkNodeWithOSK {
2083
+ encrypted_signing_private_key {
2084
+ encrypted_value
2085
+ cipher
2086
+ }
2087
+ }
2088
+ }
2089
+ }
2090
+ `;
2091
+
2092
+ // src/SigningKeyLoader.ts
2093
+ var SIGNING_KEY_PATH = "m/5";
2094
+ function isNodeIdAndPasswordSigningKeyLoaderArgs(args) {
2095
+ return args.password !== void 0;
2096
+ }
2097
+ function isMasterSeedSigningKeyLoaderArgs(args) {
2098
+ return args.masterSeed !== void 0;
2099
+ }
2100
+ var NodeIdAndPasswordSigningKeyLoader = class {
2101
+ nodeId;
2102
+ password;
2103
+ requester;
2104
+ cryptoImpl;
2105
+ constructor(args, requester, cryptoImpl) {
2106
+ this.nodeId = args.nodeId;
2107
+ this.password = args.password;
2108
+ this.requester = requester;
2109
+ this.cryptoImpl = cryptoImpl;
2110
+ }
2111
+ async loadSigningKey() {
2112
+ const encryptedKey = await this.recoverNodeSigningKey();
2113
+ if (!encryptedKey) {
2114
+ console.warn("No encrypted key found for node " + this.nodeId);
2115
+ return;
2116
+ }
2117
+ const signingPrivateKey = await this.cryptoImpl.decryptSecretWithNodePassword(
2118
+ encryptedKey.cipher,
2119
+ encryptedKey.encrypted_value,
2120
+ this.password
2121
+ );
2122
+ if (!signingPrivateKey) {
2123
+ throw new import_core2.LightsparkSigningException(
2124
+ "Unable to decrypt signing key with provided password. Please try again."
2125
+ );
2126
+ }
2127
+ let signingPrivateKeyPEM = "";
2128
+ if (new Uint8Array(signingPrivateKey)[0] === 48) {
2129
+ signingPrivateKeyPEM = (0, import_core2.b64encode)(signingPrivateKey);
2130
+ } else {
2131
+ const dec = new TextDecoder();
2132
+ signingPrivateKeyPEM = dec.decode(signingPrivateKey);
2133
+ }
2134
+ return { key: signingPrivateKeyPEM, type: import_core2.SigningKeyType.RSASigningKey };
2135
+ }
2136
+ async recoverNodeSigningKey() {
2137
+ const response = await this.requester.makeRawRequest(
2138
+ RecoverNodeSigningKey,
2139
+ { nodeId: this.nodeId }
2140
+ );
2141
+ const nodeEntity = response.entity;
2142
+ if (nodeEntity?.__typename === "LightsparkNodeWithOSK") {
2143
+ return nodeEntity.encrypted_signing_private_key;
2144
+ }
2145
+ return null;
2146
+ }
2147
+ };
2148
+ var MasterSeedSigningKeyLoader = class {
2149
+ masterSeed;
2150
+ network;
2151
+ constructor(args) {
2152
+ this.masterSeed = args.masterSeed;
2153
+ this.network = args.network;
2154
+ }
2155
+ async loadSigningKey() {
2156
+ if (import_core2.isBrowser) {
2157
+ throw new import_core2.LightsparkSigningException(
2158
+ "Browser environments not supported for master seed signing key loader."
2159
+ );
2160
+ }
2161
+ const { LightsparkSigner, Network } = await import("@lightsparkdev/crypto-wasm");
2162
+ let cryptoLibNetwork;
2163
+ switch (this.network) {
2164
+ case BitcoinNetwork_default.MAINNET:
2165
+ cryptoLibNetwork = Network.Bitcoin;
2166
+ break;
2167
+ case BitcoinNetwork_default.TESTNET:
2168
+ cryptoLibNetwork = Network.Testnet;
2169
+ break;
2170
+ case BitcoinNetwork_default.REGTEST:
2171
+ cryptoLibNetwork = Network.Regtest;
2172
+ break;
2173
+ default:
2174
+ throw new Error(
2175
+ `Unsupported lightspark_crypto network ${this.network}.`
2176
+ );
2177
+ }
2178
+ const lightsparkSigner = LightsparkSigner.from_bytes(
2179
+ this.masterSeed,
2180
+ cryptoLibNetwork
2181
+ );
2182
+ const privateKey = lightsparkSigner.derive_private_key(SIGNING_KEY_PATH);
2183
+ return { key: privateKey, type: import_core2.SigningKeyType.Secp256k1SigningKey };
2184
+ }
2185
+ };
2186
+
2187
+ // src/NodeKeyLoaderCache.ts
2188
+ var NodeKeyLoaderCache = class {
2189
+ constructor(nodeKeyCache, cryptoImpl = import_core3.DefaultCrypto) {
2190
+ this.nodeKeyCache = nodeKeyCache;
2191
+ this.cryptoImpl = cryptoImpl;
2192
+ this.idToLoader = /* @__PURE__ */ new Map();
2193
+ }
2194
+ idToLoader;
2195
+ /**
2196
+ * Sets the signing key loader for a node.
2197
+ * Instantiates a signing key loader based on the type of args passed in by
2198
+ * the user.
2199
+ *
2200
+ * @param nodeId The ID of the node to get the key for
2201
+ * @param loaderArgs Loader arguments for loading the key
2202
+ * @param requester Requester used for loading the key
2203
+ */
2204
+ setLoader(nodeId, loaderArgs, requester) {
2205
+ let loader;
2206
+ if (isNodeIdAndPasswordSigningKeyLoaderArgs(loaderArgs)) {
2207
+ loader = new NodeIdAndPasswordSigningKeyLoader(
2208
+ { nodeId, ...loaderArgs },
2209
+ requester,
2210
+ this.cryptoImpl
2211
+ );
2212
+ } else if (isMasterSeedSigningKeyLoaderArgs(loaderArgs)) {
2213
+ loader = new MasterSeedSigningKeyLoader({ ...loaderArgs });
2214
+ } else {
2215
+ throw new import_core3.LightsparkSigningException("Invalid signing key loader args");
2216
+ }
2217
+ this.idToLoader.set(nodeId, loader);
2218
+ }
2219
+ /**
2220
+ * Gets the key for a node using the loader set by [setLoader]
2221
+ *
2222
+ * @param id The ID of the node to get the key for
2223
+ * @returns The loaded key
2224
+ */
2225
+ async getKeyWithLoader(id) {
2226
+ if (this.nodeKeyCache.hasKey(id)) {
2227
+ return this.nodeKeyCache.getKey(id);
2228
+ }
2229
+ const loader = this.idToLoader.get(id);
2230
+ if (!loader) {
2231
+ throw new import_core3.LightsparkSigningException(
2232
+ "No signing key loader found for node " + id
2233
+ );
2234
+ }
2235
+ const loaderResult = await loader.loadSigningKey();
2236
+ if (!loaderResult) {
2237
+ return;
2238
+ }
2239
+ const key = await this.nodeKeyCache.loadKey(
2240
+ id,
2241
+ { key: loaderResult.key },
2242
+ loaderResult.type
2243
+ );
2244
+ return key || void 0;
2064
2245
  }
2065
2246
  };
2066
2247
 
@@ -2146,6 +2327,117 @@ var BitcoinFeeEstimate = `
2146
2327
  ${FRAGMENT2}
2147
2328
  `;
2148
2329
 
2330
+ // src/objects/IncentivesIneligibilityReason.ts
2331
+ var IncentivesIneligibilityReason = /* @__PURE__ */ ((IncentivesIneligibilityReason2) => {
2332
+ IncentivesIneligibilityReason2["FUTURE_VALUE"] = "FUTURE_VALUE";
2333
+ IncentivesIneligibilityReason2["DISABLED"] = "DISABLED";
2334
+ IncentivesIneligibilityReason2["SENDER_NOT_ELIGIBLE"] = "SENDER_NOT_ELIGIBLE";
2335
+ IncentivesIneligibilityReason2["RECEIVER_NOT_ELIGIBLE"] = "RECEIVER_NOT_ELIGIBLE";
2336
+ IncentivesIneligibilityReason2["SENDING_VASP_NOT_ELIGIBLE"] = "SENDING_VASP_NOT_ELIGIBLE";
2337
+ IncentivesIneligibilityReason2["RECEIVING_VASP_NOT_ELIGIBLE"] = "RECEIVING_VASP_NOT_ELIGIBLE";
2338
+ IncentivesIneligibilityReason2["NOT_CROSS_BORDER"] = "NOT_CROSS_BORDER";
2339
+ return IncentivesIneligibilityReason2;
2340
+ })(IncentivesIneligibilityReason || {});
2341
+ var IncentivesIneligibilityReason_default = IncentivesIneligibilityReason;
2342
+
2343
+ // src/objects/IncentivesStatus.ts
2344
+ var IncentivesStatus = /* @__PURE__ */ ((IncentivesStatus2) => {
2345
+ IncentivesStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
2346
+ IncentivesStatus2["PENDING"] = "PENDING";
2347
+ IncentivesStatus2["VALIDATED"] = "VALIDATED";
2348
+ IncentivesStatus2["INELIGIBLE"] = "INELIGIBLE";
2349
+ return IncentivesStatus2;
2350
+ })(IncentivesStatus || {});
2351
+ var IncentivesStatus_default = IncentivesStatus;
2352
+
2353
+ // src/objects/UmaInvitation.ts
2354
+ var UmaInvitationFromJson = (obj) => {
2355
+ return {
2356
+ id: obj["uma_invitation_id"],
2357
+ createdAt: obj["uma_invitation_created_at"],
2358
+ updatedAt: obj["uma_invitation_updated_at"],
2359
+ code: obj["uma_invitation_code"],
2360
+ url: obj["uma_invitation_url"],
2361
+ inviterUma: obj["uma_invitation_inviter_uma"],
2362
+ incentivesStatus: IncentivesStatus_default[obj["uma_invitation_incentives_status"]] ?? IncentivesStatus_default.FUTURE_VALUE,
2363
+ typename: "UmaInvitation",
2364
+ inviteeUma: obj["uma_invitation_invitee_uma"],
2365
+ incentivesIneligibilityReason: !!obj["uma_invitation_incentives_ineligibility_reason"] ? IncentivesIneligibilityReason_default[obj["uma_invitation_incentives_ineligibility_reason"]] ?? IncentivesIneligibilityReason_default.FUTURE_VALUE : null
2366
+ };
2367
+ };
2368
+ var FRAGMENT3 = `
2369
+ fragment UmaInvitationFragment on UmaInvitation {
2370
+ __typename
2371
+ uma_invitation_id: id
2372
+ uma_invitation_created_at: created_at
2373
+ uma_invitation_updated_at: updated_at
2374
+ uma_invitation_code: code
2375
+ uma_invitation_url: url
2376
+ uma_invitation_inviter_uma: inviter_uma
2377
+ uma_invitation_invitee_uma: invitee_uma
2378
+ uma_invitation_incentives_status: incentives_status
2379
+ uma_invitation_incentives_ineligibility_reason: incentives_ineligibility_reason
2380
+ }`;
2381
+ var getUmaInvitationQuery = (id) => {
2382
+ return {
2383
+ queryPayload: `
2384
+ query GetUmaInvitation($id: ID!) {
2385
+ entity(id: $id) {
2386
+ ... on UmaInvitation {
2387
+ ...UmaInvitationFragment
2388
+ }
2389
+ }
2390
+ }
2391
+
2392
+ ${FRAGMENT3}
2393
+ `,
2394
+ variables: { id },
2395
+ constructObject: (data) => UmaInvitationFromJson(data.entity)
2396
+ };
2397
+ };
2398
+
2399
+ // src/graphql/ClaimUmaInvitation.ts
2400
+ var ClaimUmaInvitation = `
2401
+ mutation ClaimUmaInvitation(
2402
+ $invitationCode: String!
2403
+ $inviteeUma: String!
2404
+ ) {
2405
+ claim_uma_invitation(input: {
2406
+ invitation_code: $invitationCode
2407
+ invitee_uma: $inviteeUma
2408
+ }) {
2409
+ invitation {
2410
+ ...UmaInvitationFragment
2411
+ }
2412
+ }
2413
+ }
2414
+
2415
+ ${FRAGMENT3}
2416
+ `;
2417
+
2418
+ // src/graphql/ClaimUmaInvitationWithIncentives.ts
2419
+ var ClaimUmaInvitationWithIncentives = `
2420
+ mutation ClaimUmaInvitationWithIncentives(
2421
+ $invitationCode: String!
2422
+ $inviteeUma: String!
2423
+ $inviteePhoneHash: String!
2424
+ $inviteeRegion: RegionCode!
2425
+ ) {
2426
+ claim_uma_invitation_with_incentives(input: {
2427
+ invitation_code: $invitationCode
2428
+ invitee_uma: $inviteeUma
2429
+ invitee_phone_hash: $inviteePhoneHash
2430
+ invitee_region: $inviteeRegion
2431
+ }) {
2432
+ invitation {
2433
+ ...UmaInvitationFragment
2434
+ }
2435
+ }
2436
+ }
2437
+
2438
+ ${FRAGMENT3}
2439
+ `;
2440
+
2149
2441
  // src/objects/Permission.ts
2150
2442
  var Permission = /* @__PURE__ */ ((Permission2) => {
2151
2443
  Permission2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -2179,7 +2471,7 @@ var ApiTokenFromJson = (obj) => {
2179
2471
  typename: "ApiToken"
2180
2472
  };
2181
2473
  };
2182
- var FRAGMENT3 = `
2474
+ var FRAGMENT4 = `
2183
2475
  fragment ApiTokenFragment on ApiToken {
2184
2476
  __typename
2185
2477
  api_token_id: id
@@ -2200,7 +2492,7 @@ query GetApiToken($id: ID!) {
2200
2492
  }
2201
2493
  }
2202
2494
 
2203
- ${FRAGMENT3}
2495
+ ${FRAGMENT4}
2204
2496
  `,
2205
2497
  variables: { id },
2206
2498
  constructObject: (data) => ApiTokenFromJson(data.entity)
@@ -2224,7 +2516,7 @@ var CreateApiToken = `
2224
2516
  }
2225
2517
  }
2226
2518
 
2227
- ${FRAGMENT3}
2519
+ ${FRAGMENT4}
2228
2520
  `;
2229
2521
 
2230
2522
  // src/graphql/CreateInvoice.ts
@@ -2258,7 +2550,7 @@ var BitcoinNetwork = /* @__PURE__ */ ((BitcoinNetwork2) => {
2258
2550
  var BitcoinNetwork_default = BitcoinNetwork;
2259
2551
 
2260
2552
  // src/objects/Node.ts
2261
- var import_core2 = require("@lightsparkdev/core");
2553
+ var import_core4 = require("@lightsparkdev/core");
2262
2554
 
2263
2555
  // src/objects/Balances.ts
2264
2556
  var BalancesFromJson = (obj) => {
@@ -2389,7 +2681,7 @@ query GetGraphNode($id: ID!) {
2389
2681
  }
2390
2682
  }
2391
2683
 
2392
- ${FRAGMENT4}
2684
+ ${FRAGMENT5}
2393
2685
  `,
2394
2686
  variables: { id },
2395
2687
  constructObject: (data) => GraphNodeFromJson(data.entity)
@@ -2424,7 +2716,7 @@ var GraphNodeFromJson = (obj) => {
2424
2716
  obj["graph_node_public_key"]
2425
2717
  );
2426
2718
  };
2427
- var FRAGMENT4 = `
2719
+ var FRAGMENT5 = `
2428
2720
  fragment GraphNodeFragment on GraphNode {
2429
2721
  __typename
2430
2722
  graph_node_id: id
@@ -2613,7 +2905,7 @@ query GetChannel($id: ID!) {
2613
2905
  }
2614
2906
  }
2615
2907
 
2616
- ${FRAGMENT5}
2908
+ ${FRAGMENT6}
2617
2909
  `,
2618
2910
  variables: { id },
2619
2911
  constructObject: (data) => ChannelFromJson(data.entity)
@@ -2666,7 +2958,7 @@ var ChannelFromJson = (obj) => {
2666
2958
  obj["channel_short_channel_id"]
2667
2959
  );
2668
2960
  };
2669
- var FRAGMENT5 = `
2961
+ var FRAGMENT6 = `
2670
2962
  fragment ChannelFragment on Channel {
2671
2963
  __typename
2672
2964
  channel_id: id
@@ -2990,7 +3282,7 @@ query GetLightsparkNodeWithOSK($id: ID!) {
2990
3282
  }
2991
3283
  }
2992
3284
 
2993
- ${FRAGMENT6}
3285
+ ${FRAGMENT7}
2994
3286
  `,
2995
3287
  variables: { id },
2996
3288
  constructObject: (data) => LightsparkNodeWithOSKFromJson(data.entity)
@@ -3051,7 +3343,7 @@ var LightsparkNodeWithOSKFromJson = (obj) => {
3051
3343
  ) : void 0
3052
3344
  );
3053
3345
  };
3054
- var FRAGMENT6 = `
3346
+ var FRAGMENT7 = `
3055
3347
  fragment LightsparkNodeWithOSKFragment on LightsparkNodeWithOSK {
3056
3348
  __typename
3057
3349
  lightspark_node_with_o_s_k_id: id
@@ -3375,7 +3667,7 @@ query GetLightsparkNodeWithRemoteSigning($id: ID!) {
3375
3667
  }
3376
3668
  }
3377
3669
 
3378
- ${FRAGMENT7}
3670
+ ${FRAGMENT8}
3379
3671
  `,
3380
3672
  variables: { id },
3381
3673
  constructObject: (data) => LightsparkNodeWithRemoteSigningFromJson(data.entity)
@@ -3438,7 +3730,7 @@ var LightsparkNodeWithRemoteSigningFromJson = (obj) => {
3438
3730
  !!obj["lightspark_node_with_remote_signing_balances"] ? BalancesFromJson(obj["lightspark_node_with_remote_signing_balances"]) : void 0
3439
3731
  );
3440
3732
  };
3441
- var FRAGMENT7 = `
3733
+ var FRAGMENT8 = `
3442
3734
  fragment LightsparkNodeWithRemoteSigningFragment on LightsparkNodeWithRemoteSigning {
3443
3735
  __typename
3444
3736
  lightspark_node_with_remote_signing_id: id
@@ -3653,7 +3945,7 @@ var NodeFromJson = (obj) => {
3653
3945
  !!obj["lightspark_node_with_remote_signing_balances"] ? BalancesFromJson(obj["lightspark_node_with_remote_signing_balances"]) : void 0
3654
3946
  );
3655
3947
  }
3656
- throw new import_core2.LightsparkException(
3948
+ throw new import_core4.LightsparkException(
3657
3949
  "DeserializationError",
3658
3950
  `Couldn't find a concrete type for interface Node corresponding to the typename=${obj["__typename"]}`
3659
3951
  );
@@ -3729,12 +4021,12 @@ var NodeToJson = (obj) => {
3729
4021
  lightspark_node_with_remote_signing_balances: lightsparkNodeWithRemoteSigning.balances ? BalancesToJson(lightsparkNodeWithRemoteSigning.balances) : void 0
3730
4022
  };
3731
4023
  }
3732
- throw new import_core2.LightsparkException(
4024
+ throw new import_core4.LightsparkException(
3733
4025
  "DeserializationError",
3734
4026
  `Couldn't find a concrete type for interface Node corresponding to the typename=${obj.typename}`
3735
4027
  );
3736
4028
  };
3737
- var FRAGMENT8 = `
4029
+ var FRAGMENT9 = `
3738
4030
  fragment NodeFragment on Node {
3739
4031
  __typename
3740
4032
  ... on GraphNode {
@@ -4020,7 +4312,7 @@ query GetNode($id: ID!) {
4020
4312
  }
4021
4313
  }
4022
4314
 
4023
- ${FRAGMENT8}
4315
+ ${FRAGMENT9}
4024
4316
  `,
4025
4317
  variables: { id },
4026
4318
  constructObject: (data) => NodeFromJson(data.entity)
@@ -4041,7 +4333,7 @@ var InvoiceDataFromJson = (obj) => {
4041
4333
  memo: obj["invoice_data_memo"]
4042
4334
  };
4043
4335
  };
4044
- var FRAGMENT9 = `
4336
+ var FRAGMENT10 = `
4045
4337
  fragment InvoiceDataFragment on InvoiceData {
4046
4338
  __typename
4047
4339
  invoice_data_encoded_payment_request: encoded_payment_request
@@ -4355,7 +4647,7 @@ var InvoiceFromJson = (obj) => {
4355
4647
  amountPaid: !!obj["invoice_amount_paid"] ? CurrencyAmountFromJson(obj["invoice_amount_paid"]) : void 0
4356
4648
  };
4357
4649
  };
4358
- var FRAGMENT10 = `
4650
+ var FRAGMENT11 = `
4359
4651
  fragment InvoiceFragment on Invoice {
4360
4652
  __typename
4361
4653
  invoice_id: id
@@ -4673,7 +4965,7 @@ query GetInvoice($id: ID!) {
4673
4965
  }
4674
4966
  }
4675
4967
 
4676
- ${FRAGMENT10}
4968
+ ${FRAGMENT11}
4677
4969
  `,
4678
4970
  variables: { id },
4679
4971
  constructObject: (data) => InvoiceFromJson(data.entity)
@@ -4699,7 +4991,7 @@ mutation CreateLnurlInvoice(
4699
4991
  }
4700
4992
  }
4701
4993
  }
4702
- ${FRAGMENT10}
4994
+ ${FRAGMENT11}
4703
4995
  `;
4704
4996
 
4705
4997
  // src/graphql/CreateNodeWalletAddress.ts
@@ -4761,7 +5053,7 @@ var IncomingPaymentAttemptFromJson = (obj) => {
4761
5053
  resolvedAt: obj["incoming_payment_attempt_resolved_at"]
4762
5054
  };
4763
5055
  };
4764
- var FRAGMENT11 = `
5056
+ var FRAGMENT12 = `
4765
5057
  fragment IncomingPaymentAttemptFragment on IncomingPaymentAttempt {
4766
5058
  __typename
4767
5059
  incoming_payment_attempt_id: id
@@ -4792,7 +5084,7 @@ query GetIncomingPaymentAttempt($id: ID!) {
4792
5084
  }
4793
5085
  }
4794
5086
 
4795
- ${FRAGMENT11}
5087
+ ${FRAGMENT12}
4796
5088
  `,
4797
5089
  variables: { id },
4798
5090
  constructObject: (data) => IncomingPaymentAttemptFromJson(data.entity)
@@ -4919,7 +5211,7 @@ query GetIncomingPayment($id: ID!) {
4919
5211
  }
4920
5212
  }
4921
5213
 
4922
- ${FRAGMENT12}
5214
+ ${FRAGMENT13}
4923
5215
  `,
4924
5216
  variables: { id },
4925
5217
  constructObject: (data) => IncomingPaymentFromJson(data.entity)
@@ -4958,7 +5250,7 @@ var IncomingPaymentFromJson = (obj) => {
4958
5250
  )
4959
5251
  );
4960
5252
  };
4961
- var FRAGMENT12 = `
5253
+ var FRAGMENT13 = `
4962
5254
  fragment IncomingPaymentFragment on IncomingPayment {
4963
5255
  __typename
4964
5256
  incoming_payment_id: id
@@ -5014,29 +5306,67 @@ mutation CreateTestModePayment(
5014
5306
  }
5015
5307
  }
5016
5308
 
5017
- ${FRAGMENT12}
5309
+ ${FRAGMENT13}
5018
5310
  `;
5019
5311
 
5020
- // src/graphql/CreateUmaInvoice.ts
5021
- var CreateUmaInvoice = `
5022
- mutation CreateUmaInvoice(
5023
- $node_id: ID!
5024
- $amount_msats: Long!
5025
- $metadata_hash: String!
5026
- $expiry_secs: Int = null
5027
- ) {
5028
- create_uma_invoice(input: {
5029
- node_id: $node_id
5030
- amount_msats: $amount_msats
5031
- metadata_hash: $metadata_hash
5032
- expiry_secs: $expiry_secs
5312
+ // src/graphql/CreateUmaInvitation.ts
5313
+ var CreateUmaInvitation = `
5314
+ mutation CreateUmaInvitation(
5315
+ $inviterUma: String!
5316
+ ) {
5317
+ create_uma_invitation(input: {
5318
+ inviter_uma: $inviterUma
5319
+ }) {
5320
+ invitation {
5321
+ ...UmaInvitationFragment
5322
+ }
5323
+ }
5324
+ }
5325
+
5326
+ ${FRAGMENT3}
5327
+ `;
5328
+
5329
+ // src/graphql/CreateUmaInvitationWithIncentives.ts
5330
+ var CreateUmaInvitationWithIncentives = `
5331
+ mutation CreateUmaInvitationWithIncentives(
5332
+ $inviterUma: String!
5333
+ $inviterPhoneHash: String!
5334
+ $inviterRegion: RegionCode!
5335
+ ) {
5336
+ create_uma_invitation_with_incentives(input: {
5337
+ inviter_uma: $inviterUma
5338
+ inviter_phone_hash: $inviterPhoneHash
5339
+ inviter_region: $inviterRegion
5340
+ }) {
5341
+ invitation {
5342
+ ...UmaInvitationFragment
5343
+ }
5344
+ }
5345
+ }
5346
+
5347
+ ${FRAGMENT3}
5348
+ `;
5349
+
5350
+ // src/graphql/CreateUmaInvoice.ts
5351
+ var CreateUmaInvoice = `
5352
+ mutation CreateUmaInvoice(
5353
+ $node_id: ID!
5354
+ $amount_msats: Long!
5355
+ $metadata_hash: String!
5356
+ $expiry_secs: Int = null
5357
+ ) {
5358
+ create_uma_invoice(input: {
5359
+ node_id: $node_id
5360
+ amount_msats: $amount_msats
5361
+ metadata_hash: $metadata_hash
5362
+ expiry_secs: $expiry_secs
5033
5363
  }) {
5034
5364
  invoice {
5035
5365
  ...InvoiceFragment
5036
5366
  }
5037
5367
  }
5038
5368
  }
5039
- ${FRAGMENT10}
5369
+ ${FRAGMENT11}
5040
5370
  `;
5041
5371
 
5042
5372
  // src/graphql/DecodeInvoice.ts
@@ -5050,7 +5380,7 @@ var DecodeInvoice = `
5050
5380
  }
5051
5381
  }
5052
5382
 
5053
- ${FRAGMENT9}
5383
+ ${FRAGMENT10}
5054
5384
  `;
5055
5385
 
5056
5386
  // src/graphql/DeleteApiToken.ts
@@ -5066,6 +5396,19 @@ var DeleteApiToken = `
5066
5396
  }
5067
5397
  `;
5068
5398
 
5399
+ // src/graphql/FetchUmaInvitation.ts
5400
+ var FetchUmaInvitation = `
5401
+ query FetchUmaInvitation(
5402
+ $invitationCode: String!
5403
+ ) {
5404
+ uma_invitation_by_code(code: $invitationCode) {
5405
+ ...UmaInvitationFragment
5406
+ }
5407
+ }
5408
+
5409
+ ${FRAGMENT3}
5410
+ `;
5411
+
5069
5412
  // src/graphql/FundNode.ts
5070
5413
  var FundNode = `
5071
5414
  mutation FundNode(
@@ -5083,7 +5426,7 @@ ${FRAGMENT}
5083
5426
  `;
5084
5427
 
5085
5428
  // src/objects/LightningFeeEstimateOutput.ts
5086
- var FRAGMENT13 = `
5429
+ var FRAGMENT14 = `
5087
5430
  fragment LightningFeeEstimateOutputFragment on LightningFeeEstimateOutput {
5088
5431
  __typename
5089
5432
  lightning_fee_estimate_output_fee_estimate: fee_estimate {
@@ -5112,7 +5455,7 @@ var LightningFeeEstimateForInvoice = `
5112
5455
  }
5113
5456
  }
5114
5457
 
5115
- ${FRAGMENT13}
5458
+ ${FRAGMENT14}
5116
5459
  `;
5117
5460
 
5118
5461
  // src/graphql/LightningFeeEstimateForNode.ts
@@ -5131,7 +5474,7 @@ var LightningFeeEstimateForNode = `
5131
5474
  }
5132
5475
  }
5133
5476
 
5134
- ${FRAGMENT13}
5477
+ ${FRAGMENT14}
5135
5478
  `;
5136
5479
 
5137
5480
  // src/graphql/MultiNodeDashboard.ts
@@ -5299,7 +5642,7 @@ var HopFromJson = (obj) => {
5299
5642
  expiryBlockHeight: obj["hop_expiry_block_height"]
5300
5643
  };
5301
5644
  };
5302
- var FRAGMENT14 = `
5645
+ var FRAGMENT15 = `
5303
5646
  fragment HopFragment on Hop {
5304
5647
  __typename
5305
5648
  hop_id: id
@@ -5339,7 +5682,7 @@ query GetHop($id: ID!) {
5339
5682
  }
5340
5683
  }
5341
5684
 
5342
- ${FRAGMENT14}
5685
+ ${FRAGMENT15}
5343
5686
  `,
5344
5687
  variables: { id },
5345
5688
  constructObject: (data) => HopFromJson(data.entity)
@@ -5362,11 +5705,12 @@ var OutgoingPaymentAttemptToHopsConnectionFromJson = (obj) => {
5362
5705
 
5363
5706
  // src/objects/OutgoingPaymentAttempt.ts
5364
5707
  var OutgoingPaymentAttempt = class {
5365
- constructor(id, createdAt, updatedAt, status, outgoingPaymentId, typename, failureCode, failureSourceIndex, resolvedAt, amount, fees, channelSnapshot) {
5708
+ constructor(id, createdAt, updatedAt, status, attemptedAt, outgoingPaymentId, typename, failureCode, failureSourceIndex, resolvedAt, amount, fees, channelSnapshot) {
5366
5709
  this.id = id;
5367
5710
  this.createdAt = createdAt;
5368
5711
  this.updatedAt = updatedAt;
5369
5712
  this.status = status;
5713
+ this.attemptedAt = attemptedAt;
5370
5714
  this.outgoingPaymentId = outgoingPaymentId;
5371
5715
  this.typename = typename;
5372
5716
  this.failureCode = failureCode;
@@ -5444,7 +5788,7 @@ query GetOutgoingPaymentAttempt($id: ID!) {
5444
5788
  }
5445
5789
  }
5446
5790
 
5447
- ${FRAGMENT15}
5791
+ ${FRAGMENT16}
5448
5792
  `,
5449
5793
  variables: { id },
5450
5794
  constructObject: (data) => OutgoingPaymentAttemptFromJson(data.entity)
@@ -5459,6 +5803,7 @@ ${FRAGMENT15}
5459
5803
  outgoing_payment_attempt_status: this.status,
5460
5804
  outgoing_payment_attempt_failure_code: this.failureCode,
5461
5805
  outgoing_payment_attempt_failure_source_index: this.failureSourceIndex,
5806
+ outgoing_payment_attempt_attempted_at: this.attemptedAt,
5462
5807
  outgoing_payment_attempt_resolved_at: this.resolvedAt,
5463
5808
  outgoing_payment_attempt_amount: this.amount ? CurrencyAmountToJson(this.amount) : void 0,
5464
5809
  outgoing_payment_attempt_fees: this.fees ? CurrencyAmountToJson(this.fees) : void 0,
@@ -5473,6 +5818,7 @@ var OutgoingPaymentAttemptFromJson = (obj) => {
5473
5818
  obj["outgoing_payment_attempt_created_at"],
5474
5819
  obj["outgoing_payment_attempt_updated_at"],
5475
5820
  OutgoingPaymentAttemptStatus_default[obj["outgoing_payment_attempt_status"]] ?? OutgoingPaymentAttemptStatus_default.FUTURE_VALUE,
5821
+ obj["outgoing_payment_attempt_attempted_at"],
5476
5822
  obj["outgoing_payment_attempt_outgoing_payment"].id,
5477
5823
  "OutgoingPaymentAttempt",
5478
5824
  !!obj["outgoing_payment_attempt_failure_code"] ? HtlcAttemptFailureCode_default[obj["outgoing_payment_attempt_failure_code"]] ?? HtlcAttemptFailureCode_default.FUTURE_VALUE : null,
@@ -5485,7 +5831,7 @@ var OutgoingPaymentAttemptFromJson = (obj) => {
5485
5831
  ) : void 0
5486
5832
  );
5487
5833
  };
5488
- var FRAGMENT15 = `
5834
+ var FRAGMENT16 = `
5489
5835
  fragment OutgoingPaymentAttemptFragment on OutgoingPaymentAttempt {
5490
5836
  __typename
5491
5837
  outgoing_payment_attempt_id: id
@@ -5494,6 +5840,7 @@ fragment OutgoingPaymentAttemptFragment on OutgoingPaymentAttempt {
5494
5840
  outgoing_payment_attempt_status: status
5495
5841
  outgoing_payment_attempt_failure_code: failure_code
5496
5842
  outgoing_payment_attempt_failure_source_index: failure_source_index
5843
+ outgoing_payment_attempt_attempted_at: attempted_at
5497
5844
  outgoing_payment_attempt_resolved_at: resolved_at
5498
5845
  outgoing_payment_attempt_amount: amount {
5499
5846
  __typename
@@ -5596,7 +5943,7 @@ var PaymentFailureReason = /* @__PURE__ */ ((PaymentFailureReason2) => {
5596
5943
  var PaymentFailureReason_default = PaymentFailureReason;
5597
5944
 
5598
5945
  // src/objects/PaymentRequestData.ts
5599
- var import_core3 = require("@lightsparkdev/core");
5946
+ var import_core5 = require("@lightsparkdev/core");
5600
5947
  var PaymentRequestDataFromJson = (obj) => {
5601
5948
  if (obj["__typename"] == "InvoiceData") {
5602
5949
  return {
@@ -5611,7 +5958,7 @@ var PaymentRequestDataFromJson = (obj) => {
5611
5958
  memo: obj["invoice_data_memo"]
5612
5959
  };
5613
5960
  }
5614
- throw new import_core3.LightsparkException(
5961
+ throw new import_core5.LightsparkException(
5615
5962
  "DeserializationError",
5616
5963
  `Couldn't find a concrete type for interface PaymentRequestData corresponding to the typename=${obj["__typename"]}`
5617
5964
  );
@@ -5631,7 +5978,7 @@ var PaymentRequestDataToJson = (obj) => {
5631
5978
  invoice_data_destination: NodeToJson(invoiceData.destination)
5632
5979
  };
5633
5980
  }
5634
- throw new import_core3.LightsparkException(
5981
+ throw new import_core5.LightsparkException(
5635
5982
  "DeserializationError",
5636
5983
  `Couldn't find a concrete type for interface PaymentRequestData corresponding to the typename=${obj.typename}`
5637
5984
  );
@@ -5694,6 +6041,7 @@ query FetchOutgoingPaymentToAttemptsConnection($entity_id: ID!, $first: Int, $af
5694
6041
  outgoing_payment_attempt_status: status
5695
6042
  outgoing_payment_attempt_failure_code: failure_code
5696
6043
  outgoing_payment_attempt_failure_source_index: failure_source_index
6044
+ outgoing_payment_attempt_attempted_at: attempted_at
5697
6045
  outgoing_payment_attempt_resolved_at: resolved_at
5698
6046
  outgoing_payment_attempt_amount: amount {
5699
6047
  __typename
@@ -5785,7 +6133,7 @@ query GetOutgoingPayment($id: ID!) {
5785
6133
  }
5786
6134
  }
5787
6135
 
5788
- ${FRAGMENT16}
6136
+ ${FRAGMENT17}
5789
6137
  `,
5790
6138
  variables: { id },
5791
6139
  constructObject: (data) => OutgoingPaymentFromJson(data.entity)
@@ -5834,7 +6182,7 @@ var OutgoingPaymentFromJson = (obj) => {
5834
6182
  obj["outgoing_payment_payment_preimage"]
5835
6183
  );
5836
6184
  };
5837
- var FRAGMENT16 = `
6185
+ var FRAGMENT17 = `
5838
6186
  fragment OutgoingPaymentFragment on OutgoingPayment {
5839
6187
  __typename
5840
6188
  outgoing_payment_id: id
@@ -6204,11 +6552,38 @@ var PayInvoice = `
6204
6552
  }
6205
6553
  }
6206
6554
 
6207
- ${FRAGMENT16}
6555
+ ${FRAGMENT17}
6556
+ `;
6557
+
6558
+ // src/graphql/PayUmaInvoice.ts
6559
+ var PayUmaInvoice = `
6560
+ mutation PayUmaInvoice(
6561
+ $node_id: ID!
6562
+ $encoded_invoice: String!
6563
+ $timeout_secs: Int!
6564
+ $maximum_fees_msats: Long!
6565
+ $amount_msats: Long
6566
+ ) {
6567
+ pay_uma_invoice(
6568
+ input: {
6569
+ node_id: $node_id
6570
+ encoded_invoice: $encoded_invoice
6571
+ timeout_secs: $timeout_secs
6572
+ maximum_fees_msats: $maximum_fees_msats
6573
+ amount_msats: $amount_msats
6574
+ }
6575
+ ) {
6576
+ payment {
6577
+ ...OutgoingPaymentFragment
6578
+ }
6579
+ }
6580
+ }
6581
+
6582
+ ${FRAGMENT17}
6208
6583
  `;
6209
6584
 
6210
6585
  // src/objects/PaymentRequest.ts
6211
- var import_core4 = require("@lightsparkdev/core");
6586
+ var import_core6 = require("@lightsparkdev/core");
6212
6587
  var PaymentRequestFromJson = (obj) => {
6213
6588
  if (obj["__typename"] == "Invoice") {
6214
6589
  return {
@@ -6221,12 +6596,12 @@ var PaymentRequestFromJson = (obj) => {
6221
6596
  amountPaid: !!obj["invoice_amount_paid"] ? CurrencyAmountFromJson(obj["invoice_amount_paid"]) : void 0
6222
6597
  };
6223
6598
  }
6224
- throw new import_core4.LightsparkException(
6599
+ throw new import_core6.LightsparkException(
6225
6600
  "DeserializationError",
6226
6601
  `Couldn't find a concrete type for interface PaymentRequest corresponding to the typename=${obj["__typename"]}`
6227
6602
  );
6228
6603
  };
6229
- var FRAGMENT17 = `
6604
+ var FRAGMENT18 = `
6230
6605
  fragment PaymentRequestFragment on PaymentRequest {
6231
6606
  __typename
6232
6607
  ... on Invoice {
@@ -6547,7 +6922,7 @@ query GetPaymentRequest($id: ID!) {
6547
6922
  }
6548
6923
  }
6549
6924
 
6550
- ${FRAGMENT17}
6925
+ ${FRAGMENT18}
6551
6926
  `,
6552
6927
  variables: { id },
6553
6928
  constructObject: (data) => PaymentRequestFromJson(data.entity)
@@ -6582,34 +6957,7 @@ query PaymentRequestsForNode(
6582
6957
  }
6583
6958
  }
6584
6959
 
6585
- ${FRAGMENT17}
6586
- `;
6587
-
6588
- // src/graphql/PayUmaInvoice.ts
6589
- var PayUmaInvoice = `
6590
- mutation PayUmaInvoice(
6591
- $node_id: ID!
6592
- $encoded_invoice: String!
6593
- $timeout_secs: Int!
6594
- $maximum_fees_msats: Long!
6595
- $amount_msats: Long
6596
- ) {
6597
- pay_uma_invoice(
6598
- input: {
6599
- node_id: $node_id
6600
- encoded_invoice: $encoded_invoice
6601
- timeout_secs: $timeout_secs
6602
- maximum_fees_msats: $maximum_fees_msats
6603
- amount_msats: $amount_msats
6604
- }
6605
- ) {
6606
- payment {
6607
- ...OutgoingPaymentFragment
6608
- }
6609
- }
6610
- }
6611
-
6612
- ${FRAGMENT16}
6960
+ ${FRAGMENT18}
6613
6961
  `;
6614
6962
 
6615
6963
  // src/objects/WithdrawalRequest.ts
@@ -6654,7 +7002,7 @@ var ChannelClosingTransactionFromJson = (obj) => {
6654
7002
  channelId: obj["channel_closing_transaction_channel"]?.id ?? void 0
6655
7003
  };
6656
7004
  };
6657
- var FRAGMENT18 = `
7005
+ var FRAGMENT19 = `
6658
7006
  fragment ChannelClosingTransactionFragment on ChannelClosingTransaction {
6659
7007
  __typename
6660
7008
  channel_closing_transaction_id: id
@@ -6698,7 +7046,7 @@ query GetChannelClosingTransaction($id: ID!) {
6698
7046
  }
6699
7047
  }
6700
7048
 
6701
- ${FRAGMENT18}
7049
+ ${FRAGMENT19}
6702
7050
  `,
6703
7051
  variables: { id },
6704
7052
  constructObject: (data) => ChannelClosingTransactionFromJson(data.entity)
@@ -6735,7 +7083,7 @@ var ChannelOpeningTransactionFromJson = (obj) => {
6735
7083
  channelId: obj["channel_opening_transaction_channel"]?.id ?? void 0
6736
7084
  };
6737
7085
  };
6738
- var FRAGMENT19 = `
7086
+ var FRAGMENT20 = `
6739
7087
  fragment ChannelOpeningTransactionFragment on ChannelOpeningTransaction {
6740
7088
  __typename
6741
7089
  channel_opening_transaction_id: id
@@ -6779,7 +7127,7 @@ query GetChannelOpeningTransaction($id: ID!) {
6779
7127
  }
6780
7128
  }
6781
7129
 
6782
- ${FRAGMENT19}
7130
+ ${FRAGMENT20}
6783
7131
  `,
6784
7132
  variables: { id },
6785
7133
  constructObject: (data) => ChannelOpeningTransactionFromJson(data.entity)
@@ -6948,7 +7296,7 @@ query GetWithdrawalRequest($id: ID!) {
6948
7296
  }
6949
7297
  }
6950
7298
 
6951
- ${FRAGMENT20}
7299
+ ${FRAGMENT21}
6952
7300
  `,
6953
7301
  variables: { id },
6954
7302
  constructObject: (data) => WithdrawalRequestFromJson(data.entity)
@@ -6985,7 +7333,7 @@ var WithdrawalRequestFromJson = (obj) => {
6985
7333
  obj["withdrawal_request_withdrawal"]?.id ?? void 0
6986
7334
  );
6987
7335
  };
6988
- var FRAGMENT20 = `
7336
+ var FRAGMENT21 = `
6989
7337
  fragment WithdrawalRequestFragment on WithdrawalRequest {
6990
7338
  __typename
6991
7339
  withdrawal_request_id: id
@@ -7037,7 +7385,7 @@ var RequestWithdrawal = `
7037
7385
  }
7038
7386
  }
7039
7387
 
7040
- ${FRAGMENT20}
7388
+ ${FRAGMENT21}
7041
7389
  `;
7042
7390
 
7043
7391
  // src/graphql/SendPayment.ts
@@ -7064,11 +7412,11 @@ var SendPayment = `
7064
7412
  }
7065
7413
  }
7066
7414
 
7067
- ${FRAGMENT16}
7415
+ ${FRAGMENT17}
7068
7416
  `;
7069
7417
 
7070
7418
  // src/objects/Transaction.ts
7071
- var import_core5 = require("@lightsparkdev/core");
7419
+ var import_core7 = require("@lightsparkdev/core");
7072
7420
 
7073
7421
  // src/objects/RoutingTransactionFailureReason.ts
7074
7422
  var RoutingTransactionFailureReason = /* @__PURE__ */ ((RoutingTransactionFailureReason2) => {
@@ -7212,12 +7560,12 @@ var TransactionFromJson = (obj) => {
7212
7560
  numConfirmations: obj["withdrawal_num_confirmations"]
7213
7561
  };
7214
7562
  }
7215
- throw new import_core5.LightsparkException(
7563
+ throw new import_core7.LightsparkException(
7216
7564
  "DeserializationError",
7217
7565
  `Couldn't find a concrete type for interface Transaction corresponding to the typename=${obj["__typename"]}`
7218
7566
  );
7219
7567
  };
7220
- var FRAGMENT21 = `
7568
+ var FRAGMENT22 = `
7221
7569
  fragment TransactionFragment on Transaction {
7222
7570
  __typename
7223
7571
  ... on ChannelClosingTransaction {
@@ -7774,7 +8122,7 @@ query GetTransaction($id: ID!) {
7774
8122
  }
7775
8123
  }
7776
8124
 
7777
- ${FRAGMENT21}
8125
+ ${FRAGMENT22}
7778
8126
  `,
7779
8127
  variables: { id },
7780
8128
  constructObject: (data) => TransactionFromJson(data.entity)
@@ -7855,304 +8203,128 @@ query SingleNodeDashboard(
7855
8203
  }
7856
8204
  unconfirmed_balance {
7857
8205
  ...CurrencyAmountFragment
7858
- }
7859
- confirmed_balance {
7860
- ...CurrencyAmountFragment
7861
- }
7862
- __typename
7863
- }
7864
- local_balance(bitcoin_networks: [$network], node_ids: [$nodeId]) {
7865
- ...CurrencyAmountFragment
7866
- }
7867
- remote_balance(bitcoin_networks: [$network], node_ids: [$nodeId]) {
7868
- ...CurrencyAmountFragment
7869
- }
7870
- recent_transactions: transactions(
7871
- first: $numTransactions
7872
- types: $transactionTypes
7873
- bitcoin_network: $network
7874
- lightning_node_id: $nodeId
7875
- statuses: $transaction_statuses
7876
- after_date: $transactionsAfterDate
7877
- ) {
7878
- count
7879
- total_amount_transacted {
7880
- ...CurrencyAmountFragment
7881
- }
7882
- entities {
7883
- ...TransactionFragment
7884
- __typename
7885
- }
7886
- __typename
7887
- }
7888
- __typename
7889
- }
7890
- }
7891
-
7892
- ${FRAGMENT21}
7893
- ${FRAGMENT}
7894
- `;
7895
-
7896
- // src/graphql/TransactionsForNode.ts
7897
- var TransactionsForNode = `
7898
- query TransactionsForNode(
7899
- $network: BitcoinNetwork!,
7900
- $nodeId: ID!,
7901
- $numTransactions: Int,
7902
- $afterDate: DateTime,
7903
- $transactionTypes: [TransactionType!] = [PAYMENT, PAYMENT_REQUEST, ROUTE, L1_WITHDRAW, L1_DEPOSIT]
7904
- $transaction_statuses: [TransactionStatus!] = null
7905
- ) {
7906
- current_account {
7907
- id
7908
- name
7909
- recent_transactions: transactions(
7910
- first: $numTransactions
7911
- types: $transactionTypes
7912
- bitcoin_network: $network
7913
- lightning_node_id: $nodeId
7914
- statuses: $transaction_statuses
7915
- after_date: $afterDate
7916
- ) {
7917
- count
7918
- total_amount_transacted {
7919
- ...CurrencyAmountFragment
7920
- }
7921
- entities {
7922
- ...TransactionFragment
7923
- __typename
7924
- }
7925
- __typename
7926
- }
7927
- __typename
7928
- }
7929
- }
7930
-
7931
- ${FRAGMENT21}
7932
- ${FRAGMENT}
7933
- `;
7934
-
7935
- // src/objects/TransactionUpdate.ts
7936
- var TransactionUpdateFromJson = (obj) => {
7937
- return {
7938
- id: obj["id"],
7939
- createdAt: obj["created_at"],
7940
- updatedAt: obj["updated_at"],
7941
- status: TransactionStatus_default[obj["status"]] ?? TransactionStatus_default.FUTURE_VALUE,
7942
- amount: CurrencyAmountFromJson(obj["amount"]),
7943
- typename: obj["__typename"] ?? "TransactionUpdate",
7944
- resolvedAt: obj["resolved_at"],
7945
- transactionHash: obj["transaction_hash"]
7946
- };
7947
- };
7948
- var FRAGMENT22 = `
7949
- fragment TransactionUpdateFragment on Transaction {
7950
- __typename
7951
- id
7952
- created_at
7953
- updated_at
7954
- status
7955
- resolved_at
7956
- amount {
7957
- __typename
7958
- currency_amount_original_value: original_value
7959
- currency_amount_original_unit: original_unit
7960
- currency_amount_preferred_currency_unit: preferred_currency_unit
7961
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
7962
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
7963
- }
7964
- transaction_hash
7965
- }`;
7966
-
7967
- // src/graphql/TransactionSubscription.ts
7968
- var TransactionSubscription = `
7969
- subscription TransactionSubscription(
7970
- $nodeIds: [ID!]!
7971
- ) {
7972
- transactions(node_ids: $nodeIds) {
7973
- ...TransactionUpdateFragment
7974
- __typename
7975
- }
7976
- }
7977
-
7978
- ${FRAGMENT22}
7979
- `;
7980
-
7981
- // src/NodeKeyLoaderCache.ts
7982
- var import_core7 = require("@lightsparkdev/core");
7983
-
7984
- // src/SigningKeyLoader.ts
7985
- var import_core6 = require("@lightsparkdev/core");
7986
-
7987
- // src/graphql/RecoverNodeSigningKey.ts
7988
- var RecoverNodeSigningKey = `
7989
- query RecoverNodeSigningKey($nodeId: ID!) {
7990
- entity(id: $nodeId) {
7991
- __typename
7992
- ... on LightsparkNodeWithOSK {
7993
- encrypted_signing_private_key {
7994
- encrypted_value
7995
- cipher
7996
- }
7997
- }
7998
- }
7999
- }
8000
- `;
8001
-
8002
- // src/SigningKeyLoader.ts
8003
- var SIGNING_KEY_PATH = "m/5";
8004
- function isNodeIdAndPasswordSigningKeyLoaderArgs(args) {
8005
- return args.password !== void 0;
8006
- }
8007
- function isMasterSeedSigningKeyLoaderArgs(args) {
8008
- return args.masterSeed !== void 0;
8009
- }
8010
- var NodeIdAndPasswordSigningKeyLoader = class {
8011
- nodeId;
8012
- password;
8013
- requester;
8014
- cryptoImpl;
8015
- constructor(args, requester, cryptoImpl) {
8016
- this.nodeId = args.nodeId;
8017
- this.password = args.password;
8018
- this.requester = requester;
8019
- this.cryptoImpl = cryptoImpl;
8020
- }
8021
- async loadSigningKey() {
8022
- const encryptedKey = await this.recoverNodeSigningKey();
8023
- if (!encryptedKey) {
8024
- console.warn("No encrypted key found for node " + this.nodeId);
8025
- return;
8026
- }
8027
- const signingPrivateKey = await this.cryptoImpl.decryptSecretWithNodePassword(
8028
- encryptedKey.cipher,
8029
- encryptedKey.encrypted_value,
8030
- this.password
8031
- );
8032
- if (!signingPrivateKey) {
8033
- throw new import_core6.LightsparkSigningException(
8034
- "Unable to decrypt signing key with provided password. Please try again."
8035
- );
8036
- }
8037
- let signingPrivateKeyPEM = "";
8038
- if (new Uint8Array(signingPrivateKey)[0] === 48) {
8039
- signingPrivateKeyPEM = (0, import_core6.b64encode)(signingPrivateKey);
8040
- } else {
8041
- const dec = new TextDecoder();
8042
- signingPrivateKeyPEM = dec.decode(signingPrivateKey);
8043
- }
8044
- return { key: signingPrivateKeyPEM, type: import_core6.SigningKeyType.RSASigningKey };
8045
- }
8046
- async recoverNodeSigningKey() {
8047
- const response = await this.requester.makeRawRequest(
8048
- RecoverNodeSigningKey,
8049
- { nodeId: this.nodeId }
8050
- );
8051
- const nodeEntity = response.entity;
8052
- if (nodeEntity?.__typename === "LightsparkNodeWithOSK") {
8053
- return nodeEntity.encrypted_signing_private_key;
8054
- }
8055
- return null;
8056
- }
8057
- };
8058
- var MasterSeedSigningKeyLoader = class {
8059
- masterSeed;
8060
- network;
8061
- constructor(args) {
8062
- this.masterSeed = args.masterSeed;
8063
- this.network = args.network;
8064
- }
8065
- async loadSigningKey() {
8066
- if (import_core6.isBrowser) {
8067
- throw new import_core6.LightsparkSigningException(
8068
- "Browser environments not supported for master seed signing key loader."
8069
- );
8070
- }
8071
- const { LightsparkSigner, Network } = await import("@lightsparkdev/crypto-wasm");
8072
- let cryptoLibNetwork;
8073
- switch (this.network) {
8074
- case BitcoinNetwork_default.MAINNET:
8075
- cryptoLibNetwork = Network.Bitcoin;
8076
- break;
8077
- case BitcoinNetwork_default.TESTNET:
8078
- cryptoLibNetwork = Network.Testnet;
8079
- break;
8080
- case BitcoinNetwork_default.REGTEST:
8081
- cryptoLibNetwork = Network.Regtest;
8082
- break;
8083
- default:
8084
- throw new Error(
8085
- `Unsupported lightspark_crypto network ${this.network}.`
8086
- );
8087
- }
8088
- const lightsparkSigner = LightsparkSigner.from_bytes(
8089
- this.masterSeed,
8090
- cryptoLibNetwork
8091
- );
8092
- const privateKey = lightsparkSigner.derive_private_key(SIGNING_KEY_PATH);
8093
- return { key: privateKey, type: import_core6.SigningKeyType.Secp256k1SigningKey };
8094
- }
8095
- };
8096
-
8097
- // src/NodeKeyLoaderCache.ts
8098
- var NodeKeyLoaderCache = class {
8099
- constructor(nodeKeyCache, cryptoImpl = import_core7.DefaultCrypto) {
8100
- this.nodeKeyCache = nodeKeyCache;
8101
- this.cryptoImpl = cryptoImpl;
8102
- this.idToLoader = /* @__PURE__ */ new Map();
8103
- }
8104
- idToLoader;
8105
- /**
8106
- * Sets the signing key loader for a node.
8107
- * Instantiates a signing key loader based on the type of args passed in by the user.
8108
- *
8109
- * @param nodeId The ID of the node to get the key for
8110
- * @param loaderArgs Loader arguments for loading the key
8111
- * @param requester Requester used for loading the key
8112
- */
8113
- setLoader(nodeId, loaderArgs, requester) {
8114
- let loader;
8115
- if (isNodeIdAndPasswordSigningKeyLoaderArgs(loaderArgs)) {
8116
- loader = new NodeIdAndPasswordSigningKeyLoader(
8117
- { nodeId, ...loaderArgs },
8118
- requester,
8119
- this.cryptoImpl
8120
- );
8121
- } else if (isMasterSeedSigningKeyLoaderArgs(loaderArgs)) {
8122
- loader = new MasterSeedSigningKeyLoader({ ...loaderArgs });
8123
- } else {
8124
- throw new import_core7.LightsparkSigningException("Invalid signing key loader args");
8206
+ }
8207
+ confirmed_balance {
8208
+ ...CurrencyAmountFragment
8209
+ }
8210
+ __typename
8211
+ }
8212
+ local_balance(bitcoin_networks: [$network], node_ids: [$nodeId]) {
8213
+ ...CurrencyAmountFragment
8214
+ }
8215
+ remote_balance(bitcoin_networks: [$network], node_ids: [$nodeId]) {
8216
+ ...CurrencyAmountFragment
8217
+ }
8218
+ recent_transactions: transactions(
8219
+ first: $numTransactions
8220
+ types: $transactionTypes
8221
+ bitcoin_network: $network
8222
+ lightning_node_id: $nodeId
8223
+ statuses: $transaction_statuses
8224
+ after_date: $transactionsAfterDate
8225
+ ) {
8226
+ count
8227
+ total_amount_transacted {
8228
+ ...CurrencyAmountFragment
8229
+ }
8230
+ entities {
8231
+ ...TransactionFragment
8232
+ __typename
8233
+ }
8234
+ __typename
8235
+ }
8236
+ __typename
8125
8237
  }
8126
- this.idToLoader.set(nodeId, loader);
8127
- }
8128
- /**
8129
- * Gets the key for a node using the loader set by [setLoader]
8130
- *
8131
- * @param id The ID of the node to get the key for
8132
- * @returns The loaded key
8133
- */
8134
- async getKeyWithLoader(id) {
8135
- if (this.nodeKeyCache.hasKey(id)) {
8136
- return this.nodeKeyCache.getKey(id);
8238
+ }
8239
+
8240
+ ${FRAGMENT22}
8241
+ ${FRAGMENT}
8242
+ `;
8243
+
8244
+ // src/objects/TransactionUpdate.ts
8245
+ var TransactionUpdateFromJson = (obj) => {
8246
+ return {
8247
+ id: obj["id"],
8248
+ createdAt: obj["created_at"],
8249
+ updatedAt: obj["updated_at"],
8250
+ status: TransactionStatus_default[obj["status"]] ?? TransactionStatus_default.FUTURE_VALUE,
8251
+ amount: CurrencyAmountFromJson(obj["amount"]),
8252
+ typename: obj["__typename"] ?? "TransactionUpdate",
8253
+ resolvedAt: obj["resolved_at"],
8254
+ transactionHash: obj["transaction_hash"]
8255
+ };
8256
+ };
8257
+ var FRAGMENT23 = `
8258
+ fragment TransactionUpdateFragment on Transaction {
8259
+ __typename
8260
+ id
8261
+ created_at
8262
+ updated_at
8263
+ status
8264
+ resolved_at
8265
+ amount {
8266
+ __typename
8267
+ currency_amount_original_value: original_value
8268
+ currency_amount_original_unit: original_unit
8269
+ currency_amount_preferred_currency_unit: preferred_currency_unit
8270
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8271
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8137
8272
  }
8138
- const loader = this.idToLoader.get(id);
8139
- if (!loader) {
8140
- throw new import_core7.LightsparkSigningException(
8141
- "No signing key loader found for node " + id
8142
- );
8273
+ transaction_hash
8274
+ }`;
8275
+
8276
+ // src/graphql/TransactionSubscription.ts
8277
+ var TransactionSubscription = `
8278
+ subscription TransactionSubscription(
8279
+ $nodeIds: [ID!]!
8280
+ ) {
8281
+ transactions(node_ids: $nodeIds) {
8282
+ ...TransactionUpdateFragment
8283
+ __typename
8143
8284
  }
8144
- const loaderResult = await loader.loadSigningKey();
8145
- if (!loaderResult) {
8146
- return;
8285
+ }
8286
+
8287
+ ${FRAGMENT23}
8288
+ `;
8289
+
8290
+ // src/graphql/TransactionsForNode.ts
8291
+ var TransactionsForNode = `
8292
+ query TransactionsForNode(
8293
+ $network: BitcoinNetwork!,
8294
+ $nodeId: ID!,
8295
+ $numTransactions: Int,
8296
+ $afterDate: DateTime,
8297
+ $transactionTypes: [TransactionType!] = [PAYMENT, PAYMENT_REQUEST, ROUTE, L1_WITHDRAW, L1_DEPOSIT]
8298
+ $transaction_statuses: [TransactionStatus!] = null
8299
+ ) {
8300
+ current_account {
8301
+ id
8302
+ name
8303
+ recent_transactions: transactions(
8304
+ first: $numTransactions
8305
+ types: $transactionTypes
8306
+ bitcoin_network: $network
8307
+ lightning_node_id: $nodeId
8308
+ statuses: $transaction_statuses
8309
+ after_date: $afterDate
8310
+ ) {
8311
+ count
8312
+ total_amount_transacted {
8313
+ ...CurrencyAmountFragment
8314
+ }
8315
+ entities {
8316
+ ...TransactionFragment
8317
+ __typename
8318
+ }
8319
+ __typename
8320
+ }
8321
+ __typename
8147
8322
  }
8148
- const key = await this.nodeKeyCache.loadKey(
8149
- id,
8150
- { key: loaderResult.key },
8151
- loaderResult.type
8152
- );
8153
- return key || void 0;
8154
- }
8155
- };
8323
+ }
8324
+
8325
+ ${FRAGMENT22}
8326
+ ${FRAGMENT}
8327
+ `;
8156
8328
 
8157
8329
  // src/objects/Account.ts
8158
8330
  var import_auto_bind12 = __toESM(require("auto-bind"), 1);
@@ -8275,7 +8447,7 @@ var LightsparkNodeFromJson = (obj) => {
8275
8447
  `Couldn't find a concrete type for interface LightsparkNode corresponding to the typename=${obj["__typename"]}`
8276
8448
  );
8277
8449
  };
8278
- var FRAGMENT23 = `
8450
+ var FRAGMENT24 = `
8279
8451
  fragment LightsparkNodeFragment on LightsparkNode {
8280
8452
  __typename
8281
8453
  ... on LightsparkNodeWithOSK {
@@ -8549,7 +8721,7 @@ query GetLightsparkNode($id: ID!) {
8549
8721
  }
8550
8722
  }
8551
8723
 
8552
- ${FRAGMENT23}
8724
+ ${FRAGMENT24}
8553
8725
  `,
8554
8726
  variables: { id },
8555
8727
  constructObject: (data) => LightsparkNodeFromJson(data.entity)
@@ -9659,7 +9831,7 @@ query GetWallet($id: ID!) {
9659
9831
  }
9660
9832
  }
9661
9833
 
9662
- ${FRAGMENT24}
9834
+ ${FRAGMENT25}
9663
9835
  `,
9664
9836
  variables: { id },
9665
9837
  constructObject: (data) => WalletFromJson(data.entity)
@@ -9692,7 +9864,7 @@ var WalletFromJson = (obj) => {
9692
9864
  obj["wallet_account"]?.id ?? void 0
9693
9865
  );
9694
9866
  };
9695
- var FRAGMENT24 = `
9867
+ var FRAGMENT25 = `
9696
9868
  fragment WalletFragment on Wallet {
9697
9869
  __typename
9698
9870
  wallet_id: id
@@ -11397,7 +11569,7 @@ query GetAccount {
11397
11569
  }
11398
11570
  }
11399
11571
 
11400
- ${FRAGMENT25}
11572
+ ${FRAGMENT26}
11401
11573
  `,
11402
11574
  variables: {},
11403
11575
  constructObject: (data) => AccountFromJson(data.current_account)
@@ -11422,7 +11594,7 @@ var AccountFromJson = (obj) => {
11422
11594
  obj["account_name"]
11423
11595
  );
11424
11596
  };
11425
- var FRAGMENT25 = `
11597
+ var FRAGMENT26 = `
11426
11598
  fragment AccountFragment on Account {
11427
11599
  __typename
11428
11600
  account_id: id
@@ -11452,7 +11624,8 @@ var LightsparkClient = class {
11452
11624
  * use, you should use the `AccountTokenAuthProvider`.
11453
11625
  * @param serverUrl The base URL of the server to connect to. Defaults to lightspark production.
11454
11626
  * @param cryptoImpl The crypto implementation to use. Defaults to web and node compatible crypto.
11455
- * For React Native, you should use the `ReactNativeCrypto` implementation from `@lightsparkdev/react-native`.
11627
+ * For React Native, you should use the `ReactNativeCrypto`
11628
+ * implementation from `@lightsparkdev/react-native`.
11456
11629
  */
11457
11630
  constructor(authProvider = new import_core9.StubAuthProvider(), serverUrl = "api.lightspark.com", cryptoImpl = import_core9.DefaultCrypto) {
11458
11631
  this.authProvider = authProvider;
@@ -11478,9 +11651,11 @@ var LightsparkClient = class {
11478
11651
  nodeKeyLoaderCache;
11479
11652
  LIGHTSPARK_SDK_ENDPOINT = process.env.LIGHTSPARK_SDK_ENDPOINT || "graphql/server/2023-09-13";
11480
11653
  /**
11481
- * Sets the key loader for a node. This unlocks client operations that require a private key.
11482
- * Passing in [NodeIdAndPasswordSigningKeyLoaderArgs] loads the RSA key for an OSK node.
11483
- * Passing in [MasterSeedSigningKeyLoaderArgs] loads the Secp256k1 key for a remote signing node.
11654
+ * Sets the key loader for a node. This unlocks client operations that
11655
+ * require a private key. Passing in [NodeIdAndPasswordSigningKeyLoaderArgs]
11656
+ * loads the RSA key for an OSK node.
11657
+ * Passing in [MasterSeedSigningKeyLoaderArgs] loads the Secp256k1 key for a
11658
+ * remote signing node.
11484
11659
  *
11485
11660
  * @param nodeId The ID of the node the key is for
11486
11661
  * @param loader The loader for the key
@@ -11491,7 +11666,8 @@ var LightsparkClient = class {
11491
11666
  return !!key;
11492
11667
  }
11493
11668
  /**
11494
- * Gets the signing key for a node. Must have previously called [loadNodeSigningKey].
11669
+ * Gets the signing key for a node. Must have previously called
11670
+ * [loadNodeSigningKey].
11495
11671
  *
11496
11672
  * @param nodeId The ID of the node the key is for
11497
11673
  * @returns The signing key for the node
@@ -11500,7 +11676,8 @@ var LightsparkClient = class {
11500
11676
  return await this.nodeKeyLoaderCache.getKeyWithLoader(nodeId);
11501
11677
  }
11502
11678
  /**
11503
- * Sets the auth provider for the client. This is useful for switching between auth providers if you are using
11679
+ * Sets the auth provider for the client.
11680
+ * This is useful for switching between auth providers if you are using
11504
11681
  * multiple accounts or waiting for the user to log in.
11505
11682
  *
11506
11683
  * @param authProvider
@@ -11579,7 +11756,8 @@ var LightsparkClient = class {
11579
11756
  ) ?? [];
11580
11757
  }
11581
11758
  /**
11582
- * Starts listening for new transactions or updates to existing transactions for a list of nodes.
11759
+ * Starts listening for new transactions or updates to existing transactions
11760
+ * for a list of nodes.
11583
11761
  *
11584
11762
  * @param nodeIds The node IDs for which to listen to transactions.
11585
11763
  * @returns A zen-observable that emits transaction updates for the given node IDs.
@@ -11596,8 +11774,8 @@ var LightsparkClient = class {
11596
11774
  );
11597
11775
  }
11598
11776
  /**
11599
- * Retrieves a dashboard of basic info for the authenticated account. See `AccountDashboard` for which info is
11600
- * included.
11777
+ * Retrieves a dashboard of basic info for the authenticated account.
11778
+ * See `AccountDashboard` for which info is included.
11601
11779
  *
11602
11780
  * @param nodeIds The node IDs to include in the dashboard. Defaults to undefined (all nodes).
11603
11781
  * @param bitcoinNetwork The bitcoin network to include in the dashboard. Defaults to MAINNET.
@@ -11664,8 +11842,8 @@ var LightsparkClient = class {
11664
11842
  };
11665
11843
  }
11666
11844
  /**
11667
- * Gets a basic dashboard for a single node, including recent transactions. See `SingleNodeDashboard` for which info is
11668
- * included.
11845
+ * Gets a basic dashboard for a single node, including recent transactions.
11846
+ * See `SingleNodeDashboard` for which info is included.
11669
11847
  *
11670
11848
  * @param nodeId The node ID for which to get a dashboard.
11671
11849
  * @param bitcoinNetwork The bitcoin network for which to get a dashboard. Defaults to MAINNET.
@@ -11736,7 +11914,8 @@ var LightsparkClient = class {
11736
11914
  /**
11737
11915
  * Creates an invoice for the given node.
11738
11916
  *
11739
- * Test mode note: You can simulate a payment of this invoice in test move using [createTestModePayment].
11917
+ * Test mode note: You can simulate a payment of this invoice in test move
11918
+ * using [createTestModePayment].
11740
11919
  *
11741
11920
  * @param nodeId The node ID for which to create an invoice.
11742
11921
  * @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount.
@@ -11764,11 +11943,13 @@ var LightsparkClient = class {
11764
11943
  return response.create_invoice?.invoice.data?.encoded_payment_request;
11765
11944
  }
11766
11945
  /**
11767
- * Generates a Lightning Invoice (follows the Bolt 11 specification) to request a payment
11768
- * from another Lightning Node. This should only be used for generating invoices for LNURLs,
11946
+ * Generates a Lightning Invoice (follows the Bolt 11 specification) to
11947
+ * request a payment from another Lightning Node.
11948
+ * This should only be used for generating invoices for LNURLs,
11769
11949
  * with [createInvoice] preferred in the general case.
11770
11950
  *
11771
- * Test mode note: You can simulate a payment of this invoice in test move using [createTestModePayment].
11951
+ * Test mode note: You can simulate a payment of this invoice in test move
11952
+ * using [createTestModePayment].
11772
11953
  *
11773
11954
  * @param nodeId The node ID for which to create an invoice.
11774
11955
  * @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount.
@@ -11799,10 +11980,12 @@ var LightsparkClient = class {
11799
11980
  return InvoiceFromJson(invoiceJson);
11800
11981
  }
11801
11982
  /**
11802
- * Creates a new invoice for the UMA protocol. The metadata is hashed and included in the invoice.
11803
- * This API generates a Lightning Invoice (follows the Bolt 11 specification) to request a payment
11804
- * from another Lightning Node. This should only be used for generating invoices for UMA, with `createInvoice`
11805
- * preferred in the general case.
11983
+ * Creates a new invoice for the UMA protocol.
11984
+ * The metadata is hashed and included in the invoice.
11985
+ * This API generates a Lightning Invoice (follows the Bolt 11 specification)
11986
+ * to request a payment from another Lightning Node.
11987
+ * This should only be used for generating invoices for UMA,
11988
+ * with `createInvoice` preferred in the general case.
11806
11989
  *
11807
11990
  * @param nodeId The node ID for which to create an invoice.
11808
11991
  * @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount.
@@ -11843,7 +12026,8 @@ var LightsparkClient = class {
11843
12026
  return InvoiceDataFromJson(response.decoded_payment_request);
11844
12027
  }
11845
12028
  /**
11846
- * Gets an estimate of the fee for sending a payment over the given bitcoin network.
12029
+ * Gets an estimate of the fee for sending a payment over the given bitcoin
12030
+ * network.
11847
12031
  *
11848
12032
  * @param bitcoinNetwork The bitcoin network for which to get a fee estimate. Defaults to MAINNET.
11849
12033
  * @returns A fee estimate for the given bitcoin network including a minimum fee rate, and a max-speed fee rate.
@@ -11880,7 +12064,8 @@ var LightsparkClient = class {
11880
12064
  );
11881
12065
  }
11882
12066
  /**
11883
- * Returns an estimate of the fees that will be paid to send a payment to another Lightning node.
12067
+ * Returns an estimate of the fees that will be paid to send a payment to
12068
+ * another Lightning node.
11884
12069
  *
11885
12070
  * @param nodeId The node from where you want to send the payment.
11886
12071
  * @param destinationNodePublicKey The public key of the node that you want to pay.
@@ -11916,17 +12101,20 @@ var LightsparkClient = class {
11916
12101
  /**
11917
12102
  * Sends a lightning payment for a given invoice.
11918
12103
  *
11919
- * Test mode note: For test mode, you can use the [createTestModeInvoice] function to create an invoice you can
11920
- * pay in test mode.
12104
+ * Test mode note: For test mode, you can use the [createTestModeInvoice]
12105
+ * function to create an invoice you can pay in test mode.
11921
12106
  *
11922
12107
  * @param payerNodeId The ID of the node that will pay the invoice.
11923
12108
  * @param encodedInvoice The encoded invoice to pay.
11924
12109
  * @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required.
11925
- * As guidance, a maximum fee of 16 basis points should make almost all transactions succeed. For example,
11926
- * for a transaction between 10k sats and 100k sats, this would mean a fee limit of 16 to 160 sats.
12110
+ * As guidance, a maximum fee of 16 basis points should make almost all
12111
+ * transactions succeed. For example,
12112
+ * for a transaction between 10k sats and 100k sats,
12113
+ * this would mean a fee limit of 16 to 160 sats.
11927
12114
  * @param timeoutSecs A timeout for the payment in seconds. Defaults to 60 seconds.
11928
12115
  * @param amountMsats The amount to pay in msats for a zero-amount invoice. Defaults to the full amount of the
11929
- * invoice. NOTE: This parameter can only be passed for a zero-amount invoice. Otherwise, the call will fail.
12116
+ * invoice. NOTE: This parameter can only be passed for a zero-amount
12117
+ * invoice. Otherwise, the call will fail.
11930
12118
  * @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed.
11931
12119
  */
11932
12120
  async payInvoice(payerNodeId, encodedInvoice, maximumFeesMsats, timeoutSecs = 60, amountMsats = void 0) {
@@ -11956,18 +12144,23 @@ var LightsparkClient = class {
11956
12144
  return response.pay_invoice && OutgoingPaymentFromJson(response.pay_invoice.payment);
11957
12145
  }
11958
12146
  /**
11959
- * sends an UMA payment to a node on the Lightning Network, based on the invoice
11960
- * (as defined by the BOLT11 specification) that you provide.
11961
- * This should only be used for paying UMA invoices, with `payInvoice` preferred in the general case.
12147
+ * sends an UMA payment to a node on the Lightning Network,
12148
+ * based on the invoice (as defined by the BOLT11 specification) that you
12149
+ * provide.
12150
+ * This should only be used for paying UMA invoices,
12151
+ * with `payInvoice` preferred in the general case.
11962
12152
  *
11963
12153
  * @param payerNodeId The ID of the node that will pay the invoice.
11964
12154
  * @param encodedInvoice The encoded invoice to pay.
11965
12155
  * @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required.
11966
- * As guidance, a maximum fee of 16 basis points should make almost all transactions succeed. For example,
11967
- * for a transaction between 10k sats and 100k sats, this would mean a fee limit of 16 to 160 sats.
12156
+ * As guidance, a maximum fee of 16 basis points should make almost all
12157
+ * transactions succeed. For example,
12158
+ * for a transaction between 10k sats and 100k sats,
12159
+ * this would mean a fee limit of 16 to 160 sats.
11968
12160
  * @param timeoutSecs A timeout for the payment in seconds. Defaults to 60 seconds.
11969
12161
  * @param amountMsats The amount to pay in msats for a zero-amount invoice. Defaults to the full amount of the
11970
- * invoice. NOTE: This parameter can only be passed for a zero-amount invoice. Otherwise, the call will fail.
12162
+ * invoice. NOTE: This parameter can only be passed for a zero-amount
12163
+ * invoice. Otherwise, the call will fail.
11971
12164
  * @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed.
11972
12165
  */
11973
12166
  async payUmaInvoice(payerNodeId, encodedInvoice, maximumFeesMsats, timeoutSecs = 60, amountMsats = void 0) {
@@ -11997,7 +12190,8 @@ var LightsparkClient = class {
11997
12190
  return response.pay_uma_invoice && OutgoingPaymentFromJson(response.pay_invoice.payment);
11998
12191
  }
11999
12192
  /**
12000
- * Waits for a transaction to have a completed status, and returns the transaction.
12193
+ * Waits for a transaction to have a completed status, and returns the
12194
+ * transaction.
12001
12195
  *
12002
12196
  * @param transactionId The ID of the transaction to wait for
12003
12197
  * @param pollTimeoutSecs The timeout in seconds that we will wait before throwing an exception
@@ -12034,15 +12228,18 @@ var LightsparkClient = class {
12034
12228
  return transaction;
12035
12229
  }
12036
12230
  /**
12037
- * Sends a payment directly to a node on the Lightning Network through the public key of the node without an invoice.
12231
+ * Sends a payment directly to a node on the Lightning Network through the
12232
+ * public key of the node without an invoice.
12038
12233
  *
12039
12234
  * @param payerNodeId The ID of the node that will send the payment.
12040
12235
  * @param destinationPublicKey The public key of the destination node.
12041
12236
  * @param timeoutSecs The timeout in seconds that we will try to make the payment.
12042
12237
  * @param amountMsats The amount to pay in msats.
12043
12238
  * @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required.
12044
- * As guidance, a maximum fee of 15 basis points should make almost all transactions succeed. For example,
12045
- * for a transaction between 10k sats and 100k sats, this would mean a fee limit of 15 to 150 sats.
12239
+ * As guidance, a maximum fee of 15 basis points should make almost all
12240
+ * transactions succeed. For example,
12241
+ * for a transaction between 10k sats and 100k sats,
12242
+ * this would mean a fee limit of 15 to 150 sats.
12046
12243
  * @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed.
12047
12244
  */
12048
12245
  async sendPayment(payerNodeId, destinationPublicKey, timeoutSecs = 60, amountMsats, maximumFeesMsats) {
@@ -12069,7 +12266,8 @@ var LightsparkClient = class {
12069
12266
  return response.send_payment && OutgoingPaymentFromJson(response.send_payment.payment);
12070
12267
  }
12071
12268
  /**
12072
- * Creates an L1 Bitcoin wallet address for a given node which can be used to deposit or withdraw funds.
12269
+ * Creates an L1 Bitcoin wallet address for a given node which can be used to
12270
+ * deposit or withdraw funds.
12073
12271
  *
12074
12272
  * @param nodeId The ID of the node to create a wallet address for.
12075
12273
  * @returns A string containing the wallet address for the given node.
@@ -12082,12 +12280,15 @@ var LightsparkClient = class {
12082
12280
  return response.create_node_wallet_address.wallet_address;
12083
12281
  }
12084
12282
  /**
12085
- * Withdraws funds from the account and sends it to the requested bitcoin address.
12283
+ * Withdraws funds from the account and sends it to the requested bitcoin
12284
+ * address.
12086
12285
  *
12087
- * Depending on the chosen mode, it will first take the funds from the wallet, and if applicable, close channels
12088
- * appropriately to recover enough funds and reopen channels with the remaining funds.
12089
- * The process is asynchronous and may take up to a few minutes. You can check the progress by polling the
12090
- * `WithdrawalRequest` that is created, or by subscribing to a webhook.
12286
+ * Depending on the chosen mode, it will first take the funds from the
12287
+ * wallet, and if applicable, close channels appropriately to recover enough
12288
+ * funds and reopen channels with the remaining funds.
12289
+ * The process is asynchronous and may take up to a few minutes.
12290
+ * You can check the progress by polling the `WithdrawalRequest` that is
12291
+ * created, or by subscribing to a webhook.
12091
12292
  *
12092
12293
  * @param nodeId The ID of the node from which to withdraw funds.
12093
12294
  * @param amountSats The amount of funds to withdraw in satoshis.
@@ -12108,9 +12309,10 @@ var LightsparkClient = class {
12108
12309
  return WithdrawalRequestFromJson(response.request_withdrawal.request);
12109
12310
  }
12110
12311
  /**
12111
- * Adds funds to a Lightspark node on the REGTEST network. If the amount is not specified, 10,000,000 SATOSHI will be
12112
- * added. This API only functions for nodes created on the REGTEST network and will return an error when called for
12113
- * any non-REGTEST node.
12312
+ * Adds funds to a Lightspark node on the REGTEST network.
12313
+ * If the amount is not specified, 10,000,000 SATOSHI will be added.
12314
+ * This API only functions for nodes created on the REGTEST network and will
12315
+ * return an error when called for any non-REGTEST node.
12114
12316
  *
12115
12317
  * @param nodeId The ID of the node to fund. Must be a REGTEST node.
12116
12318
  * @param amountSats The amount of funds to add to the node in satoshis. Defaults to 10,000,000 SATOSHI.
@@ -12124,8 +12326,8 @@ var LightsparkClient = class {
12124
12326
  return CurrencyAmountFromJson(response.fund_node.amount);
12125
12327
  }
12126
12328
  /**
12127
- * Creates a new API token that can be used to authenticate requests for this account when using the Lightspark APIs
12128
- * and SDKs.
12329
+ * Creates a new API token that can be used to authenticate requests for this
12330
+ * account when using the Lightspark APIs and SDKs.
12129
12331
  *
12130
12332
  * @param name Creates a new API token that can be used to authenticate requests for this account when using the
12131
12333
  * Lightspark APIs and SDKs.
@@ -12162,8 +12364,9 @@ var LightsparkClient = class {
12162
12364
  await this.requester.makeRawRequest(DeleteApiToken, { api_token_id: id });
12163
12365
  }
12164
12366
  /**
12165
- * In test mode, generates a Lightning Invoice which can be paid by a local node.
12166
- * This call is only valid in test mode. You can then pay the invoice using [payInvoice].
12367
+ * In test mode, generates a Lightning Invoice which can be paid by a local
12368
+ * node. This call is only valid in test mode.
12369
+ * You can then pay the invoice using [payInvoice].
12167
12370
  *
12168
12371
  * @param localNodeId The ID of the node that will pay the invoice.
12169
12372
  * @param amountMsats The amount to pay in milli-satoshis.
@@ -12192,8 +12395,9 @@ var LightsparkClient = class {
12192
12395
  });
12193
12396
  }
12194
12397
  /**
12195
- * In test mode, simulates a payment of a Lightning Invoice from another node.
12196
- * This can only be used in test mode and should be used with invoices generated by [createInvoice].
12398
+ * In test mode, simulates a payment of a Lightning Invoice from another
12399
+ * node. This can only be used in test mode and should be used with invoices
12400
+ * generated by [createInvoice].
12197
12401
  *
12198
12402
  * @param localNodeId The ID of the node that will receive the payment.
12199
12403
  * @param encodedInvoice The encoded invoice to pay.
@@ -12215,10 +12419,156 @@ var LightsparkClient = class {
12215
12419
  }
12216
12420
  });
12217
12421
  }
12422
+ /**
12423
+ * Creates an UMA invitation. If you are part of the incentive program,
12424
+ * you should use [createUmaInvitationWithIncentives].
12425
+ *
12426
+ * @param inviterUma The UMA of the inviter.
12427
+ * @returns The invitation that was created.
12428
+ */
12429
+ async createUmaInvitation(inviterUma) {
12430
+ return await this.executeRawQuery({
12431
+ queryPayload: CreateUmaInvitation,
12432
+ variables: {
12433
+ inviterUma
12434
+ },
12435
+ constructObject: (responseJson) => {
12436
+ if (!responseJson.create_uma_invitation?.invitation) {
12437
+ throw new import_core9.LightsparkException(
12438
+ "CreateUmaInvitationError",
12439
+ "Unable to create UMA invitation"
12440
+ );
12441
+ }
12442
+ return UmaInvitationFromJson(
12443
+ responseJson.create_uma_invitation?.invitation
12444
+ );
12445
+ }
12446
+ });
12447
+ }
12448
+ /**
12449
+ * Creates an UMA invitation as part of the incentive program.
12450
+ * @param inviterUma The UMA of the inviter.
12451
+ * @param inviterPhoneNumber The phone number of the inviter in E164 format.
12452
+ * @param inviterRegion The region of the inviter.
12453
+ * @returns The invitation that was created.
12454
+ */
12455
+ async createUmaInvitationWithIncentives(inviterUma, inviterPhoneNumber, inviterRegion) {
12456
+ const inviterPhoneHash = await this.hashPhoneNumber(inviterPhoneNumber);
12457
+ return await this.executeRawQuery({
12458
+ queryPayload: CreateUmaInvitationWithIncentives,
12459
+ variables: {
12460
+ inviterUma,
12461
+ inviterPhoneHash,
12462
+ inviterRegion
12463
+ },
12464
+ constructObject: (responseJson) => {
12465
+ if (!responseJson.create_uma_invitation_with_incentives?.invitation) {
12466
+ throw new import_core9.LightsparkException(
12467
+ "CreateUmaInvitationError",
12468
+ "Unable to create UMA invitation"
12469
+ );
12470
+ }
12471
+ return UmaInvitationFromJson(
12472
+ responseJson.create_uma_invitation_with_incentives?.invitation
12473
+ );
12474
+ }
12475
+ });
12476
+ }
12477
+ /**
12478
+ * Claims an UMA invitation. If you are part of the incentive program,
12479
+ * you should use [claimUmaInvitationWithIncentives].
12480
+ *
12481
+ * @param invitationCode The invitation code to claim.
12482
+ * @param inviteeUma The UMA of the invitee.
12483
+ * @returns The invitation that was claimed.
12484
+ */
12485
+ async claimUmaInvitation(invitationCode, inviteeUma) {
12486
+ return await this.executeRawQuery({
12487
+ queryPayload: ClaimUmaInvitation,
12488
+ variables: {
12489
+ invitationCode,
12490
+ inviteeUma
12491
+ },
12492
+ constructObject: (responseJson) => {
12493
+ if (!responseJson.claim_uma_invitation?.invitation) {
12494
+ throw new import_core9.LightsparkException(
12495
+ "ClaimUmaInvitationError",
12496
+ "Unable to claim UMA invitation"
12497
+ );
12498
+ }
12499
+ return UmaInvitationFromJson(
12500
+ responseJson.claim_uma_invitation?.invitation
12501
+ );
12502
+ }
12503
+ });
12504
+ }
12505
+ /**
12506
+ * Claims an UMA invitation as part of the incentive program.
12507
+ *
12508
+ * @param invitationCode The invitation code to claim.
12509
+ * @param inviteeUma The UMA of the invitee.
12510
+ * @param inviteePhoneNumber The phone number of the invitee in E164 format.
12511
+ * @param inviteeRegion The region of the invitee.
12512
+ * @returns The invitation that was claimed.
12513
+ */
12514
+ async claimUmaInvitationWithIncentives(invitationCode, inviteeUma, inviteePhoneNumber, inviteeRegion) {
12515
+ const inviteePhoneHash = await this.hashPhoneNumber(inviteePhoneNumber);
12516
+ return await this.executeRawQuery({
12517
+ queryPayload: ClaimUmaInvitationWithIncentives,
12518
+ variables: {
12519
+ invitationCode,
12520
+ inviteeUma,
12521
+ inviteePhoneHash,
12522
+ inviteeRegion
12523
+ },
12524
+ constructObject: (responseJson) => {
12525
+ if (!responseJson.claim_uma_invitation_with_incentives?.invitation) {
12526
+ throw new import_core9.LightsparkException(
12527
+ "ClaimUmaInvitationError",
12528
+ "Unable to claim UMA invitation"
12529
+ );
12530
+ }
12531
+ return UmaInvitationFromJson(
12532
+ responseJson.claim_uma_invitation_with_incentives?.invitation
12533
+ );
12534
+ }
12535
+ });
12536
+ }
12537
+ /**
12538
+ * Fetches an UMA invitation by its invitation code.
12539
+ *
12540
+ * @param invitationCode The code of the invitation to fetch.
12541
+ * @returns The invitation with the given code, or null if no invitation exists with that code.
12542
+ */
12543
+ async fetchUmaInvitation(invitationCode) {
12544
+ return await this.executeRawQuery({
12545
+ queryPayload: FetchUmaInvitation,
12546
+ variables: {
12547
+ invitationCode
12548
+ },
12549
+ constructObject: (responseJson) => {
12550
+ if (!responseJson.uma_invitation_by_code) {
12551
+ return null;
12552
+ }
12553
+ return UmaInvitationFromJson(responseJson.uma_invitation_by_code);
12554
+ }
12555
+ });
12556
+ }
12557
+ async hashPhoneNumber(e164PhoneNumber) {
12558
+ const e164PhoneRegex = /^\+[1-9]\d{1,14}$/;
12559
+ if (!e164PhoneRegex.test(e164PhoneNumber)) {
12560
+ throw new import_core9.LightsparkException(
12561
+ "InvalidPhoneNumber",
12562
+ "Invalid phone number. Phone number must be in E164 format."
12563
+ );
12564
+ }
12565
+ return await (0, import_core9.createSha256Hash)(e164PhoneNumber, true);
12566
+ }
12218
12567
  /**
12219
12568
  * Executes a raw `Query` against the Lightspark API.
12220
12569
  *
12221
- * This generally should not be used directly, but is exposed for advanced use cases and for internal use to retrieve
12570
+ * This generally should not be used directly,
12571
+ * but is exposed for advanced use cases and for internal use to retrieve
12222
12572
  * complex fields from objects.
12223
12573
  *
12224
12574
  * @param query The `Query` to execute.
@@ -12254,6 +12604,262 @@ var getBitcoinNetworkOrThrow = (bitcoinNetwork) => {
12254
12604
  return bitcoinNetwork;
12255
12605
  };
12256
12606
 
12607
+ // src/objects/RegionCode.ts
12608
+ var RegionCode = /* @__PURE__ */ ((RegionCode2) => {
12609
+ RegionCode2["FUTURE_VALUE"] = "FUTURE_VALUE";
12610
+ RegionCode2["AF"] = "AF";
12611
+ RegionCode2["AX"] = "AX";
12612
+ RegionCode2["AL"] = "AL";
12613
+ RegionCode2["DZ"] = "DZ";
12614
+ RegionCode2["AS"] = "AS";
12615
+ RegionCode2["AD"] = "AD";
12616
+ RegionCode2["AO"] = "AO";
12617
+ RegionCode2["AI"] = "AI";
12618
+ RegionCode2["AQ"] = "AQ";
12619
+ RegionCode2["AG"] = "AG";
12620
+ RegionCode2["AR"] = "AR";
12621
+ RegionCode2["AM"] = "AM";
12622
+ RegionCode2["AW"] = "AW";
12623
+ RegionCode2["AU"] = "AU";
12624
+ RegionCode2["AT"] = "AT";
12625
+ RegionCode2["AZ"] = "AZ";
12626
+ RegionCode2["BS"] = "BS";
12627
+ RegionCode2["BH"] = "BH";
12628
+ RegionCode2["BD"] = "BD";
12629
+ RegionCode2["BB"] = "BB";
12630
+ RegionCode2["BY"] = "BY";
12631
+ RegionCode2["BE"] = "BE";
12632
+ RegionCode2["BZ"] = "BZ";
12633
+ RegionCode2["BJ"] = "BJ";
12634
+ RegionCode2["BM"] = "BM";
12635
+ RegionCode2["BT"] = "BT";
12636
+ RegionCode2["BO"] = "BO";
12637
+ RegionCode2["BQ"] = "BQ";
12638
+ RegionCode2["BA"] = "BA";
12639
+ RegionCode2["BW"] = "BW";
12640
+ RegionCode2["BV"] = "BV";
12641
+ RegionCode2["BR"] = "BR";
12642
+ RegionCode2["IO"] = "IO";
12643
+ RegionCode2["BN"] = "BN";
12644
+ RegionCode2["BG"] = "BG";
12645
+ RegionCode2["BF"] = "BF";
12646
+ RegionCode2["BI"] = "BI";
12647
+ RegionCode2["KH"] = "KH";
12648
+ RegionCode2["CM"] = "CM";
12649
+ RegionCode2["CA"] = "CA";
12650
+ RegionCode2["CV"] = "CV";
12651
+ RegionCode2["KY"] = "KY";
12652
+ RegionCode2["CF"] = "CF";
12653
+ RegionCode2["TD"] = "TD";
12654
+ RegionCode2["CL"] = "CL";
12655
+ RegionCode2["CN"] = "CN";
12656
+ RegionCode2["CX"] = "CX";
12657
+ RegionCode2["CC"] = "CC";
12658
+ RegionCode2["CO"] = "CO";
12659
+ RegionCode2["KM"] = "KM";
12660
+ RegionCode2["CG"] = "CG";
12661
+ RegionCode2["CD"] = "CD";
12662
+ RegionCode2["CK"] = "CK";
12663
+ RegionCode2["CR"] = "CR";
12664
+ RegionCode2["CI"] = "CI";
12665
+ RegionCode2["HR"] = "HR";
12666
+ RegionCode2["CU"] = "CU";
12667
+ RegionCode2["CW"] = "CW";
12668
+ RegionCode2["CY"] = "CY";
12669
+ RegionCode2["CZ"] = "CZ";
12670
+ RegionCode2["DK"] = "DK";
12671
+ RegionCode2["DJ"] = "DJ";
12672
+ RegionCode2["DM"] = "DM";
12673
+ RegionCode2["DO"] = "DO";
12674
+ RegionCode2["EC"] = "EC";
12675
+ RegionCode2["EG"] = "EG";
12676
+ RegionCode2["SV"] = "SV";
12677
+ RegionCode2["GQ"] = "GQ";
12678
+ RegionCode2["ER"] = "ER";
12679
+ RegionCode2["EE"] = "EE";
12680
+ RegionCode2["ET"] = "ET";
12681
+ RegionCode2["FK"] = "FK";
12682
+ RegionCode2["FO"] = "FO";
12683
+ RegionCode2["FJ"] = "FJ";
12684
+ RegionCode2["FI"] = "FI";
12685
+ RegionCode2["FR"] = "FR";
12686
+ RegionCode2["GF"] = "GF";
12687
+ RegionCode2["PF"] = "PF";
12688
+ RegionCode2["TF"] = "TF";
12689
+ RegionCode2["GA"] = "GA";
12690
+ RegionCode2["GM"] = "GM";
12691
+ RegionCode2["GE"] = "GE";
12692
+ RegionCode2["DE"] = "DE";
12693
+ RegionCode2["GH"] = "GH";
12694
+ RegionCode2["GI"] = "GI";
12695
+ RegionCode2["GR"] = "GR";
12696
+ RegionCode2["GL"] = "GL";
12697
+ RegionCode2["GD"] = "GD";
12698
+ RegionCode2["GP"] = "GP";
12699
+ RegionCode2["GU"] = "GU";
12700
+ RegionCode2["GT"] = "GT";
12701
+ RegionCode2["GG"] = "GG";
12702
+ RegionCode2["GN"] = "GN";
12703
+ RegionCode2["GW"] = "GW";
12704
+ RegionCode2["GY"] = "GY";
12705
+ RegionCode2["HT"] = "HT";
12706
+ RegionCode2["HM"] = "HM";
12707
+ RegionCode2["VA"] = "VA";
12708
+ RegionCode2["HN"] = "HN";
12709
+ RegionCode2["HK"] = "HK";
12710
+ RegionCode2["HU"] = "HU";
12711
+ RegionCode2["IS"] = "IS";
12712
+ RegionCode2["IN"] = "IN";
12713
+ RegionCode2["ID"] = "ID";
12714
+ RegionCode2["IR"] = "IR";
12715
+ RegionCode2["IQ"] = "IQ";
12716
+ RegionCode2["IE"] = "IE";
12717
+ RegionCode2["IM"] = "IM";
12718
+ RegionCode2["IL"] = "IL";
12719
+ RegionCode2["IT"] = "IT";
12720
+ RegionCode2["JM"] = "JM";
12721
+ RegionCode2["JP"] = "JP";
12722
+ RegionCode2["JE"] = "JE";
12723
+ RegionCode2["JO"] = "JO";
12724
+ RegionCode2["KZ"] = "KZ";
12725
+ RegionCode2["KE"] = "KE";
12726
+ RegionCode2["KI"] = "KI";
12727
+ RegionCode2["KP"] = "KP";
12728
+ RegionCode2["KR"] = "KR";
12729
+ RegionCode2["KW"] = "KW";
12730
+ RegionCode2["KG"] = "KG";
12731
+ RegionCode2["LA"] = "LA";
12732
+ RegionCode2["LV"] = "LV";
12733
+ RegionCode2["LB"] = "LB";
12734
+ RegionCode2["LS"] = "LS";
12735
+ RegionCode2["LR"] = "LR";
12736
+ RegionCode2["LY"] = "LY";
12737
+ RegionCode2["LI"] = "LI";
12738
+ RegionCode2["LT"] = "LT";
12739
+ RegionCode2["LU"] = "LU";
12740
+ RegionCode2["MO"] = "MO";
12741
+ RegionCode2["MK"] = "MK";
12742
+ RegionCode2["MG"] = "MG";
12743
+ RegionCode2["MW"] = "MW";
12744
+ RegionCode2["MY"] = "MY";
12745
+ RegionCode2["MV"] = "MV";
12746
+ RegionCode2["ML"] = "ML";
12747
+ RegionCode2["MT"] = "MT";
12748
+ RegionCode2["MH"] = "MH";
12749
+ RegionCode2["MQ"] = "MQ";
12750
+ RegionCode2["MR"] = "MR";
12751
+ RegionCode2["MU"] = "MU";
12752
+ RegionCode2["YT"] = "YT";
12753
+ RegionCode2["MX"] = "MX";
12754
+ RegionCode2["FM"] = "FM";
12755
+ RegionCode2["MD"] = "MD";
12756
+ RegionCode2["MC"] = "MC";
12757
+ RegionCode2["MN"] = "MN";
12758
+ RegionCode2["ME"] = "ME";
12759
+ RegionCode2["MS"] = "MS";
12760
+ RegionCode2["MA"] = "MA";
12761
+ RegionCode2["MZ"] = "MZ";
12762
+ RegionCode2["MM"] = "MM";
12763
+ RegionCode2["NA"] = "NA";
12764
+ RegionCode2["NR"] = "NR";
12765
+ RegionCode2["NP"] = "NP";
12766
+ RegionCode2["NL"] = "NL";
12767
+ RegionCode2["NC"] = "NC";
12768
+ RegionCode2["NZ"] = "NZ";
12769
+ RegionCode2["NI"] = "NI";
12770
+ RegionCode2["NE"] = "NE";
12771
+ RegionCode2["NG"] = "NG";
12772
+ RegionCode2["NU"] = "NU";
12773
+ RegionCode2["NF"] = "NF";
12774
+ RegionCode2["MP"] = "MP";
12775
+ RegionCode2["NO"] = "NO";
12776
+ RegionCode2["OM"] = "OM";
12777
+ RegionCode2["PK"] = "PK";
12778
+ RegionCode2["PW"] = "PW";
12779
+ RegionCode2["PS"] = "PS";
12780
+ RegionCode2["PA"] = "PA";
12781
+ RegionCode2["PG"] = "PG";
12782
+ RegionCode2["PY"] = "PY";
12783
+ RegionCode2["PE"] = "PE";
12784
+ RegionCode2["PH"] = "PH";
12785
+ RegionCode2["PN"] = "PN";
12786
+ RegionCode2["PL"] = "PL";
12787
+ RegionCode2["PT"] = "PT";
12788
+ RegionCode2["PR"] = "PR";
12789
+ RegionCode2["QA"] = "QA";
12790
+ RegionCode2["RE"] = "RE";
12791
+ RegionCode2["RO"] = "RO";
12792
+ RegionCode2["RU"] = "RU";
12793
+ RegionCode2["RW"] = "RW";
12794
+ RegionCode2["BL"] = "BL";
12795
+ RegionCode2["SH"] = "SH";
12796
+ RegionCode2["KN"] = "KN";
12797
+ RegionCode2["LC"] = "LC";
12798
+ RegionCode2["MF"] = "MF";
12799
+ RegionCode2["PM"] = "PM";
12800
+ RegionCode2["VC"] = "VC";
12801
+ RegionCode2["WS"] = "WS";
12802
+ RegionCode2["SM"] = "SM";
12803
+ RegionCode2["ST"] = "ST";
12804
+ RegionCode2["SA"] = "SA";
12805
+ RegionCode2["SN"] = "SN";
12806
+ RegionCode2["RS"] = "RS";
12807
+ RegionCode2["SC"] = "SC";
12808
+ RegionCode2["SL"] = "SL";
12809
+ RegionCode2["SG"] = "SG";
12810
+ RegionCode2["SX"] = "SX";
12811
+ RegionCode2["SK"] = "SK";
12812
+ RegionCode2["SI"] = "SI";
12813
+ RegionCode2["SB"] = "SB";
12814
+ RegionCode2["SO"] = "SO";
12815
+ RegionCode2["ZA"] = "ZA";
12816
+ RegionCode2["GS"] = "GS";
12817
+ RegionCode2["SS"] = "SS";
12818
+ RegionCode2["ES"] = "ES";
12819
+ RegionCode2["LK"] = "LK";
12820
+ RegionCode2["SD"] = "SD";
12821
+ RegionCode2["SR"] = "SR";
12822
+ RegionCode2["SJ"] = "SJ";
12823
+ RegionCode2["SZ"] = "SZ";
12824
+ RegionCode2["SE"] = "SE";
12825
+ RegionCode2["CH"] = "CH";
12826
+ RegionCode2["SY"] = "SY";
12827
+ RegionCode2["TW"] = "TW";
12828
+ RegionCode2["TJ"] = "TJ";
12829
+ RegionCode2["TZ"] = "TZ";
12830
+ RegionCode2["TH"] = "TH";
12831
+ RegionCode2["TL"] = "TL";
12832
+ RegionCode2["TG"] = "TG";
12833
+ RegionCode2["TK"] = "TK";
12834
+ RegionCode2["TO"] = "TO";
12835
+ RegionCode2["TT"] = "TT";
12836
+ RegionCode2["TN"] = "TN";
12837
+ RegionCode2["TR"] = "TR";
12838
+ RegionCode2["TM"] = "TM";
12839
+ RegionCode2["TC"] = "TC";
12840
+ RegionCode2["TV"] = "TV";
12841
+ RegionCode2["UG"] = "UG";
12842
+ RegionCode2["UA"] = "UA";
12843
+ RegionCode2["AE"] = "AE";
12844
+ RegionCode2["GB"] = "GB";
12845
+ RegionCode2["US"] = "US";
12846
+ RegionCode2["UM"] = "UM";
12847
+ RegionCode2["UY"] = "UY";
12848
+ RegionCode2["UZ"] = "UZ";
12849
+ RegionCode2["VU"] = "VU";
12850
+ RegionCode2["VE"] = "VE";
12851
+ RegionCode2["VN"] = "VN";
12852
+ RegionCode2["VG"] = "VG";
12853
+ RegionCode2["VI"] = "VI";
12854
+ RegionCode2["WF"] = "WF";
12855
+ RegionCode2["EH"] = "EH";
12856
+ RegionCode2["YE"] = "YE";
12857
+ RegionCode2["ZM"] = "ZM";
12858
+ RegionCode2["ZW"] = "ZW";
12859
+ return RegionCode2;
12860
+ })(RegionCode || {});
12861
+ var RegionCode_default = RegionCode;
12862
+
12257
12863
  // src/objects/ComplianceProvider.ts
12258
12864
  var ComplianceProvider = /* @__PURE__ */ ((ComplianceProvider2) => {
12259
12865
  ComplianceProvider2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -12291,7 +12897,7 @@ var SignablePayloadFromJson = (obj) => {
12291
12897
  mulTweak: obj["signable_payload_mul_tweak"]
12292
12898
  };
12293
12899
  };
12294
- var FRAGMENT26 = `
12900
+ var FRAGMENT27 = `
12295
12901
  fragment SignablePayloadFragment on SignablePayload {
12296
12902
  __typename
12297
12903
  signable_payload_id: id
@@ -12317,7 +12923,7 @@ query GetSignablePayload($id: ID!) {
12317
12923
  }
12318
12924
  }
12319
12925
 
12320
- ${FRAGMENT26}
12926
+ ${FRAGMENT27}
12321
12927
  `,
12322
12928
  variables: { id },
12323
12929
  constructObject: (data) => SignablePayloadFromJson(data.entity)
@@ -12343,7 +12949,7 @@ var DepositFromJson = (obj) => {
12343
12949
  numConfirmations: obj["deposit_num_confirmations"]
12344
12950
  };
12345
12951
  };
12346
- var FRAGMENT27 = `
12952
+ var FRAGMENT28 = `
12347
12953
  fragment DepositFragment on Deposit {
12348
12954
  __typename
12349
12955
  deposit_id: id
@@ -12387,7 +12993,7 @@ query GetDeposit($id: ID!) {
12387
12993
  }
12388
12994
  }
12389
12995
 
12390
- ${FRAGMENT27}
12996
+ ${FRAGMENT28}
12391
12997
  `,
12392
12998
  variables: { id },
12393
12999
  constructObject: (data) => DepositFromJson(data.entity)
@@ -12460,7 +13066,7 @@ var LightningTransactionFromJson = (obj) => {
12460
13066
  `Couldn't find a concrete type for interface LightningTransaction corresponding to the typename=${obj["__typename"]}`
12461
13067
  );
12462
13068
  };
12463
- var FRAGMENT28 = `
13069
+ var FRAGMENT29 = `
12464
13070
  fragment LightningTransactionFragment on LightningTransaction {
12465
13071
  __typename
12466
13072
  ... on IncomingPayment {
@@ -12889,7 +13495,7 @@ query GetLightningTransaction($id: ID!) {
12889
13495
  }
12890
13496
  }
12891
13497
 
12892
- ${FRAGMENT28}
13498
+ ${FRAGMENT29}
12893
13499
  `,
12894
13500
  variables: { id },
12895
13501
  constructObject: (data) => LightningTransactionFromJson(data.entity)
@@ -12926,7 +13532,7 @@ var LightsparkNodeOwnerFromJson = (obj) => {
12926
13532
  `Couldn't find a concrete type for interface LightsparkNodeOwner corresponding to the typename=${obj["__typename"]}`
12927
13533
  );
12928
13534
  };
12929
- var FRAGMENT29 = `
13535
+ var FRAGMENT30 = `
12930
13536
  fragment LightsparkNodeOwnerFragment on LightsparkNodeOwner {
12931
13537
  __typename
12932
13538
  ... on Account {
@@ -12987,7 +13593,7 @@ query GetLightsparkNodeOwner($id: ID!) {
12987
13593
  }
12988
13594
  }
12989
13595
 
12990
- ${FRAGMENT29}
13596
+ ${FRAGMENT30}
12991
13597
  `,
12992
13598
  variables: { id },
12993
13599
  constructObject: (data) => LightsparkNodeOwnerFromJson(data.entity)
@@ -13074,7 +13680,7 @@ var OnChainTransactionFromJson = (obj) => {
13074
13680
  `Couldn't find a concrete type for interface OnChainTransaction corresponding to the typename=${obj["__typename"]}`
13075
13681
  );
13076
13682
  };
13077
- var FRAGMENT30 = `
13683
+ var FRAGMENT31 = `
13078
13684
  fragment OnChainTransactionFragment on OnChainTransaction {
13079
13685
  __typename
13080
13686
  ... on ChannelClosingTransaction {
@@ -13217,7 +13823,7 @@ query GetOnChainTransaction($id: ID!) {
13217
13823
  }
13218
13824
  }
13219
13825
 
13220
- ${FRAGMENT30}
13826
+ ${FRAGMENT31}
13221
13827
  `,
13222
13828
  variables: { id },
13223
13829
  constructObject: (data) => OnChainTransactionFromJson(data.entity)
@@ -13276,7 +13882,7 @@ var RoutingTransactionFromJson = (obj) => {
13276
13882
  failureReason: !!obj["routing_transaction_failure_reason"] ? RoutingTransactionFailureReason_default[obj["routing_transaction_failure_reason"]] ?? RoutingTransactionFailureReason_default.FUTURE_VALUE : null
13277
13883
  };
13278
13884
  };
13279
- var FRAGMENT31 = `
13885
+ var FRAGMENT32 = `
13280
13886
  fragment RoutingTransactionFragment on RoutingTransaction {
13281
13887
  __typename
13282
13888
  routing_transaction_id: id
@@ -13324,7 +13930,7 @@ query GetRoutingTransaction($id: ID!) {
13324
13930
  }
13325
13931
  }
13326
13932
 
13327
- ${FRAGMENT31}
13933
+ ${FRAGMENT32}
13328
13934
  `,
13329
13935
  variables: { id },
13330
13936
  constructObject: (data) => RoutingTransactionFromJson(data.entity)
@@ -13340,7 +13946,7 @@ var SignableFromJson = (obj) => {
13340
13946
  typename: "Signable"
13341
13947
  };
13342
13948
  };
13343
- var FRAGMENT32 = `
13949
+ var FRAGMENT33 = `
13344
13950
  fragment SignableFragment on Signable {
13345
13951
  __typename
13346
13952
  signable_id: id
@@ -13358,7 +13964,7 @@ query GetSignable($id: ID!) {
13358
13964
  }
13359
13965
  }
13360
13966
 
13361
- ${FRAGMENT32}
13967
+ ${FRAGMENT33}
13362
13968
  `,
13363
13969
  variables: { id },
13364
13970
  constructObject: (data) => SignableFromJson(data.entity)
@@ -13386,9 +13992,11 @@ var TransactionType_default = TransactionType;
13386
13992
  var WebhookEventType = /* @__PURE__ */ ((WebhookEventType2) => {
13387
13993
  WebhookEventType2["FUTURE_VALUE"] = "FUTURE_VALUE";
13388
13994
  WebhookEventType2["PAYMENT_FINISHED"] = "PAYMENT_FINISHED";
13995
+ WebhookEventType2["FORCE_CLOSURE"] = "FORCE_CLOSURE";
13389
13996
  WebhookEventType2["WITHDRAWAL_FINISHED"] = "WITHDRAWAL_FINISHED";
13390
13997
  WebhookEventType2["FUNDS_RECEIVED"] = "FUNDS_RECEIVED";
13391
13998
  WebhookEventType2["NODE_STATUS"] = "NODE_STATUS";
13999
+ WebhookEventType2["UMA_INVITATION_CLAIMED"] = "UMA_INVITATION_CLAIMED";
13392
14000
  WebhookEventType2["WALLET_STATUS"] = "WALLET_STATUS";
13393
14001
  WebhookEventType2["WALLET_OUTGOING_PAYMENT_FINISHED"] = "WALLET_OUTGOING_PAYMENT_FINISHED";
13394
14002
  WebhookEventType2["WALLET_INCOMING_PAYMENT_FINISHED"] = "WALLET_INCOMING_PAYMENT_FINISHED";
@@ -13419,7 +14027,7 @@ var WithdrawalFromJson = (obj) => {
13419
14027
  numConfirmations: obj["withdrawal_num_confirmations"]
13420
14028
  };
13421
14029
  };
13422
- var FRAGMENT33 = `
14030
+ var FRAGMENT34 = `
13423
14031
  fragment WithdrawalFragment on Withdrawal {
13424
14032
  __typename
13425
14033
  withdrawal_id: id
@@ -13463,7 +14071,7 @@ query GetWithdrawal($id: ID!) {
13463
14071
  }
13464
14072
  }
13465
14073
 
13466
- ${FRAGMENT33}
14074
+ ${FRAGMENT34}
13467
14075
  `,
13468
14076
  variables: { id },
13469
14077
  constructObject: (data) => WithdrawalFromJson(data.entity)
@@ -13534,6 +14142,8 @@ var RemoteSigningWebhookHandler = class {
13534
14142
  CurrencyUnit,
13535
14143
  GraphNode,
13536
14144
  HtlcAttemptFailureCode,
14145
+ IncentivesIneligibilityReason,
14146
+ IncentivesStatus,
13537
14147
  IncomingPayment,
13538
14148
  IncomingPaymentAttemptStatus,
13539
14149
  InvoiceType,
@@ -13549,6 +14159,7 @@ var RemoteSigningWebhookHandler = class {
13549
14159
  PaymentFailureReason,
13550
14160
  PaymentRequestStatus,
13551
14161
  Permission,
14162
+ RegionCode,
13552
14163
  RemoteSigningSubEventType,
13553
14164
  RemoteSigningWebhookHandler,
13554
14165
  RiskRating,
@@ -13582,6 +14193,7 @@ var RemoteSigningWebhookHandler = class {
13582
14193
  getSignablePayloadQuery,
13583
14194
  getSignableQuery,
13584
14195
  getTransactionQuery,
14196
+ getUmaInvitationQuery,
13585
14197
  getWithdrawalQuery,
13586
14198
  isBitcoinNetwork,
13587
14199
  verifyAndParseWebhook