@lightsparkdev/lightspark-sdk 1.2.0 → 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.
Files changed (57) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{chunk-5RDIWPBE.js → chunk-D32EWIPX.js} +3 -1
  3. package/dist/{chunk-VTPDR6P4.js → chunk-GLL4KTUT.js} +353 -15
  4. package/dist/env.cjs +3 -1
  5. package/dist/env.d.cts +17 -0
  6. package/dist/env.js +2 -2
  7. package/dist/{index-f040db9f.d.ts → index-eb604025.d.ts} +1377 -15
  8. package/dist/index.cjs +682 -94
  9. package/dist/index.d.cts +41 -0
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.js +290 -37
  12. package/dist/objects/index.cjs +345 -5
  13. package/dist/objects/index.d.cts +4 -0
  14. package/dist/objects/index.d.ts +1 -1
  15. package/dist/objects/index.js +10 -2
  16. package/dist/{text-encoding-MDIPJAHL.js → text-encoding-26SMKBAQ.js} +3 -1
  17. package/package.json +4 -4
  18. package/src/auth/AccountTokenAuthProvider.ts +15 -11
  19. package/src/client.ts +201 -7
  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/helpers.ts +3 -1
  26. package/src/objects/Account.ts +8 -0
  27. package/src/objects/AccountToChannelsConnection.ts +5 -0
  28. package/src/objects/Channel.ts +31 -0
  29. package/src/objects/ClaimUmaInvitationInput.ts +26 -0
  30. package/src/objects/ClaimUmaInvitationOutput.ts +30 -0
  31. package/src/objects/ClaimUmaInvitationWithIncentivesInput.ts +44 -0
  32. package/src/objects/ClaimUmaInvitationWithIncentivesOutput.ts +33 -0
  33. package/src/objects/CreateInvitationWithIncentivesInput.ts +37 -0
  34. package/src/objects/CreateInvitationWithIncentivesOutput.ts +32 -0
  35. package/src/objects/CreateUmaInvitationInput.ts +22 -0
  36. package/src/objects/CreateUmaInvitationOutput.ts +30 -0
  37. package/src/objects/Entity.ts +13 -0
  38. package/src/objects/GraphNode.ts +28 -0
  39. package/src/objects/IncentivesIneligibilityReason.ts +24 -0
  40. package/src/objects/IncentivesStatus.ts +18 -0
  41. package/src/objects/IncomingPayment.ts +17 -0
  42. package/src/objects/LightsparkNodeWithOSK.ts +61 -0
  43. package/src/objects/LightsparkNodeWithRemoteSigning.ts +60 -0
  44. package/src/objects/OutgoingPayment.ts +20 -0
  45. package/src/objects/OutgoingPaymentAttempt.ts +31 -0
  46. package/src/objects/RegionCode.ts +510 -0
  47. package/src/objects/UmaInvitation.ts +113 -0
  48. package/src/objects/Wallet.ts +12 -0
  49. package/src/objects/WebhookEventType.ts +4 -0
  50. package/src/objects/WithdrawalRequest.ts +17 -0
  51. package/src/objects/index.ts +15 -0
  52. package/src/tests/integration/constants.ts +10 -0
  53. package/src/tests/integration/general-regtest.test.ts +633 -0
  54. package/src/tests/serialization.test.ts +5 -2
  55. package/src/webhooks.ts +1 -1
  56. package/src/tests/integration/client.test.ts +0 -207
  57. /package/dist/{chunk-NIMBE7W3.js → chunk-BMTV3EA2.js} +0 -0
@@ -19,16 +19,33 @@ import { WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson } from
19
19
  /** This object represents a request made for an L1 withdrawal from your Lightspark Node to any Bitcoin wallet. You can retrieve this object to receive detailed information about any withdrawal request made from your Lightspark account. **/
