@lightsparkdev/lightspark-sdk 0.4.8 → 0.4.10

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 (86) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{chunk-YTXDF6SQ.js → chunk-NXUFC5J7.js} +950 -246
  3. package/dist/{index-adeff42d.d.ts → index-3ffe9e7b.d.ts} +194 -56
  4. package/dist/index.cjs +962 -254
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.js +15 -9
  7. package/dist/objects/index.cjs +952 -246
  8. package/dist/objects/index.d.ts +1 -1
  9. package/dist/objects/index.js +5 -1
  10. package/package.json +1 -2
  11. package/src/client.ts +13 -14
  12. package/src/objects/Account.ts +36 -30
  13. package/src/objects/AccountToApiTokensConnection.ts +11 -6
  14. package/src/objects/AccountToNodesConnection.ts +11 -6
  15. package/src/objects/AccountToPaymentRequestsConnection.ts +20 -15
  16. package/src/objects/AccountToTransactionsConnection.ts +19 -14
  17. package/src/objects/AccountToWalletsConnection.ts +11 -6
  18. package/src/objects/ApiToken.ts +2 -1
  19. package/src/objects/Balances.ts +1 -0
  20. package/src/objects/BitcoinNetwork.ts +2 -1
  21. package/src/objects/BlockchainBalance.ts +1 -1
  22. package/src/objects/Channel.ts +2 -2
  23. package/src/objects/ChannelClosingTransaction.ts +2 -2
  24. package/src/objects/ChannelFees.ts +1 -0
  25. package/src/objects/ChannelOpeningTransaction.ts +2 -2
  26. package/src/objects/ChannelStatus.ts +1 -0
  27. package/src/objects/Connection.ts +387 -0
  28. package/src/objects/CreateInvoiceInput.ts +12 -0
  29. package/src/objects/CreateLnurlInvoiceInput.ts +10 -0
  30. package/src/objects/CreateTestModePaymentoutput.ts +1 -0
  31. package/src/objects/CryptoSanctionsScreeningProvider.ts +14 -0
  32. package/src/objects/CurrencyAmount.ts +1 -1
  33. package/src/objects/CurrencyUnit.ts +1 -0
  34. package/src/objects/Deposit.ts +2 -2
  35. package/src/objects/Entity.ts +1 -1
  36. package/src/objects/FeeEstimate.ts +1 -0
  37. package/src/objects/GraphNode.ts +2 -2
  38. package/src/objects/Hop.ts +2 -2
  39. package/src/objects/HtlcAttemptFailureCode.ts +1 -0
  40. package/src/objects/IncomingPayment.ts +19 -6
  41. package/src/objects/IncomingPaymentAttempt.ts +2 -2
  42. package/src/objects/IncomingPaymentAttemptStatus.ts +1 -1
  43. package/src/objects/IncomingPaymentToAttemptsConnection.ts +21 -1
  44. package/src/objects/Invoice.ts +2 -2
  45. package/src/objects/InvoiceData.ts +1 -1
  46. package/src/objects/InvoiceType.ts +1 -0
  47. package/src/objects/LightningTransaction.ts +2 -2
  48. package/src/objects/LightsparkNode.ts +12 -6
  49. package/src/objects/LightsparkNodeOwner.ts +2 -2
  50. package/src/objects/LightsparkNodePurpose.ts +1 -0
  51. package/src/objects/LightsparkNodeToChannelsConnection.ts +11 -6
  52. package/src/objects/Node.ts +2 -3
  53. package/src/objects/NodeAddress.ts +1 -1
  54. package/src/objects/NodeAddressType.ts +1 -1
  55. package/src/objects/OnChainTransaction.ts +2 -3
  56. package/src/objects/OutgoingPayment.ts +14 -6
  57. package/src/objects/OutgoingPaymentAttempt.ts +14 -6
  58. package/src/objects/OutgoingPaymentAttemptStatus.ts +1 -1
  59. package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +21 -1
  60. package/src/objects/OutgoingPaymentToAttemptsConnection.ts +21 -1
  61. package/src/objects/PageInfo.ts +1 -0
  62. package/src/objects/PaymentFailureReason.ts +1 -0
  63. package/src/objects/PaymentRequest.ts +2 -2
  64. package/src/objects/PaymentRequestData.ts +1 -1
  65. package/src/objects/PaymentRequestStatus.ts +1 -0
  66. package/src/objects/Permission.ts +1 -0
  67. package/src/objects/RiskRating.ts +18 -0
  68. package/src/objects/RoutingTransaction.ts +2 -2
  69. package/src/objects/RoutingTransactionFailureReason.ts +1 -0
  70. package/src/objects/ScreenBitcoinAddressesInput.ts +23 -0
  71. package/src/objects/ScreenBitcoinAddressesOutput.ts +25 -0
  72. package/src/objects/Transaction.ts +2 -2
  73. package/src/objects/TransactionFailures.ts +1 -0
  74. package/src/objects/TransactionStatus.ts +1 -0
  75. package/src/objects/TransactionType.ts +1 -0
  76. package/src/objects/Wallet.ts +632 -7
  77. package/src/objects/WalletStatus.ts +1 -0
  78. package/src/objects/WalletToPaymentRequestsConnection.ts +57 -0
  79. package/src/objects/WalletToTransactionsConnection.ts +57 -0
  80. package/src/objects/WebhookEventType.ts +3 -0
  81. package/src/objects/Withdrawal.ts +2 -2
  82. package/src/objects/WithdrawalMode.ts +1 -0
  83. package/src/objects/WithdrawalRequest.ts +2 -1
  84. package/src/objects/WithdrawalRequestStatus.ts +1 -0
  85. package/src/objects/index.ts +7 -0
  86. package/src/objects/.eslintrc.cjs +0 -5
