@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
package/src/objects/ApiToken.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
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 Entity from "./Entity.js";
|
|
5
5
|
import Permission from "./Permission.js";
|
|
6
6
|
|
|
7
|
+
/** This is an object representing a Lightspark API token, that can be used to authenticate this account when making API calls or using our SDKs. See the “Authentication” section of our API docs for more details on its usage. **/
|
|
7
8
|
type ApiToken = Entity & {
|
|
8
9
|
/**
|
|
9
10
|
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
package/src/objects/Balances.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
4
|
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
5
5
|
|
|
6
|
+
/** This is an object representing the balance associated with your Lightspark account. You can retrieve this object to see your balance, which can be broken down into several different categorizations. **/
|
|
6
7
|
type Balances = {
|
|
7
8
|
/**
|
|
8
9
|
* This represents the balance that should be displayed when asked "how much do I own right now?". It
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
+
/** This is an enum identifying a particular Bitcoin Network. **/
|
|
3
4
|
export enum BitcoinNetwork {
|
|
4
5
|
/**
|
|
5
6
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -12,7 +13,7 @@ export enum BitcoinNetwork {
|
|
|
12
13
|
REGTEST = "REGTEST",
|
|
13
14
|
/** A test version of the Bitcoin Blockchain, maintained by a centralized organization. Not in use at Lightspark. **/
|
|
14
15
|
SIGNET = "SIGNET",
|
|
15
|
-
/** A test version of the Bitcoin Blockchain,
|
|
16
|
+
/** A test version of the Bitcoin Blockchain, publicly available. **/
|
|
16
17
|
TESTNET = "TESTNET",
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
4
|
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
5
5
|
|
|
6
|
-
/** This object
|
|
6
|
+
/** This is an object representing a detailed breakdown of the balance for a Lightspark Node. **/
|
|
7
7
|
type BlockchainBalance = {
|
|
8
8
|
/** The total wallet balance, including unconfirmed UTXOs. **/
|
|
9
9
|
totalBalance?: CurrencyAmount;
|
package/src/objects/Channel.ts
CHANGED
|
@@ -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 ChannelFees from "./ChannelFees.js";
|
|
@@ -13,7 +13,7 @@ import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
|
13
13
|
import type Entity from "./Entity.js";
|
|
14
14
|
import type TransactionType from "./TransactionType.js";
|
|
15
15
|
|
|
16
|
-
/**
|
|
16
|
+
/** This is an object representing a channel on the Lightning Network. You can retrieve this object to get detailed information on a specific Lightning Network channel. **/
|
|
17
17
|
class Channel implements Entity {
|
|
18
18
|
constructor(
|
|
19
19
|
public readonly id: string,
|
|
@@ -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 is an object representing a transaction which closes a channel on the Lightning Network. This operation allocates balances back to the local and remote nodes. **/
|
|
12
12
|
type ChannelClosingTransaction = OnChainTransaction &
|
|
13
13
|
Transaction &
|
|
14
14
|
Entity & {
|
|
@@ -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 is an object representing a transaction which opens a channel on the Lightning Network. This object occurs only for channels funded by the local Lightspark node. **/
|
|
12
12
|
type ChannelOpeningTransaction = 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 representing the status of a channel on the Lightning Network. **/
|
|
3
4
|
export enum ChannelStatus {
|
|
4
5
|
/**
|
|
5
6
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import { LightsparkException } from "@lightsparkdev/core";
|
|
4
|
+
import type AccountToApiTokensConnection from "./AccountToApiTokensConnection.js";
|
|
5
|
+
import type AccountToNodesConnection from "./AccountToNodesConnection.js";
|
|
6
|
+
import type AccountToPaymentRequestsConnection from "./AccountToPaymentRequestsConnection.js";
|
|
7
|
+
import type AccountToTransactionsConnection from "./AccountToTransactionsConnection.js";
|
|
8
|
+
import type AccountToWalletsConnection from "./AccountToWalletsConnection.js";
|
|
9
|
+
import { ApiTokenFromJson } from "./ApiToken.js";
|
|
10
|
+
import { ChannelFromJson } from "./Channel.js";
|
|
11
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
12
|
+
import { HopFromJson } from "./Hop.js";
|
|
13
|
+
import { IncomingPaymentAttemptFromJson } from "./IncomingPaymentAttempt.js";
|
|
14
|
+
import type IncomingPaymentToAttemptsConnection from "./IncomingPaymentToAttemptsConnection.js";
|
|
15
|
+
import { LightsparkNodeFromJson } from "./LightsparkNode.js";
|
|
16
|
+
import LightsparkNodePurpose from "./LightsparkNodePurpose.js";
|
|
17
|
+
import type LightsparkNodeToChannelsConnection from "./LightsparkNodeToChannelsConnection.js";
|
|
18
|
+
import { OutgoingPaymentAttemptFromJson } from "./OutgoingPaymentAttempt.js";
|
|
19
|
+
import type OutgoingPaymentAttemptToHopsConnection from "./OutgoingPaymentAttemptToHopsConnection.js";
|
|
20
|
+
import type OutgoingPaymentToAttemptsConnection from "./OutgoingPaymentToAttemptsConnection.js";
|
|
21
|
+
import type PageInfo from "./PageInfo.js";
|
|
22
|
+
import { PageInfoFromJson } from "./PageInfo.js";
|
|
23
|
+
import { PaymentRequestFromJson } from "./PaymentRequest.js";
|
|
24
|
+
import { TransactionFromJson } from "./Transaction.js";
|
|
25
|
+
import { WalletFromJson } from "./Wallet.js";
|
|
26
|
+
import type WalletToPaymentRequestsConnection from "./WalletToPaymentRequestsConnection.js";
|
|
27
|
+
import type WalletToTransactionsConnection from "./WalletToTransactionsConnection.js";
|
|
28
|
+
|
|
29
|
+
type Connection = {
|
|
30
|
+
/**
|
|
31
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
32
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
33
|
+
**/
|
|
34
|
+
count: number;
|
|
35
|
+
|
|
36
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
37
|
+
pageInfo: PageInfo;
|
|
38
|
+
|
|
39
|
+
/** The typename of the object **/
|
|
40
|
+
typename: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const ConnectionFromJson = (obj: any): Connection => {
|
|
44
|
+
if (obj["__typename"] == "AccountToApiTokensConnection") {
|
|
45
|
+
return {
|
|
46
|
+
count: obj["account_to_api_tokens_connection_count"],
|
|
47
|
+
pageInfo: PageInfoFromJson(
|
|
48
|
+
obj["account_to_api_tokens_connection_page_info"]
|
|
49
|
+
),
|
|
50
|
+
entities: obj["account_to_api_tokens_connection_entities"].map((e) =>
|
|
51
|
+
ApiTokenFromJson(e)
|
|
52
|
+
),
|
|
53
|
+
typename: "AccountToApiTokensConnection",
|
|
54
|
+
} as AccountToApiTokensConnection;
|
|
55
|
+
}
|
|
56
|
+
if (obj["__typename"] == "AccountToNodesConnection") {
|
|
57
|
+
return {
|
|
58
|
+
count: obj["account_to_nodes_connection_count"],
|
|
59
|
+
pageInfo: PageInfoFromJson(obj["account_to_nodes_connection_page_info"]),
|
|
60
|
+
entities: obj["account_to_nodes_connection_entities"].map((e) =>
|
|
61
|
+
LightsparkNodeFromJson(e)
|
|
62
|
+
),
|
|
63
|
+
typename: "AccountToNodesConnection",
|
|
64
|
+
purpose: !!obj["account_to_nodes_connection_purpose"]
|
|
65
|
+
? LightsparkNodePurpose[obj["account_to_nodes_connection_purpose"]] ??
|
|
66
|
+
LightsparkNodePurpose.FUTURE_VALUE
|
|
67
|
+
: null,
|
|
68
|
+
} as AccountToNodesConnection;
|
|
69
|
+
}
|
|
70
|
+
if (obj["__typename"] == "AccountToPaymentRequestsConnection") {
|
|
71
|
+
return {
|
|
72
|
+
count: obj["account_to_payment_requests_connection_count"],
|
|
73
|
+
pageInfo: PageInfoFromJson(
|
|
74
|
+
obj["account_to_payment_requests_connection_page_info"]
|
|
75
|
+
),
|
|
76
|
+
entities: obj["account_to_payment_requests_connection_entities"].map(
|
|
77
|
+
(e) => PaymentRequestFromJson(e)
|
|
78
|
+
),
|
|
79
|
+
typename: "AccountToPaymentRequestsConnection",
|
|
80
|
+
} as AccountToPaymentRequestsConnection;
|
|
81
|
+
}
|
|
82
|
+
if (obj["__typename"] == "AccountToTransactionsConnection") {
|
|
83
|
+
return {
|
|
84
|
+
count: obj["account_to_transactions_connection_count"],
|
|
85
|
+
pageInfo: PageInfoFromJson(
|
|
86
|
+
obj["account_to_transactions_connection_page_info"]
|
|
87
|
+
),
|
|
88
|
+
entities: obj["account_to_transactions_connection_entities"].map((e) =>
|
|
89
|
+
TransactionFromJson(e)
|
|
90
|
+
),
|
|
91
|
+
typename: "AccountToTransactionsConnection",
|
|
92
|
+
profitLoss: !!obj["account_to_transactions_connection_profit_loss"]
|
|
93
|
+
? CurrencyAmountFromJson(
|
|
94
|
+
obj["account_to_transactions_connection_profit_loss"]
|
|
95
|
+
)
|
|
96
|
+
: undefined,
|
|
97
|
+
averageFeeEarned: !!obj[
|
|
98
|
+
"account_to_transactions_connection_average_fee_earned"
|
|
99
|
+
]
|
|
100
|
+
? CurrencyAmountFromJson(
|
|
101
|
+
obj["account_to_transactions_connection_average_fee_earned"]
|
|
102
|
+
)
|
|
103
|
+
: undefined,
|
|
104
|
+
totalAmountTransacted: !!obj[
|
|
105
|
+
"account_to_transactions_connection_total_amount_transacted"
|
|
106
|
+
]
|
|
107
|
+
? CurrencyAmountFromJson(
|
|
108
|
+
obj["account_to_transactions_connection_total_amount_transacted"]
|
|
109
|
+
)
|
|
110
|
+
: undefined,
|
|
111
|
+
} as AccountToTransactionsConnection;
|
|
112
|
+
}
|
|
113
|
+
if (obj["__typename"] == "AccountToWalletsConnection") {
|
|
114
|
+
return {
|
|
115
|
+
count: obj["account_to_wallets_connection_count"],
|
|
116
|
+
pageInfo: PageInfoFromJson(
|
|
117
|
+
obj["account_to_wallets_connection_page_info"]
|
|
118
|
+
),
|
|
119
|
+
entities: obj["account_to_wallets_connection_entities"].map((e) =>
|
|
120
|
+
WalletFromJson(e)
|
|
121
|
+
),
|
|
122
|
+
typename: "AccountToWalletsConnection",
|
|
123
|
+
} as AccountToWalletsConnection;
|
|
124
|
+
}
|
|
125
|
+
if (obj["__typename"] == "IncomingPaymentToAttemptsConnection") {
|
|
126
|
+
return {
|
|
127
|
+
count: obj["incoming_payment_to_attempts_connection_count"],
|
|
128
|
+
pageInfo: PageInfoFromJson(
|
|
129
|
+
obj["incoming_payment_to_attempts_connection_page_info"]
|
|
130
|
+
),
|
|
131
|
+
entities: obj["incoming_payment_to_attempts_connection_entities"].map(
|
|
132
|
+
(e) => IncomingPaymentAttemptFromJson(e)
|
|
133
|
+
),
|
|
134
|
+
typename: "IncomingPaymentToAttemptsConnection",
|
|
135
|
+
} as IncomingPaymentToAttemptsConnection;
|
|
136
|
+
}
|
|
137
|
+
if (obj["__typename"] == "LightsparkNodeToChannelsConnection") {
|
|
138
|
+
return {
|
|
139
|
+
count: obj["lightspark_node_to_channels_connection_count"],
|
|
140
|
+
pageInfo: PageInfoFromJson(
|
|
141
|
+
obj["lightspark_node_to_channels_connection_page_info"]
|
|
142
|
+
),
|
|
143
|
+
entities: obj["lightspark_node_to_channels_connection_entities"].map(
|
|
144
|
+
(e) => ChannelFromJson(e)
|
|
145
|
+
),
|
|
146
|
+
typename: "LightsparkNodeToChannelsConnection",
|
|
147
|
+
} as LightsparkNodeToChannelsConnection;
|
|
148
|
+
}
|
|
149
|
+
if (obj["__typename"] == "OutgoingPaymentAttemptToHopsConnection") {
|
|
150
|
+
return {
|
|
151
|
+
count: obj["outgoing_payment_attempt_to_hops_connection_count"],
|
|
152
|
+
pageInfo: PageInfoFromJson(
|
|
153
|
+
obj["outgoing_payment_attempt_to_hops_connection_page_info"]
|
|
154
|
+
),
|
|
155
|
+
entities: obj["outgoing_payment_attempt_to_hops_connection_entities"].map(
|
|
156
|
+
(e) => HopFromJson(e)
|
|
157
|
+
),
|
|
158
|
+
typename: "OutgoingPaymentAttemptToHopsConnection",
|
|
159
|
+
} as OutgoingPaymentAttemptToHopsConnection;
|
|
160
|
+
}
|
|
161
|
+
if (obj["__typename"] == "OutgoingPaymentToAttemptsConnection") {
|
|
162
|
+
return {
|
|
163
|
+
count: obj["outgoing_payment_to_attempts_connection_count"],
|
|
164
|
+
pageInfo: PageInfoFromJson(
|
|
165
|
+
obj["outgoing_payment_to_attempts_connection_page_info"]
|
|
166
|
+
),
|
|
167
|
+
entities: obj["outgoing_payment_to_attempts_connection_entities"].map(
|
|
168
|
+
(e) => OutgoingPaymentAttemptFromJson(e)
|
|
169
|
+
),
|
|
170
|
+
typename: "OutgoingPaymentToAttemptsConnection",
|
|
171
|
+
} as OutgoingPaymentToAttemptsConnection;
|
|
172
|
+
}
|
|
173
|
+
if (obj["__typename"] == "WalletToPaymentRequestsConnection") {
|
|
174
|
+
return {
|
|
175
|
+
count: obj["wallet_to_payment_requests_connection_count"],
|
|
176
|
+
pageInfo: PageInfoFromJson(
|
|
177
|
+
obj["wallet_to_payment_requests_connection_page_info"]
|
|
178
|
+
),
|
|
179
|
+
entities: obj["wallet_to_payment_requests_connection_entities"].map((e) =>
|
|
180
|
+
PaymentRequestFromJson(e)
|
|
181
|
+
),
|
|
182
|
+
typename: "WalletToPaymentRequestsConnection",
|
|
183
|
+
} as WalletToPaymentRequestsConnection;
|
|
184
|
+
}
|
|
185
|
+
if (obj["__typename"] == "WalletToTransactionsConnection") {
|
|
186
|
+
return {
|
|
187
|
+
count: obj["wallet_to_transactions_connection_count"],
|
|
188
|
+
pageInfo: PageInfoFromJson(
|
|
189
|
+
obj["wallet_to_transactions_connection_page_info"]
|
|
190
|
+
),
|
|
191
|
+
entities: obj["wallet_to_transactions_connection_entities"].map((e) =>
|
|
192
|
+
TransactionFromJson(e)
|
|
193
|
+
),
|
|
194
|
+
typename: "WalletToTransactionsConnection",
|
|
195
|
+
} as WalletToTransactionsConnection;
|
|
196
|
+
}
|
|
197
|
+
throw new LightsparkException(
|
|
198
|
+
"DeserializationError",
|
|
199
|
+
`Couldn't find a concrete type for interface Connection corresponding to the typename=${obj["__typename"]}`
|
|
200
|
+
);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export const FRAGMENT = `
|
|
204
|
+
fragment ConnectionFragment on Connection {
|
|
205
|
+
__typename
|
|
206
|
+
... on AccountToApiTokensConnection {
|
|
207
|
+
__typename
|
|
208
|
+
account_to_api_tokens_connection_count: count
|
|
209
|
+
account_to_api_tokens_connection_page_info: page_info {
|
|
210
|
+
__typename
|
|
211
|
+
page_info_has_next_page: has_next_page
|
|
212
|
+
page_info_has_previous_page: has_previous_page
|
|
213
|
+
page_info_start_cursor: start_cursor
|
|
214
|
+
page_info_end_cursor: end_cursor
|
|
215
|
+
}
|
|
216
|
+
account_to_api_tokens_connection_entities: entities {
|
|
217
|
+
id
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
... on AccountToNodesConnection {
|
|
221
|
+
__typename
|
|
222
|
+
account_to_nodes_connection_count: count
|
|
223
|
+
account_to_nodes_connection_page_info: page_info {
|
|
224
|
+
__typename
|
|
225
|
+
page_info_has_next_page: has_next_page
|
|
226
|
+
page_info_has_previous_page: has_previous_page
|
|
227
|
+
page_info_start_cursor: start_cursor
|
|
228
|
+
page_info_end_cursor: end_cursor
|
|
229
|
+
}
|
|
230
|
+
account_to_nodes_connection_purpose: purpose
|
|
231
|
+
account_to_nodes_connection_entities: entities {
|
|
232
|
+
id
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
... on AccountToPaymentRequestsConnection {
|
|
236
|
+
__typename
|
|
237
|
+
account_to_payment_requests_connection_count: count
|
|
238
|
+
account_to_payment_requests_connection_page_info: page_info {
|
|
239
|
+
__typename
|
|
240
|
+
page_info_has_next_page: has_next_page
|
|
241
|
+
page_info_has_previous_page: has_previous_page
|
|
242
|
+
page_info_start_cursor: start_cursor
|
|
243
|
+
page_info_end_cursor: end_cursor
|
|
244
|
+
}
|
|
245
|
+
account_to_payment_requests_connection_entities: entities {
|
|
246
|
+
id
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
... on AccountToTransactionsConnection {
|
|
250
|
+
__typename
|
|
251
|
+
account_to_transactions_connection_count: count
|
|
252
|
+
account_to_transactions_connection_page_info: page_info {
|
|
253
|
+
__typename
|
|
254
|
+
page_info_has_next_page: has_next_page
|
|
255
|
+
page_info_has_previous_page: has_previous_page
|
|
256
|
+
page_info_start_cursor: start_cursor
|
|
257
|
+
page_info_end_cursor: end_cursor
|
|
258
|
+
}
|
|
259
|
+
account_to_transactions_connection_profit_loss: profit_loss {
|
|
260
|
+
__typename
|
|
261
|
+
currency_amount_original_value: original_value
|
|
262
|
+
currency_amount_original_unit: original_unit
|
|
263
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
264
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
265
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
266
|
+
}
|
|
267
|
+
account_to_transactions_connection_average_fee_earned: average_fee_earned {
|
|
268
|
+
__typename
|
|
269
|
+
currency_amount_original_value: original_value
|
|
270
|
+
currency_amount_original_unit: original_unit
|
|
271
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
272
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
273
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
274
|
+
}
|
|
275
|
+
account_to_transactions_connection_total_amount_transacted: total_amount_transacted {
|
|
276
|
+
__typename
|
|
277
|
+
currency_amount_original_value: original_value
|
|
278
|
+
currency_amount_original_unit: original_unit
|
|
279
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
280
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
281
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
282
|
+
}
|
|
283
|
+
account_to_transactions_connection_entities: entities {
|
|
284
|
+
id
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
... on AccountToWalletsConnection {
|
|
288
|
+
__typename
|
|
289
|
+
account_to_wallets_connection_count: count
|
|
290
|
+
account_to_wallets_connection_page_info: page_info {
|
|
291
|
+
__typename
|
|
292
|
+
page_info_has_next_page: has_next_page
|
|
293
|
+
page_info_has_previous_page: has_previous_page
|
|
294
|
+
page_info_start_cursor: start_cursor
|
|
295
|
+
page_info_end_cursor: end_cursor
|
|
296
|
+
}
|
|
297
|
+
account_to_wallets_connection_entities: entities {
|
|
298
|
+
id
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
... on IncomingPaymentToAttemptsConnection {
|
|
302
|
+
__typename
|
|
303
|
+
incoming_payment_to_attempts_connection_count: count
|
|
304
|
+
incoming_payment_to_attempts_connection_page_info: page_info {
|
|
305
|
+
__typename
|
|
306
|
+
page_info_has_next_page: has_next_page
|
|
307
|
+
page_info_has_previous_page: has_previous_page
|
|
308
|
+
page_info_start_cursor: start_cursor
|
|
309
|
+
page_info_end_cursor: end_cursor
|
|
310
|
+
}
|
|
311
|
+
incoming_payment_to_attempts_connection_entities: entities {
|
|
312
|
+
id
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
... on LightsparkNodeToChannelsConnection {
|
|
316
|
+
__typename
|
|
317
|
+
lightspark_node_to_channels_connection_count: count
|
|
318
|
+
lightspark_node_to_channels_connection_page_info: page_info {
|
|
319
|
+
__typename
|
|
320
|
+
page_info_has_next_page: has_next_page
|
|
321
|
+
page_info_has_previous_page: has_previous_page
|
|
322
|
+
page_info_start_cursor: start_cursor
|
|
323
|
+
page_info_end_cursor: end_cursor
|
|
324
|
+
}
|
|
325
|
+
lightspark_node_to_channels_connection_entities: entities {
|
|
326
|
+
id
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
... on OutgoingPaymentAttemptToHopsConnection {
|
|
330
|
+
__typename
|
|
331
|
+
outgoing_payment_attempt_to_hops_connection_count: count
|
|
332
|
+
outgoing_payment_attempt_to_hops_connection_page_info: page_info {
|
|
333
|
+
__typename
|
|
334
|
+
page_info_has_next_page: has_next_page
|
|
335
|
+
page_info_has_previous_page: has_previous_page
|
|
336
|
+
page_info_start_cursor: start_cursor
|
|
337
|
+
page_info_end_cursor: end_cursor
|
|
338
|
+
}
|
|
339
|
+
outgoing_payment_attempt_to_hops_connection_entities: entities {
|
|
340
|
+
id
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
... on OutgoingPaymentToAttemptsConnection {
|
|
344
|
+
__typename
|
|
345
|
+
outgoing_payment_to_attempts_connection_count: count
|
|
346
|
+
outgoing_payment_to_attempts_connection_page_info: page_info {
|
|
347
|
+
__typename
|
|
348
|
+
page_info_has_next_page: has_next_page
|
|
349
|
+
page_info_has_previous_page: has_previous_page
|
|
350
|
+
page_info_start_cursor: start_cursor
|
|
351
|
+
page_info_end_cursor: end_cursor
|
|
352
|
+
}
|
|
353
|
+
outgoing_payment_to_attempts_connection_entities: entities {
|
|
354
|
+
id
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
... on WalletToPaymentRequestsConnection {
|
|
358
|
+
__typename
|
|
359
|
+
wallet_to_payment_requests_connection_count: count
|
|
360
|
+
wallet_to_payment_requests_connection_page_info: page_info {
|
|
361
|
+
__typename
|
|
362
|
+
page_info_has_next_page: has_next_page
|
|
363
|
+
page_info_has_previous_page: has_previous_page
|
|
364
|
+
page_info_start_cursor: start_cursor
|
|
365
|
+
page_info_end_cursor: end_cursor
|
|
366
|
+
}
|
|
367
|
+
wallet_to_payment_requests_connection_entities: entities {
|
|
368
|
+
id
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
... on WalletToTransactionsConnection {
|
|
372
|
+
__typename
|
|
373
|
+
wallet_to_transactions_connection_count: count
|
|
374
|
+
wallet_to_transactions_connection_page_info: page_info {
|
|
375
|
+
__typename
|
|
376
|
+
page_info_has_next_page: has_next_page
|
|
377
|
+
page_info_has_previous_page: has_previous_page
|
|
378
|
+
page_info_start_cursor: start_cursor
|
|
379
|
+
page_info_end_cursor: end_cursor
|
|
380
|
+
}
|
|
381
|
+
wallet_to_transactions_connection_entities: entities {
|
|
382
|
+
id
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}`;
|
|
386
|
+
|
|
387
|
+
export default Connection;
|
|
@@ -3,13 +3,22 @@
|
|
|
3
3
|
import InvoiceType from "./InvoiceType.js";
|
|
4
4
|
|
|
5
5
|
type CreateInvoiceInput = {
|
|
6
|
+
/** The node from which to create the invoice. **/
|
|
6
7
|
nodeId: string;
|
|
7
8
|
|
|
9
|
+
/** The amount for which the invoice should be created, in millisatoshis. **/
|
|
8
10
|
amountMsats: number;
|
|
9
11
|
|
|
10
12
|
memo?: string;
|
|
11
13
|
|
|
12
14
|
invoiceType?: InvoiceType;
|
|
15
|
+
|
|
16
|
+
/** The expiry of the invoice in seconds. Default value is 86400 (1 day). **/
|
|
17
|
+
expirySecs?: number;
|
|
18
|
+
|
|
19
|
+
paymentHash?: string;
|
|
20
|
+
|
|
21
|
+
preimageNonce?: string;
|
|
13
22
|
};
|
|
14
23
|
|
|
15
24
|
export const CreateInvoiceInputFromJson = (obj: any): CreateInvoiceInput => {
|
|
@@ -21,6 +30,9 @@ export const CreateInvoiceInputFromJson = (obj: any): CreateInvoiceInput => {
|
|
|
21
30
|
? InvoiceType[obj["create_invoice_input_invoice_type"]] ??
|
|
22
31
|
InvoiceType.FUTURE_VALUE
|
|
23
32
|
: null,
|
|
33
|
+
expirySecs: obj["create_invoice_input_expiry_secs"],
|
|
34
|
+
paymentHash: obj["create_invoice_input_payment_hash"],
|
|
35
|
+
preimageNonce: obj["create_invoice_input_preimage_nonce"],
|
|
24
36
|
} as CreateInvoiceInput;
|
|
25
37
|
};
|
|
26
38
|
|
|
@@ -12,6 +12,13 @@ type CreateLnurlInvoiceInput = {
|
|
|
12
12
|
* payment) of the resulting Bolt 11 invoice.
|
|
13
13
|
**/
|
|
14
14
|
metadataHash: string;
|
|
15
|
+
|
|
16
|
+
/** The expiry of the invoice in seconds. Default value is 86400 (1 day). **/
|
|
17
|
+
expirySecs?: number;
|
|
18
|
+
|
|
19
|
+
paymentHash?: string;
|
|
20
|
+
|
|
21
|
+
preimageNonce?: string;
|
|
15
22
|
};
|
|
16
23
|
|
|
17
24
|
export const CreateLnurlInvoiceInputFromJson = (
|
|
@@ -21,6 +28,9 @@ export const CreateLnurlInvoiceInputFromJson = (
|
|
|
21
28
|
nodeId: obj["create_lnurl_invoice_input_node_id"],
|
|
22
29
|
amountMsats: obj["create_lnurl_invoice_input_amount_msats"],
|
|
23
30
|
metadataHash: obj["create_lnurl_invoice_input_metadata_hash"],
|
|
31
|
+
expirySecs: obj["create_lnurl_invoice_input_expiry_secs"],
|
|
32
|
+
paymentHash: obj["create_lnurl_invoice_input_payment_hash"],
|
|
33
|
+
preimageNonce: obj["create_lnurl_invoice_input_preimage_nonce"],
|
|
24
34
|
} as CreateLnurlInvoiceInput;
|
|
25
35
|
};
|
|
26
36
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
+
/** This is an object identifying the output of a test mode payment. This object can be used to retrieve the associated payment made from a Test Mode Payment call. **/
|
|
3
4
|
type CreateTestModePaymentoutput = {
|
|
4
5
|
/** The payment that has been sent. **/
|
|
5
6
|
paymentId: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
/** This is an enum identifying a type of crypto sanctions screening provider. **/
|
|
4
|
+
export enum CryptoSanctionsScreeningProvider {
|
|
5
|
+
/**
|
|
6
|
+
* This is an enum value that represents values that could be added in the future.
|
|
7
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
8
|
+
*/
|
|
9
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
|
+
|
|
11
|
+
CHAINALYSIS = "CHAINALYSIS",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default CryptoSanctionsScreeningProvider;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import CurrencyUnit from "./CurrencyUnit.js";
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/** This object represents the value and unit for an amount of currency. **/
|
|
6
6
|
type CurrencyAmount = {
|
|
7
7
|
/** The original numeric value for this CurrencyAmount. **/
|
|
8
8
|
originalValue: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
+
/** This enum identifies the unit of currency associated with a CurrencyAmount. **/
|
|
3
4
|
export enum CurrencyUnit {
|
|
4
5
|
/**
|
|
5
6
|
* This is an enum value that represents values that could be added in the future.
|
package/src/objects/Deposit.ts
CHANGED
|
@@ -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 a Deposit made to a Lightspark node wallet. This operation occurs for any L1 funding transaction to the wallet. You can retrieve this object to receive detailed information about the deposit. **/
|
|
12
12
|
type Deposit = OnChainTransaction &
|
|
13
13
|
Transaction &
|
|
14
14
|
Entity & {
|
package/src/objects/Entity.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/** This interface is used by all the entities in the Lightspark
|
|
3
|
+
/** This interface is used by all the entities in the Lightspark system. It defines a few core fields that are available everywhere. Any object that implements this interface can be queried using the `entity` query and its ID. **/
|
|
4
4
|
type Entity = {
|
|
5
5
|
/**
|
|
6
6
|
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
4
|
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
5
5
|
|
|
6
|
+
/** This object represents the estimated L1 transaction fees for the Bitcoin network. Fee estimates are separated by potential confirmation speeds for settlement. **/
|
|
6
7
|
type FeeEstimate = {
|
|
7
8
|
feeFast: CurrencyAmount;
|
|
8
9
|
|
package/src/objects/GraphNode.ts
CHANGED
|
@@ -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 BitcoinNetwork from "./BitcoinNetwork.js";
|
|
@@ -9,7 +9,7 @@ import type NodeAddressType from "./NodeAddressType.js";
|
|
|
9
9
|
import type NodeToAddressesConnection from "./NodeToAddressesConnection.js";
|
|
10
10
|
import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.js";
|
|
11
11
|
|
|
12
|
-
/** This
|
|
12
|
+
/** This object represents a node that exists on the Lightning Network, including nodes not managed by Lightspark. You can retrieve this object to get publicly available information about any node on the Lightning Network. **/
|
|
13
13
|
class GraphNode implements Node {
|
|
14
14
|
constructor(
|
|
15
15
|
public readonly id: string,
|