20
20
  class WithdrawalRequest implements Entity {
21
21
  constructor(
22
+ /**
23
+ * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
24
+ * string.
25
+ **/
22
26
  public readonly id: string,
27
+ /** The date and time when the entity was first created. **/
23
28
  public readonly createdAt: string,
29
+ /** The date and time when the entity was last updated. **/
24
30
  public readonly updatedAt: string,
31
+ /** The amount of money that should be withdrawn in this request. **/
25
32
  public readonly amount: CurrencyAmount,
33
+ /** The bitcoin address where the funds should be sent. **/
26
34
  public readonly bitcoinAddress: string,
35
+ /** The strategy that should be used to withdraw the funds from the account. **/
27
36
  public readonly withdrawalMode: WithdrawalMode,
37
+ /** The current status of this withdrawal request. **/
28
38
  public readonly status: WithdrawalRequestStatus,
39
+ /** The typename of the object **/
29
40
  public readonly typename: string,
41
+ /**
42
+ * If the requested amount is `-1` (i.e. everything), this field may contain an estimate of the amount
43
+ * for the withdrawal.
44
+ **/
30
45
  public readonly estimatedAmount?: CurrencyAmount | undefined,
46
+ /** The time at which this request was completed. **/
31
47
  public readonly completedAt?: string | undefined,
48
+ /** The withdrawal transaction that has been generated by this request. **/
32
49
  public readonly withdrawalId?: string | undefined,
33
50
  ) {
34
51
  autoBind(this);
@@ -22,10 +22,16 @@ export {
22
22
  export { default as ChannelSnapshot } from "./ChannelSnapshot.js";
23
23
  export { default as ChannelStatus } from "./ChannelStatus.js";
24
24
  export { default as ChannelToTransactionsConnection } from "./ChannelToTransactionsConnection.js";
25
+ export { default as ClaimUmaInvitationInput } from "./ClaimUmaInvitationInput.js";
26
+ export { default as ClaimUmaInvitationOutput } from "./ClaimUmaInvitationOutput.js";
27
+ export { default as ClaimUmaInvitationWithIncentivesInput } from "./ClaimUmaInvitationWithIncentivesInput.js";
28
+ export { default as ClaimUmaInvitationWithIncentivesOutput } from "./ClaimUmaInvitationWithIncentivesOutput.js";
25
29
  export { default as ComplianceProvider } from "./ComplianceProvider.js";
26
30
  export { default as Connection } from "./Connection.js";
27
31
  export { default as CreateApiTokenInput } from "./CreateApiTokenInput.js";
28
32
  export { default as CreateApiTokenOutput } from "./CreateApiTokenOutput.js";
33
+ export { default as CreateInvitationWithIncentivesInput } from "./CreateInvitationWithIncentivesInput.js";
34
+ export { default as CreateInvitationWithIncentivesOutput } from "./CreateInvitationWithIncentivesOutput.js";
29
35
  export { default as CreateInvoiceInput } from "./CreateInvoiceInput.js";
30
36
  export { default as CreateInvoiceOutput } from "./CreateInvoiceOutput.js";
31
37
  export { default as CreateLnurlInvoiceInput } from "./CreateLnurlInvoiceInput.js";
@@ -35,6 +41,8 @@ export { default as CreateTestModeInvoiceInput } from "./CreateTestModeInvoiceIn
35
41
  export { default as CreateTestModeInvoiceOutput } from "./CreateTestModeInvoiceOutput.js";
36
42
  export { default as CreateTestModePaymentInput } from "./CreateTestModePaymentInput.js";
37
43
  export { default as CreateTestModePaymentoutput } from "./CreateTestModePaymentoutput.js";
44
+ export { default as CreateUmaInvitationInput } from "./CreateUmaInvitationInput.js";
45
+ export { default as CreateUmaInvitationOutput } from "./CreateUmaInvitationOutput.js";
38
46
  export { default as CreateUmaInvoiceInput } from "./CreateUmaInvoiceInput.js";
39
47
  export { default as CurrencyAmount } from "./CurrencyAmount.js";
40
48
  export { default as CurrencyUnit } from "./CurrencyUnit.js";
@@ -51,6 +59,8 @@ export { default as GraphNode } from "./GraphNode.js";
51
59
  export { default as Hop, getHopQuery } from "./Hop.js";
52
60
  export { default as HtlcAttemptFailureCode } from "./HtlcAttemptFailureCode.js";
53
61
  export { default as IdAndSignature } from "./IdAndSignature.js";
62
+ export { default as IncentivesIneligibilityReason } from "./IncentivesIneligibilityReason.js";
63
+ export { default as IncentivesStatus } from "./IncentivesStatus.js";
54
64
  export { default as IncomingPayment } from "./IncomingPayment.js";
55
65
  export {
56
66
  default as IncomingPaymentAttempt,
@@ -109,6 +119,7 @@ export { default as PaymentRequestStatus } from "./PaymentRequestStatus.js";
109
119
  export { default as PayUmaInvoiceInput } from "./PayUmaInvoiceInput.js";
110
120
  export { default as Permission } from "./Permission.js";
111
121
  export { default as PostTransactionData } from "./PostTransactionData.js";
122
+ export { default as RegionCode } from "./RegionCode.js";
112
123
  export { default as RegisterPaymentInput } from "./RegisterPaymentInput.js";
113
124
  export { default as RegisterPaymentOutput } from "./RegisterPaymentOutput.js";
114
125
  export { default as ReleaseChannelPerCommitmentSecretInput } from "./ReleaseChannelPerCommitmentSecretInput.js";
@@ -148,6 +159,10 @@ export { default as TransactionFailures } from "./TransactionFailures.js";
148
159
  export { default as TransactionStatus } from "./TransactionStatus.js";
149
160
  export { default as TransactionType } from "./TransactionType.js";
150
161
  export { default as TransactionUpdate } from "./TransactionUpdate.js";
162
+ export {
163
+ default as UmaInvitation,
164
+ getUmaInvitationQuery,
165
+ } from "./UmaInvitation.js";
151
166
  export { default as UpdateChannelPerCommitmentPointInput } from "./UpdateChannelPerCommitmentPointInput.js";
152
167
  export { default as UpdateChannelPerCommitmentPointOutput } from "./UpdateChannelPerCommitmentPointOutput.js";
153
168
  export { default as UpdateNodeSharedSecretInput } from "./UpdateNodeSharedSecretInput.js";
@@ -0,0 +1,10 @@
1
+ export const TESTS_TIMEOUT = 60_000; //ms
2
+ export const LONG_TEST_TIMEOUT = 600_0000; //ms
3
+ export const DAY_IN_MS = 86400000; //ms
4
+ export const INVOICE_EXPIRY = 172800; //ms
5
+ export const TRANSACTION_WAIT_TIME = TESTS_TIMEOUT / 1000; //seconds
6
+ export const PAGINATION_STEP = 3;
7
+
8
+ export const REGTEST_SIGNING_KEY_PASSWORD = "1234!@#$";
9
+ export const ENCODED_REGTEST_REQUEST_FOR_TESTS =
10
+ "lnbcrt1pjj6zu2pp50qr2p79v65u9l8w3859259yj9fe5nt79hfw5k2am424440tlj09qdq0dp5jqargv4ex2ggcqzpgxqyz5vqsp5v0z0fu99jf37xcasu88evuphx9kdrpvtupdvhu329kx7k7un59zs9qyyssqegzx986rszy96te2kmxl7prlz0p8avthpwzhsz5v220uek7xxrz54svdsjpzwn04m6utj5ua9tmtktygc5xmjmjaqey9dadt33r8gxspvcg8wv";