@lightsparkdev/lightspark-sdk 1.1.6 → 1.2.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 +14 -0
- package/dist/{chunk-7UNNCH5S.js → chunk-VTPDR6P4.js} +1270 -342
- package/dist/{index-5235e43b.d.ts → index-f040db9f.d.ts} +707 -407
- package/dist/index.cjs +1247 -319
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/objects/index.cjs +1180 -306
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +5 -5
- package/package.json +2 -2
- package/src/objects/Account.ts +175 -2
- package/src/objects/AccountToApiTokensConnection.ts +16 -5
- package/src/objects/AccountToChannelsConnection.ts +9 -0
- package/src/objects/AccountToNodesConnection.ts +19 -5
- package/src/objects/AccountToPaymentRequestsConnection.ts +21 -5
- package/src/objects/AccountToTransactionsConnection.ts +33 -9
- package/src/objects/AccountToWalletsConnection.ts +13 -4
- package/src/objects/ApiToken.ts +13 -3
- package/src/objects/Balances.ts +17 -3
- package/src/objects/BlockchainBalance.ts +34 -9
- package/src/objects/Channel.ts +61 -16
- package/src/objects/ChannelClosingTransaction.ts +81 -61
- package/src/objects/ChannelFees.ts +16 -5
- package/src/objects/ChannelOpeningTransaction.ts +81 -61
- package/src/objects/ChannelSnapshot.ts +66 -6
- package/src/objects/ChannelToTransactionsConnection.ts +26 -6
- package/src/objects/Connection.ts +205 -10
- package/src/objects/CreateApiTokenInput.ts +8 -2
- package/src/objects/CreateApiTokenOutput.ts +9 -3
- package/src/objects/CreateInvoiceInput.ts +14 -5
- package/src/objects/CreateInvoiceOutput.ts +7 -2
- package/src/objects/CreateLnurlInvoiceInput.ts +13 -3
- package/src/objects/CreateNodeWalletAddressInput.ts +9 -2
- package/src/objects/CreateNodeWalletAddressOutput.ts +10 -2
- package/src/objects/CreateTestModeInvoiceInput.ts +14 -4
- package/src/objects/CreateTestModeInvoiceOutput.ts +10 -2
- package/src/objects/CreateTestModePaymentInput.ts +12 -3
- package/src/objects/CreateTestModePaymentoutput.ts +12 -2
- package/src/objects/CreateUmaInvoiceInput.ts +13 -3
- package/src/objects/CurrencyAmount.ts +13 -2
- package/src/objects/DeclineToSignMessagesInput.ts +9 -2
- package/src/objects/DeclineToSignMessagesOutput.ts +15 -3
- package/src/objects/DeleteApiTokenInput.ts +7 -2
- package/src/objects/DeleteApiTokenOutput.ts +7 -2
- package/src/objects/Deposit.ts +77 -61
- package/src/objects/Entity.ts +184 -2
- package/src/objects/FeeEstimate.ts +12 -3
- package/src/objects/FundNodeInput.ts +9 -3
- package/src/objects/FundNodeOutput.ts +11 -3
- package/src/objects/GraphNode.ts +21 -5
- package/src/objects/Hop.ts +27 -9
- package/src/objects/HtlcAttemptFailureCode.ts +2 -0
- package/src/objects/IdAndSignature.ts +8 -2
- package/src/objects/IncomingPayment.ts +33 -7
- package/src/objects/IncomingPaymentAttempt.ts +21 -5
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +21 -5
- package/src/objects/Invoice.ts +91 -24
- package/src/objects/InvoiceData.ts +75 -6
- package/src/objects/LightningFeeEstimateForInvoiceInput.ts +13 -3
- package/src/objects/LightningFeeEstimateForNodeInput.ts +12 -2
- package/src/objects/LightningFeeEstimateOutput.ts +15 -3
- package/src/objects/LightningTransaction.ts +171 -28
- package/src/objects/LightsparkNode.ts +311 -208
- package/src/objects/LightsparkNodeOwner.ts +35 -4
- package/src/objects/LightsparkNodeToChannelsConnection.ts +17 -4
- package/src/objects/LightsparkNodeWithOSK.ts +97 -15
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +93 -13
- package/src/objects/Node.ts +269 -67
- package/src/objects/NodeAddress.ts +8 -2
- package/src/objects/NodeToAddressesConnection.ts +13 -3
- package/src/objects/OnChainTransaction.ts +156 -44
- package/src/objects/OutgoingPayment.ts +127 -14
- package/src/objects/OutgoingPaymentAttempt.ts +57 -8
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +18 -5
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +17 -4
- package/src/objects/OutgoingPaymentsForInvoiceQueryInput.ts +12 -3
- package/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts +11 -2
- package/src/objects/PageInfo.ts +14 -6
- package/src/objects/PayInvoiceInput.ts +12 -3
- package/src/objects/PayInvoiceOutput.ts +7 -2
- package/src/objects/PayUmaInvoiceInput.ts +12 -3
- package/src/objects/PaymentRequest.ts +81 -5
- package/src/objects/PaymentRequestData.ts +81 -4
- package/src/objects/PostTransactionData.ts +12 -3
- package/src/objects/RegisterPaymentInput.ts +10 -2
- package/src/objects/RegisterPaymentOutput.ts +9 -2
- package/src/objects/ReleaseChannelPerCommitmentSecretInput.ts +13 -2
- package/src/objects/ReleaseChannelPerCommitmentSecretOutput.ts +9 -2
- package/src/objects/ReleasePaymentPreimageInput.ts +10 -2
- package/src/objects/ReleasePaymentPreimageOutput.ts +9 -2
- package/src/objects/RequestWithdrawalInput.ts +12 -2
- package/src/objects/RequestWithdrawalOutput.ts +9 -2
- package/src/objects/RichText.ts +7 -2
- package/src/objects/RoutingTransaction.ts +62 -41
- package/src/objects/ScreenNodeInput.ts +8 -2
- package/src/objects/ScreenNodeOutput.ts +7 -2
- package/src/objects/Secret.ts +8 -2
- package/src/objects/SendPaymentInput.ts +11 -2
- package/src/objects/SendPaymentOutput.ts +7 -2
- package/src/objects/SetInvoicePaymentHashInput.ts +12 -3
- package/src/objects/SetInvoicePaymentHashOutput.ts +9 -2
- package/src/objects/SignInvoiceInput.ts +9 -2
- package/src/objects/SignInvoiceOutput.ts +7 -2
- package/src/objects/SignMessagesInput.ts +13 -3
- package/src/objects/SignMessagesOutput.ts +13 -3
- package/src/objects/Signable.ts +10 -3
- package/src/objects/SignablePayload.ts +18 -5
- package/src/objects/Transaction.ts +260 -9
- package/src/objects/TransactionFailures.ts +11 -4
- package/src/objects/UpdateChannelPerCommitmentPointInput.ts +13 -2
- package/src/objects/UpdateChannelPerCommitmentPointOutput.ts +9 -2
- package/src/objects/UpdateNodeSharedSecretInput.ts +10 -2
- package/src/objects/UpdateNodeSharedSecretOutput.ts +9 -2
- package/src/objects/Wallet.ts +130 -5
- package/src/objects/WalletToPaymentRequestsConnection.ts +21 -5
- package/src/objects/WalletToTransactionsConnection.ts +16 -5
- package/src/objects/Withdrawal.ts +77 -61
- package/src/objects/WithdrawalRequest.ts +25 -4
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +19 -4
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +19 -4
- package/src/objects/index.ts +5 -2
- package/src/tests/integration/client.test.ts +46 -7
- package/src/tests/serialization.test.ts +18 -0
package/src/objects/RichText.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface RichText {
|
|
4
4
|
text: string;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
6
|
|
|
7
7
|
export const RichTextFromJson = (obj: any): RichText => {
|
|
8
8
|
return {
|
|
9
9
|
text: obj["rich_text_text"],
|
|
10
10
|
} as RichText;
|
|
11
11
|
};
|
|
12
|
+
export const RichTextToJson = (obj: RichText): any => {
|
|
13
|
+
return {
|
|
14
|
+
rich_text_text: obj.text,
|
|
15
|
+
};
|
|
16
|
+
};
|
|
12
17
|
|
|
13
18
|
export const FRAGMENT = `
|
|
14
19
|
fragment RichTextFragment on RichText {
|
|
@@ -2,64 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|
import { type Query } from "@lightsparkdev/core";
|
|
4
4
|
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import {
|
|
6
|
+
CurrencyAmountFromJson,
|
|
7
|
+
CurrencyAmountToJson,
|
|
8
|
+
} from "./CurrencyAmount.js";
|
|
8
9
|
import type RichText from "./RichText.js";
|
|
9
|
-
import { RichTextFromJson } from "./RichText.js";
|
|
10
|
+
import { RichTextFromJson, RichTextToJson } from "./RichText.js";
|
|
10
11
|
import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js";
|
|
11
|
-
import type Transaction from "./Transaction.js";
|
|
12
12
|
import TransactionStatus from "./TransactionStatus.js";
|
|
13
13
|
|
|
14
14
|
/** This object represents a transaction that was forwarded through a Lightspark node on the Lightning Network, i.e., a routed transaction. You can retrieve this object to receive information about any transaction routed through your Lightspark Node. **/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
**/
|
|
22
|
-
id: string;
|
|
15
|
+
interface RoutingTransaction {
|
|
16
|
+
/**
|
|
17
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
18
|
+
* string.
|
|
19
|
+
**/
|
|
20
|
+
id: string;
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
/** The date and time when this transaction was initiated. **/
|
|
23
|
+
createdAt: string;
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
/** The date and time when the entity was last updated. **/
|
|
26
|
+
updatedAt: string;
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
/** The current status of this transaction. **/
|
|
29
|
+
status: TransactionStatus;
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
/** The amount of money involved in this transaction. **/
|
|
32
|
+
amount: CurrencyAmount;
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
/** The typename of the object **/
|
|
35
|
+
typename: string;
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
38
|
+
resolvedAt?: string | undefined;
|
|
41
39
|
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
41
|
+
transactionHash?: string | undefined;
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
/** If known, the channel this transaction was received from. **/
|
|
44
|
+
incomingChannelId?: string | undefined;
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
/** If known, the channel this transaction was forwarded to. **/
|
|
47
|
+
outgoingChannelId?: string | undefined;
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
/**
|
|
50
|
+
* The fees collected by the node when routing this transaction. We subtract the outgoing amount to
|
|
51
|
+
* the incoming amount to determine how much fees were collected.
|
|
52
|
+
**/
|
|
53
|
+
fees?: CurrencyAmount | undefined;
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
/** If applicable, user-facing error message describing why the routing failed. **/
|
|
56
|
+
failureMessage?: RichText | undefined;
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
/** If applicable, the reason why the routing failed. **/
|
|
59
|
+
failureReason?: RoutingTransactionFailureReason | undefined;
|
|
60
|
+
}
|
|
63
61
|
|
|
64
62
|
export const RoutingTransactionFromJson = (obj: any): RoutingTransaction => {
|
|
65
63
|
return {
|
|
@@ -90,6 +88,29 @@ export const RoutingTransactionFromJson = (obj: any): RoutingTransaction => {
|
|
|
90
88
|
: null,
|
|
91
89
|
} as RoutingTransaction;
|
|
92
90
|
};
|
|
91
|
+
export const RoutingTransactionToJson = (obj: RoutingTransaction): any => {
|
|
92
|
+
return {
|
|
93
|
+
__typename: "RoutingTransaction",
|
|
94
|
+
routing_transaction_id: obj.id,
|
|
95
|
+
routing_transaction_created_at: obj.createdAt,
|
|
96
|
+
routing_transaction_updated_at: obj.updatedAt,
|
|
97
|
+
routing_transaction_status: obj.status,
|
|
98
|
+
routing_transaction_resolved_at: obj.resolvedAt,
|
|
99
|
+
routing_transaction_amount: CurrencyAmountToJson(obj.amount),
|
|
100
|
+
routing_transaction_transaction_hash: obj.transactionHash,
|
|
101
|
+
routing_transaction_incoming_channel:
|
|
102
|
+
{ id: obj.incomingChannelId } ?? undefined,
|
|
103
|
+
routing_transaction_outgoing_channel:
|
|
104
|
+
{ id: obj.outgoingChannelId } ?? undefined,
|
|
105
|
+
routing_transaction_fees: obj.fees
|
|
106
|
+
? CurrencyAmountToJson(obj.fees)
|
|
107
|
+
: undefined,
|
|
108
|
+
routing_transaction_failure_message: obj.failureMessage
|
|
109
|
+
? RichTextToJson(obj.failureMessage)
|
|
110
|
+
: undefined,
|
|
111
|
+
routing_transaction_failure_reason: obj.failureReason,
|
|
112
|
+
};
|
|
113
|
+
};
|
|
93
114
|
|
|
94
115
|
export const FRAGMENT = `
|
|
95
116
|
fragment RoutingTransactionFragment on RoutingTransaction {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import ComplianceProvider from "./ComplianceProvider.js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface ScreenNodeInput {
|
|
6
6
|
/**
|
|
7
7
|
* The compliance provider that is going to screen the node. You need to be a customer of the selected
|
|
8
8
|
* provider and store the API key on the Lightspark account setting page.
|
|
@@ -11,7 +11,7 @@ type ScreenNodeInput = {
|
|
|
11
11
|
|
|
12
12
|
/** The public key of the lightning node that needs to be screened. **/
|
|
13
13
|
nodePubkey: string;
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
15
|
|
|
16
16
|
export const ScreenNodeInputFromJson = (obj: any): ScreenNodeInput => {
|
|
17
17
|
return {
|
|
@@ -21,5 +21,11 @@ export const ScreenNodeInputFromJson = (obj: any): ScreenNodeInput => {
|
|
|
21
21
|
nodePubkey: obj["screen_node_input_node_pubkey"],
|
|
22
22
|
} as ScreenNodeInput;
|
|
23
23
|
};
|
|
24
|
+
export const ScreenNodeInputToJson = (obj: ScreenNodeInput): any => {
|
|
25
|
+
return {
|
|
26
|
+
screen_node_input_provider: obj.provider,
|
|
27
|
+
screen_node_input_node_pubkey: obj.nodePubkey,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
24
30
|
|
|
25
31
|
export default ScreenNodeInput;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import RiskRating from "./RiskRating.js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface ScreenNodeOutput {
|
|
6
6
|
rating: RiskRating;
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
|
|
9
9
|
export const ScreenNodeOutputFromJson = (obj: any): ScreenNodeOutput => {
|
|
10
10
|
return {
|
|
@@ -12,6 +12,11 @@ export const ScreenNodeOutputFromJson = (obj: any): ScreenNodeOutput => {
|
|
|
12
12
|
RiskRating[obj["screen_node_output_rating"]] ?? RiskRating.FUTURE_VALUE,
|
|
13
13
|
} as ScreenNodeOutput;
|
|
14
14
|
};
|
|
15
|
+
export const ScreenNodeOutputToJson = (obj: ScreenNodeOutput): any => {
|
|
16
|
+
return {
|
|
17
|
+
screen_node_output_rating: obj.rating,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
15
20
|
|
|
16
21
|
export const FRAGMENT = `
|
|
17
22
|
fragment ScreenNodeOutputFragment on ScreenNodeOutput {
|
package/src/objects/Secret.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface Secret {
|
|
4
4
|
encryptedValue: string;
|
|
5
5
|
|
|
6
6
|
cipher: string;
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
|
|
9
9
|
export const SecretFromJson = (obj: any): Secret => {
|
|
10
10
|
return {
|
|
@@ -12,6 +12,12 @@ export const SecretFromJson = (obj: any): Secret => {
|
|
|
12
12
|
cipher: obj["secret_cipher"],
|
|
13
13
|
} as Secret;
|
|
14
14
|
};
|
|
15
|
+
export const SecretToJson = (obj: Secret): any => {
|
|
16
|
+
return {
|
|
17
|
+
secret_encrypted_value: obj.encryptedValue,
|
|
18
|
+
secret_cipher: obj.cipher,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
15
21
|
|
|
16
22
|
export const FRAGMENT = `
|
|
17
23
|
fragment SecretFragment on Secret {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface SendPaymentInput {
|
|
4
4
|
/** The node from where you want to send the payment. **/
|
|
5
5
|
nodeId: string;
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ type SendPaymentInput = {
|
|
|
15
15
|
|
|
16
16
|
/** The maximum amount of fees that you want to pay for this payment to be sent, expressed in msats. **/
|
|
17
17
|
maximumFeesMsats: number;
|
|
18
|
-
}
|
|
18
|
+
}
|
|
19
19
|
|
|
20
20
|
export const SendPaymentInputFromJson = (obj: any): SendPaymentInput => {
|
|
21
21
|
return {
|
|
@@ -26,5 +26,14 @@ export const SendPaymentInputFromJson = (obj: any): SendPaymentInput => {
|
|
|
26
26
|
maximumFeesMsats: obj["send_payment_input_maximum_fees_msats"],
|
|
27
27
|
} as SendPaymentInput;
|
|
28
28
|
};
|
|
29
|
+
export const SendPaymentInputToJson = (obj: SendPaymentInput): any => {
|
|
30
|
+
return {
|
|
31
|
+
send_payment_input_node_id: obj.nodeId,
|
|
32
|
+
send_payment_input_destination_public_key: obj.destinationPublicKey,
|
|
33
|
+
send_payment_input_timeout_secs: obj.timeoutSecs,
|
|
34
|
+
send_payment_input_amount_msats: obj.amountMsats,
|
|
35
|
+
send_payment_input_maximum_fees_msats: obj.maximumFeesMsats,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
29
38
|
|
|
30
39
|
export default SendPaymentInput;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface SendPaymentOutput {
|
|
4
4
|
/** The payment that has been sent. **/
|
|
5
5
|
paymentId: string;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
|
|
8
8
|
export const SendPaymentOutputFromJson = (obj: any): SendPaymentOutput => {
|
|
9
9
|
return {
|
|
10
10
|
paymentId: obj["send_payment_output_payment"].id,
|
|
11
11
|
} as SendPaymentOutput;
|
|
12
12
|
};
|
|
13
|
+
export const SendPaymentOutputToJson = (obj: SendPaymentOutput): any => {
|
|
14
|
+
return {
|
|
15
|
+
send_payment_output_payment: { id: obj.paymentId },
|
|
16
|
+
};
|
|
17
|
+
};
|
|
13
18
|
|
|
14
19
|
export const FRAGMENT = `
|
|
15
20
|
fragment SendPaymentOutputFragment on SendPaymentOutput {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface SetInvoicePaymentHashInput {
|
|
4
4
|
/** The invoice that needs to be updated. **/
|
|
5
5
|
invoiceId: string;
|
|
6
6
|
|
|
@@ -11,8 +11,8 @@ type SetInvoicePaymentHashInput = {
|
|
|
11
11
|
* The 32-byte nonce used to generate the invoice preimage if applicable. It will later be included in
|
|
12
12
|
* RELEASE_PAYMENT_PREIMAGE webhook to help recover the raw preimage.
|
|
13
13
|
**/
|
|
14
|
-
preimageNonce?: string;
|
|
15
|
-
}
|
|
14
|
+
preimageNonce?: string | undefined;
|
|
15
|
+
}
|
|
16
16
|
|
|
17
17
|
export const SetInvoicePaymentHashInputFromJson = (
|
|
18
18
|
obj: any,
|
|
@@ -23,5 +23,14 @@ export const SetInvoicePaymentHashInputFromJson = (
|
|
|
23
23
|
preimageNonce: obj["set_invoice_payment_hash_input_preimage_nonce"],
|
|
24
24
|
} as SetInvoicePaymentHashInput;
|
|
25
25
|
};
|
|
26
|
+
export const SetInvoicePaymentHashInputToJson = (
|
|
27
|
+
obj: SetInvoicePaymentHashInput,
|
|
28
|
+
): any => {
|
|
29
|
+
return {
|
|
30
|
+
set_invoice_payment_hash_input_invoice_id: obj.invoiceId,
|
|
31
|
+
set_invoice_payment_hash_input_payment_hash: obj.paymentHash,
|
|
32
|
+
set_invoice_payment_hash_input_preimage_nonce: obj.preimageNonce,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
26
35
|
|
|
27
36
|
export default SetInvoicePaymentHashInput;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface SetInvoicePaymentHashOutput {
|
|
4
4
|
invoiceId: string;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
6
|
|
|
7
7
|
export const SetInvoicePaymentHashOutputFromJson = (
|
|
8
8
|
obj: any,
|
|
@@ -11,6 +11,13 @@ export const SetInvoicePaymentHashOutputFromJson = (
|
|
|
11
11
|
invoiceId: obj["set_invoice_payment_hash_output_invoice"].id,
|
|
12
12
|
} as SetInvoicePaymentHashOutput;
|
|
13
13
|
};
|
|
14
|
+
export const SetInvoicePaymentHashOutputToJson = (
|
|
15
|
+
obj: SetInvoicePaymentHashOutput,
|
|
16
|
+
): any => {
|
|
17
|
+
return {
|
|
18
|
+
set_invoice_payment_hash_output_invoice: { id: obj.invoiceId },
|
|
19
|
+
};
|
|
20
|
+
};
|
|
14
21
|
|
|
15
22
|
export const FRAGMENT = `
|
|
16
23
|
fragment SetInvoicePaymentHashOutputFragment on SetInvoicePaymentHashOutput {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface SignInvoiceInput {
|
|
4
4
|
/** The unique identifier of the invoice to be signed. **/
|
|
5
5
|
invoiceId: string;
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ type SignInvoiceInput = {
|
|
|
9
9
|
|
|
10
10
|
/** The recovery identifier for the signature. **/
|
|
11
11
|
recoveryId: number;
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
13
|
|
|
14
14
|
export const SignInvoiceInputFromJson = (obj: any): SignInvoiceInput => {
|
|
15
15
|
return {
|
|
@@ -18,5 +18,12 @@ export const SignInvoiceInputFromJson = (obj: any): SignInvoiceInput => {
|
|
|
18
18
|
recoveryId: obj["sign_invoice_input_recovery_id"],
|
|
19
19
|
} as SignInvoiceInput;
|
|
20
20
|
};
|
|
21
|
+
export const SignInvoiceInputToJson = (obj: SignInvoiceInput): any => {
|
|
22
|
+
return {
|
|
23
|
+
sign_invoice_input_invoice_id: obj.invoiceId,
|
|
24
|
+
sign_invoice_input_signature: obj.signature,
|
|
25
|
+
sign_invoice_input_recovery_id: obj.recoveryId,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
21
28
|
|
|
22
29
|
export default SignInvoiceInput;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface SignInvoiceOutput {
|
|
4
4
|
/** The signed invoice object. **/
|
|
5
5
|
invoiceId: string;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
|
|
8
8
|
export const SignInvoiceOutputFromJson = (obj: any): SignInvoiceOutput => {
|
|
9
9
|
return {
|
|
10
10
|
invoiceId: obj["sign_invoice_output_invoice"].id,
|
|
11
11
|
} as SignInvoiceOutput;
|
|
12
12
|
};
|
|
13
|
+
export const SignInvoiceOutputToJson = (obj: SignInvoiceOutput): any => {
|
|
14
|
+
return {
|
|
15
|
+
sign_invoice_output_invoice: { id: obj.invoiceId },
|
|
16
|
+
};
|
|
17
|
+
};
|
|
13
18
|
|
|
14
19
|
export const FRAGMENT = `
|
|
15
20
|
fragment SignInvoiceOutputFragment on SignInvoiceOutput {
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
import type IdAndSignature from "./IdAndSignature.js";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
IdAndSignatureFromJson,
|
|
6
|
+
IdAndSignatureToJson,
|
|
7
|
+
} from "./IdAndSignature.js";
|
|
5
8
|
|
|
6
|
-
|
|
9
|
+
interface SignMessagesInput {
|
|
7
10
|
/** The list of the message ids and signatures. **/
|
|
8
11
|
signatures: IdAndSignature[];
|
|
9
|
-
}
|
|
12
|
+
}
|
|
10
13
|
|
|
11
14
|
export const SignMessagesInputFromJson = (obj: any): SignMessagesInput => {
|
|
12
15
|
return {
|
|
@@ -15,5 +18,12 @@ export const SignMessagesInputFromJson = (obj: any): SignMessagesInput => {
|
|
|
15
18
|
),
|
|
16
19
|
} as SignMessagesInput;
|
|
17
20
|
};
|
|
21
|
+
export const SignMessagesInputToJson = (obj: SignMessagesInput): any => {
|
|
22
|
+
return {
|
|
23
|
+
sign_messages_input_signatures: obj.signatures.map((e) =>
|
|
24
|
+
IdAndSignatureToJson(e),
|
|
25
|
+
),
|
|
26
|
+
};
|
|
27
|
+
};
|
|
18
28
|
|
|
19
29
|
export default SignMessagesInput;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
import type SignablePayload from "./SignablePayload.js";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
SignablePayloadFromJson,
|
|
6
|
+
SignablePayloadToJson,
|
|
7
|
+
} from "./SignablePayload.js";
|
|
5
8
|
|
|
6
|
-
|
|
9
|
+
interface SignMessagesOutput {
|
|
7
10
|
/** The list of signed payloads. **/
|
|
8
11
|
signedPayloads: SignablePayload[];
|
|
9
|
-
}
|
|
12
|
+
}
|
|
10
13
|
|
|
11
14
|
export const SignMessagesOutputFromJson = (obj: any): SignMessagesOutput => {
|
|
12
15
|
return {
|
|
@@ -15,6 +18,13 @@ export const SignMessagesOutputFromJson = (obj: any): SignMessagesOutput => {
|
|
|
15
18
|
),
|
|
16
19
|
} as SignMessagesOutput;
|
|
17
20
|
};
|
|
21
|
+
export const SignMessagesOutputToJson = (obj: SignMessagesOutput): any => {
|
|
22
|
+
return {
|
|
23
|
+
sign_messages_output_signed_payloads: obj.signedPayloads.map((e) =>
|
|
24
|
+
SignablePayloadToJson(e),
|
|
25
|
+
),
|
|
26
|
+
};
|
|
27
|
+
};
|
|
18
28
|
|
|
19
29
|
export const FRAGMENT = `
|
|
20
30
|
fragment SignMessagesOutputFragment on SignMessagesOutput {
|
package/src/objects/Signable.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
import { type Query } from "@lightsparkdev/core";
|
|
4
|
-
import type Entity from "./Entity.js";
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
interface Signable {
|
|
7
6
|
/**
|
|
8
7
|
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
9
8
|
* string.
|
|
@@ -18,7 +17,7 @@ type Signable = Entity & {
|
|
|
18
17
|
|
|
19
18
|
/** The typename of the object **/
|
|
20
19
|
typename: string;
|
|
21
|
-
}
|
|
20
|
+
}
|
|
22
21
|
|
|
23
22
|
export const SignableFromJson = (obj: any): Signable => {
|
|
24
23
|
return {
|
|
@@ -28,6 +27,14 @@ export const SignableFromJson = (obj: any): Signable => {
|
|
|
28
27
|
typename: "Signable",
|
|
29
28
|
} as Signable;
|
|
30
29
|
};
|
|
30
|
+
export const SignableToJson = (obj: Signable): any => {
|
|
31
|
+
return {
|
|
32
|
+
__typename: "Signable",
|
|
33
|
+
signable_id: obj.id,
|
|
34
|
+
signable_created_at: obj.createdAt,
|
|
35
|
+
signable_updated_at: obj.updatedAt,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
31
38
|
|
|
32
39
|
export const FRAGMENT = `
|
|
33
40
|
fragment SignableFragment on Signable {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
import { type Query } from "@lightsparkdev/core";
|
|
4
|
-
import type Entity from "./Entity.js";
|
|
5
4
|
import SignablePayloadStatus from "./SignablePayloadStatus.js";
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
interface SignablePayload {
|
|
8
7
|
/**
|
|
9
8
|
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
10
9
|
* string.
|
|
@@ -33,11 +32,11 @@ type SignablePayload = Entity & {
|
|
|
33
32
|
typename: string;
|
|
34
33
|
|
|
35
34
|
/** The tweak value to add. **/
|
|
36
|
-
addTweak?: string;
|
|
35
|
+
addTweak?: string | undefined;
|
|
37
36
|
|
|
38
37
|
/** The tweak value to multiply. **/
|
|
39
|
-
mulTweak?: string;
|
|
40
|
-
}
|
|
38
|
+
mulTweak?: string | undefined;
|
|
39
|
+
}
|
|
41
40
|
|
|
42
41
|
export const SignablePayloadFromJson = (obj: any): SignablePayload => {
|
|
43
42
|
return {
|
|
@@ -55,6 +54,20 @@ export const SignablePayloadFromJson = (obj: any): SignablePayload => {
|
|
|
55
54
|
mulTweak: obj["signable_payload_mul_tweak"],
|
|
56
55
|
} as SignablePayload;
|
|
57
56
|
};
|
|
57
|
+
export const SignablePayloadToJson = (obj: SignablePayload): any => {
|
|
58
|
+
return {
|
|
59
|
+
__typename: "SignablePayload",
|
|
60
|
+
signable_payload_id: obj.id,
|
|
61
|
+
signable_payload_created_at: obj.createdAt,
|
|
62
|
+
signable_payload_updated_at: obj.updatedAt,
|
|
63
|
+
signable_payload_payload: obj.payload,
|
|
64
|
+
signable_payload_derivation_path: obj.derivationPath,
|
|
65
|
+
signable_payload_status: obj.status,
|
|
66
|
+
signable_payload_add_tweak: obj.addTweak,
|
|
67
|
+
signable_payload_mul_tweak: obj.mulTweak,
|
|
68
|
+
signable_payload_signable: { id: obj.signableId },
|
|
69
|
+
};
|
|
70
|
+
};
|
|
58
71
|
|
|
59
72
|
export const FRAGMENT = `
|
|
60
73
|
fragment SignablePayloadFragment on SignablePayload {
|