@@ -1,5 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
+ /** This is an object representing information about a page returned by the Lightspark API. For more information, please see the “Pagination” section of our API docs for more information about its usage. **/
3
4
  type PageInfo = {
4
5
  hasNextPage?: boolean;
5
6
 
@@ -1,5 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
+ /** This is an enum of the potential reasons why an OutgoingPayment sent from a Lightspark Node may have failed. **/
3
4
  export enum PaymentFailureReason {
4
5
  /**
5
6
  * This is an enum value that represents values that could be added in the future.
@@ -1,7 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import type { Query } from "@lightsparkdev/core";
4
- import { LightsparkException } from "@lightsparkdev/core";
3
+ import { LightsparkException, type Query } from "@lightsparkdev/core";
5
4
  import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
6
5
  import type Entity from "./Entity.js";
7
6
  import type Invoice from "./Invoice.js";
@@ -9,6 +8,7 @@ import { InvoiceDataFromJson } from "./InvoiceData.js";
9
8
  import type PaymentRequestData from "./PaymentRequestData.js";
10
9
  import PaymentRequestStatus from "./PaymentRequestStatus.js";
11
10
 
11
+ /** This object contains information related to a payment request generated or received by a LightsparkNode. You can retrieve this object to receive payment information about a specific invoice. **/
12
12
  type PaymentRequest = Entity & {
13
13
  /**
14
14
  * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
@@ -6,7 +6,7 @@ import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
6
6
  import type InvoiceData from "./InvoiceData.js";
7
7
  import { NodeFromJson } from "./Node.js";
8
8
 
9
- /** The interface of a payment request on the Lightning Network (a.k.a. Lightning Invoice). **/
9
+ /** This object is an interface of a payment request on the Lightning Network (i.e., a Lightning Invoice). It contains data related to parsing the payment details of a Lightning Invoice. **/
10
10
  type PaymentRequestData = {
11
11
  encodedPaymentRequest: string;
12
12
 
@@ -1,5 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
+ /** This is an enum of the potential states that a payment request on the Lightning Network can take. **/
3
4
  export enum PaymentRequestStatus {
4
5
  /**
5
6
  * This is an enum value that represents values that could be added in the future.
@@ -1,5 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
+ /** This is an enum of the potential permissions that a Lightspark user can have in regards to account management. **/
3
4
  export enum Permission {
4
5
  /**
5
6
  * This is an enum value that represents values that could be added in the future.
@@ -0,0 +1,18 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ /** This is an enum of the potential risk ratings related to a transaction made over the Lightning Network. These risk ratings are returned from the CryptoSanctionScreeningProvider. **/
4
+ export enum RiskRating {
5
+ /**
6
+ * This is an enum value that represents values that could be added in the future.
7
+ * Clients should support unknown values as more of them could be added without notice.
8
+ */
9
+ FUTURE_VALUE = "FUTURE_VALUE",
10
+
11
+ HIGH_RISK = "HIGH_RISK",
12
+
13
+ LOW_RISK = "LOW_RISK",
14
+
15
+ UNKNOWN = "UNKNOWN",
16
+ }
17
+
18
+ export default RiskRating;
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import type { Query } from "@lightsparkdev/core";
3
+ import { type Query } from "@lightsparkdev/core";
4
4
  import type CurrencyAmount from "./CurrencyAmount.js";
5
5
  import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
6
6
  import type Entity from "./Entity.js";
@@ -11,7 +11,7 @@ import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.j
11
11
  import type Transaction from "./Transaction.js";
12
12
  import TransactionStatus from "./TransactionStatus.js";
13
13
 
14
- /** A transaction that was forwarded through a Lightspark node on the Lightning Network. **/
14
+ /** This object represents a transaction that was forwarded through a Lightspark node on the Lightning Network, i.e., a routed transaction. You can retrieve this object to receive information about any transaction routed through your Lightspark Node. **/
15
15
  type RoutingTransaction = LightningTransaction &
16
16
  Transaction &
17
17
  Entity & {
@@ -1,5 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
+ /** This is an enum of the potential reasons that an attempted routed transaction through a Lightspark node may have failed. **/
3
4
  export enum RoutingTransactionFailureReason {
4
5
  /**
5
6
  * This is an enum value that represents values that could be added in the future.
@@ -0,0 +1,23 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import CryptoSanctionsScreeningProvider from "./CryptoSanctionsScreeningProvider.js";
4
+
5
+ type ScreenBitcoinAddressesInput = {
6
+ provider: CryptoSanctionsScreeningProvider;
7
+
8
+ addresses: string[];
9
+ };
10
+
11
+ export const ScreenBitcoinAddressesInputFromJson = (
12
+ obj: any
13
+ ): ScreenBitcoinAddressesInput => {
14
+ return {
15
+ provider:
16
+ CryptoSanctionsScreeningProvider[
17
+ obj["screen_bitcoin_addresses_input_provider"]
18
+ ] ?? CryptoSanctionsScreeningProvider.FUTURE_VALUE,
19
+ addresses: obj["screen_bitcoin_addresses_input_addresses"],
20
+ } as ScreenBitcoinAddressesInput;
21
+ };
22
+
23
+ export default ScreenBitcoinAddressesInput;
@@ -0,0 +1,25 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import RiskRating from "./RiskRating.js";
4
+
5
+ type ScreenBitcoinAddressesOutput = {
6
+ ratings: RiskRating[];
7
+ };
8
+
9
+ export const ScreenBitcoinAddressesOutputFromJson = (
10
+ obj: any
11
+ ): ScreenBitcoinAddressesOutput => {
12
+ return {
13
+ ratings: obj["screen_bitcoin_addresses_output_ratings"].map(
14
+ (e) => RiskRating[e]
15
+ ),
16
+ } as ScreenBitcoinAddressesOutput;
17
+ };
18
+
19
+ export const FRAGMENT = `
20
+ fragment ScreenBitcoinAddressesOutputFragment on ScreenBitcoinAddressesOutput {
21
+ __typename
22
+ screen_bitcoin_addresses_output_ratings: ratings
23
+ }`;
24
+
25
+ export default ScreenBitcoinAddressesOutput;
@@ -1,7 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import type { Query } from "@lightsparkdev/core";
4
- import { LightsparkException } from "@lightsparkdev/core";
3
+ import { LightsparkException, type Query } from "@lightsparkdev/core";
5
4
  import type ChannelClosingTransaction from "./ChannelClosingTransaction.js";
6
5
  import type ChannelOpeningTransaction from "./ChannelOpeningTransaction.js";
7
6
  import type CurrencyAmount from "./CurrencyAmount.js";
@@ -18,6 +17,7 @@ import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.j
18
17
  import TransactionStatus from "./TransactionStatus.js";
19
18
  import type Withdrawal from "./Withdrawal.js";
20
19
 
20
+ /** This object represents a payment transaction. The transaction can occur either on a Bitcoin Network, or over the Lightning Network. You can retrieve this object to receive specific information about a particular transaction tied to your Lightspark Node. **/
21
21
  type Transaction = Entity & {
22
22
  /**
23
23
  * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
@@ -3,6 +3,7 @@
3
3
  import PaymentFailureReason from "./PaymentFailureReason.js";
4
4
  import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js";
5
5
 
6
+ /** This object represents payment failures associated with your Lightspark Node. **/
6
7
  type TransactionFailures = {
7
8
  paymentFailures?: PaymentFailureReason[];
8
9
 
@@ -1,5 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
+ /** This is an enum of the potential statuses a transaction associated with your Lightspark Node can take. **/
3
4
  export enum TransactionStatus {
4
5
  /**
5
6
  * This is an enum value that represents values that could be added in the future.
@@ -1,5 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
+ /** This is an enum of the potential types of transactions that can be associated with your Lightspark Node. **/
3
4
  export enum TransactionType {
4
5
  /**
5
6
  * This is an enum value that represents values that could be added in the future.