@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.
Files changed (123) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{chunk-7UNNCH5S.js → chunk-VTPDR6P4.js} +1270 -342
  3. package/dist/{index-5235e43b.d.ts → index-f040db9f.d.ts} +707 -407
  4. package/dist/index.cjs +1247 -319
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.js +7 -7
  7. package/dist/objects/index.cjs +1180 -306
  8. package/dist/objects/index.d.ts +1 -1
  9. package/dist/objects/index.js +5 -5
  10. package/package.json +2 -2
  11. package/src/objects/Account.ts +175 -2
  12. package/src/objects/AccountToApiTokensConnection.ts +16 -5
  13. package/src/objects/AccountToChannelsConnection.ts +9 -0
  14. package/src/objects/AccountToNodesConnection.ts +19 -5
  15. package/src/objects/AccountToPaymentRequestsConnection.ts +21 -5
  16. package/src/objects/AccountToTransactionsConnection.ts +33 -9
  17. package/src/objects/AccountToWalletsConnection.ts +13 -4
  18. package/src/objects/ApiToken.ts +13 -3
  19. package/src/objects/Balances.ts +17 -3
  20. package/src/objects/BlockchainBalance.ts +34 -9
  21. package/src/objects/Channel.ts +61 -16
  22. package/src/objects/ChannelClosingTransaction.ts +81 -61
  23. package/src/objects/ChannelFees.ts +16 -5
  24. package/src/objects/ChannelOpeningTransaction.ts +81 -61
  25. package/src/objects/ChannelSnapshot.ts +66 -6
  26. package/src/objects/ChannelToTransactionsConnection.ts +26 -6
  27. package/src/objects/Connection.ts +205 -10
  28. package/src/objects/CreateApiTokenInput.ts +8 -2
  29. package/src/objects/CreateApiTokenOutput.ts +9 -3
  30. package/src/objects/CreateInvoiceInput.ts +14 -5
  31. package/src/objects/CreateInvoiceOutput.ts +7 -2
  32. package/src/objects/CreateLnurlInvoiceInput.ts +13 -3
  33. package/src/objects/CreateNodeWalletAddressInput.ts +9 -2
  34. package/src/objects/CreateNodeWalletAddressOutput.ts +10 -2
  35. package/src/objects/CreateTestModeInvoiceInput.ts +14 -4
  36. package/src/objects/CreateTestModeInvoiceOutput.ts +10 -2
  37. package/src/objects/CreateTestModePaymentInput.ts +12 -3
  38. package/src/objects/CreateTestModePaymentoutput.ts +12 -2
  39. package/src/objects/CreateUmaInvoiceInput.ts +13 -3
  40. package/src/objects/CurrencyAmount.ts +13 -2
  41. package/src/objects/DeclineToSignMessagesInput.ts +9 -2
  42. package/src/objects/DeclineToSignMessagesOutput.ts +15 -3
  43. package/src/objects/DeleteApiTokenInput.ts +7 -2
  44. package/src/objects/DeleteApiTokenOutput.ts +7 -2
  45. package/src/objects/Deposit.ts +77 -61
  46. package/src/objects/Entity.ts +184 -2
  47. package/src/objects/FeeEstimate.ts +12 -3
  48. package/src/objects/FundNodeInput.ts +9 -3
  49. package/src/objects/FundNodeOutput.ts +11 -3
  50. package/src/objects/GraphNode.ts +21 -5
  51. package/src/objects/Hop.ts +27 -9
  52. package/src/objects/HtlcAttemptFailureCode.ts +2 -0
  53. package/src/objects/IdAndSignature.ts +8 -2
  54. package/src/objects/IncomingPayment.ts +33 -7
  55. package/src/objects/IncomingPaymentAttempt.ts +21 -5
  56. package/src/objects/IncomingPaymentToAttemptsConnection.ts +21 -5
  57. package/src/objects/Invoice.ts +91 -24
  58. package/src/objects/InvoiceData.ts +75 -6
  59. package/src/objects/LightningFeeEstimateForInvoiceInput.ts +13 -3
  60. package/src/objects/LightningFeeEstimateForNodeInput.ts +12 -2
  61. package/src/objects/LightningFeeEstimateOutput.ts +15 -3
  62. package/src/objects/LightningTransaction.ts +171 -28
  63. package/src/objects/LightsparkNode.ts +311 -208
  64. package/src/objects/LightsparkNodeOwner.ts +35 -4
  65. package/src/objects/LightsparkNodeToChannelsConnection.ts +17 -4
  66. package/src/objects/LightsparkNodeWithOSK.ts +97 -15
  67. package/src/objects/LightsparkNodeWithRemoteSigning.ts +93 -13
  68. package/src/objects/Node.ts +269 -67
  69. package/src/objects/NodeAddress.ts +8 -2
  70. package/src/objects/NodeToAddressesConnection.ts +13 -3
  71. package/src/objects/OnChainTransaction.ts +156 -44
  72. package/src/objects/OutgoingPayment.ts +127 -14
  73. package/src/objects/OutgoingPaymentAttempt.ts +57 -8
  74. package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +18 -5
  75. package/src/objects/OutgoingPaymentToAttemptsConnection.ts +17 -4
  76. package/src/objects/OutgoingPaymentsForInvoiceQueryInput.ts +12 -3
  77. package/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts +11 -2
  78. package/src/objects/PageInfo.ts +14 -6
  79. package/src/objects/PayInvoiceInput.ts +12 -3
  80. package/src/objects/PayInvoiceOutput.ts +7 -2
  81. package/src/objects/PayUmaInvoiceInput.ts +12 -3
  82. package/src/objects/PaymentRequest.ts +81 -5
  83. package/src/objects/PaymentRequestData.ts +81 -4
  84. package/src/objects/PostTransactionData.ts +12 -3
  85. package/src/objects/RegisterPaymentInput.ts +10 -2
  86. package/src/objects/RegisterPaymentOutput.ts +9 -2
  87. package/src/objects/ReleaseChannelPerCommitmentSecretInput.ts +13 -2
  88. package/src/objects/ReleaseChannelPerCommitmentSecretOutput.ts +9 -2
  89. package/src/objects/ReleasePaymentPreimageInput.ts +10 -2
  90. package/src/objects/ReleasePaymentPreimageOutput.ts +9 -2
  91. package/src/objects/RequestWithdrawalInput.ts +12 -2
  92. package/src/objects/RequestWithdrawalOutput.ts +9 -2
  93. package/src/objects/RichText.ts +7 -2
  94. package/src/objects/RoutingTransaction.ts +62 -41
  95. package/src/objects/ScreenNodeInput.ts +8 -2
  96. package/src/objects/ScreenNodeOutput.ts +7 -2
  97. package/src/objects/Secret.ts +8 -2
  98. package/src/objects/SendPaymentInput.ts +11 -2
  99. package/src/objects/SendPaymentOutput.ts +7 -2
  100. package/src/objects/SetInvoicePaymentHashInput.ts +12 -3
  101. package/src/objects/SetInvoicePaymentHashOutput.ts +9 -2
  102. package/src/objects/SignInvoiceInput.ts +9 -2
  103. package/src/objects/SignInvoiceOutput.ts +7 -2
  104. package/src/objects/SignMessagesInput.ts +13 -3
  105. package/src/objects/SignMessagesOutput.ts +13 -3
  106. package/src/objects/Signable.ts +10 -3
  107. package/src/objects/SignablePayload.ts +18 -5
  108. package/src/objects/Transaction.ts +260 -9
  109. package/src/objects/TransactionFailures.ts +11 -4
  110. package/src/objects/UpdateChannelPerCommitmentPointInput.ts +13 -2
  111. package/src/objects/UpdateChannelPerCommitmentPointOutput.ts +9 -2
  112. package/src/objects/UpdateNodeSharedSecretInput.ts +10 -2
  113. package/src/objects/UpdateNodeSharedSecretOutput.ts +9 -2
  114. package/src/objects/Wallet.ts +130 -5
  115. package/src/objects/WalletToPaymentRequestsConnection.ts +21 -5
  116. package/src/objects/WalletToTransactionsConnection.ts +16 -5
  117. package/src/objects/Withdrawal.ts +77 -61
  118. package/src/objects/WithdrawalRequest.ts +25 -4
  119. package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +19 -4
  120. package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +19 -4
  121. package/src/objects/index.ts +5 -2
  122. package/src/tests/integration/client.test.ts +46 -7
  123. package/src/tests/serialization.test.ts +18 -0
