@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.
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-YTXDF6SQ.js → chunk-NXUFC5J7.js} +950 -246
- package/dist/{index-adeff42d.d.ts → index-3ffe9e7b.d.ts} +194 -56
- package/dist/index.cjs +962 -254
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -9
- package/dist/objects/index.cjs +952 -246
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +5 -1
- package/package.json +1 -2
- package/src/client.ts +13 -14
- package/src/objects/Account.ts +36 -30
- package/src/objects/AccountToApiTokensConnection.ts +11 -6
- package/src/objects/AccountToNodesConnection.ts +11 -6
- package/src/objects/AccountToPaymentRequestsConnection.ts +20 -15
- package/src/objects/AccountToTransactionsConnection.ts +19 -14
- package/src/objects/AccountToWalletsConnection.ts +11 -6
- package/src/objects/ApiToken.ts +2 -1
- package/src/objects/Balances.ts +1 -0
- package/src/objects/BitcoinNetwork.ts +2 -1
- package/src/objects/BlockchainBalance.ts +1 -1
- package/src/objects/Channel.ts +2 -2
- package/src/objects/ChannelClosingTransaction.ts +2 -2
- package/src/objects/ChannelFees.ts +1 -0
- package/src/objects/ChannelOpeningTransaction.ts +2 -2
- package/src/objects/ChannelStatus.ts +1 -0
- package/src/objects/Connection.ts +387 -0
- package/src/objects/CreateInvoiceInput.ts +12 -0
- package/src/objects/CreateLnurlInvoiceInput.ts +10 -0
- package/src/objects/CreateTestModePaymentoutput.ts +1 -0
- package/src/objects/CryptoSanctionsScreeningProvider.ts +14 -0
- package/src/objects/CurrencyAmount.ts +1 -1
- package/src/objects/CurrencyUnit.ts +1 -0
- package/src/objects/Deposit.ts +2 -2
- package/src/objects/Entity.ts +1 -1
- package/src/objects/FeeEstimate.ts +1 -0
- package/src/objects/GraphNode.ts +2 -2
- package/src/objects/Hop.ts +2 -2
- package/src/objects/HtlcAttemptFailureCode.ts +1 -0
- package/src/objects/IncomingPayment.ts +19 -6
- package/src/objects/IncomingPaymentAttempt.ts +2 -2
- package/src/objects/IncomingPaymentAttemptStatus.ts +1 -1
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +21 -1
- package/src/objects/Invoice.ts +2 -2
- package/src/objects/InvoiceData.ts +1 -1
- package/src/objects/InvoiceType.ts +1 -0
- package/src/objects/LightningTransaction.ts +2 -2
- package/src/objects/LightsparkNode.ts +12 -6
- package/src/objects/LightsparkNodeOwner.ts +2 -2
- package/src/objects/LightsparkNodePurpose.ts +1 -0
- package/src/objects/LightsparkNodeToChannelsConnection.ts +11 -6
- package/src/objects/Node.ts +2 -3
- package/src/objects/NodeAddress.ts +1 -1
- package/src/objects/NodeAddressType.ts +1 -1
- package/src/objects/OnChainTransaction.ts +2 -3
- package/src/objects/OutgoingPayment.ts +14 -6
- package/src/objects/OutgoingPaymentAttempt.ts +14 -6
- package/src/objects/OutgoingPaymentAttemptStatus.ts +1 -1
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +21 -1
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +21 -1
- package/src/objects/PageInfo.ts +1 -0
- package/src/objects/PaymentFailureReason.ts +1 -0
- package/src/objects/PaymentRequest.ts +2 -2
- package/src/objects/PaymentRequestData.ts +1 -1
- package/src/objects/PaymentRequestStatus.ts +1 -0
- package/src/objects/Permission.ts +1 -0
- package/src/objects/RiskRating.ts +18 -0
- package/src/objects/RoutingTransaction.ts +2 -2
- package/src/objects/RoutingTransactionFailureReason.ts +1 -0
- package/src/objects/ScreenBitcoinAddressesInput.ts +23 -0
- package/src/objects/ScreenBitcoinAddressesOutput.ts +25 -0
- package/src/objects/Transaction.ts +2 -2
- package/src/objects/TransactionFailures.ts +1 -0
- package/src/objects/TransactionStatus.ts +1 -0
- package/src/objects/TransactionType.ts +1 -0
- package/src/objects/Wallet.ts +632 -7
- package/src/objects/WalletStatus.ts +1 -0
- package/src/objects/WalletToPaymentRequestsConnection.ts +57 -0
- package/src/objects/WalletToTransactionsConnection.ts +57 -0
- package/src/objects/WebhookEventType.ts +3 -0
- package/src/objects/Withdrawal.ts +2 -2
- package/src/objects/WithdrawalMode.ts +1 -0
- package/src/objects/WithdrawalRequest.ts +2 -1
- package/src/objects/WithdrawalRequestStatus.ts +1 -0
- package/src/objects/index.ts +7 -0
- 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 enum of the potential statuses that your Lightspark wallet can take. **/
|
|
3
4
|
export enum WalletStatus {
|
|
4
5
|
/**
|
|
5
6
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import type Connection from "./Connection.js";
|
|
4
|
+
import type PageInfo from "./PageInfo.js";
|
|
5
|
+
import { PageInfoFromJson } from "./PageInfo.js";
|
|
6
|
+
import type PaymentRequest from "./PaymentRequest.js";
|
|
7
|
+
import { PaymentRequestFromJson } from "./PaymentRequest.js";
|
|
8
|
+
|
|
9
|
+
type WalletToPaymentRequestsConnection = Connection & {
|
|
10
|
+
/**
|
|
11
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
12
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
13
|
+
**/
|
|
14
|
+
count: number;
|
|
15
|
+
|
|
16
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
17
|
+
pageInfo: PageInfo;
|
|
18
|
+
|
|
19
|
+
/** The payment requests for the current page of this connection. **/
|
|
20
|
+
entities: PaymentRequest[];
|
|
21
|
+
|
|
22
|
+
/** The typename of the object **/
|
|
23
|
+
typename: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const WalletToPaymentRequestsConnectionFromJson = (
|
|
27
|
+
obj: any
|
|
28
|
+
): WalletToPaymentRequestsConnection => {
|
|
29
|
+
return {
|
|
30
|
+
count: obj["wallet_to_payment_requests_connection_count"],
|
|
31
|
+
pageInfo: PageInfoFromJson(
|
|
32
|
+
obj["wallet_to_payment_requests_connection_page_info"]
|
|
33
|
+
),
|
|
34
|
+
entities: obj["wallet_to_payment_requests_connection_entities"].map((e) =>
|
|
35
|
+
PaymentRequestFromJson(e)
|
|
36
|
+
),
|
|
37
|
+
typename: "WalletToPaymentRequestsConnection",
|
|
38
|
+
} as WalletToPaymentRequestsConnection;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const FRAGMENT = `
|
|
42
|
+
fragment WalletToPaymentRequestsConnectionFragment on WalletToPaymentRequestsConnection {
|
|
43
|
+
__typename
|
|
44
|
+
wallet_to_payment_requests_connection_count: count
|
|
45
|
+
wallet_to_payment_requests_connection_page_info: page_info {
|
|
46
|
+
__typename
|
|
47
|
+
page_info_has_next_page: has_next_page
|
|
48
|
+
page_info_has_previous_page: has_previous_page
|
|
49
|
+
page_info_start_cursor: start_cursor
|
|
50
|
+
page_info_end_cursor: end_cursor
|
|
51
|
+
}
|
|
52
|
+
wallet_to_payment_requests_connection_entities: entities {
|
|
53
|
+
id
|
|
54
|
+
}
|
|
55
|
+
}`;
|
|
56
|
+
|
|
57
|
+
export default WalletToPaymentRequestsConnection;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import type Connection from "./Connection.js";
|
|
4
|
+
import type PageInfo from "./PageInfo.js";
|
|
5
|
+
import { PageInfoFromJson } from "./PageInfo.js";
|
|
6
|
+
import type Transaction from "./Transaction.js";
|
|
7
|
+
import { TransactionFromJson } from "./Transaction.js";
|
|
8
|
+
|
|
9
|
+
type WalletToTransactionsConnection = Connection & {
|
|
10
|
+
/**
|
|
11
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
12
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
13
|
+
**/
|
|
14
|
+
count: number;
|
|
15
|
+
|
|
16
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
17
|
+
pageInfo: PageInfo;
|
|
18
|
+
|
|
19
|
+
/** The transactions for the current page of this connection. **/
|
|
20
|
+
entities: Transaction[];
|
|
21
|
+
|
|
22
|
+
/** The typename of the object **/
|
|
23
|
+
typename: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const WalletToTransactionsConnectionFromJson = (
|
|
27
|
+
obj: any
|
|
28
|
+
): WalletToTransactionsConnection => {
|
|
29
|
+
return {
|
|
30
|
+
count: obj["wallet_to_transactions_connection_count"],
|
|
31
|
+
pageInfo: PageInfoFromJson(
|
|
32
|
+
obj["wallet_to_transactions_connection_page_info"]
|
|
33
|
+
),
|
|
34
|
+
entities: obj["wallet_to_transactions_connection_entities"].map((e) =>
|
|
35
|
+
TransactionFromJson(e)
|
|
36
|
+
),
|
|
37
|
+
typename: "WalletToTransactionsConnection",
|
|
38
|
+
} as WalletToTransactionsConnection;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const FRAGMENT = `
|
|
42
|
+
fragment WalletToTransactionsConnectionFragment on WalletToTransactionsConnection {
|
|
43
|
+
__typename
|
|
44
|
+
wallet_to_transactions_connection_count: count
|
|
45
|
+
wallet_to_transactions_connection_page_info: page_info {
|
|
46
|
+
__typename
|
|
47
|
+
page_info_has_next_page: has_next_page
|
|
48
|
+
page_info_has_previous_page: has_previous_page
|
|
49
|
+
page_info_start_cursor: start_cursor
|
|
50
|
+
page_info_end_cursor: end_cursor
|
|
51
|
+
}
|
|
52
|
+
wallet_to_transactions_connection_entities: entities {
|
|
53
|
+
id
|
|
54
|
+
}
|
|
55
|
+
}`;
|
|
56
|
+
|
|
57
|
+
export default WalletToTransactionsConnection;
|
|
@@ -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 event types that can be associated with your Lightspark wallets. **/
|
|
3
4
|
export enum WebhookEventType {
|
|
4
5
|
/**
|
|
5
6
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -20,6 +21,8 @@ export enum WebhookEventType {
|
|
|
20
21
|
WALLET_WITHDRAWAL_FINISHED = "WALLET_WITHDRAWAL_FINISHED",
|
|
21
22
|
|
|
22
23
|
WALLET_FUNDS_RECEIVED = "WALLET_FUNDS_RECEIVED",
|
|
24
|
+
|
|
25
|
+
REMOTE_SIGNING = "REMOTE_SIGNING",
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
export default WebhookEventType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import type
|
|
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";
|
|
@@ -8,7 +8,7 @@ import type OnChainTransaction from "./OnChainTransaction.js";
|
|
|
8
8
|
import type Transaction from "./Transaction.js";
|
|
9
9
|
import TransactionStatus from "./TransactionStatus.js";
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/** This object represents an L1 withdrawal from your Lightspark Node to any Bitcoin wallet. You can retrieve this object to receive detailed information about any L1 withdrawal associated with your Lightspark Node or account. **/
|
|
12
12
|
type Withdrawal = OnChainTransaction &
|
|
13
13
|
Transaction &
|
|
14
14
|
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 modes that your Bitcoin withdrawal can take. **/
|
|
3
4
|
export enum WithdrawalMode {
|
|
4
5
|
/**
|
|
5
6
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import type
|
|
3
|
+
import { type Query } from "@lightsparkdev/core";
|
|
4
4
|
import autoBind from "auto-bind";
|
|
5
5
|
import type LightsparkClient from "../client.js";
|
|
6
6
|
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
@@ -13,6 +13,7 @@ import { WithdrawalRequestToChannelClosingTransactionsConnectionFromJson } from
|
|
|
13
13
|
import type WithdrawalRequestToChannelOpeningTransactionsConnection from "./WithdrawalRequestToChannelOpeningTransactionsConnection.js";
|
|
14
14
|
import { WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson } from "./WithdrawalRequestToChannelOpeningTransactionsConnection.js";
|
|
15
15
|
|
|
16
|
+
/** This object represents a request made for an L1 withdrawal from your Lightspark Node to any Bitcoin wallet. You can retrieve this object to receive detailed information about any withdrawal request made from your Lightspark account. **/
|
|
16
17
|
class WithdrawalRequest implements Entity {
|
|
17
18
|
constructor(
|
|
18
19
|
public readonly id: string,
|
|
@@ -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 that a Withdrawal can take. **/
|
|
3
4
|
export enum WithdrawalRequestStatus {
|
|
4
5
|
/**
|
|
5
6
|
* This is an enum value that represents values that could be added in the future.
|
package/src/objects/index.ts
CHANGED
|
@@ -21,6 +21,7 @@ export {
|
|
|
21
21
|
} from "./ChannelOpeningTransaction.js";
|
|
22
22
|
export { default as ChannelStatus } from "./ChannelStatus.js";
|
|
23
23
|
export { default as ChannelToTransactionsConnection } from "./ChannelToTransactionsConnection.js";
|
|
24
|
+
export { default as Connection } from "./Connection.js";
|
|
24
25
|
export { default as CreateApiTokenInput } from "./CreateApiTokenInput.js";
|
|
25
26
|
export { default as CreateApiTokenOutput } from "./CreateApiTokenOutput.js";
|
|
26
27
|
export { default as CreateInvoiceInput } from "./CreateInvoiceInput.js";
|
|
@@ -32,6 +33,7 @@ export { default as CreateTestModeInvoiceInput } from "./CreateTestModeInvoiceIn
|
|
|
32
33
|
export { default as CreateTestModeInvoiceOutput } from "./CreateTestModeInvoiceOutput.js";
|
|
33
34
|
export { default as CreateTestModePaymentInput } from "./CreateTestModePaymentInput.js";
|
|
34
35
|
export { default as CreateTestModePaymentoutput } from "./CreateTestModePaymentoutput.js";
|
|
36
|
+
export { default as CryptoSanctionsScreeningProvider } from "./CryptoSanctionsScreeningProvider.js";
|
|
35
37
|
export { default as CurrencyAmount } from "./CurrencyAmount.js";
|
|
36
38
|
export { default as CurrencyUnit } from "./CurrencyUnit.js";
|
|
37
39
|
export { default as DeleteApiTokenInput } from "./DeleteApiTokenInput.js";
|
|
@@ -96,11 +98,14 @@ export { default as Permission } from "./Permission.js";
|
|
|
96
98
|
export { default as RequestWithdrawalInput } from "./RequestWithdrawalInput.js";
|
|
97
99
|
export { default as RequestWithdrawalOutput } from "./RequestWithdrawalOutput.js";
|
|
98
100
|
export { default as RichText } from "./RichText.js";
|
|
101
|
+
export { default as RiskRating } from "./RiskRating.js";
|
|
99
102
|
export {
|
|
100
103
|
default as RoutingTransaction,
|
|
101
104
|
getRoutingTransactionQuery,
|
|
102
105
|
} from "./RoutingTransaction.js";
|
|
103
106
|
export { default as RoutingTransactionFailureReason } from "./RoutingTransactionFailureReason.js";
|
|
107
|
+
export { default as ScreenBitcoinAddressesInput } from "./ScreenBitcoinAddressesInput.js";
|
|
108
|
+
export { default as ScreenBitcoinAddressesOutput } from "./ScreenBitcoinAddressesOutput.js";
|
|
104
109
|
export { default as Secret } from "./Secret.js";
|
|
105
110
|
export { default as SendPaymentInput } from "./SendPaymentInput.js";
|
|
106
111
|
export { default as SendPaymentOutput } from "./SendPaymentOutput.js";
|
|
@@ -112,6 +117,8 @@ export { default as TransactionType } from "./TransactionType.js";
|
|
|
112
117
|
export { default as TransactionUpdate } from "./TransactionUpdate.js";
|
|
113
118
|
export { default as Wallet } from "./Wallet.js";
|
|
114
119
|
export { default as WalletStatus } from "./WalletStatus.js";
|
|
120
|
+
export { default as WalletToPaymentRequestsConnection } from "./WalletToPaymentRequestsConnection.js";
|
|
121
|
+
export { default as WalletToTransactionsConnection } from "./WalletToTransactionsConnection.js";
|
|
115
122
|
export { default as WebhookEventType } from "./WebhookEventType.js";
|
|
116
123
|
export { default as Withdrawal, getWithdrawalQuery } from "./Withdrawal.js";
|
|
117
124
|
export { default as WithdrawalMode } from "./WithdrawalMode.js";
|