@lightsparkdev/lightspark-sdk 0.2.3 → 0.2.5

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @lightsparkdev/lightspark-sdk
2
2
 
3
+ ## 0.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 9491bd4: Bumping to the newest core patch version.
8
+
9
+ ## 0.2.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 5fb981cf8: Rename WalletDashboard to SingleNodeDashboard
14
+
3
15
  ## 0.2.3
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # The Lightspark JS+TS SDK
2
2
 
3
+ ![npm (scoped)](https://img.shields.io/npm/v/@lightsparkdev/lightspark-sdk)
4
+
3
5
  This is the Lightspark Typescript SDK, which can be used either from a node or browser environment. It's used to manage accounts, nodes, wallets, etc. See the examples directory for some examples of how to use it!
4
6
 
5
7
  ## Getting started
@@ -116,7 +118,6 @@ Then, run the examples:
116
118
  ```bash
117
119
  $ cd examples/node-scripts
118
120
  $ npm install
119
- $ ts-node getWalletDashboard.ts
120
121
  $ ts-node createInvoice.ts -a "100" -m "Whasssupppp"
121
122
  ```
122
123
 
@@ -879,29 +879,7 @@ declare class OutgoingPayment implements LightningTransaction {
879
879
  static getOutgoingPaymentQuery(id: string): Query<OutgoingPayment>;
880
880
  }
881
881
 
882
- type TransactionUpdate = {
883
- /**
884
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
885
- * string.
886
- **/
887
- id: string;
888
- /** The date and time when this transaction was initiated. **/
889
- createdAt: string;
890
- /** The date and time when the entity was last updated. **/
891
- updatedAt: string;
892
- /** The current status of this transaction. **/
893
- status: TransactionStatus;
894
- /** The amount of money involved in this transaction. **/
895
- amount: CurrencyAmount;
896
- /** The typename of the object **/
897
- typename: string;
898
- /** The date and time when this transaction was completed or failed. **/
899
- resolvedAt?: string;
900
- /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
901
- transactionHash?: string;
902
- };
903
-
904
- type WalletDashboard = {
882
+ type SingleNodeDashboard = {
905
883
  id: string;
906
884
  displayName: string;
907
885
  purpose: Maybe<LightsparkNodePurpose>;
@@ -925,6 +903,28 @@ type WalletDashboard = {
925
903
  recentTransactions: Transaction[];
926
904
  };
927
905
 
906
+ type TransactionUpdate = {
907
+ /**
908
+ * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
909
+ * string.
910
+ **/
911
+ id: string;
912
+ /** The date and time when this transaction was initiated. **/
913
+ createdAt: string;
914
+ /** The date and time when the entity was last updated. **/
915
+ updatedAt: string;
916
+ /** The current status of this transaction. **/
917
+ status: TransactionStatus;
918
+ /** The amount of money involved in this transaction. **/
919
+ amount: CurrencyAmount;
920
+ /** The typename of the object **/
921
+ typename: string;
922
+ /** The date and time when this transaction was completed or failed. **/
923
+ resolvedAt?: string;
924
+ /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
925
+ transactionHash?: string;
926
+ };
927
+
928
928
  declare enum WithdrawalMode {
929
929
  /**
930
930
  * This is an enum value that represents values that could be added in the future.
@@ -1203,7 +1203,7 @@ declare class LightsparkClient {
1203
1203
  */
1204
1204
  getAccountDashboard(nodeIds?: string[] | undefined, bitcoinNetwork?: BitcoinNetwork): Promise<AccountDashboard>;
1205
1205
  /**
1206
- * Gets a basic dashboard for a single node, including recent transactions. See `WalletDashboard` for which info is
1206
+ * Gets a basic dashboard for a single node, including recent transactions. See `SingleNodeDashboard` for which info is
1207
1207
  * included.
1208
1208
  *
1209
1209
  * @param nodeId The node ID for which to get a dashboard.
@@ -1212,7 +1212,7 @@ declare class LightsparkClient {
1212
1212
  * Defaults to undefined (no limit).
1213
1213
  * @returns A basic dashboard for the given node ID.
1214
1214
  */
1215
- getSingleNodeDashboard(nodeId: string, bitcoinNetwork?: BitcoinNetwork, transactionsAfterDate?: Maybe<string>): Promise<WalletDashboard>;
1215
+ getSingleNodeDashboard(nodeId: string, bitcoinNetwork?: BitcoinNetwork, transactionsAfterDate?: Maybe<string>): Promise<SingleNodeDashboard>;
1216
1216
  /**
1217
1217
  * Creates an invoice for the given node.
1218
1218
  *
@@ -1736,4 +1736,4 @@ type Withdrawal = OnChainTransaction & Transaction & Entity & {
1736
1736
  };
1737
1737
  declare const getWithdrawalQuery: (id: string) => Query<Withdrawal>;
1738
1738
 
1739
- export { LightningTransaction as $, Account as A, Balances as B, Channel as C, DeleteApiTokenInput as D, Deposit as E, getDepositQuery as F, Entity as G, FeeEstimate as H, FundNodeInput as I, FundNodeOutput as J, GraphNode as K, LightsparkClient as L, Hop as M, getHopQuery as N, HtlcAttemptFailureCode as O, IncomingPayment as P, IncomingPaymentAttempt as Q, getIncomingPaymentAttemptQuery as R, IncomingPaymentAttemptStatus as S, IncomingPaymentToAttemptsConnection as T, Invoice as U, getInvoiceQuery as V, InvoiceData as W, InvoiceType as X, LightningFeeEstimateForInvoiceInput as Y, LightningFeeEstimateForNodeInput as Z, LightningFeeEstimateOutput as _, AccountToApiTokensConnection as a, getLightningTransactionQuery as a0, LightsparkNode as a1, LightsparkNodePurpose as a2, LightsparkNodeStatus as a3, LightsparkNodeToChannelsConnection as a4, Node as a5, NodeAddress as a6, NodeAddressType as a7, NodeToAddressesConnection as a8, OnChainTransaction as a9, TransactionFailures as aA, TransactionStatus as aB, TransactionType as aC, TransactionUpdate as aD, Wallet as aE, WalletDashboard as aF, WebhookEventType as aG, Withdrawal as aH, getWithdrawalQuery as aI, WithdrawalMode as aJ, WithdrawalRequest as aK, WithdrawalRequestStatus as aL, WithdrawalRequestToChannelClosingTransactionsConnection as aM, WithdrawalRequestToChannelOpeningTransactionsConnection as aN, getOnChainTransactionQuery as aa, OutgoingPayment as ab, OutgoingPaymentAttempt as ac, OutgoingPaymentAttemptStatus as ad, OutgoingPaymentAttemptToHopsConnection as ae, OutgoingPaymentToAttemptsConnection as af, PageInfo as ag, PayInvoiceInput as ah, PayInvoiceOutput as ai, PaymentFailureReason as aj, PaymentRequest as ak, getPaymentRequestQuery as al, PaymentRequestData as am, PaymentRequestStatus as an, Permission as ao, RequestWithdrawalInput as ap, RequestWithdrawalOutput as aq, RichText as ar, RoutingTransaction as as, getRoutingTransactionQuery as at, RoutingTransactionFailureReason as au, Secret as av, SendPaymentInput as aw, SendPaymentOutput as ax, Transaction as ay, getTransactionQuery as az, AccountToChannelsConnection as b, AccountToNodesConnection as c, AccountToPaymentRequestsConnection as d, AccountToTransactionsConnection as e, AccountToWalletsConnection as f, ApiToken as g, getApiTokenQuery as h, BitcoinNetwork as i, BlockchainBalance as j, ChannelClosingTransaction as k, getChannelClosingTransactionQuery as l, ChannelFees as m, ChannelOpeningTransaction as n, getChannelOpeningTransactionQuery as o, ChannelStatus as p, ChannelToTransactionsConnection as q, CreateApiTokenInput as r, CreateApiTokenOutput as s, CreateInvoiceInput as t, CreateInvoiceOutput as u, CreateNodeWalletAddressInput as v, CreateNodeWalletAddressOutput as w, CurrencyAmount as x, CurrencyUnit as y, DeleteApiTokenOutput as z };
1739
+ export { LightningTransaction as $, Account as A, Balances as B, Channel as C, DeleteApiTokenInput as D, Deposit as E, getDepositQuery as F, Entity as G, FeeEstimate as H, FundNodeInput as I, FundNodeOutput as J, GraphNode as K, LightsparkClient as L, Hop as M, getHopQuery as N, HtlcAttemptFailureCode as O, IncomingPayment as P, IncomingPaymentAttempt as Q, getIncomingPaymentAttemptQuery as R, IncomingPaymentAttemptStatus as S, IncomingPaymentToAttemptsConnection as T, Invoice as U, getInvoiceQuery as V, InvoiceData as W, InvoiceType as X, LightningFeeEstimateForInvoiceInput as Y, LightningFeeEstimateForNodeInput as Z, LightningFeeEstimateOutput as _, AccountToApiTokensConnection as a, getLightningTransactionQuery as a0, LightsparkNode as a1, LightsparkNodePurpose as a2, LightsparkNodeStatus as a3, LightsparkNodeToChannelsConnection as a4, Node as a5, NodeAddress as a6, NodeAddressType as a7, NodeToAddressesConnection as a8, OnChainTransaction as a9, getTransactionQuery as aA, TransactionFailures as aB, TransactionStatus as aC, TransactionType as aD, TransactionUpdate as aE, Wallet as aF, WebhookEventType as aG, Withdrawal as aH, getWithdrawalQuery as aI, WithdrawalMode as aJ, WithdrawalRequest as aK, WithdrawalRequestStatus as aL, WithdrawalRequestToChannelClosingTransactionsConnection as aM, WithdrawalRequestToChannelOpeningTransactionsConnection as aN, getOnChainTransactionQuery as aa, OutgoingPayment as ab, OutgoingPaymentAttempt as ac, OutgoingPaymentAttemptStatus as ad, OutgoingPaymentAttemptToHopsConnection as ae, OutgoingPaymentToAttemptsConnection as af, PageInfo as ag, PayInvoiceInput as ah, PayInvoiceOutput as ai, PaymentFailureReason as aj, PaymentRequest as ak, getPaymentRequestQuery as al, PaymentRequestData as am, PaymentRequestStatus as an, Permission as ao, RequestWithdrawalInput as ap, RequestWithdrawalOutput as aq, RichText as ar, RoutingTransaction as as, getRoutingTransactionQuery as at, RoutingTransactionFailureReason as au, Secret as av, SendPaymentInput as aw, SendPaymentOutput as ax, SingleNodeDashboard as ay, Transaction as az, AccountToChannelsConnection as b, AccountToNodesConnection as c, AccountToPaymentRequestsConnection as d, AccountToTransactionsConnection as e, AccountToWalletsConnection as f, ApiToken as g, getApiTokenQuery as h, BitcoinNetwork as i, BlockchainBalance as j, ChannelClosingTransaction as k, getChannelClosingTransactionQuery as l, ChannelFees as m, ChannelOpeningTransaction as n, getChannelOpeningTransactionQuery as o, ChannelStatus as p, ChannelToTransactionsConnection as q, CreateApiTokenInput as r, CreateApiTokenOutput as s, CreateInvoiceInput as t, CreateInvoiceOutput as u, CreateNodeWalletAddressInput as v, CreateNodeWalletAddressOutput as w, CurrencyAmount as x, CurrencyUnit as y, DeleteApiTokenOutput as z };
package/dist/index.cjs CHANGED
@@ -35,7 +35,7 @@ var require_package = __commonJS({
35
35
  "package.json"(exports, module2) {
36
36
  module2.exports = {
37
37
  name: "@lightsparkdev/lightspark-sdk",
38
- version: "0.2.2",
38
+ version: "0.2.5",
39
39
  description: "Lightspark JS SDK",
40
40
  author: "Lightspark Inc.",
41
41
  keywords: [
@@ -92,24 +92,25 @@ var require_package = __commonJS({
92
92
  ],
93
93
  scripts: {
94
94
  build: "tsup --entry src/index.ts --entry src/objects/index.ts --format cjs,esm --dts",
95
- "copy-static": "cp ./package.json ./README.md ./LICENSE ./dist/",
96
- dev: "yarn build -- --watch",
97
95
  clean: "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
98
- lint: "npx prettier --check ./src",
96
+ dev: "yarn build -- --watch",
97
+ docs: "typedoc src",
99
98
  format: "npx prettier --write ./src",
99
+ lint: "npx prettier --check ./src",
100
+ postversion: "yarn build",
100
101
  test: "tsc --noEmit --project tsconfig-test.json && jest --no-cache --runInBand --bail",
101
- "type-check": "tsc --noEmit",
102
- postversion: "yarn build"
102
+ "type-check": "tsc --noEmit"
103
103
  },
104
104
  license: "Apache-2.0",
105
105
  dependencies: {
106
- "@lightsparkdev/core": "^0.2.1",
106
+ "@lightsparkdev/core": "^0.2.3",
107
107
  "auto-bind": "^5.0.1",
108
108
  crypto: "^1.0.1",
109
109
  "crypto-browserify": "^3.12.0",
110
110
  dayjs: "^1.11.7",
111
111
  graphql: "^16.6.0",
112
112
  "graphql-ws": "^5.11.3",
113
+ typedoc: "^0.24.7",
113
114
  ws: "^8.12.1",
114
115
  "zen-observable-ts": "^1.1.0"
115
116
  },
@@ -121,8 +122,8 @@ var require_package = __commonJS({
121
122
  "prettier-plugin-organize-imports": "^3.2.2",
122
123
  "ts-jest": "^29.0.5",
123
124
  "ts-node": "^10.9.1",
124
- typescript: "^4.9.5",
125
- tsconfig: "*"
125
+ tsconfig: "*",
126
+ typescript: "^4.9.5"
126
127
  }
127
128
  };
128
129
  }
@@ -5558,7 +5559,7 @@ var LightsparkClient = class {
5558
5559
  };
5559
5560
  }
5560
5561
  /**
5561
- * Gets a basic dashboard for a single node, including recent transactions. See `WalletDashboard` for which info is
5562
+ * Gets a basic dashboard for a single node, including recent transactions. See `SingleNodeDashboard` for which info is
5562
5563
  * included.
5563
5564
  *
5564
5565
  * @param nodeId The node ID for which to get a dashboard.
@@ -5568,12 +5569,15 @@ var LightsparkClient = class {
5568
5569
  * @returns A basic dashboard for the given node ID.
5569
5570
  */
5570
5571
  async getSingleNodeDashboard(nodeId, bitcoinNetwork = BitcoinNetwork_default.MAINNET, transactionsAfterDate = void 0) {
5571
- const response = await this.requester.makeRawRequest(SingleNodeDashboard, {
5572
- nodeId,
5573
- network: bitcoinNetwork,
5574
- numTransactions: 20,
5575
- transactionsAfterDate
5576
- });
5572
+ const response = await this.requester.makeRawRequest(
5573
+ SingleNodeDashboard,
5574
+ {
5575
+ nodeId,
5576
+ network: bitcoinNetwork,
5577
+ numTransactions: 20,
5578
+ transactionsAfterDate
5579
+ }
5580
+ );
5577
5581
  if (!response.current_account) {
5578
5582
  throw new import_core7.LightsparkAuthException("No current account");
5579
5583
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AuthProvider } from '@lightsparkdev/core';
2
- 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 BitcoinNetwork, j as BlockchainBalance, C as Channel, k as ChannelClosingTransaction, m as ChannelFees, n as ChannelOpeningTransaction, p as ChannelStatus, q as ChannelToTransactionsConnection, r as CreateApiTokenInput, s as CreateApiTokenOutput, t as CreateInvoiceInput, u as CreateInvoiceOutput, v as CreateNodeWalletAddressInput, w as CreateNodeWalletAddressOutput, x as CurrencyAmount, y as CurrencyUnit, D as DeleteApiTokenInput, z as DeleteApiTokenOutput, E as Deposit, G as Entity, H as FeeEstimate, I as FundNodeInput, J as FundNodeOutput, K as GraphNode, M as Hop, O as HtlcAttemptFailureCode, P as IncomingPayment, Q as IncomingPaymentAttempt, S as IncomingPaymentAttemptStatus, T as IncomingPaymentToAttemptsConnection, U as Invoice, W as InvoiceData, X as InvoiceType, Y as LightningFeeEstimateForInvoiceInput, Z as LightningFeeEstimateForNodeInput, _ as LightningFeeEstimateOutput, $ as LightningTransaction, L as LightsparkClient, a1 as LightsparkNode, a2 as LightsparkNodePurpose, a3 as LightsparkNodeStatus, a4 as LightsparkNodeToChannelsConnection, a5 as Node, a6 as NodeAddress, a7 as NodeAddressType, a8 as NodeToAddressesConnection, a9 as OnChainTransaction, ab as OutgoingPayment, ac as OutgoingPaymentAttempt, ad as OutgoingPaymentAttemptStatus, ae as OutgoingPaymentAttemptToHopsConnection, af as OutgoingPaymentToAttemptsConnection, ag as PageInfo, ah as PayInvoiceInput, ai as PayInvoiceOutput, aj as PaymentFailureReason, ak as PaymentRequest, am as PaymentRequestData, an as PaymentRequestStatus, ao as Permission, ap as RequestWithdrawalInput, aq as RequestWithdrawalOutput, ar as RichText, as as RoutingTransaction, au as RoutingTransactionFailureReason, av as Secret, aw as SendPaymentInput, ax as SendPaymentOutput, ay as Transaction, aA as TransactionFailures, aB as TransactionStatus, aC as TransactionType, aD as TransactionUpdate, aE as Wallet, aF as WalletDashboard, aG as WebhookEventType, aH as Withdrawal, aJ as WithdrawalMode, aK as WithdrawalRequest, aL as WithdrawalRequestStatus, aM as WithdrawalRequestToChannelClosingTransactionsConnection, aN as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, l as getChannelClosingTransactionQuery, o as getChannelOpeningTransactionQuery, F as getDepositQuery, N as getHopQuery, R as getIncomingPaymentAttemptQuery, V as getInvoiceQuery, a0 as getLightningTransactionQuery, aa as getOnChainTransactionQuery, al as getPaymentRequestQuery, at as getRoutingTransactionQuery, az as getTransactionQuery, aI as getWithdrawalQuery } from './Withdrawal-6e015ff8.js';
2
+ 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 BitcoinNetwork, j as BlockchainBalance, C as Channel, k as ChannelClosingTransaction, m as ChannelFees, n as ChannelOpeningTransaction, p as ChannelStatus, q as ChannelToTransactionsConnection, r as CreateApiTokenInput, s as CreateApiTokenOutput, t as CreateInvoiceInput, u as CreateInvoiceOutput, v as CreateNodeWalletAddressInput, w as CreateNodeWalletAddressOutput, x as CurrencyAmount, y as CurrencyUnit, D as DeleteApiTokenInput, z as DeleteApiTokenOutput, E as Deposit, G as Entity, H as FeeEstimate, I as FundNodeInput, J as FundNodeOutput, K as GraphNode, M as Hop, O as HtlcAttemptFailureCode, P as IncomingPayment, Q as IncomingPaymentAttempt, S as IncomingPaymentAttemptStatus, T as IncomingPaymentToAttemptsConnection, U as Invoice, W as InvoiceData, X as InvoiceType, Y as LightningFeeEstimateForInvoiceInput, Z as LightningFeeEstimateForNodeInput, _ as LightningFeeEstimateOutput, $ as LightningTransaction, L as LightsparkClient, a1 as LightsparkNode, a2 as LightsparkNodePurpose, a3 as LightsparkNodeStatus, a4 as LightsparkNodeToChannelsConnection, a5 as Node, a6 as NodeAddress, a7 as NodeAddressType, a8 as NodeToAddressesConnection, a9 as OnChainTransaction, ab as OutgoingPayment, ac as OutgoingPaymentAttempt, ad as OutgoingPaymentAttemptStatus, ae as OutgoingPaymentAttemptToHopsConnection, af as OutgoingPaymentToAttemptsConnection, ag as PageInfo, ah as PayInvoiceInput, ai as PayInvoiceOutput, aj as PaymentFailureReason, ak as PaymentRequest, am as PaymentRequestData, an as PaymentRequestStatus, ao as Permission, ap as RequestWithdrawalInput, aq as RequestWithdrawalOutput, ar as RichText, as as RoutingTransaction, au as RoutingTransactionFailureReason, av as Secret, aw as SendPaymentInput, ax as SendPaymentOutput, ay as SingleNodeDashboard, az as Transaction, aB as TransactionFailures, aC as TransactionStatus, aD as TransactionType, aE as TransactionUpdate, aF as Wallet, aG as WebhookEventType, aH as Withdrawal, aJ as WithdrawalMode, aK as WithdrawalRequest, aL as WithdrawalRequestStatus, aM as WithdrawalRequestToChannelClosingTransactionsConnection, aN as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, l as getChannelClosingTransactionQuery, o as getChannelOpeningTransactionQuery, F as getDepositQuery, N as getHopQuery, R as getIncomingPaymentAttemptQuery, V as getInvoiceQuery, a0 as getLightningTransactionQuery, aa as getOnChainTransactionQuery, al as getPaymentRequestQuery, at as getRoutingTransactionQuery, aA as getTransactionQuery, aI as getWithdrawalQuery } from './Withdrawal-f68ab02c.js';
3
3
  import 'zen-observable';
4
4
 
5
5
  declare class AccountTokenAuthProvider implements AuthProvider {
package/dist/index.js CHANGED
@@ -60,14 +60,14 @@ import {
60
60
  getRoutingTransactionQuery,
61
61
  getTransactionQuery,
62
62
  getWithdrawalQuery
63
- } from "./chunk-ZBDRJ7IU.js";
63
+ } from "./chunk-OKTW3ZBO.js";
64
64
 
65
65
  // package.json
66
66
  var require_package = __commonJS({
67
67
  "package.json"(exports, module) {
68
68
  module.exports = {
69
69
  name: "@lightsparkdev/lightspark-sdk",
70
- version: "0.2.2",
70
+ version: "0.2.5",
71
71
  description: "Lightspark JS SDK",
72
72
  author: "Lightspark Inc.",
73
73
  keywords: [
@@ -124,24 +124,25 @@ var require_package = __commonJS({
124
124
  ],
125
125
  scripts: {
126
126
  build: "tsup --entry src/index.ts --entry src/objects/index.ts --format cjs,esm --dts",
127
- "copy-static": "cp ./package.json ./README.md ./LICENSE ./dist/",
128
- dev: "yarn build -- --watch",
129
127
  clean: "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
130
- lint: "npx prettier --check ./src",
128
+ dev: "yarn build -- --watch",
129
+ docs: "typedoc src",
131
130
  format: "npx prettier --write ./src",
131
+ lint: "npx prettier --check ./src",
132
+ postversion: "yarn build",
132
133
  test: "tsc --noEmit --project tsconfig-test.json && jest --no-cache --runInBand --bail",
133
- "type-check": "tsc --noEmit",
134
- postversion: "yarn build"
134
+ "type-check": "tsc --noEmit"
135
135
  },
136
136
  license: "Apache-2.0",
137
137
  dependencies: {
138
- "@lightsparkdev/core": "^0.2.1",
138
+ "@lightsparkdev/core": "^0.2.3",
139
139
  "auto-bind": "^5.0.1",
140
140
  crypto: "^1.0.1",
141
141
  "crypto-browserify": "^3.12.0",
142
142
  dayjs: "^1.11.7",
143
143
  graphql: "^16.6.0",
144
144
  "graphql-ws": "^5.11.3",
145
+ typedoc: "^0.24.7",
145
146
  ws: "^8.12.1",
146
147
  "zen-observable-ts": "^1.1.0"
147
148
  },
@@ -153,8 +154,8 @@ var require_package = __commonJS({
153
154
  "prettier-plugin-organize-imports": "^3.2.2",
154
155
  "ts-jest": "^29.0.5",
155
156
  "ts-node": "^10.9.1",
156
- typescript: "^4.9.5",
157
- tsconfig: "*"
157
+ tsconfig: "*",
158
+ typescript: "^4.9.5"
158
159
  }
159
160
  };
160
161
  }
@@ -845,7 +846,7 @@ var LightsparkClient = class {
845
846
  };
846
847
  }
847
848
  /**
848
- * Gets a basic dashboard for a single node, including recent transactions. See `WalletDashboard` for which info is
849
+ * Gets a basic dashboard for a single node, including recent transactions. See `SingleNodeDashboard` for which info is
849
850
  * included.
850
851
  *
851
852
  * @param nodeId The node ID for which to get a dashboard.
@@ -855,12 +856,15 @@ var LightsparkClient = class {
855
856
  * @returns A basic dashboard for the given node ID.
856
857
  */
857
858
  async getSingleNodeDashboard(nodeId, bitcoinNetwork = BitcoinNetwork_default.MAINNET, transactionsAfterDate = void 0) {
858
- const response = await this.requester.makeRawRequest(SingleNodeDashboard, {
859
- nodeId,
860
- network: bitcoinNetwork,
861
- numTransactions: 20,
862
- transactionsAfterDate
863
- });
859
+ const response = await this.requester.makeRawRequest(
860
+ SingleNodeDashboard,
861
+ {
862
+ nodeId,
863
+ network: bitcoinNetwork,
864
+ numTransactions: 20,
865
+ transactionsAfterDate
866
+ }
867
+ );
864
868
  if (!response.current_account) {
865
869
  throw new LightsparkAuthException("No current account");
866
870
  }
@@ -1,3 +1,3 @@
1
- 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 BitcoinNetwork, j as BlockchainBalance, C as Channel, k as ChannelClosingTransaction, m as ChannelFees, n as ChannelOpeningTransaction, p as ChannelStatus, q as ChannelToTransactionsConnection, r as CreateApiTokenInput, s as CreateApiTokenOutput, t as CreateInvoiceInput, u as CreateInvoiceOutput, v as CreateNodeWalletAddressInput, w as CreateNodeWalletAddressOutput, x as CurrencyAmount, y as CurrencyUnit, D as DeleteApiTokenInput, z as DeleteApiTokenOutput, E as Deposit, G as Entity, H as FeeEstimate, I as FundNodeInput, J as FundNodeOutput, K as GraphNode, M as Hop, O as HtlcAttemptFailureCode, P as IncomingPayment, Q as IncomingPaymentAttempt, S as IncomingPaymentAttemptStatus, T as IncomingPaymentToAttemptsConnection, U as Invoice, W as InvoiceData, X as InvoiceType, Y as LightningFeeEstimateForInvoiceInput, Z as LightningFeeEstimateForNodeInput, _ as LightningFeeEstimateOutput, $ as LightningTransaction, a1 as LightsparkNode, a2 as LightsparkNodePurpose, a3 as LightsparkNodeStatus, a4 as LightsparkNodeToChannelsConnection, a5 as Node, a6 as NodeAddress, a7 as NodeAddressType, a8 as NodeToAddressesConnection, a9 as OnChainTransaction, ab as OutgoingPayment, ac as OutgoingPaymentAttempt, ad as OutgoingPaymentAttemptStatus, ae as OutgoingPaymentAttemptToHopsConnection, af as OutgoingPaymentToAttemptsConnection, ag as PageInfo, ah as PayInvoiceInput, ai as PayInvoiceOutput, aj as PaymentFailureReason, ak as PaymentRequest, am as PaymentRequestData, an as PaymentRequestStatus, ao as Permission, ap as RequestWithdrawalInput, aq as RequestWithdrawalOutput, ar as RichText, as as RoutingTransaction, au as RoutingTransactionFailureReason, av as Secret, aw as SendPaymentInput, ax as SendPaymentOutput, ay as Transaction, aA as TransactionFailures, aB as TransactionStatus, aC as TransactionType, aD as TransactionUpdate, aE as Wallet, aF as WalletDashboard, aG as WebhookEventType, aH as Withdrawal, aJ as WithdrawalMode, aK as WithdrawalRequest, aL as WithdrawalRequestStatus, aM as WithdrawalRequestToChannelClosingTransactionsConnection, aN as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, l as getChannelClosingTransactionQuery, o as getChannelOpeningTransactionQuery, F as getDepositQuery, N as getHopQuery, R as getIncomingPaymentAttemptQuery, V as getInvoiceQuery, a0 as getLightningTransactionQuery, aa as getOnChainTransactionQuery, al as getPaymentRequestQuery, at as getRoutingTransactionQuery, az as getTransactionQuery, aI as getWithdrawalQuery } from '../Withdrawal-6e015ff8.js';
1
+ 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 BitcoinNetwork, j as BlockchainBalance, C as Channel, k as ChannelClosingTransaction, m as ChannelFees, n as ChannelOpeningTransaction, p as ChannelStatus, q as ChannelToTransactionsConnection, r as CreateApiTokenInput, s as CreateApiTokenOutput, t as CreateInvoiceInput, u as CreateInvoiceOutput, v as CreateNodeWalletAddressInput, w as CreateNodeWalletAddressOutput, x as CurrencyAmount, y as CurrencyUnit, D as DeleteApiTokenInput, z as DeleteApiTokenOutput, E as Deposit, G as Entity, H as FeeEstimate, I as FundNodeInput, J as FundNodeOutput, K as GraphNode, M as Hop, O as HtlcAttemptFailureCode, P as IncomingPayment, Q as IncomingPaymentAttempt, S as IncomingPaymentAttemptStatus, T as IncomingPaymentToAttemptsConnection, U as Invoice, W as InvoiceData, X as InvoiceType, Y as LightningFeeEstimateForInvoiceInput, Z as LightningFeeEstimateForNodeInput, _ as LightningFeeEstimateOutput, $ as LightningTransaction, a1 as LightsparkNode, a2 as LightsparkNodePurpose, a3 as LightsparkNodeStatus, a4 as LightsparkNodeToChannelsConnection, a5 as Node, a6 as NodeAddress, a7 as NodeAddressType, a8 as NodeToAddressesConnection, a9 as OnChainTransaction, ab as OutgoingPayment, ac as OutgoingPaymentAttempt, ad as OutgoingPaymentAttemptStatus, ae as OutgoingPaymentAttemptToHopsConnection, af as OutgoingPaymentToAttemptsConnection, ag as PageInfo, ah as PayInvoiceInput, ai as PayInvoiceOutput, aj as PaymentFailureReason, ak as PaymentRequest, am as PaymentRequestData, an as PaymentRequestStatus, ao as Permission, ap as RequestWithdrawalInput, aq as RequestWithdrawalOutput, ar as RichText, as as RoutingTransaction, au as RoutingTransactionFailureReason, av as Secret, aw as SendPaymentInput, ax as SendPaymentOutput, ay as SingleNodeDashboard, az as Transaction, aB as TransactionFailures, aC as TransactionStatus, aD as TransactionType, aE as TransactionUpdate, aF as Wallet, aG as WebhookEventType, aH as Withdrawal, aJ as WithdrawalMode, aK as WithdrawalRequest, aL as WithdrawalRequestStatus, aM as WithdrawalRequestToChannelClosingTransactionsConnection, aN as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, l as getChannelClosingTransactionQuery, o as getChannelOpeningTransactionQuery, F as getDepositQuery, N as getHopQuery, R as getIncomingPaymentAttemptQuery, V as getInvoiceQuery, a0 as getLightningTransactionQuery, aa as getOnChainTransactionQuery, al as getPaymentRequestQuery, at as getRoutingTransactionQuery, aA as getTransactionQuery, aI as getWithdrawalQuery } from '../Withdrawal-f68ab02c.js';
2
2
  import '@lightsparkdev/core';
3
3
  import 'zen-observable';
@@ -42,7 +42,7 @@ import {
42
42
  getRoutingTransactionQuery,
43
43
  getTransactionQuery,
44
44
  getWithdrawalQuery
45
- } from "../chunk-ZBDRJ7IU.js";
45
+ } from "../chunk-OKTW3ZBO.js";
46
46
  export {
47
47
  Account_default as Account,
48
48
  AccountToChannelsConnection_default as AccountToChannelsConnection,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightsparkdev/lightspark-sdk",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Lightspark JS SDK",
5
5
  "author": "Lightspark Inc.",
6
6
  "keywords": [
@@ -57,24 +57,25 @@
57
57
  ],
58
58
  "scripts": {
59
59
  "build": "tsup --entry src/index.ts --entry src/objects/index.ts --format cjs,esm --dts",
60
- "copy-static": "cp ./package.json ./README.md ./LICENSE ./dist/",
61
- "dev": "yarn build -- --watch",
62
60
  "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
63
- "lint": "npx prettier --check ./src",
61
+ "dev": "yarn build -- --watch",
62
+ "docs": "typedoc src",
64
63
  "format": "npx prettier --write ./src",
64
+ "lint": "npx prettier --check ./src",
65
+ "postversion": "yarn build",
65
66
  "test": "tsc --noEmit --project tsconfig-test.json && jest --no-cache --runInBand --bail",
66
- "type-check": "tsc --noEmit",
67
- "postversion": "yarn build"
67
+ "type-check": "tsc --noEmit"
68
68
  },
69
69
  "license": "Apache-2.0",
70
70
  "dependencies": {
71
- "@lightsparkdev/core": "^0.2.2",
71
+ "@lightsparkdev/core": "^0.2.3",
72
72
  "auto-bind": "^5.0.1",
73
73
  "crypto": "^1.0.1",
74
74
  "crypto-browserify": "^3.12.0",
75
75
  "dayjs": "^1.11.7",
76
76
  "graphql": "^16.6.0",
77
77
  "graphql-ws": "^5.11.3",
78
+ "typedoc": "^0.24.7",
78
79
  "ws": "^8.12.1",
79
80
  "zen-observable-ts": "^1.1.0"
80
81
  },
@@ -86,7 +87,7 @@
86
87
  "prettier-plugin-organize-imports": "^3.2.2",
87
88
  "ts-jest": "^29.0.5",
88
89
  "ts-node": "^10.9.1",
89
- "typescript": "^4.9.5",
90
- "tsconfig": "*"
90
+ "tsconfig": "*",
91
+ "typescript": "^4.9.5"
91
92
  }
92
93
  }
package/src/client.ts CHANGED
@@ -33,7 +33,7 @@ import { PayInvoice } from "./graphql/PayInvoice.js";
33
33
  import { RecoverNodeSigningKey } from "./graphql/RecoverNodeSigningKey.js";
34
34
  import { RequestWithdrawal } from "./graphql/RequestWithdrawal.js";
35
35
  import { SendPayment } from "./graphql/SendPayment.js";
36
- import { SingleNodeDashboard } from "./graphql/SingleNodeDashboard.js";
36
+ import { SingleNodeDashboard as SingleNodeDashboardQuery } from "./graphql/SingleNodeDashboard.js";
37
37
  import { TransactionsForNode } from "./graphql/TransactionsForNode.js";
38
38
  import { TransactionSubscription } from "./graphql/TransactionSubscription.js";
39
39
  import Account from "./objects/Account.js";
@@ -50,11 +50,11 @@ import OutgoingPayment, {
50
50
  OutgoingPaymentFromJson,
51
51
  } from "./objects/OutgoingPayment.js";
52
52
  import Permission from "./objects/Permission.js";
53
+ import SingleNodeDashboard from "./objects/SingleNodeDashboard.js";
53
54
  import Transaction, { TransactionFromJson } from "./objects/Transaction.js";
54
55
  import TransactionUpdate, {
55
56
  TransactionUpdateFromJson,
56
57
  } from "./objects/TransactionUpdate.js";
57
- import WalletDashboard from "./objects/WalletDashboard.js";
58
58
  import WithdrawalMode from "./objects/WithdrawalMode.js";
59
59
  import WithdrawalRequest, {
60
60
  WithdrawalRequestFromJson,
@@ -292,7 +292,7 @@ class LightsparkClient {
292
292
  }
293
293
 
294
294
  /**
295
- * Gets a basic dashboard for a single node, including recent transactions. See `WalletDashboard` for which info is
295
+ * Gets a basic dashboard for a single node, including recent transactions. See `SingleNodeDashboard` for which info is
296
296
  * included.
297
297
  *
298
298
  * @param nodeId The node ID for which to get a dashboard.
@@ -305,13 +305,16 @@ class LightsparkClient {
305
305
  nodeId: string,
306
306
  bitcoinNetwork: BitcoinNetwork = BitcoinNetwork.MAINNET,
307
307
  transactionsAfterDate: Maybe<string> = undefined
308
- ): Promise<WalletDashboard> {
309
- const response = await this.requester.makeRawRequest(SingleNodeDashboard, {
310
- nodeId: nodeId,
311
- network: bitcoinNetwork,
312
- numTransactions: 20,
313
- transactionsAfterDate,
314
- });
308
+ ): Promise<SingleNodeDashboard> {
309
+ const response = await this.requester.makeRawRequest(
310
+ SingleNodeDashboardQuery,
311
+ {
312
+ nodeId: nodeId,
313
+ network: bitcoinNetwork,
314
+ numTransactions: 20,
315
+ transactionsAfterDate,
316
+ }
317
+ );
315
318
  if (!response.current_account) {
316
319
  throw new LightsparkAuthException("No current account");
317
320
  }
@@ -5,7 +5,7 @@ import LightsparkNodeStatus from "./LightsparkNodeStatus.js";
5
5
  import NodeAddressType from "./NodeAddressType.js";
6
6
  import Transaction from "./Transaction.js";
7
7
 
8
- type WalletDashboard = {
8
+ type SingleNodeDashboard = {
9
9
  id: string;
10
10
  displayName: string;
11
11
  purpose: Maybe<LightsparkNodePurpose>;
@@ -29,4 +29,4 @@ type WalletDashboard = {
29
29
  recentTransactions: Transaction[];
30
30
  };
31
31
 
32
- export default WalletDashboard;
32
+ export default SingleNodeDashboard;
@@ -95,13 +95,13 @@ export { default as RoutingTransactionFailureReason } from "./RoutingTransaction
95
95
  export { default as Secret } from "./Secret.js";
96
96
  export { default as SendPaymentInput } from "./SendPaymentInput.js";
97
97
  export { default as SendPaymentOutput } from "./SendPaymentOutput.js";
98
+ export { default as SingleNodeDashboard } from "./SingleNodeDashboard.js";
98
99
  export { default as Transaction, getTransactionQuery } from "./Transaction.js";
99
100
  export { default as TransactionFailures } from "./TransactionFailures.js";
100
101
  export { default as TransactionStatus } from "./TransactionStatus.js";
101
102
  export { default as TransactionType } from "./TransactionType.js";
102
103
  export { default as TransactionUpdate } from "./TransactionUpdate.js";
103
104
  export { default as Wallet } from "./Wallet.js";
104
- export { default as WalletDashboard } from "./WalletDashboard.js";
105
105
  export { default as WebhookEventType } from "./WebhookEventType.js";
106
106
  export { default as Withdrawal, getWithdrawalQuery } from "./Withdrawal.js";
107
107
  export { default as WithdrawalMode } from "./WithdrawalMode.js";