@lightsparkdev/lightspark-sdk 0.4.10 → 1.0.0
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 +30 -0
- package/README.md +1 -1
- package/dist/{chunk-NXUFC5J7.js → chunk-LZC5C5NI.js} +2908 -635
- package/dist/{index-3ffe9e7b.d.ts → index-09d4ac20.d.ts} +373 -62
- package/dist/index.cjs +3395 -842
- package/dist/index.d.ts +2 -2
- package/dist/index.js +390 -94
- package/dist/objects/index.cjs +2735 -553
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +17 -5
- package/package.json +12 -9
- package/src/NodeKeyLoaderCache.ts +87 -0
- package/src/SigningKeyLoader.ts +177 -0
- package/src/auth/AccountTokenAuthProvider.ts +4 -4
- package/src/client.ts +209 -118
- package/src/graphql/CreateInvoice.ts +3 -2
- package/src/graphql/CreateLnurlInvoice.ts +2 -0
- package/src/graphql/CreateUmaInvoice.ts +23 -0
- package/src/graphql/MultiNodeDashboard.ts +0 -3
- package/src/graphql/PayUmaInvoice.ts +29 -0
- package/src/graphql/RecoverNodeSigningKey.ts +1 -1
- package/src/graphql/SingleNodeDashboard.ts +0 -1
- package/src/lightspark_crypto/lightspark_crypto.d.ts +157 -0
- package/src/lightspark_crypto/lightspark_crypto.js +1010 -0
- package/src/lightspark_crypto/lightspark_crypto_bg.wasm +0 -0
- package/src/lightspark_crypto/lightspark_crypto_bg.wasm.d.ts +120 -0
- package/src/lightspark_crypto/package.json +11 -0
- package/src/objects/Account.ts +437 -120
- package/src/objects/AccountToApiTokensConnection.ts +3 -3
- package/src/objects/AccountToChannelsConnection.ts +4 -4
- package/src/objects/AccountToNodesConnection.ts +2 -15
- package/src/objects/AccountToPaymentRequestsConnection.ts +3 -3
- package/src/objects/AccountToTransactionsConnection.ts +6 -6
- package/src/objects/AccountToWalletsConnection.ts +2 -2
- package/src/objects/Balances.ts +2 -2
- package/src/objects/Channel.ts +4 -4
- package/src/objects/ChannelClosingTransaction.ts +2 -2
- package/src/objects/ChannelOpeningTransaction.ts +2 -2
- package/src/objects/ChannelToTransactionsConnection.ts +4 -4
- package/src/objects/{CryptoSanctionsScreeningProvider.ts → ComplianceProvider.ts} +3 -3
- package/src/objects/Connection.ts +25 -31
- package/src/objects/CreateApiTokenInput.ts +1 -1
- package/src/objects/CreateApiTokenOutput.ts +1 -1
- package/src/objects/CreateInvoiceInput.ts +0 -6
- package/src/objects/CreateLnurlInvoiceInput.ts +1 -7
- 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 +14 -2
- package/src/objects/CreateUmaInvoiceInput.ts +24 -0
- package/src/objects/DeclineToSignMessagesInput.ts +16 -0
- package/src/objects/DeclineToSignMessagesOutput.ts +28 -0
- package/src/objects/DeleteApiTokenOutput.ts +1 -1
- package/src/objects/Entity.ts +401 -66
- package/src/objects/GraphNode.ts +3 -3
- package/src/objects/IdAndSignature.ts +16 -0
- package/src/objects/IncomingPayment.ts +21 -8
- package/src/objects/IncomingPaymentAttempt.ts +2 -2
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +3 -3
- package/src/objects/Invoice.ts +118 -21
- package/src/objects/InvoiceData.ts +118 -21
- 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 +155 -31
- package/src/objects/LightsparkNode.ts +272 -112
- package/src/objects/LightsparkNodeOwner.ts +8 -4
- package/src/objects/LightsparkNodeToChannelsConnection.ts +3 -3
- package/src/objects/LightsparkNodeWithOSK.ts +389 -0
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +384 -0
- package/src/objects/Node.ts +213 -60
- package/src/objects/NodeToAddressesConnection.ts +2 -2
- package/src/objects/OnChainTransaction.ts +2 -2
- package/src/objects/OutgoingPayment.ts +139 -24
- package/src/objects/OutgoingPaymentAttempt.ts +5 -5
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +3 -3
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +3 -3
- package/src/objects/OutgoingPaymentsForInvoiceQueryInput.ts +25 -0
- package/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts +28 -0
- package/src/objects/PayUmaInvoiceInput.ts +25 -0
- package/src/objects/{LightsparkNodePurpose.ts → PaymentDirection.ts} +5 -7
- package/src/objects/PaymentRequest.ts +119 -22
- package/src/objects/PaymentRequestData.ts +119 -22
- package/src/objects/PostTransactionData.ts +39 -0
- package/src/objects/RegisterPaymentInput.ts +31 -0
- package/src/objects/RegisterPaymentOutput.ts +23 -0
- package/src/objects/ReleaseChannelPerCommitmentSecretInput.ts +23 -0
- package/src/objects/ReleaseChannelPerCommitmentSecretOutput.ts +23 -0
- package/src/objects/ReleasePaymentPreimageInput.ts +20 -0
- package/src/objects/ReleasePaymentPreimageOutput.ts +23 -0
- package/src/objects/RemoteSigningSubEventType.ts +26 -0
- package/src/objects/RequestWithdrawalInput.ts +1 -1
- package/src/objects/RequestWithdrawalOutput.ts +1 -1
- package/src/objects/RoutingTransaction.ts +1 -1
- package/src/objects/ScreenNodeInput.ts +20 -0
- package/src/objects/ScreenNodeOutput.ts +22 -0
- package/src/objects/SetInvoicePaymentHashInput.ts +24 -0
- package/src/objects/SetInvoicePaymentHashOutput.ts +23 -0
- package/src/objects/SignInvoiceInput.ts +19 -0
- package/src/objects/SignInvoiceOutput.ts +21 -0
- package/src/objects/SignMessagesInput.ts +18 -0
- package/src/objects/SignMessagesOutput.ts +26 -0
- package/src/objects/Signable.ts +58 -0
- package/src/objects/SignablePayload.ts +93 -0
- package/src/objects/SignablePayloadStatus.ts +17 -0
- package/src/objects/SingleNodeDashboard.ts +0 -2
- package/src/objects/Transaction.ts +153 -29
- package/src/objects/TransactionFailures.ts +1 -1
- package/src/objects/UpdateChannelPerCommitmentPointInput.ts +25 -0
- package/src/objects/UpdateChannelPerCommitmentPointOutput.ts +23 -0
- package/src/objects/UpdateNodeSharedSecretInput.ts +18 -0
- package/src/objects/UpdateNodeSharedSecretOutput.ts +23 -0
- package/src/objects/Wallet.ts +271 -51
- package/src/objects/WalletToPaymentRequestsConnection.ts +3 -3
- package/src/objects/WalletToTransactionsConnection.ts +3 -3
- package/src/objects/WithdrawalRequest.ts +6 -6
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +2 -2
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +2 -2
- package/src/objects/index.ts +37 -4
- package/src/{__tests__ → tests}/webhooks.test.ts +1 -1
- package/src/webhooks.ts +1 -1
- package/src/objects/ScreenBitcoinAddressesInput.ts +0 -23
- package/src/objects/ScreenBitcoinAddressesOutput.ts +0 -25
|
@@ -24,7 +24,7 @@ class OutgoingPaymentAttempt implements Entity {
|
|
|
24
24
|
public readonly failureSourceIndex?: number,
|
|
25
25
|
public readonly resolvedAt?: string,
|
|
26
26
|
public readonly amount?: CurrencyAmount,
|
|
27
|
-
public readonly fees?: CurrencyAmount
|
|
27
|
+
public readonly fees?: CurrencyAmount,
|
|
28
28
|
) {
|
|
29
29
|
autoBind(this);
|
|
30
30
|
}
|
|
@@ -32,7 +32,7 @@ class OutgoingPaymentAttempt implements Entity {
|
|
|
32
32
|
public async getHops(
|
|
33
33
|
client: LightsparkClient,
|
|
34
34
|
first: number | undefined = undefined,
|
|
35
|
-
after: string | undefined = undefined
|
|
35
|
+
after: string | undefined = undefined,
|
|
36
36
|
): Promise<OutgoingPaymentAttemptToHopsConnection> {
|
|
37
37
|
return (await client.executeRawQuery({
|
|
38
38
|
queryPayload: `
|
|
@@ -91,7 +91,7 @@ query FetchOutgoingPaymentAttemptToHopsConnection($entity_id: ID!, $first: Int,
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
static getOutgoingPaymentAttemptQuery(
|
|
94
|
-
id: string
|
|
94
|
+
id: string,
|
|
95
95
|
): Query<OutgoingPaymentAttempt> {
|
|
96
96
|
return {
|
|
97
97
|
queryPayload: `
|
|
@@ -113,7 +113,7 @@ ${FRAGMENT}
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
export const OutgoingPaymentAttemptFromJson = (
|
|
116
|
-
obj: any
|
|
116
|
+
obj: any,
|
|
117
117
|
): OutgoingPaymentAttempt => {
|
|
118
118
|
return new OutgoingPaymentAttempt(
|
|
119
119
|
obj["outgoing_payment_attempt_id"],
|
|
@@ -134,7 +134,7 @@ export const OutgoingPaymentAttemptFromJson = (
|
|
|
134
134
|
: undefined,
|
|
135
135
|
!!obj["outgoing_payment_attempt_fees"]
|
|
136
136
|
? CurrencyAmountFromJson(obj["outgoing_payment_attempt_fees"])
|
|
137
|
-
: undefined
|
|
137
|
+
: undefined,
|
|
138
138
|
);
|
|
139
139
|
};
|
|
140
140
|
|
|
@@ -25,15 +25,15 @@ type OutgoingPaymentAttemptToHopsConnection = Connection & {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export const OutgoingPaymentAttemptToHopsConnectionFromJson = (
|
|
28
|
-
obj: any
|
|
28
|
+
obj: any,
|
|
29
29
|
): OutgoingPaymentAttemptToHopsConnection => {
|
|
30
30
|
return {
|
|
31
31
|
count: obj["outgoing_payment_attempt_to_hops_connection_count"],
|
|
32
32
|
pageInfo: PageInfoFromJson(
|
|
33
|
-
obj["outgoing_payment_attempt_to_hops_connection_page_info"]
|
|
33
|
+
obj["outgoing_payment_attempt_to_hops_connection_page_info"],
|
|
34
34
|
),
|
|
35
35
|
entities: obj["outgoing_payment_attempt_to_hops_connection_entities"].map(
|
|
36
|
-
(e) => HopFromJson(e)
|
|
36
|
+
(e) => HopFromJson(e),
|
|
37
37
|
),
|
|
38
38
|
typename: "OutgoingPaymentAttemptToHopsConnection",
|
|
39
39
|
} as OutgoingPaymentAttemptToHopsConnection;
|
|
@@ -25,15 +25,15 @@ type OutgoingPaymentToAttemptsConnection = Connection & {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export const OutgoingPaymentToAttemptsConnectionFromJson = (
|
|
28
|
-
obj: any
|
|
28
|
+
obj: any,
|
|
29
29
|
): OutgoingPaymentToAttemptsConnection => {
|
|
30
30
|
return {
|
|
31
31
|
count: obj["outgoing_payment_to_attempts_connection_count"],
|
|
32
32
|
pageInfo: PageInfoFromJson(
|
|
33
|
-
obj["outgoing_payment_to_attempts_connection_page_info"]
|
|
33
|
+
obj["outgoing_payment_to_attempts_connection_page_info"],
|
|
34
34
|
),
|
|
35
35
|
entities: obj["outgoing_payment_to_attempts_connection_entities"].map((e) =>
|
|
36
|
-
OutgoingPaymentAttemptFromJson(e)
|
|
36
|
+
OutgoingPaymentAttemptFromJson(e),
|
|
37
37
|
),
|
|
38
38
|
typename: "OutgoingPaymentToAttemptsConnection",
|
|
39
39
|
} as OutgoingPaymentToAttemptsConnection;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import TransactionStatus from "./TransactionStatus.js";
|
|
4
|
+
|
|
5
|
+
type OutgoingPaymentsForInvoiceQueryInput = {
|
|
6
|
+
/** The encoded invoice that the outgoing payments paid to. **/
|
|
7
|
+
encodedInvoice: string;
|
|
8
|
+
|
|
9
|
+
/** An optional filter to only query outgoing payments of given statuses. **/
|
|
10
|
+
statuses?: TransactionStatus[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const OutgoingPaymentsForInvoiceQueryInputFromJson = (
|
|
14
|
+
obj: any,
|
|
15
|
+
): OutgoingPaymentsForInvoiceQueryInput => {
|
|
16
|
+
return {
|
|
17
|
+
encodedInvoice:
|
|
18
|
+
obj["outgoing_payments_for_invoice_query_input_encoded_invoice"],
|
|
19
|
+
statuses: obj["outgoing_payments_for_invoice_query_input_statuses"]?.map(
|
|
20
|
+
(e) => TransactionStatus[e],
|
|
21
|
+
),
|
|
22
|
+
} as OutgoingPaymentsForInvoiceQueryInput;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default OutgoingPaymentsForInvoiceQueryInput;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import type OutgoingPayment from "./OutgoingPayment.js";
|
|
4
|
+
import { OutgoingPaymentFromJson } from "./OutgoingPayment.js";
|
|
5
|
+
|
|
6
|
+
type OutgoingPaymentsForInvoiceQueryOutput = {
|
|
7
|
+
payments: OutgoingPayment[];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const OutgoingPaymentsForInvoiceQueryOutputFromJson = (
|
|
11
|
+
obj: any,
|
|
12
|
+
): OutgoingPaymentsForInvoiceQueryOutput => {
|
|
13
|
+
return {
|
|
14
|
+
payments: obj["outgoing_payments_for_invoice_query_output_payments"].map(
|
|
15
|
+
(e) => OutgoingPaymentFromJson(e),
|
|
16
|
+
),
|
|
17
|
+
} as OutgoingPaymentsForInvoiceQueryOutput;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const FRAGMENT = `
|
|
21
|
+
fragment OutgoingPaymentsForInvoiceQueryOutputFragment on OutgoingPaymentsForInvoiceQueryOutput {
|
|
22
|
+
__typename
|
|
23
|
+
outgoing_payments_for_invoice_query_output_payments: payments {
|
|
24
|
+
id
|
|
25
|
+
}
|
|
26
|
+
}`;
|
|
27
|
+
|
|
28
|
+
export default OutgoingPaymentsForInvoiceQueryOutput;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
type PayUmaInvoiceInput = {
|
|
4
|
+
nodeId: string;
|
|
5
|
+
|
|
6
|
+
encodedInvoice: string;
|
|
7
|
+
|
|
8
|
+
timeoutSecs: number;
|
|
9
|
+
|
|
10
|
+
maximumFeesMsats: number;
|
|
11
|
+
|
|
12
|
+
amountMsats?: number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const PayUmaInvoiceInputFromJson = (obj: any): PayUmaInvoiceInput => {
|
|
16
|
+
return {
|
|
17
|
+
nodeId: obj["pay_uma_invoice_input_node_id"],
|
|
18
|
+
encodedInvoice: obj["pay_uma_invoice_input_encoded_invoice"],
|
|
19
|
+
timeoutSecs: obj["pay_uma_invoice_input_timeout_secs"],
|
|
20
|
+
maximumFeesMsats: obj["pay_uma_invoice_input_maximum_fees_msats"],
|
|
21
|
+
amountMsats: obj["pay_uma_invoice_input_amount_msats"],
|
|
22
|
+
} as PayUmaInvoiceInput;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default PayUmaInvoiceInput;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/** This is an enum
|
|
4
|
-
export enum
|
|
3
|
+
/** This is an enum indicating the direction of the payment. **/
|
|
4
|
+
export enum PaymentDirection {
|
|
5
5
|
/**
|
|
6
6
|
* This is an enum value that represents values that could be added in the future.
|
|
7
7
|
* Clients should support unknown values as more of them could be added without notice.
|
|
8
8
|
*/
|
|
9
9
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
SENT = "SENT",
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
ROUTING = "ROUTING",
|
|
13
|
+
RECEIVED = "RECEIVED",
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
export default
|
|
16
|
+
export default PaymentDirection;
|
|
@@ -50,7 +50,7 @@ export const PaymentRequestFromJson = (obj: any): PaymentRequest => {
|
|
|
50
50
|
}
|
|
51
51
|
throw new LightsparkException(
|
|
52
52
|
"DeserializationError",
|
|
53
|
-
`Couldn't find a concrete type for interface PaymentRequest corresponding to the typename=${obj["__typename"]}
|
|
53
|
+
`Couldn't find a concrete type for interface PaymentRequest corresponding to the typename=${obj["__typename"]}`,
|
|
54
54
|
);
|
|
55
55
|
};
|
|
56
56
|
|
|
@@ -92,24 +92,54 @@ fragment PaymentRequestFragment on PaymentRequest {
|
|
|
92
92
|
graph_node_display_name: display_name
|
|
93
93
|
graph_node_public_key: public_key
|
|
94
94
|
}
|
|
95
|
-
... on
|
|
95
|
+
... on LightsparkNodeWithOSK {
|
|
96
96
|
__typename
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
97
|
+
lightspark_node_with_o_s_k_id: id
|
|
98
|
+
lightspark_node_with_o_s_k_created_at: created_at
|
|
99
|
+
lightspark_node_with_o_s_k_updated_at: updated_at
|
|
100
|
+
lightspark_node_with_o_s_k_alias: alias
|
|
101
|
+
lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network
|
|
102
|
+
lightspark_node_with_o_s_k_color: color
|
|
103
|
+
lightspark_node_with_o_s_k_conductivity: conductivity
|
|
104
|
+
lightspark_node_with_o_s_k_display_name: display_name
|
|
105
|
+
lightspark_node_with_o_s_k_public_key: public_key
|
|
106
|
+
lightspark_node_with_o_s_k_owner: owner {
|
|
107
107
|
id
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
lightspark_node_with_o_s_k_status: status
|
|
110
|
+
lightspark_node_with_o_s_k_total_balance: total_balance {
|
|
111
|
+
__typename
|
|
112
|
+
currency_amount_original_value: original_value
|
|
113
|
+
currency_amount_original_unit: original_unit
|
|
114
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
115
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
116
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
117
|
+
}
|
|
118
|
+
lightspark_node_with_o_s_k_total_local_balance: total_local_balance {
|
|
119
|
+
__typename
|
|
120
|
+
currency_amount_original_value: original_value
|
|
121
|
+
currency_amount_original_unit: original_unit
|
|
122
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
123
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
124
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
125
|
+
}
|
|
126
|
+
lightspark_node_with_o_s_k_local_balance: local_balance {
|
|
127
|
+
__typename
|
|
128
|
+
currency_amount_original_value: original_value
|
|
129
|
+
currency_amount_original_unit: original_unit
|
|
130
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
131
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
132
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
111
133
|
}
|
|
112
|
-
|
|
134
|
+
lightspark_node_with_o_s_k_remote_balance: remote_balance {
|
|
135
|
+
__typename
|
|
136
|
+
currency_amount_original_value: original_value
|
|
137
|
+
currency_amount_original_unit: original_unit
|
|
138
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
139
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
140
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
141
|
+
}
|
|
142
|
+
lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance {
|
|
113
143
|
__typename
|
|
114
144
|
blockchain_balance_total_balance: total_balance {
|
|
115
145
|
__typename
|
|
@@ -160,12 +190,29 @@ fragment PaymentRequestFragment on PaymentRequest {
|
|
|
160
190
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
161
191
|
}
|
|
162
192
|
}
|
|
163
|
-
|
|
193
|
+
lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos
|
|
194
|
+
lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key {
|
|
164
195
|
__typename
|
|
165
196
|
secret_encrypted_value: encrypted_value
|
|
166
197
|
secret_cipher: cipher
|
|
167
198
|
}
|
|
168
|
-
|
|
199
|
+
}
|
|
200
|
+
... on LightsparkNodeWithRemoteSigning {
|
|
201
|
+
__typename
|
|
202
|
+
lightspark_node_with_remote_signing_id: id
|
|
203
|
+
lightspark_node_with_remote_signing_created_at: created_at
|
|
204
|
+
lightspark_node_with_remote_signing_updated_at: updated_at
|
|
205
|
+
lightspark_node_with_remote_signing_alias: alias
|
|
206
|
+
lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network
|
|
207
|
+
lightspark_node_with_remote_signing_color: color
|
|
208
|
+
lightspark_node_with_remote_signing_conductivity: conductivity
|
|
209
|
+
lightspark_node_with_remote_signing_display_name: display_name
|
|
210
|
+
lightspark_node_with_remote_signing_public_key: public_key
|
|
211
|
+
lightspark_node_with_remote_signing_owner: owner {
|
|
212
|
+
id
|
|
213
|
+
}
|
|
214
|
+
lightspark_node_with_remote_signing_status: status
|
|
215
|
+
lightspark_node_with_remote_signing_total_balance: total_balance {
|
|
169
216
|
__typename
|
|
170
217
|
currency_amount_original_value: original_value
|
|
171
218
|
currency_amount_original_unit: original_unit
|
|
@@ -173,7 +220,7 @@ fragment PaymentRequestFragment on PaymentRequest {
|
|
|
173
220
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
174
221
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
175
222
|
}
|
|
176
|
-
|
|
223
|
+
lightspark_node_with_remote_signing_total_local_balance: total_local_balance {
|
|
177
224
|
__typename
|
|
178
225
|
currency_amount_original_value: original_value
|
|
179
226
|
currency_amount_original_unit: original_unit
|
|
@@ -181,7 +228,7 @@ fragment PaymentRequestFragment on PaymentRequest {
|
|
|
181
228
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
182
229
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
183
230
|
}
|
|
184
|
-
|
|
231
|
+
lightspark_node_with_remote_signing_local_balance: local_balance {
|
|
185
232
|
__typename
|
|
186
233
|
currency_amount_original_value: original_value
|
|
187
234
|
currency_amount_original_unit: original_unit
|
|
@@ -189,8 +236,7 @@ fragment PaymentRequestFragment on PaymentRequest {
|
|
|
189
236
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
190
237
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
191
238
|
}
|
|
192
|
-
|
|
193
|
-
lightspark_node_remote_balance: remote_balance {
|
|
239
|
+
lightspark_node_with_remote_signing_remote_balance: remote_balance {
|
|
194
240
|
__typename
|
|
195
241
|
currency_amount_original_value: original_value
|
|
196
242
|
currency_amount_original_unit: original_unit
|
|
@@ -198,7 +244,58 @@ fragment PaymentRequestFragment on PaymentRequest {
|
|
|
198
244
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
199
245
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
200
246
|
}
|
|
201
|
-
|
|
247
|
+
lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance {
|
|
248
|
+
__typename
|
|
249
|
+
blockchain_balance_total_balance: total_balance {
|
|
250
|
+
__typename
|
|
251
|
+
currency_amount_original_value: original_value
|
|
252
|
+
currency_amount_original_unit: original_unit
|
|
253
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
254
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
255
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
256
|
+
}
|
|
257
|
+
blockchain_balance_confirmed_balance: confirmed_balance {
|
|
258
|
+
__typename
|
|
259
|
+
currency_amount_original_value: original_value
|
|
260
|
+
currency_amount_original_unit: original_unit
|
|
261
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
262
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
263
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
264
|
+
}
|
|
265
|
+
blockchain_balance_unconfirmed_balance: unconfirmed_balance {
|
|
266
|
+
__typename
|
|
267
|
+
currency_amount_original_value: original_value
|
|
268
|
+
currency_amount_original_unit: original_unit
|
|
269
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
270
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
271
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
272
|
+
}
|
|
273
|
+
blockchain_balance_locked_balance: locked_balance {
|
|
274
|
+
__typename
|
|
275
|
+
currency_amount_original_value: original_value
|
|
276
|
+
currency_amount_original_unit: original_unit
|
|
277
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
278
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
279
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
280
|
+
}
|
|
281
|
+
blockchain_balance_required_reserve: required_reserve {
|
|
282
|
+
__typename
|
|
283
|
+
currency_amount_original_value: original_value
|
|
284
|
+
currency_amount_original_unit: original_unit
|
|
285
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
286
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
287
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
288
|
+
}
|
|
289
|
+
blockchain_balance_available_balance: available_balance {
|
|
290
|
+
__typename
|
|
291
|
+
currency_amount_original_value: original_value
|
|
292
|
+
currency_amount_original_unit: original_unit
|
|
293
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
294
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
295
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos
|
|
202
299
|
}
|
|
203
300
|
}
|
|
204
301
|
}
|
|
@@ -34,7 +34,7 @@ export const PaymentRequestDataFromJson = (obj: any): PaymentRequestData => {
|
|
|
34
34
|
}
|
|
35
35
|
throw new LightsparkException(
|
|
36
36
|
"DeserializationError",
|
|
37
|
-
`Couldn't find a concrete type for interface PaymentRequestData corresponding to the typename=${obj["__typename"]}
|
|
37
|
+
`Couldn't find a concrete type for interface PaymentRequestData corresponding to the typename=${obj["__typename"]}`,
|
|
38
38
|
);
|
|
39
39
|
};
|
|
40
40
|
|
|
@@ -71,24 +71,54 @@ fragment PaymentRequestDataFragment on PaymentRequestData {
|
|
|
71
71
|
graph_node_display_name: display_name
|
|
72
72
|
graph_node_public_key: public_key
|
|
73
73
|
}
|
|
74
|
-
... on
|
|
74
|
+
... on LightsparkNodeWithOSK {
|
|
75
75
|
__typename
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
lightspark_node_with_o_s_k_id: id
|
|
77
|
+
lightspark_node_with_o_s_k_created_at: created_at
|
|
78
|
+
lightspark_node_with_o_s_k_updated_at: updated_at
|
|
79
|
+
lightspark_node_with_o_s_k_alias: alias
|
|
80
|
+
lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network
|
|
81
|
+
lightspark_node_with_o_s_k_color: color
|
|
82
|
+
lightspark_node_with_o_s_k_conductivity: conductivity
|
|
83
|
+
lightspark_node_with_o_s_k_display_name: display_name
|
|
84
|
+
lightspark_node_with_o_s_k_public_key: public_key
|
|
85
|
+
lightspark_node_with_o_s_k_owner: owner {
|
|
86
86
|
id
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
lightspark_node_with_o_s_k_status: status
|
|
89
|
+
lightspark_node_with_o_s_k_total_balance: total_balance {
|
|
90
|
+
__typename
|
|
91
|
+
currency_amount_original_value: original_value
|
|
92
|
+
currency_amount_original_unit: original_unit
|
|
93
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
94
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
95
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
96
|
+
}
|
|
97
|
+
lightspark_node_with_o_s_k_total_local_balance: total_local_balance {
|
|
98
|
+
__typename
|
|
99
|
+
currency_amount_original_value: original_value
|
|
100
|
+
currency_amount_original_unit: original_unit
|
|
101
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
102
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
103
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
104
|
+
}
|
|
105
|
+
lightspark_node_with_o_s_k_local_balance: local_balance {
|
|
106
|
+
__typename
|
|
107
|
+
currency_amount_original_value: original_value
|
|
108
|
+
currency_amount_original_unit: original_unit
|
|
109
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
110
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
111
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
90
112
|
}
|
|
91
|
-
|
|
113
|
+
lightspark_node_with_o_s_k_remote_balance: remote_balance {
|
|
114
|
+
__typename
|
|
115
|
+
currency_amount_original_value: original_value
|
|
116
|
+
currency_amount_original_unit: original_unit
|
|
117
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
118
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
119
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
120
|
+
}
|
|
121
|
+
lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance {
|
|
92
122
|
__typename
|
|
93
123
|
blockchain_balance_total_balance: total_balance {
|
|
94
124
|
__typename
|
|
@@ -139,12 +169,29 @@ fragment PaymentRequestDataFragment on PaymentRequestData {
|
|
|
139
169
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
140
170
|
}
|
|
141
171
|
}
|
|
142
|
-
|
|
172
|
+
lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos
|
|
173
|
+
lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key {
|
|
143
174
|
__typename
|
|
144
175
|
secret_encrypted_value: encrypted_value
|
|
145
176
|
secret_cipher: cipher
|
|
146
177
|
}
|
|
147
|
-
|
|
178
|
+
}
|
|
179
|
+
... on LightsparkNodeWithRemoteSigning {
|
|
180
|
+
__typename
|
|
181
|
+
lightspark_node_with_remote_signing_id: id
|
|
182
|
+
lightspark_node_with_remote_signing_created_at: created_at
|
|
183
|
+
lightspark_node_with_remote_signing_updated_at: updated_at
|
|
184
|
+
lightspark_node_with_remote_signing_alias: alias
|
|
185
|
+
lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network
|
|
186
|
+
lightspark_node_with_remote_signing_color: color
|
|
187
|
+
lightspark_node_with_remote_signing_conductivity: conductivity
|
|
188
|
+
lightspark_node_with_remote_signing_display_name: display_name
|
|
189
|
+
lightspark_node_with_remote_signing_public_key: public_key
|
|
190
|
+
lightspark_node_with_remote_signing_owner: owner {
|
|
191
|
+
id
|
|
192
|
+
}
|
|
193
|
+
lightspark_node_with_remote_signing_status: status
|
|
194
|
+
lightspark_node_with_remote_signing_total_balance: total_balance {
|
|
148
195
|
__typename
|
|
149
196
|
currency_amount_original_value: original_value
|
|
150
197
|
currency_amount_original_unit: original_unit
|
|
@@ -152,7 +199,7 @@ fragment PaymentRequestDataFragment on PaymentRequestData {
|
|
|
152
199
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
153
200
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
154
201
|
}
|
|
155
|
-
|
|
202
|
+
lightspark_node_with_remote_signing_total_local_balance: total_local_balance {
|
|
156
203
|
__typename
|
|
157
204
|
currency_amount_original_value: original_value
|
|
158
205
|
currency_amount_original_unit: original_unit
|
|
@@ -160,7 +207,7 @@ fragment PaymentRequestDataFragment on PaymentRequestData {
|
|
|
160
207
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
161
208
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
162
209
|
}
|
|
163
|
-
|
|
210
|
+
lightspark_node_with_remote_signing_local_balance: local_balance {
|
|
164
211
|
__typename
|
|
165
212
|
currency_amount_original_value: original_value
|
|
166
213
|
currency_amount_original_unit: original_unit
|
|
@@ -168,8 +215,7 @@ fragment PaymentRequestDataFragment on PaymentRequestData {
|
|
|
168
215
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
169
216
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
170
217
|
}
|
|
171
|
-
|
|
172
|
-
lightspark_node_remote_balance: remote_balance {
|
|
218
|
+
lightspark_node_with_remote_signing_remote_balance: remote_balance {
|
|
173
219
|
__typename
|
|
174
220
|
currency_amount_original_value: original_value
|
|
175
221
|
currency_amount_original_unit: original_unit
|
|
@@ -177,7 +223,58 @@ fragment PaymentRequestDataFragment on PaymentRequestData {
|
|
|
177
223
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
178
224
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
179
225
|
}
|
|
180
|
-
|
|
226
|
+
lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance {
|
|
227
|
+
__typename
|
|
228
|
+
blockchain_balance_total_balance: total_balance {
|
|
229
|
+
__typename
|
|
230
|
+
currency_amount_original_value: original_value
|
|
231
|
+
currency_amount_original_unit: original_unit
|
|
232
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
233
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
234
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
235
|
+
}
|
|
236
|
+
blockchain_balance_confirmed_balance: confirmed_balance {
|
|
237
|
+
__typename
|
|
238
|
+
currency_amount_original_value: original_value
|
|
239
|
+
currency_amount_original_unit: original_unit
|
|
240
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
241
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
242
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
243
|
+
}
|
|
244
|
+
blockchain_balance_unconfirmed_balance: unconfirmed_balance {
|
|
245
|
+
__typename
|
|
246
|
+
currency_amount_original_value: original_value
|
|
247
|
+
currency_amount_original_unit: original_unit
|
|
248
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
249
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
250
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
251
|
+
}
|
|
252
|
+
blockchain_balance_locked_balance: locked_balance {
|
|
253
|
+
__typename
|
|
254
|
+
currency_amount_original_value: original_value
|
|
255
|
+
currency_amount_original_unit: original_unit
|
|
256
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
257
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
258
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
259
|
+
}
|
|
260
|
+
blockchain_balance_required_reserve: required_reserve {
|
|
261
|
+
__typename
|
|
262
|
+
currency_amount_original_value: original_value
|
|
263
|
+
currency_amount_original_unit: original_unit
|
|
264
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
265
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
266
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
267
|
+
}
|
|
268
|
+
blockchain_balance_available_balance: available_balance {
|
|
269
|
+
__typename
|
|
270
|
+
currency_amount_original_value: original_value
|
|
271
|
+
currency_amount_original_unit: original_unit
|
|
272
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
273
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
274
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos
|
|
181
278
|
}
|
|
182
279
|
}
|
|
183
280
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
5
|
+
|
|
6
|
+
/** This object represents post-transaction data that could be used to register payment for KYT. **/
|
|
7
|
+
type PostTransactionData = {
|
|
8
|
+
/**
|
|
9
|
+
* The utxo of the channel over which the payment went through in the format of
|
|
10
|
+
* <transaction_hash>:<output_index>.
|
|
11
|
+
**/
|
|
12
|
+
utxo: string;
|
|
13
|
+
|
|
14
|
+
/** The amount of funds transferred in the payment. **/
|
|
15
|
+
amount: CurrencyAmount;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const PostTransactionDataFromJson = (obj: any): PostTransactionData => {
|
|
19
|
+
return {
|
|
20
|
+
utxo: obj["post_transaction_data_utxo"],
|
|
21
|
+
amount: CurrencyAmountFromJson(obj["post_transaction_data_amount"]),
|
|
22
|
+
} as PostTransactionData;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const FRAGMENT = `
|
|
26
|
+
fragment PostTransactionDataFragment on PostTransactionData {
|
|
27
|
+
__typename
|
|
28
|
+
post_transaction_data_utxo: utxo
|
|
29
|
+
post_transaction_data_amount: amount {
|
|
30
|
+
__typename
|
|
31
|
+
currency_amount_original_value: original_value
|
|
32
|
+
currency_amount_original_unit: original_unit
|
|
33
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
34
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
35
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
36
|
+
}
|
|
37
|
+
}`;
|
|
38
|
+
|
|
39
|
+
export default PostTransactionData;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import ComplianceProvider from "./ComplianceProvider.js";
|
|
4
|
+
import PaymentDirection from "./PaymentDirection.js";
|
|
5
|
+
|
|
6
|
+
type RegisterPaymentInput = {
|
|
7
|
+
provider: ComplianceProvider;
|
|
8
|
+
|
|
9
|
+
paymentId: string;
|
|
10
|
+
|
|
11
|
+
nodePubkey: string;
|
|
12
|
+
|
|
13
|
+
direction: PaymentDirection;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const RegisterPaymentInputFromJson = (
|
|
17
|
+
obj: any,
|
|
18
|
+
): RegisterPaymentInput => {
|
|
19
|
+
return {
|
|
20
|
+
provider:
|
|
21
|
+
ComplianceProvider[obj["register_payment_input_provider"]] ??
|
|
22
|
+
ComplianceProvider.FUTURE_VALUE,
|
|
23
|
+
paymentId: obj["register_payment_input_payment_id"],
|
|
24
|
+
nodePubkey: obj["register_payment_input_node_pubkey"],
|
|
25
|
+
direction:
|
|
26
|
+
PaymentDirection[obj["register_payment_input_direction"]] ??
|
|
27
|
+
PaymentDirection.FUTURE_VALUE,
|
|
28
|
+
} as RegisterPaymentInput;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default RegisterPaymentInput;
|