@lightsparkdev/lightspark-sdk 0.2.3 → 0.2.4
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/README.md +0 -1
- package/dist/.DS_Store +0 -0
- package/dist/{Withdrawal-cc441c06.d.ts → Withdrawal-f68ab02c.d.ts} +29 -29
- package/dist/{Withdrawal-bf5c1b52.d.ts → Withdrawal-f8570ed4.d.ts} +30 -29
- package/dist/{chunk-5Z7FB6OT.js → chunk-OKTW3ZBO.js} +257 -31
- package/dist/index.cjs +16 -13
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -14
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/client.ts +13 -10
- package/src/objects/{WalletDashboard.ts → SingleNodeDashboard.ts} +2 -2
- package/src/objects/index.ts +1 -1
- package/dist/Withdrawal-27a4d10d.d.ts +0 -1672
- package/dist/Withdrawal-e042fa79.d.ts +0 -1740
- package/dist/Withdrawal-ebb4865c.d.ts +0 -1688
- package/dist/chunk-3VRI7CHE.js +0 -5508
- package/dist/chunk-XFOVS6EY.js +0 -5524
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/dist/.DS_Store
ADDED
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Maybe, Query, AuthProvider,
|
|
1
|
+
import { Maybe, Query, AuthProvider, CryptoInterface } from '@lightsparkdev/core';
|
|
2
2
|
import Observable from 'zen-observable';
|
|
3
3
|
|
|
4
4
|
declare enum CurrencyUnit {
|
|
@@ -879,29 +879,7 @@ declare class OutgoingPayment implements LightningTransaction {
|
|
|
879
879
|
static getOutgoingPaymentQuery(id: string): Query<OutgoingPayment>;
|
|
880
880
|
}
|
|
881
881
|
|
|
882
|
-
type
|
|
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.
|
|
@@ -1147,9 +1147,9 @@ declare class WithdrawalRequest implements Entity {
|
|
|
1147
1147
|
declare class LightsparkClient {
|
|
1148
1148
|
private authProvider;
|
|
1149
1149
|
private readonly serverUrl;
|
|
1150
|
-
private readonly nodeKeyCache;
|
|
1151
1150
|
private readonly cryptoImpl;
|
|
1152
1151
|
private requester;
|
|
1152
|
+
private readonly nodeKeyCache;
|
|
1153
1153
|
/**
|
|
1154
1154
|
* Constructs a new LightsparkClient.
|
|
1155
1155
|
*
|
|
@@ -1159,7 +1159,7 @@ declare class LightsparkClient {
|
|
|
1159
1159
|
* @param nodeKeyCache This is used to cache node keys for the duration of the session. Defaults to a new instance of
|
|
1160
1160
|
* `NodeKeyCache`. You should not need to change this.
|
|
1161
1161
|
*/
|
|
1162
|
-
constructor(authProvider?: AuthProvider, serverUrl?: string,
|
|
1162
|
+
constructor(authProvider?: AuthProvider, serverUrl?: string, cryptoImpl?: CryptoInterface);
|
|
1163
1163
|
/**
|
|
1164
1164
|
* Sets the auth provider for the client. This is useful for switching between auth providers if you are using
|
|
1165
1165
|
* multiple accounts or waiting for the user to log in.
|
|
@@ -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 `
|
|
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<
|
|
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,
|
|
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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Maybe, Query, AuthProvider,
|
|
1
|
+
import { Maybe, Query, AuthProvider, CryptoInterface } from '@lightsparkdev/core';
|
|
2
2
|
import Observable from 'zen-observable';
|
|
3
3
|
|
|
4
4
|
declare enum CurrencyUnit {
|
|
@@ -879,29 +879,7 @@ declare class OutgoingPayment implements LightningTransaction {
|
|
|
879
879
|
static getOutgoingPaymentQuery(id: string): Query<OutgoingPayment>;
|
|
880
880
|
}
|
|
881
881
|
|
|
882
|
-
type
|
|
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 SinglesNodeDashboard = {
|
|
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.
|
|
@@ -1147,8 +1147,9 @@ declare class WithdrawalRequest implements Entity {
|
|
|
1147
1147
|
declare class LightsparkClient {
|
|
1148
1148
|
private authProvider;
|
|
1149
1149
|
private readonly serverUrl;
|
|
1150
|
-
private readonly
|
|
1150
|
+
private readonly cryptoImpl;
|
|
1151
1151
|
private requester;
|
|
1152
|
+
private readonly nodeKeyCache;
|
|
1152
1153
|
/**
|
|
1153
1154
|
* Constructs a new LightsparkClient.
|
|
1154
1155
|
*
|
|
@@ -1158,7 +1159,7 @@ declare class LightsparkClient {
|
|
|
1158
1159
|
* @param nodeKeyCache This is used to cache node keys for the duration of the session. Defaults to a new instance of
|
|
1159
1160
|
* `NodeKeyCache`. You should not need to change this.
|
|
1160
1161
|
*/
|
|
1161
|
-
constructor(authProvider?: AuthProvider, serverUrl?: string,
|
|
1162
|
+
constructor(authProvider?: AuthProvider, serverUrl?: string, cryptoImpl?: CryptoInterface);
|
|
1162
1163
|
/**
|
|
1163
1164
|
* Sets the auth provider for the client. This is useful for switching between auth providers if you are using
|
|
1164
1165
|
* multiple accounts or waiting for the user to log in.
|
|
@@ -1202,7 +1203,7 @@ declare class LightsparkClient {
|
|
|
1202
1203
|
*/
|
|
1203
1204
|
getAccountDashboard(nodeIds?: string[] | undefined, bitcoinNetwork?: BitcoinNetwork): Promise<AccountDashboard>;
|
|
1204
1205
|
/**
|
|
1205
|
-
* Gets a basic dashboard for a single node, including recent transactions. See `
|
|
1206
|
+
* Gets a basic dashboard for a single node, including recent transactions. See `SinglesNodeDashboard` for which info is
|
|
1206
1207
|
* included.
|
|
1207
1208
|
*
|
|
1208
1209
|
* @param nodeId The node ID for which to get a dashboard.
|
|
@@ -1211,7 +1212,7 @@ declare class LightsparkClient {
|
|
|
1211
1212
|
* Defaults to undefined (no limit).
|
|
1212
1213
|
* @returns A basic dashboard for the given node ID.
|
|
1213
1214
|
*/
|
|
1214
|
-
|
|
1215
|
+
getSinglesNodeDashboard(nodeId: string, bitcoinNetwork?: BitcoinNetwork, transactionsAfterDate?: Maybe<string>): Promise<SinglesNodeDashboard>;
|
|
1215
1216
|
/**
|
|
1216
1217
|
* Creates an invoice for the given node.
|
|
1217
1218
|
*
|
|
@@ -1735,4 +1736,4 @@ type Withdrawal = OnChainTransaction & Transaction & Entity & {
|
|
|
1735
1736
|
};
|
|
1736
1737
|
declare const getWithdrawalQuery: (id: string) => Query<Withdrawal>;
|
|
1737
1738
|
|
|
1738
|
-
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,
|
|
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, SinglesNodeDashboard 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 };
|