@lightsparkdev/lightspark-sdk 0.4.9 → 0.4.11
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/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 +963 -254
- package/dist/index.d.ts +2 -2
- package/dist/index.js +16 -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 +4 -4
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/auth/AccountTokenAuthProvider.ts +4 -4
- package/src/client.ts +62 -63
- package/src/objects/Account.ts +46 -40
- package/src/objects/AccountToApiTokensConnection.ts +14 -9
- package/src/objects/AccountToChannelsConnection.ts +4 -4
- package/src/objects/AccountToNodesConnection.ts +13 -8
- package/src/objects/AccountToPaymentRequestsConnection.ts +22 -17
- package/src/objects/AccountToTransactionsConnection.ts +24 -19
- package/src/objects/AccountToWalletsConnection.ts +13 -8
- package/src/objects/ApiToken.ts +2 -1
- package/src/objects/Balances.ts +3 -2
- package/src/objects/BitcoinNetwork.ts +2 -1
- package/src/objects/BlockchainBalance.ts +1 -1
- package/src/objects/Channel.ts +6 -6
- package/src/objects/ChannelClosingTransaction.ts +4 -4
- package/src/objects/ChannelFees.ts +1 -0
- package/src/objects/ChannelOpeningTransaction.ts +4 -4
- package/src/objects/ChannelStatus.ts +1 -0
- package/src/objects/ChannelToTransactionsConnection.ts +4 -4
- package/src/objects/Connection.ts +387 -0
- package/src/objects/CreateApiTokenInput.ts +1 -1
- package/src/objects/CreateApiTokenOutput.ts +1 -1
- package/src/objects/CreateInvoiceInput.ts +12 -0
- package/src/objects/CreateLnurlInvoiceInput.ts +11 -1
- package/src/objects/CreateNodeWalletAddressInput.ts +1 -1
- package/src/objects/CreateNodeWalletAddressOutput.ts +1 -1
- package/src/objects/CreateTestModeInvoiceInput.ts +1 -1
- package/src/objects/CreateTestModeInvoiceOutput.ts +1 -1
- package/src/objects/CreateTestModePaymentInput.ts +1 -1
- package/src/objects/CreateTestModePaymentoutput.ts +2 -1
- package/src/objects/CryptoSanctionsScreeningProvider.ts +14 -0
- package/src/objects/CurrencyAmount.ts +1 -1
- package/src/objects/CurrencyUnit.ts +1 -0
- package/src/objects/DeleteApiTokenOutput.ts +1 -1
- 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 +5 -5
- package/src/objects/Hop.ts +2 -2
- package/src/objects/HtlcAttemptFailureCode.ts +1 -0
- package/src/objects/IncomingPayment.ts +21 -8
- package/src/objects/IncomingPaymentAttempt.ts +4 -4
- package/src/objects/IncomingPaymentAttemptStatus.ts +1 -1
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +23 -3
- package/src/objects/Invoice.ts +2 -2
- package/src/objects/InvoiceData.ts +1 -1
- package/src/objects/InvoiceType.ts +1 -0
- package/src/objects/LightningFeeEstimateForInvoiceInput.ts +1 -1
- package/src/objects/LightningFeeEstimateForNodeInput.ts +1 -1
- package/src/objects/LightningFeeEstimateOutput.ts +2 -2
- package/src/objects/LightningTransaction.ts +8 -8
- package/src/objects/LightsparkNode.ts +15 -9
- package/src/objects/LightsparkNodeOwner.ts +6 -6
- package/src/objects/LightsparkNodePurpose.ts +1 -0
- package/src/objects/LightsparkNodeToChannelsConnection.ts +14 -9
- package/src/objects/Node.ts +7 -8
- package/src/objects/NodeAddress.ts +1 -1
- package/src/objects/NodeAddressType.ts +1 -1
- package/src/objects/NodeToAddressesConnection.ts +2 -2
- package/src/objects/OnChainTransaction.ts +4 -5
- package/src/objects/OutgoingPayment.ts +16 -8
- package/src/objects/OutgoingPaymentAttempt.ts +18 -10
- package/src/objects/OutgoingPaymentAttemptStatus.ts +1 -1
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +23 -3
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +23 -3
- package/src/objects/PageInfo.ts +1 -0
- package/src/objects/PaymentFailureReason.ts +1 -0
- package/src/objects/PaymentRequest.ts +3 -3
- package/src/objects/PaymentRequestData.ts +2 -2
- package/src/objects/PaymentRequestStatus.ts +1 -0
- package/src/objects/Permission.ts +1 -0
- package/src/objects/RequestWithdrawalInput.ts +1 -1
- package/src/objects/RequestWithdrawalOutput.ts +1 -1
- package/src/objects/RiskRating.ts +18 -0
- package/src/objects/RoutingTransaction.ts +3 -3
- 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 +6 -6
- package/src/objects/TransactionFailures.ts +2 -1
- package/src/objects/TransactionStatus.ts +1 -0
- package/src/objects/TransactionType.ts +1 -0
- package/src/objects/Wallet.ts +636 -11
- 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 +8 -7
- package/src/objects/WithdrawalRequestStatus.ts +1 -0
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +2 -2
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +2 -2
- package/src/objects/index.ts +7 -0
- package/src/webhooks.ts +1 -1
- package/src/objects/.eslintrc.cjs +0 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthProvider } from '@lightsparkdev/core';
|
|
2
|
-
import { W as WebhookEventType } from './index-
|
|
3
|
-
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BitcoinNetwork, j as BlockchainBalance, C as Channel, k as ChannelClosingTransaction, m as ChannelFees, n as ChannelOpeningTransaction, p as ChannelStatus, q as ChannelToTransactionsConnection, r as
|
|
2
|
+
import { W as WebhookEventType } from './index-3ffe9e7b.js';
|
|
3
|
+
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BitcoinNetwork, j as BlockchainBalance, C as Channel, k as ChannelClosingTransaction, m as ChannelFees, n as ChannelOpeningTransaction, p as ChannelStatus, q as ChannelToTransactionsConnection, r as Connection, s as CreateApiTokenInput, t as CreateApiTokenOutput, u as CreateInvoiceInput, v as CreateInvoiceOutput, w as CreateLnurlInvoiceInput, x as CreateNodeWalletAddressInput, y as CreateNodeWalletAddressOutput, z as CreateTestModeInvoiceInput, D as CreateTestModeInvoiceOutput, E as CreateTestModePaymentInput, F as CreateTestModePaymentoutput, G as CryptoSanctionsScreeningProvider, H as CurrencyAmount, I as CurrencyUnit, J as DeleteApiTokenInput, K as DeleteApiTokenOutput, M as Deposit, O as Entity, P as FeeEstimate, Q as FundNodeInput, R as FundNodeOutput, S as GraphNode, T as Hop, V as HtlcAttemptFailureCode, X as IncomingPayment, Y as IncomingPaymentAttempt, _ as IncomingPaymentAttemptStatus, $ as IncomingPaymentToAttemptsConnection, a0 as Invoice, a2 as InvoiceData, a3 as InvoiceType, a4 as LightningFeeEstimateForInvoiceInput, a5 as LightningFeeEstimateForNodeInput, a6 as LightningFeeEstimateOutput, a7 as LightningTransaction, L as LightsparkClient, a9 as LightsparkNode, aa as LightsparkNodeOwner, ac as LightsparkNodePurpose, ad as LightsparkNodeStatus, ae as LightsparkNodeToChannelsConnection, af as Node, ag as NodeAddress, ah as NodeAddressType, ai as NodeToAddressesConnection, aj as OnChainTransaction, al as OutgoingPayment, am as OutgoingPaymentAttempt, an as OutgoingPaymentAttemptStatus, ao as OutgoingPaymentAttemptToHopsConnection, ap as OutgoingPaymentToAttemptsConnection, aq as PageInfo, ar as PayInvoiceInput, as as PayInvoiceOutput, at as PaymentFailureReason, au as PaymentRequest, aw as PaymentRequestData, ax as PaymentRequestStatus, ay as Permission, az as RequestWithdrawalInput, aA as RequestWithdrawalOutput, aB as RichText, aC as RiskRating, aD as RoutingTransaction, aF as RoutingTransactionFailureReason, aG as ScreenBitcoinAddressesInput, aH as ScreenBitcoinAddressesOutput, aI as Secret, aJ as SendPaymentInput, aK as SendPaymentOutput, aL as SingleNodeDashboard, aM as Transaction, aO as TransactionFailures, aP as TransactionStatus, aQ as TransactionType, aR as TransactionUpdate, aS as Wallet, aT as WalletStatus, aU as WalletToPaymentRequestsConnection, aV as WalletToTransactionsConnection, aW as Withdrawal, aY as WithdrawalMode, aZ as WithdrawalRequest, a_ as WithdrawalRequestStatus, a$ as WithdrawalRequestToChannelClosingTransactionsConnection, b0 as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, l as getChannelClosingTransactionQuery, o as getChannelOpeningTransactionQuery, N as getDepositQuery, U as getHopQuery, Z as getIncomingPaymentAttemptQuery, a1 as getInvoiceQuery, a8 as getLightningTransactionQuery, ab as getLightsparkNodeOwnerQuery, ak as getOnChainTransactionQuery, av as getPaymentRequestQuery, aE as getRoutingTransactionQuery, aN as getTransactionQuery, aX as getWithdrawalQuery } from './index-3ffe9e7b.js';
|
|
4
4
|
import 'zen-observable';
|
|
5
5
|
|
|
6
6
|
declare class AccountTokenAuthProvider implements AuthProvider {
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
BitcoinNetwork_default,
|
|
6
6
|
ChannelStatus_default,
|
|
7
7
|
Channel_default,
|
|
8
|
+
CryptoSanctionsScreeningProvider_default,
|
|
8
9
|
CurrencyAmountFromJson,
|
|
9
10
|
CurrencyUnit_default,
|
|
10
11
|
FRAGMENT,
|
|
@@ -37,6 +38,7 @@ import {
|
|
|
37
38
|
PaymentFailureReason_default,
|
|
38
39
|
PaymentRequestStatus_default,
|
|
39
40
|
Permission_default,
|
|
41
|
+
RiskRating_default,
|
|
40
42
|
RoutingTransactionFailureReason_default,
|
|
41
43
|
TransactionFromJson,
|
|
42
44
|
TransactionStatus_default,
|
|
@@ -64,7 +66,7 @@ import {
|
|
|
64
66
|
getRoutingTransactionQuery,
|
|
65
67
|
getTransactionQuery,
|
|
66
68
|
getWithdrawalQuery
|
|
67
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-NXUFC5J7.js";
|
|
68
70
|
import "./chunk-NIMBE7W3.js";
|
|
69
71
|
|
|
70
72
|
// src/auth/AccountTokenAuthProvider.ts
|
|
@@ -115,7 +117,7 @@ import { createHash } from "crypto";
|
|
|
115
117
|
// package.json
|
|
116
118
|
var package_default = {
|
|
117
119
|
name: "@lightsparkdev/lightspark-sdk",
|
|
118
|
-
version: "0.4.
|
|
120
|
+
version: "0.4.11",
|
|
119
121
|
description: "Lightspark JS SDK",
|
|
120
122
|
author: "Lightspark Inc.",
|
|
121
123
|
keywords: [
|
|
@@ -178,6 +180,7 @@ var package_default = {
|
|
|
178
180
|
"format:fix": "prettier src --write",
|
|
179
181
|
format: "prettier src --check",
|
|
180
182
|
"lint:fix": "eslint --fix .",
|
|
183
|
+
"lint:fix:continue": "eslint --fix . || exit 0",
|
|
181
184
|
"lint:watch": "esw ./src -w --ext .ts,.tsx,.js --color",
|
|
182
185
|
lint: "eslint .",
|
|
183
186
|
postversion: "yarn build",
|
|
@@ -187,7 +190,7 @@ var package_default = {
|
|
|
187
190
|
},
|
|
188
191
|
license: "Apache-2.0",
|
|
189
192
|
dependencies: {
|
|
190
|
-
"@lightsparkdev/core": "0.3.
|
|
193
|
+
"@lightsparkdev/core": "0.3.11",
|
|
191
194
|
"auto-bind": "^5.0.1",
|
|
192
195
|
crypto: "^1.0.1",
|
|
193
196
|
"crypto-browserify": "^3.12.0",
|
|
@@ -199,7 +202,6 @@ var package_default = {
|
|
|
199
202
|
},
|
|
200
203
|
devDependencies: {
|
|
201
204
|
"@lightsparkdev/eslint-config": "*",
|
|
202
|
-
"@lightsparkdev/gql": "0.0.3",
|
|
203
205
|
"@lightsparkdev/tsconfig": "0.0.0",
|
|
204
206
|
"@types/crypto-js": "^4.1.1",
|
|
205
207
|
"@types/jest": "^29.5.2",
|
|
@@ -207,7 +209,7 @@ var package_default = {
|
|
|
207
209
|
eslint: "^8.3.0",
|
|
208
210
|
"eslint-watch": "^8.0.0",
|
|
209
211
|
jest: "^29.4.1",
|
|
210
|
-
prettier: "
|
|
212
|
+
prettier: "3.0.2",
|
|
211
213
|
"prettier-plugin-organize-imports": "^3.2.2",
|
|
212
214
|
"ts-jest": "^29.0.5",
|
|
213
215
|
"ts-node": "^10.9.1",
|
|
@@ -842,11 +844,14 @@ var LightsparkClient = class {
|
|
|
842
844
|
* @returns A zen-observable that emits transaction updates for the given node IDs.
|
|
843
845
|
*/
|
|
844
846
|
listenToTransactions(nodeIds) {
|
|
845
|
-
const response = this.requester.subscribe(
|
|
846
|
-
|
|
847
|
-
|
|
847
|
+
const response = this.requester.subscribe(
|
|
848
|
+
TransactionSubscription,
|
|
849
|
+
{
|
|
850
|
+
nodeIds
|
|
851
|
+
}
|
|
852
|
+
);
|
|
848
853
|
return response.map(
|
|
849
|
-
(response2) => response2
|
|
854
|
+
(response2) => response2?.data?.transactions && TransactionUpdateFromJson(response2.data.transactions)
|
|
850
855
|
);
|
|
851
856
|
}
|
|
852
857
|
/**
|
|
@@ -1436,6 +1441,7 @@ export {
|
|
|
1436
1441
|
BitcoinNetwork_default as BitcoinNetwork,
|
|
1437
1442
|
Channel_default as Channel,
|
|
1438
1443
|
ChannelStatus_default as ChannelStatus,
|
|
1444
|
+
CryptoSanctionsScreeningProvider_default as CryptoSanctionsScreeningProvider,
|
|
1439
1445
|
CurrencyUnit_default as CurrencyUnit,
|
|
1440
1446
|
GraphNode_default as GraphNode,
|
|
1441
1447
|
HtlcAttemptFailureCode_default as HtlcAttemptFailureCode,
|
|
@@ -1454,6 +1460,7 @@ export {
|
|
|
1454
1460
|
PaymentFailureReason_default as PaymentFailureReason,
|
|
1455
1461
|
PaymentRequestStatus_default as PaymentRequestStatus,
|
|
1456
1462
|
Permission_default as Permission,
|
|
1463
|
+
RiskRating_default as RiskRating,
|
|
1457
1464
|
RoutingTransactionFailureReason_default as RoutingTransactionFailureReason,
|
|
1458
1465
|
TransactionStatus_default as TransactionStatus,
|
|
1459
1466
|
TransactionType_default as TransactionType,
|