@lightsparkdev/lightspark-sdk 1.2.0 → 1.2.2
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 +17 -0
- package/dist/{chunk-5RDIWPBE.js → chunk-D32EWIPX.js} +3 -1
- package/dist/{chunk-VTPDR6P4.js → chunk-GLL4KTUT.js} +353 -15
- package/dist/env.cjs +3 -1
- package/dist/env.d.cts +17 -0
- package/dist/env.js +2 -2
- package/dist/{index-f040db9f.d.ts → index-eb604025.d.ts} +1377 -15
- package/dist/index.cjs +682 -94
- package/dist/index.d.cts +41 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +290 -37
- package/dist/objects/index.cjs +345 -5
- package/dist/objects/index.d.cts +4 -0
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +10 -2
- package/dist/{text-encoding-MDIPJAHL.js → text-encoding-26SMKBAQ.js} +3 -1
- package/package.json +4 -4
- package/src/auth/AccountTokenAuthProvider.ts +15 -11
- package/src/client.ts +201 -7
- package/src/graphql/ClaimUmaInvitation.ts +21 -0
- package/src/graphql/ClaimUmaInvitationWithIncentives.ts +25 -0
- package/src/graphql/CreateUmaInvitation.ts +19 -0
- package/src/graphql/CreateUmaInvitationWithIncentives.ts +23 -0
- package/src/graphql/FetchUmaInvitation.ts +15 -0
- package/src/helpers.ts +3 -1
- package/src/objects/Account.ts +8 -0
- package/src/objects/AccountToChannelsConnection.ts +5 -0
- package/src/objects/Channel.ts +31 -0
- package/src/objects/ClaimUmaInvitationInput.ts +26 -0
- package/src/objects/ClaimUmaInvitationOutput.ts +30 -0
- package/src/objects/ClaimUmaInvitationWithIncentivesInput.ts +44 -0
- package/src/objects/ClaimUmaInvitationWithIncentivesOutput.ts +33 -0
- package/src/objects/CreateInvitationWithIncentivesInput.ts +37 -0
- package/src/objects/CreateInvitationWithIncentivesOutput.ts +32 -0
- package/src/objects/CreateUmaInvitationInput.ts +22 -0
- package/src/objects/CreateUmaInvitationOutput.ts +30 -0
- package/src/objects/Entity.ts +13 -0
- package/src/objects/GraphNode.ts +28 -0
- package/src/objects/IncentivesIneligibilityReason.ts +24 -0
- package/src/objects/IncentivesStatus.ts +18 -0
- package/src/objects/IncomingPayment.ts +17 -0
- package/src/objects/LightsparkNodeWithOSK.ts +61 -0
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +60 -0
- package/src/objects/OutgoingPayment.ts +20 -0
- package/src/objects/OutgoingPaymentAttempt.ts +31 -0
- package/src/objects/RegionCode.ts +510 -0
- package/src/objects/UmaInvitation.ts +113 -0
- package/src/objects/Wallet.ts +12 -0
- package/src/objects/WebhookEventType.ts +4 -0
- package/src/objects/WithdrawalRequest.ts +17 -0
- package/src/objects/index.ts +15 -0
- package/src/tests/integration/constants.ts +10 -0
- package/src/tests/integration/general-regtest.test.ts +633 -0
- package/src/tests/serialization.test.ts +5 -2
- package/src/webhooks.ts +1 -1
- package/src/tests/integration/client.test.ts +0 -207
- /package/dist/{chunk-NIMBE7W3.js → chunk-BMTV3EA2.js} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
interface CreateInvitationWithIncentivesOutput {
|
|
4
|
+
invitationId: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const CreateInvitationWithIncentivesOutputFromJson = (
|
|
8
|
+
obj: any,
|
|
9
|
+
): CreateInvitationWithIncentivesOutput => {
|
|
10
|
+
return {
|
|
11
|
+
invitationId: obj["create_invitation_with_incentives_output_invitation"].id,
|
|
12
|
+
} as CreateInvitationWithIncentivesOutput;
|
|
13
|
+
};
|
|
14
|
+
export const CreateInvitationWithIncentivesOutputToJson = (
|
|
15
|
+
obj: CreateInvitationWithIncentivesOutput,
|
|
16
|
+
): any => {
|
|
17
|
+
return {
|
|
18
|
+
create_invitation_with_incentives_output_invitation: {
|
|
19
|
+
id: obj.invitationId,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const FRAGMENT = `
|
|
25
|
+
fragment CreateInvitationWithIncentivesOutputFragment on CreateInvitationWithIncentivesOutput {
|
|
26
|
+
__typename
|
|
27
|
+
create_invitation_with_incentives_output_invitation: invitation {
|
|
28
|
+
id
|
|
29
|
+
}
|
|
30
|
+
}`;
|
|
31
|
+
|
|
32
|
+
export default CreateInvitationWithIncentivesOutput;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
interface CreateUmaInvitationInput {
|
|
4
|
+
inviterUma: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const CreateUmaInvitationInputFromJson = (
|
|
8
|
+
obj: any,
|
|
9
|
+
): CreateUmaInvitationInput => {
|
|
10
|
+
return {
|
|
11
|
+
inviterUma: obj["create_uma_invitation_input_inviter_uma"],
|
|
12
|
+
} as CreateUmaInvitationInput;
|
|
13
|
+
};
|
|
14
|
+
export const CreateUmaInvitationInputToJson = (
|
|
15
|
+
obj: CreateUmaInvitationInput,
|
|
16
|
+
): any => {
|
|
17
|
+
return {
|
|
18
|
+
create_uma_invitation_input_inviter_uma: obj.inviterUma,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default CreateUmaInvitationInput;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
interface CreateUmaInvitationOutput {
|
|
4
|
+
invitationId: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const CreateUmaInvitationOutputFromJson = (
|
|
8
|
+
obj: any,
|
|
9
|
+
): CreateUmaInvitationOutput => {
|
|
10
|
+
return {
|
|
11
|
+
invitationId: obj["create_uma_invitation_output_invitation"].id,
|
|
12
|
+
} as CreateUmaInvitationOutput;
|
|
13
|
+
};
|
|
14
|
+
export const CreateUmaInvitationOutputToJson = (
|
|
15
|
+
obj: CreateUmaInvitationOutput,
|
|
16
|
+
): any => {
|
|
17
|
+
return {
|
|
18
|
+
create_uma_invitation_output_invitation: { id: obj.invitationId },
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const FRAGMENT = `
|
|
23
|
+
fragment CreateUmaInvitationOutputFragment on CreateUmaInvitationOutput {
|
|
24
|
+
__typename
|
|
25
|
+
create_uma_invitation_output_invitation: invitation {
|
|
26
|
+
id
|
|
27
|
+
}
|
|
28
|
+
}`;
|
|
29
|
+
|
|
30
|
+
export default CreateUmaInvitationOutput;
|
package/src/objects/Entity.ts
CHANGED
|
@@ -1237,6 +1237,7 @@ fragment EntityFragment on Entity {
|
|
|
1237
1237
|
outgoing_payment_attempt_status: status
|
|
1238
1238
|
outgoing_payment_attempt_failure_code: failure_code
|
|
1239
1239
|
outgoing_payment_attempt_failure_source_index: failure_source_index
|
|
1240
|
+
outgoing_payment_attempt_attempted_at: attempted_at
|
|
1240
1241
|
outgoing_payment_attempt_resolved_at: resolved_at
|
|
1241
1242
|
outgoing_payment_attempt_amount: amount {
|
|
1242
1243
|
__typename
|
|
@@ -1361,6 +1362,18 @@ fragment EntityFragment on Entity {
|
|
|
1361
1362
|
id
|
|
1362
1363
|
}
|
|
1363
1364
|
}
|
|
1365
|
+
... on UmaInvitation {
|
|
1366
|
+
__typename
|
|
1367
|
+
uma_invitation_id: id
|
|
1368
|
+
uma_invitation_created_at: created_at
|
|
1369
|
+
uma_invitation_updated_at: updated_at
|
|
1370
|
+
uma_invitation_code: code
|
|
1371
|
+
uma_invitation_url: url
|
|
1372
|
+
uma_invitation_inviter_uma: inviter_uma
|
|
1373
|
+
uma_invitation_invitee_uma: invitee_uma
|
|
1374
|
+
uma_invitation_incentives_status: incentives_status
|
|
1375
|
+
uma_invitation_incentives_ineligibility_reason: incentives_ineligibility_reason
|
|
1376
|
+
}
|
|
1364
1377
|
... on Wallet {
|
|
1365
1378
|
__typename
|
|
1366
1379
|
wallet_id: id
|
package/src/objects/GraphNode.ts
CHANGED
|
@@ -13,15 +13,43 @@ import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.j
|
|
|
13
13
|
/** 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. **/
|
|
14
14
|
class GraphNode implements Node, Entity {
|
|
15
15
|
constructor(
|
|
16
|
+
/**
|
|
17
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
18
|
+
* string.
|
|
19
|
+
**/
|
|
16
20
|
public readonly id: string,
|
|
21
|
+
/** The date and time when the entity was first created. **/
|
|
17
22
|
public readonly createdAt: string,
|
|
23
|
+
/** The date and time when the entity was last updated. **/
|
|
18
24
|
public readonly updatedAt: string,
|
|
25
|
+
/** The Bitcoin Network this node is deployed in. **/
|
|
19
26
|
public readonly bitcoinNetwork: BitcoinNetwork,
|
|
27
|
+
/**
|
|
28
|
+
* The name of this node in the network. It will be the most human-readable option possible, depending
|
|
29
|
+
* on the data available for this node.
|
|
30
|
+
**/
|
|
20
31
|
public readonly displayName: string,
|
|
32
|
+
/** The typename of the object **/
|
|
21
33
|
public readonly typename: string,
|
|
34
|
+
/**
|
|
35
|
+
* A name that identifies the node. It has no importance in terms of operating the node, it is just a
|
|
36
|
+
* way to identify and search for commercial services or popular nodes. This alias can be changed at
|
|
37
|
+
* any time by the node operator.
|
|
38
|
+
**/
|
|
22
39
|
public readonly alias?: string | undefined,
|
|
40
|
+
/**
|
|
41
|
+
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is white. It
|
|
42
|
+
* has no importance in terms of operating the node, it is just a way to visually differentiate nodes.
|
|
43
|
+
* That color can be changed at any time by the node operator.
|
|
44
|
+
**/
|
|
23
45
|
public readonly color?: string | undefined,
|
|
46
|
+
/**
|
|
47
|
+
* A summary metric used to capture how well positioned a node is to send, receive, or route
|
|
48
|
+
* transactions efficiently. Maximizing a node's conductivity helps a node’s transactions to be
|
|
49
|
+
* capital efficient. The value is an integer ranging between 0 and 10 (bounds included).
|
|
50
|
+
**/
|
|
24
51
|
public readonly conductivity?: number | undefined,
|
|
52
|
+
/** The public key of this node. It acts as a unique identifier of this node in the Lightning Network. **/
|
|
25
53
|
public readonly publicKey?: string | undefined,
|
|
26
54
|
) {
|
|
27
55
|
autoBind(this);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
/** Describes the reason for an invitation to not be eligible for incentives. **/
|
|
4
|
+
export enum IncentivesIneligibilityReason {
|
|
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
|
+
/** This invitation is not eligible for incentives because it has been created outside of the incentives flow. **/
|
|
11
|
+
DISABLED = "DISABLED",
|
|
12
|
+
/** This invitation is not eligible for incentives because the sender is not eligible. **/
|
|
13
|
+
SENDER_NOT_ELIGIBLE = "SENDER_NOT_ELIGIBLE",
|
|
14
|
+
/** This invitation is not eligible for incentives because the receiver is not eligible. **/
|
|
15
|
+
RECEIVER_NOT_ELIGIBLE = "RECEIVER_NOT_ELIGIBLE",
|
|
16
|
+
/** This invitation is not eligible for incentives because the sending VASP is not part of the incentives program. **/
|
|
17
|
+
SENDING_VASP_NOT_ELIGIBLE = "SENDING_VASP_NOT_ELIGIBLE",
|
|
18
|
+
/** This invitation is not eligible for incentives because the receiving VASP is not part of the incentives program. **/
|
|
19
|
+
RECEIVING_VASP_NOT_ELIGIBLE = "RECEIVING_VASP_NOT_ELIGIBLE",
|
|
20
|
+
/** This invitation is not eligible for incentives because the sender and receiver are in the same region. **/
|
|
21
|
+
NOT_CROSS_BORDER = "NOT_CROSS_BORDER",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default IncentivesIneligibilityReason;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
/** Describes the status of the incentives for this invitation. **/
|
|
4
|
+
export enum IncentivesStatus {
|
|
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
|
+
/** The invitation is eligible for incentives in its current state. When it is claimed, we will reassess. **/
|
|
11
|
+
PENDING = "PENDING",
|
|
12
|
+
/** The incentives have been validated. **/
|
|
13
|
+
VALIDATED = "VALIDATED",
|
|
14
|
+
/** This invitation is not eligible for incentives. A more detailed reason can be found in the `incentives_ineligibility_reason` field. **/
|
|
15
|
+
INELIGIBLE = "INELIGIBLE",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default IncentivesStatus;
|
|
@@ -24,16 +24,33 @@ import TransactionStatus from "./TransactionStatus.js";
|
|
|
24
24
|
/** This object represents any payment sent to a Lightspark node on the Lightning Network. You can retrieve this object to receive payment related information about a specific payment received by a Lightspark node. **/
|
|
25
25
|
class IncomingPayment implements LightningTransaction, Transaction, Entity {
|
|
26
26
|
constructor(
|
|
27
|
+
/**
|
|
28
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
29
|
+
* string.
|
|
30
|
+
**/
|
|
27
31
|
public readonly id: string,
|
|
32
|
+
/** The date and time when this transaction was initiated. **/
|
|
28
33
|
public readonly createdAt: string,
|
|
34
|
+
/** The date and time when the entity was last updated. **/
|
|
29
35
|
public readonly updatedAt: string,
|
|
36
|
+
/** The current status of this transaction. **/
|
|
30
37
|
public readonly status: TransactionStatus,
|
|
38
|
+
/** The amount of money involved in this transaction. **/
|
|
31
39
|
public readonly amount: CurrencyAmount,
|
|
40
|
+
/** The recipient Lightspark node this payment was sent to. **/
|
|
32
41
|
public readonly destinationId: string,
|
|
42
|
+
/** The typename of the object **/
|
|
33
43
|
public readonly typename: string,
|
|
44
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
34
45
|
public readonly resolvedAt?: string | undefined,
|
|
46
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
35
47
|
public readonly transactionHash?: string | undefined,
|
|
48
|
+
/**
|
|
49
|
+
* The optional payment request for this incoming payment, which will be null if the payment is sent
|
|
50
|
+
* through keysend.
|
|
51
|
+
**/
|
|
36
52
|
public readonly paymentRequestId?: string | undefined,
|
|
53
|
+
/** The post transaction data which can be used in KYT payment registration. **/
|
|
37
54
|
public readonly umaPostTransactionData?: PostTransactionData[] | undefined,
|
|
38
55
|
) {
|
|
39
56
|
autoBind(this);
|
|
@@ -32,25 +32,86 @@ import { SecretFromJson, SecretToJson } from "./Secret.js";
|
|
|
32
32
|
/** This is a Lightspark node with OSK. **/
|
|
33
33
|
class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity {
|
|
34
34
|
constructor(
|
|
35
|
+
/**
|
|
36
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
37
|
+
* string.
|
|
38
|
+
**/
|
|
35
39
|
public readonly id: string,
|
|
40
|
+
/** The date and time when the entity was first created. **/
|
|
36
41
|
public readonly createdAt: string,
|
|
42
|
+
/** The date and time when the entity was last updated. **/
|
|
37
43
|
public readonly updatedAt: string,
|
|
44
|
+
/** The Bitcoin Network this node is deployed in. **/
|
|
38
45
|
public readonly bitcoinNetwork: BitcoinNetwork,
|
|
46
|
+
/**
|
|
47
|
+
* The name of this node in the network. It will be the most human-readable option possible, depending
|
|
48
|
+
* on the data available for this node.
|
|
49
|
+
**/
|
|
39
50
|
public readonly displayName: string,
|
|
51
|
+
/** The owner of this LightsparkNode. **/
|
|
40
52
|
public readonly ownerId: string,
|
|
53
|
+
/**
|
|
54
|
+
* The utxos of the channels that are connected to this node. This is used in uma flow for
|
|
55
|
+
* pre-screening.
|
|
56
|
+
**/
|
|
41
57
|
public readonly umaPrescreeningUtxos: string[],
|
|
58
|
+
/** The typename of the object **/
|
|
42
59
|
public readonly typename: string,
|
|
60
|
+
/**
|
|
61
|
+
* A name that identifies the node. It has no importance in terms of operating the node, it is just a
|
|
62
|
+
* way to identify and search for commercial services or popular nodes. This alias can be changed at
|
|
63
|
+
* any time by the node operator.
|
|
64
|
+
**/
|
|
43
65
|
public readonly alias?: string | undefined,
|
|
66
|
+
/**
|
|
67
|
+
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is white. It
|
|
68
|
+
* has no importance in terms of operating the node, it is just a way to visually differentiate nodes.
|
|
69
|
+
* That color can be changed at any time by the node operator.
|
|
70
|
+
**/
|
|
44
71
|
public readonly color?: string | undefined,
|
|
72
|
+
/**
|
|
73
|
+
* A summary metric used to capture how well positioned a node is to send, receive, or route
|
|
74
|
+
* transactions efficiently. Maximizing a node's conductivity helps a node’s transactions to be
|
|
75
|
+
* capital efficient. The value is an integer ranging between 0 and 10 (bounds included).
|
|
76
|
+
**/
|
|
45
77
|
public readonly conductivity?: number | undefined,
|
|
78
|
+
/** The public key of this node. It acts as a unique identifier of this node in the Lightning Network. **/
|
|
46
79
|
public readonly publicKey?: string | undefined,
|
|
80
|
+
/** The current status of this node. **/
|
|
47
81
|
public readonly status?: LightsparkNodeStatus | undefined,
|
|
82
|
+
/**
|
|
83
|
+
* The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this node.
|
|
84
|
+
*
|
|
85
|
+
* @deprecated Use `balances` instead.
|
|
86
|
+
**/
|
|
48
87
|
public readonly totalBalance?: CurrencyAmount | undefined,
|
|
88
|
+
/**
|
|
89
|
+
* The total sum of the channel balances (online and offline) on this node.
|
|
90
|
+
*
|
|
91
|
+
* @deprecated Use `balances` instead.
|
|
92
|
+
**/
|
|
49
93
|
public readonly totalLocalBalance?: CurrencyAmount | undefined,
|
|
94
|
+
/**
|
|
95
|
+
* The sum of the channel balances (online only) that are available to send on this node.
|
|
96
|
+
*
|
|
97
|
+
* @deprecated Use `balances` instead.
|
|
98
|
+
**/
|
|
50
99
|
public readonly localBalance?: CurrencyAmount | undefined,
|
|
100
|
+
/**
|
|
101
|
+
* The sum of the channel balances that are available to receive on this node.
|
|
102
|
+
*
|
|
103
|
+
* @deprecated Use `balances` instead.
|
|
104
|
+
**/
|
|
51
105
|
public readonly remoteBalance?: CurrencyAmount | undefined,
|
|
106
|
+
/**
|
|
107
|
+
* The details of the balance of this node on the Bitcoin Network.
|
|
108
|
+
*
|
|
109
|
+
* @deprecated Use `balances` instead.
|
|
110
|
+
**/
|
|
52
111
|
public readonly blockchainBalance?: BlockchainBalance | undefined,
|
|
112
|
+
/** The balances that describe the funds in this node. **/
|
|
53
113
|
public readonly balances?: Balances | undefined,
|
|
114
|
+
/** The private key client is using to sign a GraphQL request which will be verified at server side. **/
|
|
54
115
|
public readonly encryptedSigningPrivateKey?: Secret | undefined,
|
|
55
116
|
) {
|
|
56
117
|
autoBind(this);
|
|
@@ -30,24 +30,84 @@ import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.j
|
|
|
30
30
|
/** This is a Lightspark node with remote signing. **/
|
|
31
31
|
class LightsparkNodeWithRemoteSigning implements LightsparkNode, Node, Entity {
|
|
32
32
|
constructor(
|
|
33
|
+
/**
|
|
34
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
35
|
+
* string.
|
|
36
|
+
**/
|
|
33
37
|
public readonly id: string,
|
|
38
|
+
/** The date and time when the entity was first created. **/
|
|
34
39
|
public readonly createdAt: string,
|
|
40
|
+
/** The date and time when the entity was last updated. **/
|
|
35
41
|
public readonly updatedAt: string,
|
|
42
|
+
/** The Bitcoin Network this node is deployed in. **/
|
|
36
43
|
public readonly bitcoinNetwork: BitcoinNetwork,
|
|
44
|
+
/**
|
|
45
|
+
* The name of this node in the network. It will be the most human-readable option possible, depending
|
|
46
|
+
* on the data available for this node.
|
|
47
|
+
**/
|
|
37
48
|
public readonly displayName: string,
|
|
49
|
+
/** The owner of this LightsparkNode. **/
|
|
38
50
|
public readonly ownerId: string,
|
|
51
|
+
/**
|
|
52
|
+
* The utxos of the channels that are connected to this node. This is used in uma flow for
|
|
53
|
+
* pre-screening.
|
|
54
|
+
**/
|
|
39
55
|
public readonly umaPrescreeningUtxos: string[],
|
|
56
|
+
/** The typename of the object **/
|
|
40
57
|
public readonly typename: string,
|
|
58
|
+
/**
|
|
59
|
+
* A name that identifies the node. It has no importance in terms of operating the node, it is just a
|
|
60
|
+
* way to identify and search for commercial services or popular nodes. This alias can be changed at
|
|
61
|
+
* any time by the node operator.
|
|
62
|
+
**/
|
|
41
63
|
public readonly alias?: string | undefined,
|
|
64
|
+
/**
|
|
65
|
+
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is white. It
|
|
66
|
+
* has no importance in terms of operating the node, it is just a way to visually differentiate nodes.
|
|
67
|
+
* That color can be changed at any time by the node operator.
|
|
68
|
+
**/
|
|
42
69
|
public readonly color?: string | undefined,
|
|
70
|
+
/**
|
|
71
|
+
* A summary metric used to capture how well positioned a node is to send, receive, or route
|
|
72
|
+
* transactions efficiently. Maximizing a node's conductivity helps a node’s transactions to be
|
|
73
|
+
* capital efficient. The value is an integer ranging between 0 and 10 (bounds included).
|
|
74
|
+
**/
|
|
43
75
|
public readonly conductivity?: number | undefined,
|
|
76
|
+
/** The public key of this node. It acts as a unique identifier of this node in the Lightning Network. **/
|
|
44
77
|
public readonly publicKey?: string | undefined,
|
|
78
|
+
/** The current status of this node. **/
|
|
45
79
|
public readonly status?: LightsparkNodeStatus | undefined,
|
|
80
|
+
/**
|
|
81
|
+
* The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this node.
|
|
82
|
+
*
|
|
83
|
+
* @deprecated Use `balances` instead.
|
|
84
|
+
**/
|
|
46
85
|
public readonly totalBalance?: CurrencyAmount | undefined,
|
|
86
|
+
/**
|
|
87
|
+
* The total sum of the channel balances (online and offline) on this node.
|
|
88
|
+
*
|
|
89
|
+
* @deprecated Use `balances` instead.
|
|
90
|
+
**/
|
|
47
91
|
public readonly totalLocalBalance?: CurrencyAmount | undefined,
|
|
92
|
+
/**
|
|
93
|
+
* The sum of the channel balances (online only) that are available to send on this node.
|
|
94
|
+
*
|
|
95
|
+
* @deprecated Use `balances` instead.
|
|
96
|
+
**/
|
|
48
97
|
public readonly localBalance?: CurrencyAmount | undefined,
|
|
98
|
+
/**
|
|
99
|
+
* The sum of the channel balances that are available to receive on this node.
|
|
100
|
+
*
|
|
101
|
+
* @deprecated Use `balances` instead.
|
|
102
|
+
**/
|
|
49
103
|
public readonly remoteBalance?: CurrencyAmount | undefined,
|
|
104
|
+
/**
|
|
105
|
+
* The details of the balance of this node on the Bitcoin Network.
|
|
106
|
+
*
|
|
107
|
+
* @deprecated Use `balances` instead.
|
|
108
|
+
**/
|
|
50
109
|
public readonly blockchainBalance?: BlockchainBalance | undefined,
|
|
110
|
+
/** The balances that describe the funds in this node. **/
|
|
51
111
|
public readonly balances?: Balances | undefined,
|
|
52
112
|
) {
|
|
53
113
|
autoBind(this);
|
|
@@ -31,21 +31,40 @@ import TransactionStatus from "./TransactionStatus.js";
|
|
|
31
31
|
/** This object represents a Lightning Network payment sent from a Lightspark Node. You can retrieve this object to receive payment related information about any payment sent from your Lightspark Node on the Lightning Network. **/
|
|
32
32
|
class OutgoingPayment implements LightningTransaction, Transaction, Entity {
|
|
33
33
|
constructor(
|
|
34
|
+
/**
|
|
35
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
36
|
+
* string.
|
|
37
|
+
**/
|
|
34
38
|
public readonly id: string,
|
|
39
|
+
/** The date and time when this transaction was initiated. **/
|
|
35
40
|
public readonly createdAt: string,
|
|
41
|
+
/** The date and time when the entity was last updated. **/
|
|
36
42
|
public readonly updatedAt: string,
|
|
43
|
+
/** The current status of this transaction. **/
|
|
37
44
|
public readonly status: TransactionStatus,
|
|
45
|
+
/** The amount of money involved in this transaction. **/
|
|
38
46
|
public readonly amount: CurrencyAmount,
|
|
47
|
+
/** The Lightspark node this payment originated from. **/
|
|
39
48
|
public readonly originId: string,
|
|
49
|
+
/** The typename of the object **/
|
|
40
50
|
public readonly typename: string,
|
|
51
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
41
52
|
public readonly resolvedAt?: string | undefined,
|
|
53
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
42
54
|
public readonly transactionHash?: string | undefined,
|
|
55
|
+
/** If known, the final recipient node this payment was sent to. **/
|
|
43
56
|
public readonly destinationId?: string | undefined,
|
|
57
|
+
/** The fees paid by the sender node to send the payment. **/
|
|
44
58
|
public readonly fees?: CurrencyAmount | undefined,
|
|
59
|
+
/** The data of the payment request that was paid by this transaction, if known. **/
|
|
45
60
|
public readonly paymentRequestData?: PaymentRequestData | undefined,
|
|
61
|
+
/** If applicable, the reason why the payment failed. **/
|
|
46
62
|
public readonly failureReason?: PaymentFailureReason | undefined,
|
|
63
|
+
/** If applicable, user-facing error message describing why the payment failed. **/
|
|
47
64
|
public readonly failureMessage?: RichText | undefined,
|
|
65
|
+
/** The post transaction data which can be used in KYT payment registration. **/
|
|
48
66
|
public readonly umaPostTransactionData?: PostTransactionData[] | undefined,
|
|
67
|
+
/** The preimage of the payment. **/
|
|
49
68
|
public readonly paymentPreimage?: string | undefined,
|
|
50
69
|
) {
|
|
51
70
|
autoBind(this);
|
|
@@ -79,6 +98,7 @@ query FetchOutgoingPaymentToAttemptsConnection($entity_id: ID!, $first: Int, $af
|
|
|
79
98
|
outgoing_payment_attempt_status: status
|
|
80
99
|
outgoing_payment_attempt_failure_code: failure_code
|
|
81
100
|
outgoing_payment_attempt_failure_source_index: failure_source_index
|
|
101
|
+
outgoing_payment_attempt_attempted_at: attempted_at
|
|
82
102
|
outgoing_payment_attempt_resolved_at: resolved_at
|
|
83
103
|
outgoing_payment_attempt_amount: amount {
|
|
84
104
|
__typename
|
|
@@ -22,17 +22,45 @@ import { OutgoingPaymentAttemptToHopsConnectionFromJson } from "./OutgoingPaymen
|
|
|
22
22
|
/** This object represents an attempted Lightning Network payment sent from a Lightspark Node. You can retrieve this object to receive payment related information about any payment attempt sent from your Lightspark Node on the Lightning Network, including any potential reasons the payment may have failed. **/
|
|
23
23
|
class OutgoingPaymentAttempt implements Entity {
|
|
24
24
|
constructor(
|
|
25
|
+
/**
|
|
26
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
27
|
+
* string.
|
|
28
|
+
**/
|
|
25
29
|
public readonly id: string,
|
|
30
|
+
/** The date and time when the entity was first created. **/
|
|
26
31
|
public readonly createdAt: string,
|
|
32
|
+
/** The date and time when the entity was last updated. **/
|
|
27
33
|
public readonly updatedAt: string,
|
|
34
|
+
/** The status of an outgoing payment attempt. **/
|
|
28
35
|
public readonly status: OutgoingPaymentAttemptStatus,
|
|
36
|
+
/** The date and time when the attempt was initiated. **/
|
|
37
|
+
public readonly attemptedAt: string,
|
|
38
|
+
/** The outgoing payment for this attempt. **/
|
|
29
39
|
public readonly outgoingPaymentId: string,
|
|
40
|
+
/** The typename of the object **/
|
|
30
41
|
public readonly typename: string,
|
|
42
|
+
/** If the payment attempt failed, then this contains the Bolt #4 failure code. **/
|
|
31
43
|
public readonly failureCode?: HtlcAttemptFailureCode | undefined,
|
|
44
|
+
/**
|
|
45
|
+
* If the payment attempt failed, then this contains the index of the hop at which the problem
|
|
46
|
+
* occurred.
|
|
47
|
+
**/
|
|
32
48
|
public readonly failureSourceIndex?: number | undefined,
|
|
49
|
+
/** The time the outgoing payment attempt failed or succeeded. **/
|
|
33
50
|
public readonly resolvedAt?: string | undefined,
|
|
51
|
+
/**
|
|
52
|
+
* The total amount of funds required to complete a payment over this route. This value includes the
|
|
53
|
+
* cumulative fees for each hop. As a result, the attempt extended to the first-hop in the route will
|
|
54
|
+
* need to have at least this much value, otherwise the route will fail at an intermediate node due to
|
|
55
|
+
* an insufficient amount.
|
|
56
|
+
**/
|
|
34
57
|
public readonly amount?: CurrencyAmount | undefined,
|
|
58
|
+
/**
|
|
59
|
+
* The sum of the fees paid at each hop within the route of this attempt. In the case of a one-hop
|
|
60
|
+
* payment, this value will be zero as we don't need to pay a fee to ourselves.
|
|
61
|
+
**/
|
|
35
62
|
public readonly fees?: CurrencyAmount | undefined,
|
|
63
|
+
/** The channel snapshot at the time the outgoing payment attempt was made. **/
|
|
36
64
|
public readonly channelSnapshot?: ChannelSnapshot | undefined,
|
|
37
65
|
) {
|
|
38
66
|
autoBind(this);
|
|
@@ -129,6 +157,7 @@ ${FRAGMENT}
|
|
|
129
157
|
outgoing_payment_attempt_status: this.status,
|
|
130
158
|
outgoing_payment_attempt_failure_code: this.failureCode,
|
|
131
159
|
outgoing_payment_attempt_failure_source_index: this.failureSourceIndex,
|
|
160
|
+
outgoing_payment_attempt_attempted_at: this.attemptedAt,
|
|
132
161
|
outgoing_payment_attempt_resolved_at: this.resolvedAt,
|
|
133
162
|
outgoing_payment_attempt_amount: this.amount
|
|
134
163
|
? CurrencyAmountToJson(this.amount)
|
|
@@ -153,6 +182,7 @@ export const OutgoingPaymentAttemptFromJson = (
|
|
|
153
182
|
obj["outgoing_payment_attempt_updated_at"],
|
|
154
183
|
OutgoingPaymentAttemptStatus[obj["outgoing_payment_attempt_status"]] ??
|
|
155
184
|
OutgoingPaymentAttemptStatus.FUTURE_VALUE,
|
|
185
|
+
obj["outgoing_payment_attempt_attempted_at"],
|
|
156
186
|
obj["outgoing_payment_attempt_outgoing_payment"].id,
|
|
157
187
|
"OutgoingPaymentAttempt",
|
|
158
188
|
!!obj["outgoing_payment_attempt_failure_code"]
|
|
@@ -184,6 +214,7 @@ fragment OutgoingPaymentAttemptFragment on OutgoingPaymentAttempt {
|
|
|
184
214
|
outgoing_payment_attempt_status: status
|
|
185
215
|
outgoing_payment_attempt_failure_code: failure_code
|
|
186
216
|
outgoing_payment_attempt_failure_source_index: failure_source_index
|
|
217
|
+
outgoing_payment_attempt_attempted_at: attempted_at
|
|
187
218
|
outgoing_payment_attempt_resolved_at: resolved_at
|
|
188
219
|
outgoing_payment_attempt_amount: amount {
|
|
189
220
|
__typename
|