@lightsparkdev/lightspark-sdk 0.2.2 → 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 +14 -0
- package/README.md +0 -1
- package/dist/.DS_Store +0 -0
- package/dist/{Withdrawal-ebb4865c.d.ts → Withdrawal-6e015ff8.d.ts} +55 -4
- package/dist/{Withdrawal-27a4d10d.d.ts → Withdrawal-f68ab02c.d.ts} +98 -31
- package/dist/Withdrawal-f8570ed4.d.ts +1739 -0
- package/dist/{chunk-5Z7FB6OT.js → chunk-OKTW3ZBO.js} +257 -31
- package/dist/{chunk-XFOVS6EY.js → chunk-ZBDRJ7IU.js} +263 -31
- package/dist/index.cjs +284 -49
- package/dist/index.d.ts +1 -1
- package/dist/index.js +30 -21
- package/dist/objects/index.cjs +251 -24
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +3 -1
- package/package.json +2 -2
- package/src/.DS_Store +0 -0
- package/src/client.ts +29 -21
- package/src/objects/{WalletDashboard.ts → SingleNodeDashboard.ts} +2 -2
- package/src/objects/index.ts +1 -1
- package/dist/chunk-3VRI7CHE.js +0 -5508
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @lightsparkdev/lightspark-sdk
|
|
2
2
|
|
|
3
|
+
## 0.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5fb981cf8: Rename WalletDashboard to SingleNodeDashboard
|
|
8
|
+
|
|
9
|
+
## 0.2.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Refactor internals to allow for a custom react native crypto implementation to be injected into the LightsparkClient.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
- @lightsparkdev/core@0.2.2
|
|
16
|
+
|
|
3
17
|
## 0.2.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
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 {
|
|
@@ -562,6 +562,55 @@ type AccountToTransactionsConnection = {
|
|
|
562
562
|
totalAmountTransacted?: CurrencyAmount;
|
|
563
563
|
};
|
|
564
564
|
|
|
565
|
+
type Balances = {
|
|
566
|
+
/**
|
|
567
|
+
* This represents the balance that should be displayed when asked "how much do I own right now?". It
|
|
568
|
+
* represents the amount currently owned, including things that may not be owned soon (e.g. in-flight
|
|
569
|
+
* outgoing payments, in-flight withdrawals, commit fees, etc.). It really is a snapshot of what is
|
|
570
|
+
* officially owned at this instant.
|
|
571
|
+
**/
|
|
572
|
+
ownedBalance: CurrencyAmount;
|
|
573
|
+
/**
|
|
574
|
+
* This represents the balance that should be displayed when asked "how much can I send on Lightning
|
|
575
|
+
* right now?". It represents the amount currently available to be sent on the Lightning network. We
|
|
576
|
+
* remove from the balance all the funds that are temporarily locked (e.g. channel reserves).
|
|
577
|
+
**/
|
|
578
|
+
availableToSendBalance: CurrencyAmount;
|
|
579
|
+
/**
|
|
580
|
+
* This represents the balance that should be displayed when asked "how much money can I withdraw on
|
|
581
|
+
* the Bitcoin network right now?". It represents the amount currently available to withdraw and is
|
|
582
|
+
* usually equal to the `owned_balance` but it does not include in-flight operations (which would
|
|
583
|
+
* likely succeed and therefore likely make your withdrawal fail).
|
|
584
|
+
**/
|
|
585
|
+
availableToWithdrawBalance: CurrencyAmount;
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
declare class Wallet implements Entity {
|
|
589
|
+
readonly id: string;
|
|
590
|
+
readonly createdAt: string;
|
|
591
|
+
readonly updatedAt: string;
|
|
592
|
+
readonly thirdPartyIdentifier: string;
|
|
593
|
+
readonly typename: string;
|
|
594
|
+
readonly lastLoginAt?: string | undefined;
|
|
595
|
+
readonly balances?: Balances | undefined;
|
|
596
|
+
constructor(id: string, createdAt: string, updatedAt: string, thirdPartyIdentifier: string, typename: string, lastLoginAt?: string | undefined, balances?: Balances | undefined);
|
|
597
|
+
getTotalAmountReceived(client: LightsparkClient, createdAfterDate?: string | undefined, createdBeforeDate?: string | undefined): Promise<CurrencyAmount>;
|
|
598
|
+
getTotalAmountSent(client: LightsparkClient, createdAfterDate?: string | undefined, createdBeforeDate?: string | undefined): Promise<CurrencyAmount>;
|
|
599
|
+
static getWalletQuery(): Query<Wallet>;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
type AccountToWalletsConnection = {
|
|
603
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
604
|
+
pageInfo: PageInfo;
|
|
605
|
+
/**
|
|
606
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
607
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
608
|
+
**/
|
|
609
|
+
count: number;
|
|
610
|
+
/** The wallets for the current page of this connection. **/
|
|
611
|
+
entities: Wallet[];
|
|
612
|
+
};
|
|
613
|
+
|
|
565
614
|
declare enum PaymentFailureReason {
|
|
566
615
|
/**
|
|
567
616
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -612,6 +661,7 @@ declare class Account implements Entity {
|
|
|
612
661
|
getChannels(client: LightsparkClient, bitcoinNetwork: BitcoinNetwork, lightningNodeId?: string | undefined, afterDate?: string | undefined, beforeDate?: string | undefined, first?: number | undefined): Promise<AccountToChannelsConnection>;
|
|
613
662
|
getTransactions(client: LightsparkClient, first?: number | undefined, after?: string | undefined, types?: TransactionType[] | undefined, afterDate?: string | undefined, beforeDate?: string | undefined, bitcoinNetwork?: BitcoinNetwork | undefined, lightningNodeId?: string | undefined, statuses?: TransactionStatus[] | undefined, excludeFailures?: TransactionFailures | undefined): Promise<AccountToTransactionsConnection>;
|
|
614
663
|
getPaymentRequests(client: LightsparkClient, first?: number | undefined, after?: string | undefined, afterDate?: string | undefined, beforeDate?: string | undefined, bitcoinNetwork?: BitcoinNetwork | undefined, lightningNodeId?: string | undefined): Promise<AccountToPaymentRequestsConnection>;
|
|
664
|
+
getWallets(client: LightsparkClient, first?: number | undefined): Promise<AccountToWalletsConnection>;
|
|
615
665
|
static getAccountQuery(): Query<Account>;
|
|
616
666
|
}
|
|
617
667
|
|
|
@@ -1097,8 +1147,9 @@ declare class WithdrawalRequest implements Entity {
|
|
|
1097
1147
|
declare class LightsparkClient {
|
|
1098
1148
|
private authProvider;
|
|
1099
1149
|
private readonly serverUrl;
|
|
1100
|
-
private readonly
|
|
1150
|
+
private readonly cryptoImpl;
|
|
1101
1151
|
private requester;
|
|
1152
|
+
private readonly nodeKeyCache;
|
|
1102
1153
|
/**
|
|
1103
1154
|
* Constructs a new LightsparkClient.
|
|
1104
1155
|
*
|
|
@@ -1108,7 +1159,7 @@ declare class LightsparkClient {
|
|
|
1108
1159
|
* @param nodeKeyCache This is used to cache node keys for the duration of the session. Defaults to a new instance of
|
|
1109
1160
|
* `NodeKeyCache`. You should not need to change this.
|
|
1110
1161
|
*/
|
|
1111
|
-
constructor(authProvider?: AuthProvider, serverUrl?: string,
|
|
1162
|
+
constructor(authProvider?: AuthProvider, serverUrl?: string, cryptoImpl?: CryptoInterface);
|
|
1112
1163
|
/**
|
|
1113
1164
|
* Sets the auth provider for the client. This is useful for switching between auth providers if you are using
|
|
1114
1165
|
* multiple accounts or waiting for the user to log in.
|
|
@@ -1685,4 +1736,4 @@ type Withdrawal = OnChainTransaction & Transaction & Entity & {
|
|
|
1685
1736
|
};
|
|
1686
1737
|
declare const getWithdrawalQuery: (id: string) => Query<Withdrawal>;
|
|
1687
1738
|
|
|
1688
|
-
export {
|
|
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 };
|
|
@@ -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 {
|
|
@@ -67,6 +67,7 @@ declare enum LightsparkNodeStatus {
|
|
|
67
67
|
READY = "READY",
|
|
68
68
|
STOPPED = "STOPPED",
|
|
69
69
|
TERMINATED = "TERMINATED",
|
|
70
|
+
TERMINATING = "TERMINATING",
|
|
70
71
|
WALLET_LOCKED = "WALLET_LOCKED",
|
|
71
72
|
FAILED_TO_DEPLOY = "FAILED_TO_DEPLOY"
|
|
72
73
|
}
|
|
@@ -561,6 +562,55 @@ type AccountToTransactionsConnection = {
|
|
|
561
562
|
totalAmountTransacted?: CurrencyAmount;
|
|
562
563
|
};
|
|
563
564
|
|
|
565
|
+
type Balances = {
|
|
566
|
+
/**
|
|
567
|
+
* This represents the balance that should be displayed when asked "how much do I own right now?". It
|
|
568
|
+
* represents the amount currently owned, including things that may not be owned soon (e.g. in-flight
|
|
569
|
+
* outgoing payments, in-flight withdrawals, commit fees, etc.). It really is a snapshot of what is
|
|
570
|
+
* officially owned at this instant.
|
|
571
|
+
**/
|
|
572
|
+
ownedBalance: CurrencyAmount;
|
|
573
|
+
/**
|
|
574
|
+
* This represents the balance that should be displayed when asked "how much can I send on Lightning
|
|
575
|
+
* right now?". It represents the amount currently available to be sent on the Lightning network. We
|
|
576
|
+
* remove from the balance all the funds that are temporarily locked (e.g. channel reserves).
|
|
577
|
+
**/
|
|
578
|
+
availableToSendBalance: CurrencyAmount;
|
|
579
|
+
/**
|
|
580
|
+
* This represents the balance that should be displayed when asked "how much money can I withdraw on
|
|
581
|
+
* the Bitcoin network right now?". It represents the amount currently available to withdraw and is
|
|
582
|
+
* usually equal to the `owned_balance` but it does not include in-flight operations (which would
|
|
583
|
+
* likely succeed and therefore likely make your withdrawal fail).
|
|
584
|
+
**/
|
|
585
|
+
availableToWithdrawBalance: CurrencyAmount;
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
declare class Wallet implements Entity {
|
|
589
|
+
readonly id: string;
|
|
590
|
+
readonly createdAt: string;
|
|
591
|
+
readonly updatedAt: string;
|
|
592
|
+
readonly thirdPartyIdentifier: string;
|
|
593
|
+
readonly typename: string;
|
|
594
|
+
readonly lastLoginAt?: string | undefined;
|
|
595
|
+
readonly balances?: Balances | undefined;
|
|
596
|
+
constructor(id: string, createdAt: string, updatedAt: string, thirdPartyIdentifier: string, typename: string, lastLoginAt?: string | undefined, balances?: Balances | undefined);
|
|
597
|
+
getTotalAmountReceived(client: LightsparkClient, createdAfterDate?: string | undefined, createdBeforeDate?: string | undefined): Promise<CurrencyAmount>;
|
|
598
|
+
getTotalAmountSent(client: LightsparkClient, createdAfterDate?: string | undefined, createdBeforeDate?: string | undefined): Promise<CurrencyAmount>;
|
|
599
|
+
static getWalletQuery(): Query<Wallet>;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
type AccountToWalletsConnection = {
|
|
603
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
604
|
+
pageInfo: PageInfo;
|
|
605
|
+
/**
|
|
606
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
607
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
608
|
+
**/
|
|
609
|
+
count: number;
|
|
610
|
+
/** The wallets for the current page of this connection. **/
|
|
611
|
+
entities: Wallet[];
|
|
612
|
+
};
|
|
613
|
+
|
|
564
614
|
declare enum PaymentFailureReason {
|
|
565
615
|
/**
|
|
566
616
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -611,6 +661,7 @@ declare class Account implements Entity {
|
|
|
611
661
|
getChannels(client: LightsparkClient, bitcoinNetwork: BitcoinNetwork, lightningNodeId?: string | undefined, afterDate?: string | undefined, beforeDate?: string | undefined, first?: number | undefined): Promise<AccountToChannelsConnection>;
|
|
612
662
|
getTransactions(client: LightsparkClient, first?: number | undefined, after?: string | undefined, types?: TransactionType[] | undefined, afterDate?: string | undefined, beforeDate?: string | undefined, bitcoinNetwork?: BitcoinNetwork | undefined, lightningNodeId?: string | undefined, statuses?: TransactionStatus[] | undefined, excludeFailures?: TransactionFailures | undefined): Promise<AccountToTransactionsConnection>;
|
|
613
663
|
getPaymentRequests(client: LightsparkClient, first?: number | undefined, after?: string | undefined, afterDate?: string | undefined, beforeDate?: string | undefined, bitcoinNetwork?: BitcoinNetwork | undefined, lightningNodeId?: string | undefined): Promise<AccountToPaymentRequestsConnection>;
|
|
664
|
+
getWallets(client: LightsparkClient, first?: number | undefined): Promise<AccountToWalletsConnection>;
|
|
614
665
|
static getAccountQuery(): Query<Account>;
|
|
615
666
|
}
|
|
616
667
|
|
|
@@ -634,13 +685,22 @@ type FeeEstimate = {
|
|
|
634
685
|
type InvoiceData = PaymentRequestData & {
|
|
635
686
|
encodedPaymentRequest: string;
|
|
636
687
|
bitcoinNetwork: BitcoinNetwork;
|
|
688
|
+
/** The payment hash of this invoice. **/
|
|
637
689
|
paymentHash: string;
|
|
690
|
+
/**
|
|
691
|
+
* The requested amount in this invoice. If it is equal to 0, the sender should choose the amount to
|
|
692
|
+
* send.
|
|
693
|
+
**/
|
|
638
694
|
amount: CurrencyAmount;
|
|
695
|
+
/** The date and time when this invoice was created. **/
|
|
639
696
|
createdAt: string;
|
|
697
|
+
/** The date and time when this invoice will expire. **/
|
|
640
698
|
expiresAt: string;
|
|
699
|
+
/** The lightning node that will be paid when fulfilling this invoice. **/
|
|
641
700
|
destination: Node;
|
|
642
701
|
/** The typename of the object **/
|
|
643
702
|
typename: string;
|
|
703
|
+
/** A short, UTF-8 encoded, description of the purpose of this invoice. **/
|
|
644
704
|
memo?: string;
|
|
645
705
|
};
|
|
646
706
|
|
|
@@ -819,29 +879,7 @@ declare class OutgoingPayment implements LightningTransaction {
|
|
|
819
879
|
static getOutgoingPaymentQuery(id: string): Query<OutgoingPayment>;
|
|
820
880
|
}
|
|
821
881
|
|
|
822
|
-
type
|
|
823
|
-
/**
|
|
824
|
-
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
825
|
-
* string.
|
|
826
|
-
**/
|
|
827
|
-
id: string;
|
|
828
|
-
/** The date and time when this transaction was initiated. **/
|
|
829
|
-
createdAt: string;
|
|
830
|
-
/** The date and time when the entity was last updated. **/
|
|
831
|
-
updatedAt: string;
|
|
832
|
-
/** The current status of this transaction. **/
|
|
833
|
-
status: TransactionStatus;
|
|
834
|
-
/** The amount of money involved in this transaction. **/
|
|
835
|
-
amount: CurrencyAmount;
|
|
836
|
-
/** The typename of the object **/
|
|
837
|
-
typename: string;
|
|
838
|
-
/** The date and time when this transaction was completed or failed. **/
|
|
839
|
-
resolvedAt?: string;
|
|
840
|
-
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
841
|
-
transactionHash?: string;
|
|
842
|
-
};
|
|
843
|
-
|
|
844
|
-
type WalletDashboard = {
|
|
882
|
+
type SingleNodeDashboard = {
|
|
845
883
|
id: string;
|
|
846
884
|
displayName: string;
|
|
847
885
|
purpose: Maybe<LightsparkNodePurpose>;
|
|
@@ -865,6 +903,28 @@ type WalletDashboard = {
|
|
|
865
903
|
recentTransactions: Transaction[];
|
|
866
904
|
};
|
|
867
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
|
+
|
|
868
928
|
declare enum WithdrawalMode {
|
|
869
929
|
/**
|
|
870
930
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -1052,9 +1112,10 @@ declare class WithdrawalRequest implements Entity {
|
|
|
1052
1112
|
readonly withdrawalMode: WithdrawalMode;
|
|
1053
1113
|
readonly status: WithdrawalRequestStatus;
|
|
1054
1114
|
readonly typename: string;
|
|
1115
|
+
readonly estimatedAmount?: CurrencyAmount | undefined;
|
|
1055
1116
|
readonly completedAt?: string | undefined;
|
|
1056
1117
|
readonly withdrawalId?: string | undefined;
|
|
1057
|
-
constructor(id: string, createdAt: string, updatedAt: string, amount: CurrencyAmount, bitcoinAddress: string, withdrawalMode: WithdrawalMode, status: WithdrawalRequestStatus, typename: string, completedAt?: string | undefined, withdrawalId?: string | undefined);
|
|
1118
|
+
constructor(id: string, createdAt: string, updatedAt: string, amount: CurrencyAmount, bitcoinAddress: string, withdrawalMode: WithdrawalMode, status: WithdrawalRequestStatus, typename: string, estimatedAmount?: CurrencyAmount | undefined, completedAt?: string | undefined, withdrawalId?: string | undefined);
|
|
1058
1119
|
getChannelClosingTransactions(client: LightsparkClient, first?: number | undefined): Promise<WithdrawalRequestToChannelClosingTransactionsConnection>;
|
|
1059
1120
|
getChannelOpeningTransactions(client: LightsparkClient, first?: number | undefined): Promise<WithdrawalRequestToChannelOpeningTransactionsConnection>;
|
|
1060
1121
|
static getWithdrawalRequestQuery(id: string): Query<WithdrawalRequest>;
|
|
@@ -1086,8 +1147,9 @@ declare class WithdrawalRequest implements Entity {
|
|
|
1086
1147
|
declare class LightsparkClient {
|
|
1087
1148
|
private authProvider;
|
|
1088
1149
|
private readonly serverUrl;
|
|
1089
|
-
private readonly
|
|
1150
|
+
private readonly cryptoImpl;
|
|
1090
1151
|
private requester;
|
|
1152
|
+
private readonly nodeKeyCache;
|
|
1091
1153
|
/**
|
|
1092
1154
|
* Constructs a new LightsparkClient.
|
|
1093
1155
|
*
|
|
@@ -1097,7 +1159,7 @@ declare class LightsparkClient {
|
|
|
1097
1159
|
* @param nodeKeyCache This is used to cache node keys for the duration of the session. Defaults to a new instance of
|
|
1098
1160
|
* `NodeKeyCache`. You should not need to change this.
|
|
1099
1161
|
*/
|
|
1100
|
-
constructor(authProvider?: AuthProvider, serverUrl?: string,
|
|
1162
|
+
constructor(authProvider?: AuthProvider, serverUrl?: string, cryptoImpl?: CryptoInterface);
|
|
1101
1163
|
/**
|
|
1102
1164
|
* Sets the auth provider for the client. This is useful for switching between auth providers if you are using
|
|
1103
1165
|
* multiple accounts or waiting for the user to log in.
|
|
@@ -1141,7 +1203,7 @@ declare class LightsparkClient {
|
|
|
1141
1203
|
*/
|
|
1142
1204
|
getAccountDashboard(nodeIds?: string[] | undefined, bitcoinNetwork?: BitcoinNetwork): Promise<AccountDashboard>;
|
|
1143
1205
|
/**
|
|
1144
|
-
* 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
|
|
1145
1207
|
* included.
|
|
1146
1208
|
*
|
|
1147
1209
|
* @param nodeId The node ID for which to get a dashboard.
|
|
@@ -1150,7 +1212,7 @@ declare class LightsparkClient {
|
|
|
1150
1212
|
* Defaults to undefined (no limit).
|
|
1151
1213
|
* @returns A basic dashboard for the given node ID.
|
|
1152
1214
|
*/
|
|
1153
|
-
getSingleNodeDashboard(nodeId: string, bitcoinNetwork?: BitcoinNetwork, transactionsAfterDate?: Maybe<string>): Promise<
|
|
1215
|
+
getSingleNodeDashboard(nodeId: string, bitcoinNetwork?: BitcoinNetwork, transactionsAfterDate?: Maybe<string>): Promise<SingleNodeDashboard>;
|
|
1154
1216
|
/**
|
|
1155
1217
|
* Creates an invoice for the given node.
|
|
1156
1218
|
*
|
|
@@ -1621,7 +1683,12 @@ declare enum WebhookEventType {
|
|
|
1621
1683
|
*/
|
|
1622
1684
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
1623
1685
|
PAYMENT_FINISHED = "PAYMENT_FINISHED",
|
|
1624
|
-
NODE_STATUS = "NODE_STATUS"
|
|
1686
|
+
NODE_STATUS = "NODE_STATUS",
|
|
1687
|
+
WALLET_STATUS = "WALLET_STATUS",
|
|
1688
|
+
WALLET_OUTGOING_PAYMENT_FINISHED = "WALLET_OUTGOING_PAYMENT_FINISHED",
|
|
1689
|
+
WALLET_INCOMING_PAYMENT_FINISHED = "WALLET_INCOMING_PAYMENT_FINISHED",
|
|
1690
|
+
WALLET_WITHDRAWAL_FINISHED = "WALLET_WITHDRAWAL_FINISHED",
|
|
1691
|
+
WALLET_FUNDS_RECEIVED = "WALLET_FUNDS_RECEIVED"
|
|
1625
1692
|
}
|
|
1626
1693
|
|
|
1627
1694
|
/** The transaction on the Bitcoin blockchain to withdraw funds from the Lightspark node to a Bitcoin wallet. **/
|
|
@@ -1669,4 +1736,4 @@ type Withdrawal = OnChainTransaction & Transaction & Entity & {
|
|
|
1669
1736
|
};
|
|
1670
1737
|
declare const getWithdrawalQuery: (id: string) => Query<Withdrawal>;
|
|
1671
1738
|
|
|
1672
|
-
export {
|
|
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 };
|