@lightsparkdev/lightspark-sdk 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-VTPDR6P4.js → chunk-GLL4KTUT.js} +353 -15
- package/dist/{index-5acc6526.d.ts → index-eb604025.d.ts} +662 -3
- package/dist/index.cjs +654 -76
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +265 -17
- package/dist/objects/index.cjs +345 -5
- package/dist/objects/index.d.cts +1 -1
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +9 -1
- package/package.json +1 -1
- package/src/client.ts +194 -1
- package/src/graphql/ClaimUmaInvitation.ts +21 -0
- package/src/graphql/ClaimUmaInvitationWithIncentives.ts +25 -0
- package/src/graphql/CreateUmaInvitation.ts +19 -0
- package/src/graphql/CreateUmaInvitationWithIncentives.ts +23 -0
- package/src/graphql/FetchUmaInvitation.ts +15 -0
- package/src/objects/ClaimUmaInvitationInput.ts +26 -0
- package/src/objects/ClaimUmaInvitationOutput.ts +30 -0
- package/src/objects/ClaimUmaInvitationWithIncentivesInput.ts +44 -0
- package/src/objects/ClaimUmaInvitationWithIncentivesOutput.ts +33 -0
- package/src/objects/CreateInvitationWithIncentivesInput.ts +37 -0
- package/src/objects/CreateInvitationWithIncentivesOutput.ts +32 -0
- package/src/objects/CreateUmaInvitationInput.ts +22 -0
- package/src/objects/CreateUmaInvitationOutput.ts +30 -0
- package/src/objects/Entity.ts +13 -0
- package/src/objects/IncentivesIneligibilityReason.ts +24 -0
- package/src/objects/IncentivesStatus.ts +18 -0
- package/src/objects/OutgoingPayment.ts +1 -0
- package/src/objects/OutgoingPaymentAttempt.ts +6 -1
- package/src/objects/RegionCode.ts +510 -0
- package/src/objects/UmaInvitation.ts +113 -0
- package/src/objects/WebhookEventType.ts +4 -0
- package/src/objects/index.ts +15 -0
- package/src/tests/integration/constants.ts +0 -3
- package/src/tests/integration/general-regtest.test.ts +177 -196
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthProvider } from '@lightsparkdev/core';
|
|
2
|
-
import { W as WebhookEventType, L as LightsparkClient } from './index-
|
|
3
|
-
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BlockchainBalance, C as Channel, j as ChannelClosingTransaction, l as ChannelFees, m as ChannelOpeningTransaction, o as ChannelSnapshot, p as ChannelStatus, q as ChannelToTransactionsConnection, r as
|
|
2
|
+
import { W as WebhookEventType, L as LightsparkClient } from './index-eb604025.js';
|
|
3
|
+
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BlockchainBalance, C as Channel, j as ChannelClosingTransaction, l as ChannelFees, m as ChannelOpeningTransaction, o as ChannelSnapshot, p as ChannelStatus, q as ChannelToTransactionsConnection, r as ClaimUmaInvitationInput, s as ClaimUmaInvitationOutput, t as ClaimUmaInvitationWithIncentivesInput, u as ClaimUmaInvitationWithIncentivesOutput, v as ComplianceProvider, w as Connection, x as CreateApiTokenInput, y as CreateApiTokenOutput, z as CreateInvitationWithIncentivesInput, D as CreateInvitationWithIncentivesOutput, E as CreateInvoiceInput, F as CreateInvoiceOutput, G as CreateLnurlInvoiceInput, H as CreateNodeWalletAddressInput, I as CreateNodeWalletAddressOutput, J as CreateTestModeInvoiceInput, K as CreateTestModeInvoiceOutput, M as CreateTestModePaymentInput, N as CreateTestModePaymentoutput, O as CreateUmaInvitationInput, P as CreateUmaInvitationOutput, Q as CreateUmaInvoiceInput, R as CurrencyAmount, S as CurrencyUnit, T as DeclineToSignMessagesInput, U as DeclineToSignMessagesOutput, V as DeleteApiTokenInput, X as DeleteApiTokenOutput, Y as Deposit, _ as Entity, $ as FeeEstimate, a0 as FundNodeInput, a1 as FundNodeOutput, a2 as GraphNode, a3 as Hop, a5 as HtlcAttemptFailureCode, a6 as IdAndSignature, a7 as IncentivesIneligibilityReason, a8 as IncentivesStatus, a9 as IncomingPayment, aa as IncomingPaymentAttempt, ac as IncomingPaymentAttemptStatus, ad as IncomingPaymentToAttemptsConnection, ae as Invoice, ag as InvoiceData, ah as InvoiceType, ai as LightningFeeEstimateForInvoiceInput, aj as LightningFeeEstimateForNodeInput, ak as LightningFeeEstimateOutput, al as LightningTransaction, an as LightsparkNode, ap as LightsparkNodeOwner, ar as LightsparkNodeStatus, as as LightsparkNodeToChannelsConnection, at as LightsparkNodeWithOSK, au as LightsparkNodeWithRemoteSigning, av as Node, ax as NodeAddress, ay as NodeAddressType, az as NodeToAddressesConnection, aA as OnChainTransaction, aC as OutgoingPayment, aD as OutgoingPaymentAttempt, aE as OutgoingPaymentAttemptStatus, aF as OutgoingPaymentAttemptToHopsConnection, aI as OutgoingPaymentToAttemptsConnection, aG as OutgoingPaymentsForInvoiceQueryInput, aH as OutgoingPaymentsForInvoiceQueryOutput, aJ as PageInfo, aK as PayInvoiceInput, aL as PayInvoiceOutput, aS as PayUmaInvoiceInput, aM as PaymentDirection, aN as PaymentFailureReason, aO as PaymentRequest, aQ as PaymentRequestData, aR as PaymentRequestStatus, aT as Permission, aU as PostTransactionData, aV as RegionCode, aW as RegisterPaymentInput, aX as RegisterPaymentOutput, aY as ReleaseChannelPerCommitmentSecretInput, aZ as ReleaseChannelPerCommitmentSecretOutput, a_ as ReleasePaymentPreimageInput, a$ as ReleasePaymentPreimageOutput, b0 as RemoteSigningSubEventType, b1 as RequestWithdrawalInput, b2 as RequestWithdrawalOutput, b3 as RichText, b4 as RiskRating, b5 as RoutingTransaction, b7 as RoutingTransactionFailureReason, b8 as ScreenNodeInput, b9 as ScreenNodeOutput, ba as Secret, bb as SendPaymentInput, bc as SendPaymentOutput, bd as SetInvoicePaymentHashInput, be as SetInvoicePaymentHashOutput, bk as SignInvoiceInput, bl as SignInvoiceOutput, bm as SignMessagesInput, bn as SignMessagesOutput, bf as Signable, bh as SignablePayload, bj as SignablePayloadStatus, bo as SingleNodeDashboard, bp as Transaction, br as TransactionFailures, bs as TransactionStatus, bt as TransactionType, bu as TransactionUpdate, bv as UmaInvitation, bx as UpdateChannelPerCommitmentPointInput, by as UpdateChannelPerCommitmentPointOutput, bz as UpdateNodeSharedSecretInput, bA as UpdateNodeSharedSecretOutput, bB as Wallet, bC as WalletStatus, bD as WalletToPaymentRequestsConnection, bE as WalletToTransactionsConnection, bF as Withdrawal, bH as WithdrawalMode, bI as WithdrawalRequest, bJ as WithdrawalRequestStatus, bK as WithdrawalRequestToChannelClosingTransactionsConnection, bL as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, k as getChannelClosingTransactionQuery, n as getChannelOpeningTransactionQuery, Z as getDepositQuery, a4 as getHopQuery, ab as getIncomingPaymentAttemptQuery, af as getInvoiceQuery, am as getLightningTransactionQuery, aq as getLightsparkNodeOwnerQuery, ao as getLightsparkNodeQuery, aw as getNodeQuery, aB as getOnChainTransactionQuery, aP as getPaymentRequestQuery, b6 as getRoutingTransactionQuery, bi as getSignablePayloadQuery, bg as getSignableQuery, bq as getTransactionQuery, bw as getUmaInvitationQuery, bG as getWithdrawalQuery } from './index-eb604025.js';
|
|
4
4
|
import { B as BitcoinNetwork } from './BitcoinNetwork-a816c0be.js';
|
|
5
5
|
import 'zen-observable';
|
|
6
6
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthProvider } from '@lightsparkdev/core';
|
|
2
|
-
import { W as WebhookEventType, L as LightsparkClient } from './index-
|
|
3
|
-
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BlockchainBalance, C as Channel, j as ChannelClosingTransaction, l as ChannelFees, m as ChannelOpeningTransaction, o as ChannelSnapshot, p as ChannelStatus, q as ChannelToTransactionsConnection, r as
|
|
2
|
+
import { W as WebhookEventType, L as LightsparkClient } from './index-eb604025.js';
|
|
3
|
+
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BlockchainBalance, C as Channel, j as ChannelClosingTransaction, l as ChannelFees, m as ChannelOpeningTransaction, o as ChannelSnapshot, p as ChannelStatus, q as ChannelToTransactionsConnection, r as ClaimUmaInvitationInput, s as ClaimUmaInvitationOutput, t as ClaimUmaInvitationWithIncentivesInput, u as ClaimUmaInvitationWithIncentivesOutput, v as ComplianceProvider, w as Connection, x as CreateApiTokenInput, y as CreateApiTokenOutput, z as CreateInvitationWithIncentivesInput, D as CreateInvitationWithIncentivesOutput, E as CreateInvoiceInput, F as CreateInvoiceOutput, G as CreateLnurlInvoiceInput, H as CreateNodeWalletAddressInput, I as CreateNodeWalletAddressOutput, J as CreateTestModeInvoiceInput, K as CreateTestModeInvoiceOutput, M as CreateTestModePaymentInput, N as CreateTestModePaymentoutput, O as CreateUmaInvitationInput, P as CreateUmaInvitationOutput, Q as CreateUmaInvoiceInput, R as CurrencyAmount, S as CurrencyUnit, T as DeclineToSignMessagesInput, U as DeclineToSignMessagesOutput, V as DeleteApiTokenInput, X as DeleteApiTokenOutput, Y as Deposit, _ as Entity, $ as FeeEstimate, a0 as FundNodeInput, a1 as FundNodeOutput, a2 as GraphNode, a3 as Hop, a5 as HtlcAttemptFailureCode, a6 as IdAndSignature, a7 as IncentivesIneligibilityReason, a8 as IncentivesStatus, a9 as IncomingPayment, aa as IncomingPaymentAttempt, ac as IncomingPaymentAttemptStatus, ad as IncomingPaymentToAttemptsConnection, ae as Invoice, ag as InvoiceData, ah as InvoiceType, ai as LightningFeeEstimateForInvoiceInput, aj as LightningFeeEstimateForNodeInput, ak as LightningFeeEstimateOutput, al as LightningTransaction, an as LightsparkNode, ap as LightsparkNodeOwner, ar as LightsparkNodeStatus, as as LightsparkNodeToChannelsConnection, at as LightsparkNodeWithOSK, au as LightsparkNodeWithRemoteSigning, av as Node, ax as NodeAddress, ay as NodeAddressType, az as NodeToAddressesConnection, aA as OnChainTransaction, aC as OutgoingPayment, aD as OutgoingPaymentAttempt, aE as OutgoingPaymentAttemptStatus, aF as OutgoingPaymentAttemptToHopsConnection, aI as OutgoingPaymentToAttemptsConnection, aG as OutgoingPaymentsForInvoiceQueryInput, aH as OutgoingPaymentsForInvoiceQueryOutput, aJ as PageInfo, aK as PayInvoiceInput, aL as PayInvoiceOutput, aS as PayUmaInvoiceInput, aM as PaymentDirection, aN as PaymentFailureReason, aO as PaymentRequest, aQ as PaymentRequestData, aR as PaymentRequestStatus, aT as Permission, aU as PostTransactionData, aV as RegionCode, aW as RegisterPaymentInput, aX as RegisterPaymentOutput, aY as ReleaseChannelPerCommitmentSecretInput, aZ as ReleaseChannelPerCommitmentSecretOutput, a_ as ReleasePaymentPreimageInput, a$ as ReleasePaymentPreimageOutput, b0 as RemoteSigningSubEventType, b1 as RequestWithdrawalInput, b2 as RequestWithdrawalOutput, b3 as RichText, b4 as RiskRating, b5 as RoutingTransaction, b7 as RoutingTransactionFailureReason, b8 as ScreenNodeInput, b9 as ScreenNodeOutput, ba as Secret, bb as SendPaymentInput, bc as SendPaymentOutput, bd as SetInvoicePaymentHashInput, be as SetInvoicePaymentHashOutput, bk as SignInvoiceInput, bl as SignInvoiceOutput, bm as SignMessagesInput, bn as SignMessagesOutput, bf as Signable, bh as SignablePayload, bj as SignablePayloadStatus, bo as SingleNodeDashboard, bp as Transaction, br as TransactionFailures, bs as TransactionStatus, bt as TransactionType, bu as TransactionUpdate, bv as UmaInvitation, bx as UpdateChannelPerCommitmentPointInput, by as UpdateChannelPerCommitmentPointOutput, bz as UpdateNodeSharedSecretInput, bA as UpdateNodeSharedSecretOutput, bB as Wallet, bC as WalletStatus, bD as WalletToPaymentRequestsConnection, bE as WalletToTransactionsConnection, bF as Withdrawal, bH as WithdrawalMode, bI as WithdrawalRequest, bJ as WithdrawalRequestStatus, bK as WithdrawalRequestToChannelClosingTransactionsConnection, bL as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, k as getChannelClosingTransactionQuery, n as getChannelOpeningTransactionQuery, Z as getDepositQuery, a4 as getHopQuery, ab as getIncomingPaymentAttemptQuery, af as getInvoiceQuery, am as getLightningTransactionQuery, aq as getLightsparkNodeOwnerQuery, ao as getLightsparkNodeQuery, aw as getNodeQuery, aB as getOnChainTransactionQuery, aP as getPaymentRequestQuery, b6 as getRoutingTransactionQuery, bi as getSignablePayloadQuery, bg as getSignableQuery, bq as getTransactionQuery, bw as getUmaInvitationQuery, bG as getWithdrawalQuery } from './index-eb604025.js';
|
|
4
4
|
import { B as BitcoinNetwork } from './BitcoinNetwork-a816c0be.js';
|
|
5
5
|
import 'zen-observable';
|
|
6
6
|
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
FRAGMENT10,
|
|
17
17
|
FRAGMENT11,
|
|
18
18
|
FRAGMENT12,
|
|
19
|
+
FRAGMENT13,
|
|
19
20
|
FRAGMENT2,
|
|
20
21
|
FRAGMENT3,
|
|
21
22
|
FRAGMENT4,
|
|
@@ -27,6 +28,8 @@ import {
|
|
|
27
28
|
FeeEstimateFromJson,
|
|
28
29
|
GraphNode_default,
|
|
29
30
|
HtlcAttemptFailureCode_default,
|
|
31
|
+
IncentivesIneligibilityReason_default,
|
|
32
|
+
IncentivesStatus_default,
|
|
30
33
|
IncomingPaymentAttemptStatus_default,
|
|
31
34
|
IncomingPaymentFromJson,
|
|
32
35
|
IncomingPayment_default,
|
|
@@ -46,6 +49,7 @@ import {
|
|
|
46
49
|
PaymentRequestFromJson,
|
|
47
50
|
PaymentRequestStatus_default,
|
|
48
51
|
Permission_default,
|
|
52
|
+
RegionCode_default,
|
|
49
53
|
RemoteSigningSubEventType_default,
|
|
50
54
|
RiskRating_default,
|
|
51
55
|
RoutingTransactionFailureReason_default,
|
|
@@ -54,6 +58,7 @@ import {
|
|
|
54
58
|
TransactionStatus_default,
|
|
55
59
|
TransactionType_default,
|
|
56
60
|
TransactionUpdateFromJson,
|
|
61
|
+
UmaInvitationFromJson,
|
|
57
62
|
WalletStatus_default,
|
|
58
63
|
Wallet_default,
|
|
59
64
|
WebhookEventType,
|
|
@@ -79,8 +84,9 @@ import {
|
|
|
79
84
|
getSignablePayloadQuery,
|
|
80
85
|
getSignableQuery,
|
|
81
86
|
getTransactionQuery,
|
|
87
|
+
getUmaInvitationQuery,
|
|
82
88
|
getWithdrawalQuery
|
|
83
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-GLL4KTUT.js";
|
|
84
90
|
import {
|
|
85
91
|
BitcoinNetwork_default
|
|
86
92
|
} from "./chunk-K6SAUSAX.js";
|
|
@@ -138,7 +144,7 @@ import {
|
|
|
138
144
|
// package.json
|
|
139
145
|
var package_default = {
|
|
140
146
|
name: "@lightsparkdev/lightspark-sdk",
|
|
141
|
-
version: "1.2.
|
|
147
|
+
version: "1.2.2",
|
|
142
148
|
description: "Lightspark JS SDK",
|
|
143
149
|
author: "Lightspark Inc.",
|
|
144
150
|
keywords: [
|
|
@@ -268,6 +274,48 @@ var BitcoinFeeEstimate = `
|
|
|
268
274
|
${FRAGMENT2}
|
|
269
275
|
`;
|
|
270
276
|
|
|
277
|
+
// src/graphql/ClaimUmaInvitation.ts
|
|
278
|
+
var ClaimUmaInvitation = `
|
|
279
|
+
mutation ClaimUmaInvitation(
|
|
280
|
+
$invitationCode: String!
|
|
281
|
+
$inviteeUma: String!
|
|
282
|
+
) {
|
|
283
|
+
claim_uma_invitation(input: {
|
|
284
|
+
invitation_code: $invitationCode
|
|
285
|
+
invitee_uma: $inviteeUma
|
|
286
|
+
}) {
|
|
287
|
+
invitation {
|
|
288
|
+
...UmaInvitationFragment
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
${FRAGMENT3}
|
|
294
|
+
`;
|
|
295
|
+
|
|
296
|
+
// src/graphql/ClaimUmaInvitationWithIncentives.ts
|
|
297
|
+
var ClaimUmaInvitationWithIncentives = `
|
|
298
|
+
mutation ClaimUmaInvitationWithIncentives(
|
|
299
|
+
$invitationCode: String!
|
|
300
|
+
$inviteeUma: String!
|
|
301
|
+
$inviteePhoneHash: String!
|
|
302
|
+
$inviteeRegion: RegionCode!
|
|
303
|
+
) {
|
|
304
|
+
claim_uma_invitation_with_incentives(input: {
|
|
305
|
+
invitation_code: $invitationCode
|
|
306
|
+
invitee_uma: $inviteeUma
|
|
307
|
+
invitee_phone_hash: $inviteePhoneHash
|
|
308
|
+
invitee_region: $inviteeRegion
|
|
309
|
+
}) {
|
|
310
|
+
invitation {
|
|
311
|
+
...UmaInvitationFragment
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
${FRAGMENT3}
|
|
317
|
+
`;
|
|
318
|
+
|
|
271
319
|
// src/graphql/CreateApiToken.ts
|
|
272
320
|
var CreateApiToken = `
|
|
273
321
|
mutation CreateApiToken(
|
|
@@ -285,7 +333,7 @@ var CreateApiToken = `
|
|
|
285
333
|
}
|
|
286
334
|
}
|
|
287
335
|
|
|
288
|
-
${
|
|
336
|
+
${FRAGMENT4}
|
|
289
337
|
`;
|
|
290
338
|
|
|
291
339
|
// src/graphql/CreateInvoice.ts
|
|
@@ -326,7 +374,7 @@ mutation CreateLnurlInvoice(
|
|
|
326
374
|
}
|
|
327
375
|
}
|
|
328
376
|
}
|
|
329
|
-
${
|
|
377
|
+
${FRAGMENT6}
|
|
330
378
|
`;
|
|
331
379
|
|
|
332
380
|
// src/graphql/CreateNodeWalletAddress.ts
|
|
@@ -379,7 +427,45 @@ mutation CreateTestModePayment(
|
|
|
379
427
|
}
|
|
380
428
|
}
|
|
381
429
|
|
|
382
|
-
${
|
|
430
|
+
${FRAGMENT7}
|
|
431
|
+
`;
|
|
432
|
+
|
|
433
|
+
// src/graphql/CreateUmaInvitation.ts
|
|
434
|
+
var CreateUmaInvitation = `
|
|
435
|
+
mutation CreateUmaInvitation(
|
|
436
|
+
$inviterUma: String!
|
|
437
|
+
) {
|
|
438
|
+
create_uma_invitation(input: {
|
|
439
|
+
inviter_uma: $inviterUma
|
|
440
|
+
}) {
|
|
441
|
+
invitation {
|
|
442
|
+
...UmaInvitationFragment
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
${FRAGMENT3}
|
|
448
|
+
`;
|
|
449
|
+
|
|
450
|
+
// src/graphql/CreateUmaInvitationWithIncentives.ts
|
|
451
|
+
var CreateUmaInvitationWithIncentives = `
|
|
452
|
+
mutation CreateUmaInvitationWithIncentives(
|
|
453
|
+
$inviterUma: String!
|
|
454
|
+
$inviterPhoneHash: String!
|
|
455
|
+
$inviterRegion: RegionCode!
|
|
456
|
+
) {
|
|
457
|
+
create_uma_invitation_with_incentives(input: {
|
|
458
|
+
inviter_uma: $inviterUma
|
|
459
|
+
inviter_phone_hash: $inviterPhoneHash
|
|
460
|
+
inviter_region: $inviterRegion
|
|
461
|
+
}) {
|
|
462
|
+
invitation {
|
|
463
|
+
...UmaInvitationFragment
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
${FRAGMENT3}
|
|
383
469
|
`;
|
|
384
470
|
|
|
385
471
|
// src/graphql/CreateUmaInvoice.ts
|
|
@@ -401,7 +487,7 @@ mutation CreateUmaInvoice(
|
|
|
401
487
|
}
|
|
402
488
|
}
|
|
403
489
|
}
|
|
404
|
-
${
|
|
490
|
+
${FRAGMENT6}
|
|
405
491
|
`;
|
|
406
492
|
|
|
407
493
|
// src/graphql/DecodeInvoice.ts
|
|
@@ -415,7 +501,7 @@ var DecodeInvoice = `
|
|
|
415
501
|
}
|
|
416
502
|
}
|
|
417
503
|
|
|
418
|
-
${
|
|
504
|
+
${FRAGMENT5}
|
|
419
505
|
`;
|
|
420
506
|
|
|
421
507
|
// src/graphql/DeleteApiToken.ts
|
|
@@ -431,6 +517,19 @@ var DeleteApiToken = `
|
|
|
431
517
|
}
|
|
432
518
|
`;
|
|
433
519
|
|
|
520
|
+
// src/graphql/FetchUmaInvitation.ts
|
|
521
|
+
var FetchUmaInvitation = `
|
|
522
|
+
query FetchUmaInvitation(
|
|
523
|
+
$invitationCode: String!
|
|
524
|
+
) {
|
|
525
|
+
uma_invitation_by_code(code: $invitationCode) {
|
|
526
|
+
...UmaInvitationFragment
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
${FRAGMENT3}
|
|
531
|
+
`;
|
|
532
|
+
|
|
434
533
|
// src/graphql/FundNode.ts
|
|
435
534
|
var FundNode = `
|
|
436
535
|
mutation FundNode(
|
|
@@ -463,7 +562,7 @@ var LightningFeeEstimateForInvoice = `
|
|
|
463
562
|
}
|
|
464
563
|
}
|
|
465
564
|
|
|
466
|
-
${
|
|
565
|
+
${FRAGMENT8}
|
|
467
566
|
`;
|
|
468
567
|
|
|
469
568
|
// src/graphql/LightningFeeEstimateForNode.ts
|
|
@@ -482,7 +581,7 @@ var LightningFeeEstimateForNode = `
|
|
|
482
581
|
}
|
|
483
582
|
}
|
|
484
583
|
|
|
485
|
-
${
|
|
584
|
+
${FRAGMENT8}
|
|
486
585
|
`;
|
|
487
586
|
|
|
488
587
|
// src/graphql/MultiNodeDashboard.ts
|
|
@@ -584,7 +683,7 @@ var PayInvoice = `
|
|
|
584
683
|
}
|
|
585
684
|
}
|
|
586
685
|
|
|
587
|
-
${
|
|
686
|
+
${FRAGMENT9}
|
|
588
687
|
`;
|
|
589
688
|
|
|
590
689
|
// src/graphql/PaymentRequestsForNode.ts
|
|
@@ -615,7 +714,7 @@ query PaymentRequestsForNode(
|
|
|
615
714
|
}
|
|
616
715
|
}
|
|
617
716
|
|
|
618
|
-
${
|
|
717
|
+
${FRAGMENT10}
|
|
619
718
|
`;
|
|
620
719
|
|
|
621
720
|
// src/graphql/PayUmaInvoice.ts
|
|
@@ -642,7 +741,7 @@ var PayUmaInvoice = `
|
|
|
642
741
|
}
|
|
643
742
|
}
|
|
644
743
|
|
|
645
|
-
${
|
|
744
|
+
${FRAGMENT9}
|
|
646
745
|
`;
|
|
647
746
|
|
|
648
747
|
// src/graphql/RequestWithdrawal.ts
|
|
@@ -665,7 +764,7 @@ var RequestWithdrawal = `
|
|
|
665
764
|
}
|
|
666
765
|
}
|
|
667
766
|
|
|
668
|
-
${
|
|
767
|
+
${FRAGMENT11}
|
|
669
768
|
`;
|
|
670
769
|
|
|
671
770
|
// src/graphql/SendPayment.ts
|
|
@@ -692,7 +791,7 @@ var SendPayment = `
|
|
|
692
791
|
}
|
|
693
792
|
}
|
|
694
793
|
|
|
695
|
-
${
|
|
794
|
+
${FRAGMENT9}
|
|
696
795
|
`;
|
|
697
796
|
|
|
698
797
|
// src/graphql/SingleNodeDashboard.ts
|
|
@@ -803,7 +902,7 @@ query SingleNodeDashboard(
|
|
|
803
902
|
}
|
|
804
903
|
}
|
|
805
904
|
|
|
806
|
-
${
|
|
905
|
+
${FRAGMENT12}
|
|
807
906
|
${FRAGMENT}
|
|
808
907
|
`;
|
|
809
908
|
|
|
@@ -842,7 +941,7 @@ query TransactionsForNode(
|
|
|
842
941
|
}
|
|
843
942
|
}
|
|
844
943
|
|
|
845
|
-
${
|
|
944
|
+
${FRAGMENT12}
|
|
846
945
|
${FRAGMENT}
|
|
847
946
|
`;
|
|
848
947
|
|
|
@@ -857,7 +956,7 @@ subscription TransactionSubscription(
|
|
|
857
956
|
}
|
|
858
957
|
}
|
|
859
958
|
|
|
860
|
-
${
|
|
959
|
+
${FRAGMENT13}
|
|
861
960
|
`;
|
|
862
961
|
|
|
863
962
|
// src/NodeKeyLoaderCache.ts
|
|
@@ -1818,6 +1917,151 @@ var LightsparkClient = class {
|
|
|
1818
1917
|
}
|
|
1819
1918
|
});
|
|
1820
1919
|
}
|
|
1920
|
+
/**
|
|
1921
|
+
* Creates an UMA invitation. If you are part of the incentive program, you should use
|
|
1922
|
+
* [createUmaInvitationWithIncentives].
|
|
1923
|
+
*
|
|
1924
|
+
* @param inviterUma The UMA of the inviter.
|
|
1925
|
+
* @returns The invitation that was created.
|
|
1926
|
+
*/
|
|
1927
|
+
async createUmaInvitation(inviterUma) {
|
|
1928
|
+
return await this.executeRawQuery({
|
|
1929
|
+
queryPayload: CreateUmaInvitation,
|
|
1930
|
+
variables: {
|
|
1931
|
+
inviterUma
|
|
1932
|
+
},
|
|
1933
|
+
constructObject: (responseJson) => {
|
|
1934
|
+
if (!responseJson.create_uma_invitation?.invitation) {
|
|
1935
|
+
throw new LightsparkException(
|
|
1936
|
+
"CreateUmaInvitationError",
|
|
1937
|
+
"Unable to create UMA invitation"
|
|
1938
|
+
);
|
|
1939
|
+
}
|
|
1940
|
+
return UmaInvitationFromJson(
|
|
1941
|
+
responseJson.create_uma_invitation?.invitation
|
|
1942
|
+
);
|
|
1943
|
+
}
|
|
1944
|
+
});
|
|
1945
|
+
}
|
|
1946
|
+
/**
|
|
1947
|
+
* Creates an UMA invitation as part of the incentive program.
|
|
1948
|
+
* @param inviterUma The UMA of the inviter.
|
|
1949
|
+
* @param inviterPhoneNumber The phone number of the inviter in E164 format.
|
|
1950
|
+
* @param inviterRegion The region of the inviter.
|
|
1951
|
+
* @returns The invitation that was created.
|
|
1952
|
+
*/
|
|
1953
|
+
async createUmaInvitationWithIncentives(inviterUma, inviterPhoneNumber, inviterRegion) {
|
|
1954
|
+
const inviterPhoneHash = await this.hashPhoneNumber(inviterPhoneNumber);
|
|
1955
|
+
return await this.executeRawQuery({
|
|
1956
|
+
queryPayload: CreateUmaInvitationWithIncentives,
|
|
1957
|
+
variables: {
|
|
1958
|
+
inviterUma,
|
|
1959
|
+
inviterPhoneHash,
|
|
1960
|
+
inviterRegion
|
|
1961
|
+
},
|
|
1962
|
+
constructObject: (responseJson) => {
|
|
1963
|
+
if (!responseJson.create_uma_invitation_with_incentives?.invitation) {
|
|
1964
|
+
throw new LightsparkException(
|
|
1965
|
+
"CreateUmaInvitationError",
|
|
1966
|
+
"Unable to create UMA invitation"
|
|
1967
|
+
);
|
|
1968
|
+
}
|
|
1969
|
+
return UmaInvitationFromJson(
|
|
1970
|
+
responseJson.create_uma_invitation_with_incentives?.invitation
|
|
1971
|
+
);
|
|
1972
|
+
}
|
|
1973
|
+
});
|
|
1974
|
+
}
|
|
1975
|
+
/**
|
|
1976
|
+
* Claims an UMA invitation. If you are part of the incentive program, you should use
|
|
1977
|
+
* [claimUmaInvitationWithIncentives].
|
|
1978
|
+
*
|
|
1979
|
+
* @param invitationCode The invitation code to claim.
|
|
1980
|
+
* @param inviteeUma The UMA of the invitee.
|
|
1981
|
+
* @returns The invitation that was claimed.
|
|
1982
|
+
*/
|
|
1983
|
+
async claimUmaInvitation(invitationCode, inviteeUma) {
|
|
1984
|
+
return await this.executeRawQuery({
|
|
1985
|
+
queryPayload: ClaimUmaInvitation,
|
|
1986
|
+
variables: {
|
|
1987
|
+
invitationCode,
|
|
1988
|
+
inviteeUma
|
|
1989
|
+
},
|
|
1990
|
+
constructObject: (responseJson) => {
|
|
1991
|
+
if (!responseJson.claim_uma_invitation?.invitation) {
|
|
1992
|
+
throw new LightsparkException(
|
|
1993
|
+
"ClaimUmaInvitationError",
|
|
1994
|
+
"Unable to claim UMA invitation"
|
|
1995
|
+
);
|
|
1996
|
+
}
|
|
1997
|
+
return UmaInvitationFromJson(
|
|
1998
|
+
responseJson.claim_uma_invitation?.invitation
|
|
1999
|
+
);
|
|
2000
|
+
}
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
/**
|
|
2004
|
+
* Claims an UMA invitation as part of the incentive program.
|
|
2005
|
+
*
|
|
2006
|
+
* @param invitationCode The invitation code to claim.
|
|
2007
|
+
* @param inviteeUma The UMA of the invitee.
|
|
2008
|
+
* @param inviteePhoneNumber The phone number of the invitee in E164 format.
|
|
2009
|
+
* @param inviteeRegion The region of the invitee.
|
|
2010
|
+
* @returns The invitation that was claimed.
|
|
2011
|
+
*/
|
|
2012
|
+
async claimUmaInvitationWithIncentives(invitationCode, inviteeUma, inviteePhoneNumber, inviteeRegion) {
|
|
2013
|
+
const inviteePhoneHash = await this.hashPhoneNumber(inviteePhoneNumber);
|
|
2014
|
+
return await this.executeRawQuery({
|
|
2015
|
+
queryPayload: ClaimUmaInvitationWithIncentives,
|
|
2016
|
+
variables: {
|
|
2017
|
+
invitationCode,
|
|
2018
|
+
inviteeUma,
|
|
2019
|
+
inviteePhoneHash,
|
|
2020
|
+
inviteeRegion
|
|
2021
|
+
},
|
|
2022
|
+
constructObject: (responseJson) => {
|
|
2023
|
+
if (!responseJson.claim_uma_invitation_with_incentives?.invitation) {
|
|
2024
|
+
throw new LightsparkException(
|
|
2025
|
+
"ClaimUmaInvitationError",
|
|
2026
|
+
"Unable to claim UMA invitation"
|
|
2027
|
+
);
|
|
2028
|
+
}
|
|
2029
|
+
return UmaInvitationFromJson(
|
|
2030
|
+
responseJson.claim_uma_invitation_with_incentives?.invitation
|
|
2031
|
+
);
|
|
2032
|
+
}
|
|
2033
|
+
});
|
|
2034
|
+
}
|
|
2035
|
+
/**
|
|
2036
|
+
* Fetches an UMA invitation by its invitation code.
|
|
2037
|
+
*
|
|
2038
|
+
* @param invitationCode The code of the invitation to fetch.
|
|
2039
|
+
* @returns The invitation with the given code, or null if no invitation exists with that code.
|
|
2040
|
+
*/
|
|
2041
|
+
async fetchUmaInvitation(invitationCode) {
|
|
2042
|
+
return await this.executeRawQuery({
|
|
2043
|
+
queryPayload: FetchUmaInvitation,
|
|
2044
|
+
variables: {
|
|
2045
|
+
invitationCode
|
|
2046
|
+
},
|
|
2047
|
+
constructObject: (responseJson) => {
|
|
2048
|
+
if (!responseJson.uma_invitation_by_code) {
|
|
2049
|
+
return null;
|
|
2050
|
+
}
|
|
2051
|
+
return UmaInvitationFromJson(responseJson.uma_invitation_by_code);
|
|
2052
|
+
}
|
|
2053
|
+
});
|
|
2054
|
+
}
|
|
2055
|
+
async hashPhoneNumber(e164PhoneNumber) {
|
|
2056
|
+
const e164PhoneRegex = /^\+[1-9]\d{1,14}$/;
|
|
2057
|
+
if (!e164PhoneRegex.test(e164PhoneNumber)) {
|
|
2058
|
+
throw new LightsparkException(
|
|
2059
|
+
"InvalidPhoneNumber",
|
|
2060
|
+
"Invalid phone number. Phone number must be in E164 format."
|
|
2061
|
+
);
|
|
2062
|
+
}
|
|
2063
|
+
return await createSha256Hash(e164PhoneNumber, true);
|
|
2064
|
+
}
|
|
1821
2065
|
/**
|
|
1822
2066
|
* Executes a raw `Query` against the Lightspark API.
|
|
1823
2067
|
*
|
|
@@ -1896,6 +2140,8 @@ export {
|
|
|
1896
2140
|
CurrencyUnit_default as CurrencyUnit,
|
|
1897
2141
|
GraphNode_default as GraphNode,
|
|
1898
2142
|
HtlcAttemptFailureCode_default as HtlcAttemptFailureCode,
|
|
2143
|
+
IncentivesIneligibilityReason_default as IncentivesIneligibilityReason,
|
|
2144
|
+
IncentivesStatus_default as IncentivesStatus,
|
|
1899
2145
|
IncomingPayment_default as IncomingPayment,
|
|
1900
2146
|
IncomingPaymentAttemptStatus_default as IncomingPaymentAttemptStatus,
|
|
1901
2147
|
InvoiceType_default as InvoiceType,
|
|
@@ -1911,6 +2157,7 @@ export {
|
|
|
1911
2157
|
PaymentFailureReason_default as PaymentFailureReason,
|
|
1912
2158
|
PaymentRequestStatus_default as PaymentRequestStatus,
|
|
1913
2159
|
Permission_default as Permission,
|
|
2160
|
+
RegionCode_default as RegionCode,
|
|
1914
2161
|
RemoteSigningSubEventType_default as RemoteSigningSubEventType,
|
|
1915
2162
|
RemoteSigningWebhookHandler,
|
|
1916
2163
|
RiskRating_default as RiskRating,
|
|
@@ -1944,6 +2191,7 @@ export {
|
|
|
1944
2191
|
getSignablePayloadQuery,
|
|
1945
2192
|
getSignableQuery,
|
|
1946
2193
|
getTransactionQuery,
|
|
2194
|
+
getUmaInvitationQuery,
|
|
1947
2195
|
getWithdrawalQuery,
|
|
1948
2196
|
isBitcoinNetwork,
|
|
1949
2197
|
verifyAndParseWebhook
|