@lightsparkdev/lightspark-sdk 0.4.7 → 0.4.9
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/index.cjs +5 -5
- package/dist/index.js +5 -5
- package/package.json +3 -3
- package/src/auth/AccountTokenAuthProvider.ts +2 -1
- package/src/client.ts +33 -31
- package/src/graphql/MultiNodeDashboard.ts +6 -7
- package/src/objects/Account.ts +23 -29
- package/src/objects/AccountToApiTokensConnection.ts +4 -2
- package/src/objects/AccountToChannelsConnection.ts +2 -1
- package/src/objects/AccountToNodesConnection.ts +4 -2
- package/src/objects/AccountToPaymentRequestsConnection.ts +4 -2
- package/src/objects/AccountToTransactionsConnection.ts +6 -3
- package/src/objects/AccountToWalletsConnection.ts +4 -2
- package/src/objects/ApiToken.ts +2 -2
- package/src/objects/Balances.ts +2 -1
- package/src/objects/BlockchainBalance.ts +2 -1
- package/src/objects/Channel.ts +10 -9
- package/src/objects/ChannelClosingTransaction.ts +6 -5
- package/src/objects/ChannelFees.ts +2 -1
- package/src/objects/ChannelOpeningTransaction.ts +6 -5
- package/src/objects/ChannelToTransactionsConnection.ts +2 -1
- package/src/objects/CreateApiTokenOutput.ts +2 -1
- package/src/objects/Deposit.ts +6 -5
- package/src/objects/FeeEstimate.ts +2 -1
- package/src/objects/FundNodeOutput.ts +2 -1
- package/src/objects/GraphNode.ts +6 -7
- package/src/objects/Hop.ts +4 -3
- package/src/objects/IncomingPayment.ts +8 -8
- package/src/objects/IncomingPaymentAttempt.ts +4 -3
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +2 -3
- package/src/objects/Invoice.ts +7 -5
- package/src/objects/InvoiceData.ts +5 -3
- package/src/objects/LightningFeeEstimateOutput.ts +2 -1
- package/src/objects/LightningTransaction.ts +7 -5
- package/src/objects/LightsparkNode.ts +15 -16
- package/src/objects/LightsparkNodeOwner.ts +3 -2
- package/src/objects/LightsparkNodeToChannelsConnection.ts +4 -2
- package/src/objects/Node.ts +7 -7
- package/src/objects/NodeToAddressesConnection.ts +2 -1
- package/src/objects/OnChainTransaction.ts +10 -8
- package/src/objects/OutgoingPayment.ts +11 -11
- package/src/objects/OutgoingPaymentAttempt.ts +7 -7
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +2 -1
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +2 -3
- package/src/objects/PaymentRequest.ts +5 -4
- package/src/objects/PaymentRequestData.ts +1 -1
- package/src/objects/RoutingTransaction.ts +8 -6
- package/src/objects/SingleNodeDashboard.ts +6 -6
- package/src/objects/Transaction.ts +10 -8
- package/src/objects/TransactionUpdate.ts +2 -1
- package/src/objects/Wallet.ts +7 -5
- package/src/objects/Withdrawal.ts +6 -5
- package/src/objects/WithdrawalRequest.ts +9 -10
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +4 -4
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +4 -4
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
4
|
import autoBind from "auto-bind";
|
|
5
|
-
import LightsparkClient from "../client.js";
|
|
6
|
-
import CurrencyAmount
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
} from "./IncomingPaymentToAttemptsConnection.js";
|
|
11
|
-
import LightningTransaction from "./LightningTransaction.js";
|
|
5
|
+
import type LightsparkClient from "../client.js";
|
|
6
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
7
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
8
|
+
import type IncomingPaymentAttemptStatus from "./IncomingPaymentAttemptStatus.js";
|
|
9
|
+
import type IncomingPaymentToAttemptsConnection from "./IncomingPaymentToAttemptsConnection.js";
|
|
10
|
+
import { IncomingPaymentToAttemptsConnectionFromJson } from "./IncomingPaymentToAttemptsConnection.js";
|
|
11
|
+
import type LightningTransaction from "./LightningTransaction.js";
|
|
12
12
|
import TransactionStatus from "./TransactionStatus.js";
|
|
13
13
|
|
|
14
14
|
/** A transaction that was sent to a Lightspark node on the Lightning Network. **/
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
4
|
-
import CurrencyAmount
|
|
5
|
-
import
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
5
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
6
|
+
import type Entity from "./Entity.js";
|
|
6
7
|
import IncomingPaymentAttemptStatus from "./IncomingPaymentAttemptStatus.js";
|
|
7
8
|
|
|
8
9
|
/** An attempt for a payment over a route from sender node to recipient node. **/
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import IncomingPaymentAttempt
|
|
4
|
-
|
|
5
|
-
} from "./IncomingPaymentAttempt.js";
|
|
3
|
+
import type IncomingPaymentAttempt from "./IncomingPaymentAttempt.js";
|
|
4
|
+
import { IncomingPaymentAttemptFromJson } from "./IncomingPaymentAttempt.js";
|
|
6
5
|
|
|
7
6
|
/** The connection from incoming payment to all attempts. **/
|
|
8
7
|
type IncomingPaymentToAttemptsConnection = {
|
package/src/objects/Invoice.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
4
|
-
import CurrencyAmount
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
5
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
6
|
+
import type Entity from "./Entity.js";
|
|
7
|
+
import type InvoiceData from "./InvoiceData.js";
|
|
8
|
+
import { InvoiceDataFromJson } from "./InvoiceData.js";
|
|
9
|
+
import type PaymentRequest from "./PaymentRequest.js";
|
|
8
10
|
import PaymentRequestStatus from "./PaymentRequestStatus.js";
|
|
9
11
|
|
|
10
12
|
/** This object represents a BOLT #11 invoice (https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) initiated by a Lightspark Node. **/
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
import BitcoinNetwork from "./BitcoinNetwork.js";
|
|
4
|
-
import CurrencyAmount
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
5
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
6
|
+
import type Node from "./Node.js";
|
|
7
|
+
import { NodeFromJson } from "./Node.js";
|
|
8
|
+
import type PaymentRequestData from "./PaymentRequestData.js";
|
|
7
9
|
|
|
8
10
|
/** This object represents the BOLT #11 invoice protocol for Lightning Payments. See https://github.com/lightning/bolts/blob/master/11-payment-encoding.md. **/
|
|
9
11
|
type InvoiceData = PaymentRequestData & {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import CurrencyAmount
|
|
3
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
4
5
|
|
|
5
6
|
type LightningFeeEstimateOutput = {
|
|
6
7
|
/** The estimated fees for the payment. **/
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import { LightsparkException } from "@lightsparkdev/core";
|
|
5
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
6
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
7
|
+
import type Entity from "./Entity.js";
|
|
6
8
|
import IncomingPayment from "./IncomingPayment.js";
|
|
7
9
|
import OutgoingPayment from "./OutgoingPayment.js";
|
|
8
10
|
import PaymentFailureReason from "./PaymentFailureReason.js";
|
|
9
11
|
import { PaymentRequestDataFromJson } from "./PaymentRequestData.js";
|
|
10
12
|
import { RichTextFromJson } from "./RichText.js";
|
|
11
|
-
import RoutingTransaction from "./RoutingTransaction.js";
|
|
13
|
+
import type RoutingTransaction from "./RoutingTransaction.js";
|
|
12
14
|
import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js";
|
|
13
|
-
import Transaction from "./Transaction.js";
|
|
15
|
+
import type Transaction from "./Transaction.js";
|
|
14
16
|
import TransactionStatus from "./TransactionStatus.js";
|
|
15
17
|
|
|
16
18
|
type LightningTransaction = Transaction &
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
4
|
import autoBind from "auto-bind";
|
|
5
|
-
import LightsparkClient from "../client.js";
|
|
5
|
+
import type LightsparkClient from "../client.js";
|
|
6
6
|
import BitcoinNetwork from "./BitcoinNetwork.js";
|
|
7
|
-
import BlockchainBalance
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
-
import
|
|
7
|
+
import type BlockchainBalance from "./BlockchainBalance.js";
|
|
8
|
+
import { BlockchainBalanceFromJson } from "./BlockchainBalance.js";
|
|
9
|
+
import type ChannelStatus from "./ChannelStatus.js";
|
|
10
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
11
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
12
12
|
import LightsparkNodePurpose from "./LightsparkNodePurpose.js";
|
|
13
13
|
import LightsparkNodeStatus from "./LightsparkNodeStatus.js";
|
|
14
|
-
import LightsparkNodeToChannelsConnection
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import NodeToAddressesConnection
|
|
20
|
-
|
|
21
|
-
} from "./
|
|
22
|
-
import Secret, { SecretFromJson } from "./Secret.js";
|
|
14
|
+
import type LightsparkNodeToChannelsConnection from "./LightsparkNodeToChannelsConnection.js";
|
|
15
|
+
import { LightsparkNodeToChannelsConnectionFromJson } from "./LightsparkNodeToChannelsConnection.js";
|
|
16
|
+
import type Node from "./Node.js";
|
|
17
|
+
import type NodeAddressType from "./NodeAddressType.js";
|
|
18
|
+
import type NodeToAddressesConnection from "./NodeToAddressesConnection.js";
|
|
19
|
+
import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.js";
|
|
20
|
+
import type Secret from "./Secret.js";
|
|
21
|
+
import { SecretFromJson } from "./Secret.js";
|
|
23
22
|
|
|
24
23
|
/** This is a node that is managed by Lightspark and is managed within the current connected account. It contains many details about the node configuration, state, and metadata. **/
|
|
25
24
|
class LightsparkNode implements Node {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import { LightsparkException } from "@lightsparkdev/core";
|
|
4
5
|
import Account from "./Account.js";
|
|
5
6
|
import { BalancesFromJson } from "./Balances.js";
|
|
6
|
-
import Entity from "./Entity.js";
|
|
7
|
+
import type Entity from "./Entity.js";
|
|
7
8
|
import Wallet from "./Wallet.js";
|
|
8
9
|
import WalletStatus from "./WalletStatus.js";
|
|
9
10
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import Channel
|
|
4
|
-
import
|
|
3
|
+
import type Channel from "./Channel.js";
|
|
4
|
+
import { ChannelFromJson } from "./Channel.js";
|
|
5
|
+
import type PageInfo from "./PageInfo.js";
|
|
6
|
+
import { PageInfoFromJson } from "./PageInfo.js";
|
|
5
7
|
|
|
6
8
|
type LightsparkNodeToChannelsConnection = {
|
|
7
9
|
/** An object that holds pagination information about the objects in this connection. **/
|
package/src/objects/Node.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import { LightsparkException } from "@lightsparkdev/core";
|
|
4
5
|
import autoBind from "auto-bind";
|
|
5
|
-
import LightsparkClient from "../client.js";
|
|
6
|
+
import type LightsparkClient from "../client.js";
|
|
6
7
|
import BitcoinNetwork from "./BitcoinNetwork.js";
|
|
7
8
|
import { BlockchainBalanceFromJson } from "./BlockchainBalance.js";
|
|
8
9
|
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
9
|
-
import Entity from "./Entity.js";
|
|
10
|
+
import type Entity from "./Entity.js";
|
|
10
11
|
import GraphNode from "./GraphNode.js";
|
|
11
12
|
import LightsparkNode from "./LightsparkNode.js";
|
|
12
13
|
import LightsparkNodePurpose from "./LightsparkNodePurpose.js";
|
|
13
14
|
import LightsparkNodeStatus from "./LightsparkNodeStatus.js";
|
|
14
|
-
import NodeAddressType from "./NodeAddressType.js";
|
|
15
|
-
import NodeToAddressesConnection
|
|
16
|
-
|
|
17
|
-
} from "./NodeToAddressesConnection.js";
|
|
15
|
+
import type NodeAddressType from "./NodeAddressType.js";
|
|
16
|
+
import type NodeToAddressesConnection from "./NodeToAddressesConnection.js";
|
|
17
|
+
import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.js";
|
|
18
18
|
import { SecretFromJson } from "./Secret.js";
|
|
19
19
|
|
|
20
20
|
/** This interface represents a lightning node that can be connected to the Lightning Network to send and receive transactions. **/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import NodeAddress
|
|
3
|
+
import type NodeAddress from "./NodeAddress.js";
|
|
4
|
+
import { NodeAddressFromJson } from "./NodeAddress.js";
|
|
4
5
|
|
|
5
6
|
/** A connection between a node and the addresses it has announced for itself on Lightning Network. **/
|
|
6
7
|
type NodeToAddressesConnection = {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import { LightsparkException } from "@lightsparkdev/core";
|
|
5
|
+
import type ChannelClosingTransaction from "./ChannelClosingTransaction.js";
|
|
6
|
+
import type ChannelOpeningTransaction from "./ChannelOpeningTransaction.js";
|
|
7
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
8
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
9
|
+
import type Deposit from "./Deposit.js";
|
|
10
|
+
import type Entity from "./Entity.js";
|
|
11
|
+
import type Transaction from "./Transaction.js";
|
|
10
12
|
import TransactionStatus from "./TransactionStatus.js";
|
|
11
|
-
import Withdrawal from "./Withdrawal.js";
|
|
13
|
+
import type Withdrawal from "./Withdrawal.js";
|
|
12
14
|
|
|
13
15
|
/** Transaction happened on Bitcoin blockchain. **/
|
|
14
16
|
type OnChainTransaction = Transaction &
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
4
|
import autoBind from "auto-bind";
|
|
5
|
-
import LightsparkClient from "../client.js";
|
|
6
|
-
import CurrencyAmount
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
} from "./OutgoingPaymentToAttemptsConnection.js";
|
|
5
|
+
import type LightsparkClient from "../client.js";
|
|
6
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
7
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
8
|
+
import type LightningTransaction from "./LightningTransaction.js";
|
|
9
|
+
import type OutgoingPaymentToAttemptsConnection from "./OutgoingPaymentToAttemptsConnection.js";
|
|
10
|
+
import { OutgoingPaymentToAttemptsConnectionFromJson } from "./OutgoingPaymentToAttemptsConnection.js";
|
|
11
11
|
import PaymentFailureReason from "./PaymentFailureReason.js";
|
|
12
|
-
import PaymentRequestData
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import
|
|
12
|
+
import type PaymentRequestData from "./PaymentRequestData.js";
|
|
13
|
+
import { PaymentRequestDataFromJson } from "./PaymentRequestData.js";
|
|
14
|
+
import type RichText from "./RichText.js";
|
|
15
|
+
import { RichTextFromJson } from "./RichText.js";
|
|
16
16
|
import TransactionStatus from "./TransactionStatus.js";
|
|
17
17
|
|
|
18
18
|
/** A transaction that was sent from a Lightspark node on the Lightning Network. **/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
4
|
import autoBind from "auto-bind";
|
|
5
|
-
import LightsparkClient from "../client.js";
|
|
6
|
-
import CurrencyAmount
|
|
7
|
-
import
|
|
5
|
+
import type LightsparkClient from "../client.js";
|
|
6
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
7
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
8
|
+
import type Entity from "./Entity.js";
|
|
8
9
|
import HtlcAttemptFailureCode from "./HtlcAttemptFailureCode.js";
|
|
9
10
|
import OutgoingPaymentAttemptStatus from "./OutgoingPaymentAttemptStatus.js";
|
|
10
|
-
import OutgoingPaymentAttemptToHopsConnection
|
|
11
|
-
|
|
12
|
-
} from "./OutgoingPaymentAttemptToHopsConnection.js";
|
|
11
|
+
import type OutgoingPaymentAttemptToHopsConnection from "./OutgoingPaymentAttemptToHopsConnection.js";
|
|
12
|
+
import { OutgoingPaymentAttemptToHopsConnectionFromJson } from "./OutgoingPaymentAttemptToHopsConnection.js";
|
|
13
13
|
|
|
14
14
|
/** An attempt for a payment over a route from sender node to recipient node. **/
|
|
15
15
|
class OutgoingPaymentAttempt implements Entity {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import Hop
|
|
3
|
+
import type Hop from "./Hop.js";
|
|
4
|
+
import { HopFromJson } from "./Hop.js";
|
|
4
5
|
|
|
5
6
|
/** The connection from an outgoing payment attempt to the list of sequential hops that define the path from sender node to recipient node. **/
|
|
6
7
|
type OutgoingPaymentAttemptToHopsConnection = {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import OutgoingPaymentAttempt
|
|
4
|
-
|
|
5
|
-
} from "./OutgoingPaymentAttempt.js";
|
|
3
|
+
import type OutgoingPaymentAttempt from "./OutgoingPaymentAttempt.js";
|
|
4
|
+
import { OutgoingPaymentAttemptFromJson } from "./OutgoingPaymentAttempt.js";
|
|
6
5
|
|
|
7
6
|
/** The connection from outgoing payment to all attempts. **/
|
|
8
7
|
type OutgoingPaymentToAttemptsConnection = {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import { LightsparkException } from "@lightsparkdev/core";
|
|
4
5
|
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
5
|
-
import Entity from "./Entity.js";
|
|
6
|
-
import Invoice from "./Invoice.js";
|
|
6
|
+
import type Entity from "./Entity.js";
|
|
7
|
+
import type Invoice from "./Invoice.js";
|
|
7
8
|
import { InvoiceDataFromJson } from "./InvoiceData.js";
|
|
8
|
-
import PaymentRequestData from "./PaymentRequestData.js";
|
|
9
|
+
import type PaymentRequestData from "./PaymentRequestData.js";
|
|
9
10
|
import PaymentRequestStatus from "./PaymentRequestStatus.js";
|
|
10
11
|
|
|
11
12
|
type PaymentRequest = Entity & {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { LightsparkException } from "@lightsparkdev/core";
|
|
4
4
|
import BitcoinNetwork from "./BitcoinNetwork.js";
|
|
5
5
|
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
6
|
-
import InvoiceData from "./InvoiceData.js";
|
|
6
|
+
import type InvoiceData from "./InvoiceData.js";
|
|
7
7
|
import { NodeFromJson } from "./Node.js";
|
|
8
8
|
|
|
9
9
|
/** The interface of a payment request on the Lightning Network (a.k.a. Lightning Invoice). **/
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
4
|
-
import CurrencyAmount
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
5
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
6
|
+
import type Entity from "./Entity.js";
|
|
7
|
+
import type LightningTransaction from "./LightningTransaction.js";
|
|
8
|
+
import type RichText from "./RichText.js";
|
|
9
|
+
import { RichTextFromJson } from "./RichText.js";
|
|
8
10
|
import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js";
|
|
9
|
-
import Transaction from "./Transaction.js";
|
|
11
|
+
import type Transaction from "./Transaction.js";
|
|
10
12
|
import TransactionStatus from "./TransactionStatus.js";
|
|
11
13
|
|
|
12
14
|
/** A transaction that was forwarded through a Lightspark node on the Lightning Network. **/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Maybe } from "@lightsparkdev/core";
|
|
2
|
-
import CurrencyAmount from "./CurrencyAmount.js";
|
|
3
|
-
import LightsparkNodePurpose from "./LightsparkNodePurpose.js";
|
|
4
|
-
import LightsparkNodeStatus from "./LightsparkNodeStatus.js";
|
|
5
|
-
import NodeAddressType from "./NodeAddressType.js";
|
|
6
|
-
import Transaction from "./Transaction.js";
|
|
1
|
+
import type { Maybe } from "@lightsparkdev/core";
|
|
2
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
3
|
+
import type LightsparkNodePurpose from "./LightsparkNodePurpose.js";
|
|
4
|
+
import type LightsparkNodeStatus from "./LightsparkNodeStatus.js";
|
|
5
|
+
import type NodeAddressType from "./NodeAddressType.js";
|
|
6
|
+
import type Transaction from "./Transaction.js";
|
|
7
7
|
|
|
8
8
|
type SingleNodeDashboard = {
|
|
9
9
|
id: string;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import { LightsparkException } from "@lightsparkdev/core";
|
|
5
|
+
import type ChannelClosingTransaction from "./ChannelClosingTransaction.js";
|
|
6
|
+
import type ChannelOpeningTransaction from "./ChannelOpeningTransaction.js";
|
|
7
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
8
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
9
|
+
import type Deposit from "./Deposit.js";
|
|
10
|
+
import type Entity from "./Entity.js";
|
|
9
11
|
import IncomingPayment from "./IncomingPayment.js";
|
|
10
12
|
import OutgoingPayment from "./OutgoingPayment.js";
|
|
11
13
|
import PaymentFailureReason from "./PaymentFailureReason.js";
|
|
12
14
|
import { PaymentRequestDataFromJson } from "./PaymentRequestData.js";
|
|
13
15
|
import { RichTextFromJson } from "./RichText.js";
|
|
14
|
-
import RoutingTransaction from "./RoutingTransaction.js";
|
|
16
|
+
import type RoutingTransaction from "./RoutingTransaction.js";
|
|
15
17
|
import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js";
|
|
16
18
|
import TransactionStatus from "./TransactionStatus.js";
|
|
17
|
-
import Withdrawal from "./Withdrawal.js";
|
|
19
|
+
import type Withdrawal from "./Withdrawal.js";
|
|
18
20
|
|
|
19
21
|
type Transaction = Entity & {
|
|
20
22
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import CurrencyAmount
|
|
3
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
4
5
|
import TransactionStatus from "./TransactionStatus.js";
|
|
5
6
|
|
|
6
7
|
type TransactionUpdate = {
|
package/src/objects/Wallet.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
4
|
import autoBind from "auto-bind";
|
|
5
|
-
import LightsparkClient from "../client.js";
|
|
6
|
-
import Balances
|
|
7
|
-
import
|
|
8
|
-
import
|
|
5
|
+
import type LightsparkClient from "../client.js";
|
|
6
|
+
import type Balances from "./Balances.js";
|
|
7
|
+
import { BalancesFromJson } from "./Balances.js";
|
|
8
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
9
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
10
|
+
import type LightsparkNodeOwner from "./LightsparkNodeOwner.js";
|
|
9
11
|
import WalletStatus from "./WalletStatus.js";
|
|
10
12
|
|
|
11
13
|
class Wallet implements LightsparkNodeOwner {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
4
|
-
import CurrencyAmount
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
5
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
6
|
+
import type Entity from "./Entity.js";
|
|
7
|
+
import type OnChainTransaction from "./OnChainTransaction.js";
|
|
8
|
+
import type Transaction from "./Transaction.js";
|
|
8
9
|
import TransactionStatus from "./TransactionStatus.js";
|
|
9
10
|
|
|
10
11
|
/** The transaction on the Bitcoin blockchain to withdraw funds from the Lightspark node to a Bitcoin wallet. **/
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
4
|
import autoBind from "auto-bind";
|
|
5
|
-
import LightsparkClient from "../client.js";
|
|
6
|
-
import CurrencyAmount
|
|
7
|
-
import
|
|
5
|
+
import type LightsparkClient from "../client.js";
|
|
6
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
7
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
8
|
+
import type Entity from "./Entity.js";
|
|
8
9
|
import WithdrawalMode from "./WithdrawalMode.js";
|
|
9
10
|
import WithdrawalRequestStatus from "./WithdrawalRequestStatus.js";
|
|
10
|
-
import WithdrawalRequestToChannelClosingTransactionsConnection
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import WithdrawalRequestToChannelOpeningTransactionsConnection
|
|
14
|
-
WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson,
|
|
15
|
-
} from "./WithdrawalRequestToChannelOpeningTransactionsConnection.js";
|
|
11
|
+
import type WithdrawalRequestToChannelClosingTransactionsConnection from "./WithdrawalRequestToChannelClosingTransactionsConnection.js";
|
|
12
|
+
import { WithdrawalRequestToChannelClosingTransactionsConnectionFromJson } from "./WithdrawalRequestToChannelClosingTransactionsConnection.js";
|
|
13
|
+
import type WithdrawalRequestToChannelOpeningTransactionsConnection from "./WithdrawalRequestToChannelOpeningTransactionsConnection.js";
|
|
14
|
+
import { WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson } from "./WithdrawalRequestToChannelOpeningTransactionsConnection.js";
|
|
16
15
|
|
|
17
16
|
class WithdrawalRequest implements Entity {
|
|
18
17
|
constructor(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import ChannelClosingTransaction
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
3
|
+
import type ChannelClosingTransaction from "./ChannelClosingTransaction.js";
|
|
4
|
+
import { ChannelClosingTransactionFromJson } from "./ChannelClosingTransaction.js";
|
|
5
|
+
import type PageInfo from "./PageInfo.js";
|
|
6
|
+
import { PageInfoFromJson } from "./PageInfo.js";
|
|
7
7
|
|
|
8
8
|
type WithdrawalRequestToChannelClosingTransactionsConnection = {
|
|
9
9
|
/** An object that holds pagination information about the objects in this connection. **/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import ChannelOpeningTransaction
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
3
|
+
import type ChannelOpeningTransaction from "./ChannelOpeningTransaction.js";
|
|
4
|
+
import { ChannelOpeningTransactionFromJson } from "./ChannelOpeningTransaction.js";
|
|
5
|
+
import type PageInfo from "./PageInfo.js";
|
|
6
|
+
import { PageInfoFromJson } from "./PageInfo.js";
|
|
7
7
|
|
|
8
8
|
type WithdrawalRequestToChannelOpeningTransactionsConnection = {
|
|
9
9
|
/** An object that holds pagination information about the objects in this connection. **/
|