@@ -1,14 +1,19 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- type RichText = {
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 { CurrencyAmountFromJson } from "./CurrencyAmount.js";
6
- import type Entity from "./Entity.js";
7
- import type LightningTransaction from "./LightningTransaction.js";
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
- type RoutingTransaction = LightningTransaction &
16
- Transaction &
17
- Entity & {
18
- /**
19
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
20
- * string.
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
- /** The date and time when this transaction was initiated. **/
25
- createdAt: string;
22
+ /** The date and time when this transaction was initiated. **/
23
+ createdAt: string;
26
24
 
27
- /** The date and time when the entity was last updated. **/
28
- updatedAt: string;
25
+ /** The date and time when the entity was last updated. **/
26
+ updatedAt: string;
29
27
 
30
- /** The current status of this transaction. **/
31
- status: TransactionStatus;
28
+ /** The current status of this transaction. **/
29
+ status: TransactionStatus;
32
30
 
33
- /** The amount of money involved in this transaction. **/
34
- amount: CurrencyAmount;
31
+ /** The amount of money involved in this transaction. **/
32
+ amount: CurrencyAmount;
35
33
 
36
- /** The typename of the object **/
37
- typename: string;
34
+ /** The typename of the object **/
35
+ typename: string;
38
36
 
39
- /** The date and time when this transaction was completed or failed. **/
40
- resolvedAt?: string;
37
+ /** The date and time when this transaction was completed or failed. **/
38
+ resolvedAt?: string | undefined;
41
39
 
42
- /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
43
- transactionHash?: string;
40
+ /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
41
+ transactionHash?: string | undefined;
44
42
 
45
- /** If known, the channel this transaction was received from. **/
46
- incomingChannelId?: string;
43
+ /** If known, the channel this transaction was received from. **/
44
+ incomingChannelId?: string | undefined;
47
45
 
48
- /** If known, the channel this transaction was forwarded to. **/
49
- outgoingChannelId?: string;
46
+ /** If known, the channel this transaction was forwarded to. **/
47
+ outgoingChannelId?: string | undefined;
50
48
 
51
- /**
52
- * The fees collected by the node when routing this transaction. We subtract the outgoing amount to
53
- * the incoming amount to determine how much fees were collected.
54
- **/
55
- fees?: CurrencyAmount;
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
- /** If applicable, user-facing error message describing why the routing failed. **/
58
- failureMessage?: RichText;
55
+ /** If applicable, user-facing error message describing why the routing failed. **/
56
+ failureMessage?: RichText | undefined;
59
57
 
60
- /** If applicable, the reason why the routing failed. **/
61
- failureReason?: RoutingTransactionFailureReason;
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
- type ScreenNodeInput = {
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
- type ScreenNodeOutput = {
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 {
@@ -1,10 +1,10 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- type Secret = {
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
- type SendPaymentInput = {
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
- type SendPaymentOutput = {
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
- type SetInvoicePaymentHashInput = {
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
- type SetInvoicePaymentHashOutput = {
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
- type SignInvoiceInput = {
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
- type SignInvoiceOutput = {
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 { IdAndSignatureFromJson } from "./IdAndSignature.js";
4
+ import {
5
+ IdAndSignatureFromJson,
6
+ IdAndSignatureToJson,
7
+ } from "./IdAndSignature.js";
5
8
 
6
- type SignMessagesInput = {
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 { SignablePayloadFromJson } from "./SignablePayload.js";
4
+ import {
5
+ SignablePayloadFromJson,
6
+ SignablePayloadToJson,
7
+ } from "./SignablePayload.js";
5
8
 
6
- type SignMessagesOutput = {
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 {
@@ -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
- type Signable = Entity & {
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
- type SignablePayload = Entity & {
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 {