@buildonspark/spark-sdk 0.0.15 → 0.0.16

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 (131) hide show
  1. package/dist/services/wallet-config.d.ts +1 -0
  2. package/dist/services/wallet-config.js +1 -0
  3. package/dist/services/wallet-config.js.map +1 -1
  4. package/dist/spark-sdk.d.ts +1 -1
  5. package/dist/spark-sdk.js +3 -3
  6. package/dist/spark-sdk.js.map +1 -1
  7. package/package.json +4 -3
  8. package/src/examples/example.js +247 -0
  9. package/src/examples/example.ts +207 -0
  10. package/src/graphql/client.ts +282 -0
  11. package/src/graphql/mutations/CompleteCoopExit.ts +19 -0
  12. package/src/graphql/mutations/CompleteLeavesSwap.ts +17 -0
  13. package/src/graphql/mutations/RequestCoopExit.ts +20 -0
  14. package/src/graphql/mutations/RequestLightningReceive.ts +26 -0
  15. package/src/graphql/mutations/RequestLightningSend.ts +17 -0
  16. package/src/graphql/mutations/RequestSwapLeaves.ts +24 -0
  17. package/src/graphql/objects/BitcoinNetwork.ts +22 -0
  18. package/src/graphql/objects/CompleteCoopExitInput.ts +41 -0
  19. package/src/graphql/objects/CompleteCoopExitOutput.ts +45 -0
  20. package/src/graphql/objects/CompleteLeavesSwapInput.ts +45 -0
  21. package/src/graphql/objects/CompleteLeavesSwapOutput.ts +45 -0
  22. package/src/graphql/objects/CompleteSeedReleaseInput.ts +41 -0
  23. package/src/graphql/objects/CompleteSeedReleaseOutput.ts +43 -0
  24. package/src/graphql/objects/Connection.ts +90 -0
  25. package/src/graphql/objects/CoopExitFeeEstimateInput.ts +41 -0
  26. package/src/graphql/objects/CoopExitFeeEstimateOutput.ts +52 -0
  27. package/src/graphql/objects/CoopExitRequest.ts +118 -0
  28. package/src/graphql/objects/CurrencyAmount.ts +74 -0
  29. package/src/graphql/objects/CurrencyUnit.ts +32 -0
  30. package/src/graphql/objects/Entity.ts +202 -0
  31. package/src/graphql/objects/GetChallengeInput.ts +37 -0
  32. package/src/graphql/objects/GetChallengeOutput.ts +43 -0
  33. package/src/graphql/objects/Invoice.ts +83 -0
  34. package/src/graphql/objects/Leaf.ts +59 -0
  35. package/src/graphql/objects/LeavesSwapFeeEstimateInput.ts +37 -0
  36. package/src/graphql/objects/LeavesSwapFeeEstimateOutput.ts +52 -0
  37. package/src/graphql/objects/LeavesSwapRequest.ts +192 -0
  38. package/src/graphql/objects/LightningReceiveFeeEstimateInput.ts +41 -0
  39. package/src/graphql/objects/LightningReceiveFeeEstimateOutput.ts +52 -0
  40. package/src/graphql/objects/LightningReceiveRequest.ts +147 -0
  41. package/src/graphql/objects/LightningReceiveRequestStatus.ts +34 -0
  42. package/src/graphql/objects/LightningSendFeeEstimateInput.ts +37 -0
  43. package/src/graphql/objects/LightningSendFeeEstimateOutput.ts +52 -0
  44. package/src/graphql/objects/LightningSendRequest.ts +134 -0
  45. package/src/graphql/objects/LightningSendRequestStatus.ts +28 -0
  46. package/src/graphql/objects/NotifyReceiverTransferInput.ts +41 -0
  47. package/src/graphql/objects/PageInfo.ts +58 -0
  48. package/src/graphql/objects/Provider.ts +41 -0
  49. package/src/graphql/objects/RequestCoopExitInput.ts +41 -0
  50. package/src/graphql/objects/RequestCoopExitOutput.ts +45 -0
  51. package/src/graphql/objects/RequestLeavesSwapInput.ts +55 -0
  52. package/src/graphql/objects/RequestLeavesSwapOutput.ts +45 -0
  53. package/src/graphql/objects/RequestLightningReceiveInput.ts +58 -0
  54. package/src/graphql/objects/RequestLightningReceiveOutput.ts +45 -0
  55. package/src/graphql/objects/RequestLightningSendInput.ts +41 -0
  56. package/src/graphql/objects/RequestLightningSendOutput.ts +45 -0
  57. package/src/graphql/objects/SparkCoopExitRequestStatus.ts +20 -0
  58. package/src/graphql/objects/SparkLeavesSwapRequestStatus.ts +20 -0
  59. package/src/graphql/objects/SparkTransferToLeavesConnection.ts +79 -0
  60. package/src/graphql/objects/SparkWalletUser.ts +86 -0
  61. package/src/graphql/objects/StartSeedReleaseInput.ts +37 -0
  62. package/src/graphql/objects/SwapLeaf.ts +53 -0
  63. package/src/graphql/objects/Transfer.ts +98 -0
  64. package/src/graphql/objects/UserLeafInput.ts +28 -0
  65. package/src/graphql/objects/VerifyChallengeInput.ts +51 -0
  66. package/src/graphql/objects/VerifyChallengeOutput.ts +43 -0
  67. package/src/graphql/objects/WalletUserIdentityPublicKeyInput.ts +37 -0
  68. package/src/graphql/objects/WalletUserIdentityPublicKeyOutput.ts +43 -0
  69. package/src/graphql/objects/index.ts +67 -0
  70. package/src/graphql/queries/CoopExitFeeEstimate.ts +18 -0
  71. package/src/graphql/queries/CurrentUser.ts +10 -0
  72. package/src/graphql/queries/LightningReceiveFeeEstimate.ts +18 -0
  73. package/src/graphql/queries/LightningSendFeeEstimate.ts +16 -0
  74. package/src/proto/common.ts +431 -0
  75. package/src/proto/google/protobuf/descriptor.ts +6625 -0
  76. package/src/proto/google/protobuf/duration.ts +197 -0
  77. package/src/proto/google/protobuf/empty.ts +83 -0
  78. package/src/proto/google/protobuf/timestamp.ts +226 -0
  79. package/src/proto/mock.ts +151 -0
  80. package/src/proto/spark.ts +12727 -0
  81. package/src/proto/spark_authn.ts +673 -0
  82. package/src/proto/validate/validate.ts +6047 -0
  83. package/src/services/config.ts +71 -0
  84. package/src/services/connection.ts +264 -0
  85. package/src/services/coop-exit.ts +190 -0
  86. package/src/services/deposit.ts +327 -0
  87. package/src/services/lightning.ts +341 -0
  88. package/src/services/lrc20.ts +42 -0
  89. package/src/services/token-transactions.ts +499 -0
  90. package/src/services/transfer.ts +1188 -0
  91. package/src/services/tree-creation.ts +618 -0
  92. package/src/services/wallet-config.ts +141 -0
  93. package/src/signer/signer.ts +531 -0
  94. package/src/spark-sdk.ts +1644 -0
  95. package/src/tests/adaptor-signature.test.ts +64 -0
  96. package/src/tests/bitcoin.test.ts +122 -0
  97. package/src/tests/coop-exit.test.ts +233 -0
  98. package/src/tests/deposit.test.ts +98 -0
  99. package/src/tests/keys.test.ts +82 -0
  100. package/src/tests/lightning.test.ts +307 -0
  101. package/src/tests/secret-sharing.test.ts +63 -0
  102. package/src/tests/swap.test.ts +252 -0
  103. package/src/tests/test-util.ts +92 -0
  104. package/src/tests/tokens.test.ts +47 -0
  105. package/src/tests/transfer.test.ts +371 -0
  106. package/src/tests/tree-creation.test.ts +56 -0
  107. package/src/tests/utils/spark-testing-wallet.ts +37 -0
  108. package/src/tests/utils/test-faucet.ts +257 -0
  109. package/src/types/grpc.ts +8 -0
  110. package/src/types/index.ts +3 -0
  111. package/src/utils/adaptor-signature.ts +189 -0
  112. package/src/utils/bitcoin.ts +138 -0
  113. package/src/utils/crypto.ts +14 -0
  114. package/src/utils/index.ts +12 -0
  115. package/src/utils/keys.ts +92 -0
  116. package/src/utils/mempool.ts +42 -0
  117. package/src/utils/network.ts +70 -0
  118. package/src/utils/proof.ts +17 -0
  119. package/src/utils/response-validation.ts +26 -0
  120. package/src/utils/secret-sharing.ts +263 -0
  121. package/src/utils/signing.ts +96 -0
  122. package/src/utils/token-hashing.ts +163 -0
  123. package/src/utils/token-keyshares.ts +31 -0
  124. package/src/utils/token-transactions.ts +71 -0
  125. package/src/utils/transaction.ts +45 -0
  126. package/src/utils/wasm-wrapper.ts +57 -0
  127. package/src/utils/wasm.ts +154 -0
  128. package/src/wasm/spark_bindings.d.ts +208 -0
  129. package/src/wasm/spark_bindings.js +1161 -0
  130. package/src/wasm/spark_bindings_bg.wasm +0 -0
  131. package/src/wasm/spark_bindings_bg.wasm.d.ts +136 -0
@@ -0,0 +1,28 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+ export enum LightningSendRequestStatus {
6
+ /**
7
+ * This is an enum value that represents values that could be added in the future.
8
+ * Clients should support unknown values as more of them could be added without notice.
9
+ */
10
+ FUTURE_VALUE = "FUTURE_VALUE",
11
+
12
+ CREATED = "CREATED",
13
+
14
+ REQUEST_VALIDATED = "REQUEST_VALIDATED",
15
+
16
+ LIGHTNING_PAYMENT_INITIATED = "LIGHTNING_PAYMENT_INITIATED",
17
+
18
+ LIGHTNING_PAYMENT_FAILED = "LIGHTNING_PAYMENT_FAILED",
19
+
20
+ LIGHTNING_PAYMENT_SUCCEEDED = "LIGHTNING_PAYMENT_SUCCEEDED",
21
+
22
+ PREIMAGE_PROVIDED = "PREIMAGE_PROVIDED",
23
+
24
+ TRANSFER_COMPLETED = "TRANSFER_COMPLETED",
25
+
26
+ }
27
+
28
+ export default LightningSendRequestStatus;
@@ -0,0 +1,41 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+
6
+
7
+
8
+ interface NotifyReceiverTransferInput {
9
+
10
+
11
+ phoneNumber: string;
12
+
13
+ amountSats: number;
14
+
15
+
16
+
17
+
18
+ }
19
+
20
+ export const NotifyReceiverTransferInputFromJson = (obj: any): NotifyReceiverTransferInput => {
21
+ return {
22
+ phoneNumber: obj["notify_receiver_transfer_input_phone_number"],
23
+ amountSats: obj["notify_receiver_transfer_input_amount_sats"],
24
+
25
+ } as NotifyReceiverTransferInput;
26
+
27
+ }
28
+ export const NotifyReceiverTransferInputToJson = (obj: NotifyReceiverTransferInput): any => {
29
+ return {
30
+ notify_receiver_transfer_input_phone_number: obj.phoneNumber,
31
+ notify_receiver_transfer_input_amount_sats: obj.amountSats,
32
+
33
+ }
34
+
35
+ }
36
+
37
+
38
+
39
+
40
+
41
+ export default NotifyReceiverTransferInput;
@@ -0,0 +1,58 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+
6
+
7
+ /** This is an object representing information about a page returned by the Lightspark API. For more information, please see the “Pagination” section of our API docs for more information about its usage. **/
8
+ interface PageInfo {
9
+
10
+
11
+ hasNextPage?: boolean | undefined;
12
+
13
+ hasPreviousPage?: boolean | undefined;
14
+
15
+ startCursor?: string | undefined;
16
+
17
+ endCursor?: string | undefined;
18
+
19
+
20
+
21
+
22
+ }
23
+
24
+ export const PageInfoFromJson = (obj: any): PageInfo => {
25
+ return {
26
+ hasNextPage: obj["page_info_has_next_page"],
27
+ hasPreviousPage: obj["page_info_has_previous_page"],
28
+ startCursor: obj["page_info_start_cursor"],
29
+ endCursor: obj["page_info_end_cursor"],
30
+
31
+ } as PageInfo;
32
+
33
+ }
34
+ export const PageInfoToJson = (obj: PageInfo): any => {
35
+ return {
36
+ page_info_has_next_page: obj.hasNextPage,
37
+ page_info_has_previous_page: obj.hasPreviousPage,
38
+ page_info_start_cursor: obj.startCursor,
39
+ page_info_end_cursor: obj.endCursor,
40
+
41
+ }
42
+
43
+ }
44
+
45
+
46
+ export const FRAGMENT = `
47
+ fragment PageInfoFragment on PageInfo {
48
+ __typename
49
+ page_info_has_next_page: has_next_page
50
+ page_info_has_previous_page: has_previous_page
51
+ page_info_start_cursor: start_cursor
52
+ page_info_end_cursor: end_cursor
53
+ }`;
54
+
55
+
56
+
57
+
58
+ export default PageInfo;
@@ -0,0 +1,41 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+
6
+
7
+
8
+ interface Provider {
9
+
10
+
11
+ accountId: string;
12
+
13
+ jwt: string;
14
+
15
+
16
+
17
+
18
+ }
19
+
20
+ export const ProviderFromJson = (obj: any): Provider => {
21
+ return {
22
+ accountId: obj["provider_account_id"],
23
+ jwt: obj["provider_jwt"],
24
+
25
+ } as Provider;
26
+
27
+ }
28
+ export const ProviderToJson = (obj: Provider): any => {
29
+ return {
30
+ provider_account_id: obj.accountId,
31
+ provider_jwt: obj.jwt,
32
+
33
+ }
34
+
35
+ }
36
+
37
+
38
+
39
+
40
+
41
+ export default Provider;
@@ -0,0 +1,41 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+
6
+
7
+
8
+ interface RequestCoopExitInput {
9
+
10
+
11
+ leafExternalIds: string[];
12
+
13
+ withdrawalAddress: string;
14
+
15
+
16
+
17
+
18
+ }
19
+
20
+ export const RequestCoopExitInputFromJson = (obj: any): RequestCoopExitInput => {
21
+ return {
22
+ leafExternalIds: obj["request_coop_exit_input_leaf_external_ids"],
23
+ withdrawalAddress: obj["request_coop_exit_input_withdrawal_address"],
24
+
25
+ } as RequestCoopExitInput;
26
+
27
+ }
28
+ export const RequestCoopExitInputToJson = (obj: RequestCoopExitInput): any => {
29
+ return {
30
+ request_coop_exit_input_leaf_external_ids: obj.leafExternalIds,
31
+ request_coop_exit_input_withdrawal_address: obj.withdrawalAddress,
32
+
33
+ }
34
+
35
+ }
36
+
37
+
38
+
39
+
40
+
41
+ export default RequestCoopExitInput;
@@ -0,0 +1,45 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+
6
+
7
+
8
+ interface RequestCoopExitOutput {
9
+
10
+
11
+ requestId: string;
12
+
13
+
14
+
15
+
16
+ }
17
+
18
+ export const RequestCoopExitOutputFromJson = (obj: any): RequestCoopExitOutput => {
19
+ return {
20
+ requestId: obj["request_coop_exit_output_request"].id,
21
+
22
+ } as RequestCoopExitOutput;
23
+
24
+ }
25
+ export const RequestCoopExitOutputToJson = (obj: RequestCoopExitOutput): any => {
26
+ return {
27
+ request_coop_exit_output_request: { id: obj.requestId },
28
+
29
+ }
30
+
31
+ }
32
+
33
+
34
+ export const FRAGMENT = `
35
+ fragment RequestCoopExitOutputFragment on RequestCoopExitOutput {
36
+ __typename
37
+ request_coop_exit_output_request: request {
38
+ id
39
+ }
40
+ }`;
41
+
42
+
43
+
44
+
45
+ export default RequestCoopExitOutput;
@@ -0,0 +1,55 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+ import {UserLeafInputFromJson} from './UserLeafInput.js';
6
+ import UserLeafInput from './UserLeafInput.js';
7
+ import {UserLeafInputToJson} from './UserLeafInput.js';
8
+
9
+
10
+ interface RequestLeavesSwapInput {
11
+
12
+
13
+ adaptorPubkey: string;
14
+
15
+ totalAmountSats: number;
16
+
17
+ targetAmountSats: number;
18
+
19
+ feeSats: number;
20
+
21
+ userLeaves: UserLeafInput[];
22
+
23
+
24
+
25
+
26
+ }
27
+
28
+ export const RequestLeavesSwapInputFromJson = (obj: any): RequestLeavesSwapInput => {
29
+ return {
30
+ adaptorPubkey: obj["request_leaves_swap_input_adaptor_pubkey"],
31
+ totalAmountSats: obj["request_leaves_swap_input_total_amount_sats"],
32
+ targetAmountSats: obj["request_leaves_swap_input_target_amount_sats"],
33
+ feeSats: obj["request_leaves_swap_input_fee_sats"],
34
+ userLeaves: obj["request_leaves_swap_input_user_leaves"].map((e) => UserLeafInputFromJson(e)),
35
+
36
+ } as RequestLeavesSwapInput;
37
+
38
+ }
39
+ export const RequestLeavesSwapInputToJson = (obj: RequestLeavesSwapInput): any => {
40
+ return {
41
+ request_leaves_swap_input_adaptor_pubkey: obj.adaptorPubkey,
42
+ request_leaves_swap_input_total_amount_sats: obj.totalAmountSats,
43
+ request_leaves_swap_input_target_amount_sats: obj.targetAmountSats,
44
+ request_leaves_swap_input_fee_sats: obj.feeSats,
45
+ request_leaves_swap_input_user_leaves: obj.userLeaves.map((e) => UserLeafInputToJson(e)),
46
+
47
+ }
48
+
49
+ }
50
+
51
+
52
+
53
+
54
+
55
+ export default RequestLeavesSwapInput;
@@ -0,0 +1,45 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+
6
+
7
+
8
+ interface RequestLeavesSwapOutput {
9
+
10
+
11
+ requestId: string;
12
+
13
+
14
+
15
+
16
+ }
17
+
18
+ export const RequestLeavesSwapOutputFromJson = (obj: any): RequestLeavesSwapOutput => {
19
+ return {
20
+ requestId: obj["request_leaves_swap_output_request"].id,
21
+
22
+ } as RequestLeavesSwapOutput;
23
+
24
+ }
25
+ export const RequestLeavesSwapOutputToJson = (obj: RequestLeavesSwapOutput): any => {
26
+ return {
27
+ request_leaves_swap_output_request: { id: obj.requestId },
28
+
29
+ }
30
+
31
+ }
32
+
33
+
34
+ export const FRAGMENT = `
35
+ fragment RequestLeavesSwapOutputFragment on RequestLeavesSwapOutput {
36
+ __typename
37
+ request_leaves_swap_output_request: request {
38
+ id
39
+ }
40
+ }`;
41
+
42
+
43
+
44
+
45
+ export default RequestLeavesSwapOutput;
@@ -0,0 +1,58 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+ import BitcoinNetwork from './BitcoinNetwork.js';
6
+
7
+
8
+ interface RequestLightningReceiveInput {
9
+
10
+
11
+ /** The bitcoin network the lightning invoice is created on. **/
12
+ network: BitcoinNetwork;
13
+
14
+ /** The amount for which the lightning invoice should be created in satoshis. **/
15
+ amountSats: number;
16
+
17
+ /** The 32-byte hash of the payment preimage to use when generating the lightning invoice. **/
18
+ paymentHash: string;
19
+
20
+ /** The expiry of the lightning invoice in seconds. Default value is 3600 (1 hour). **/
21
+ expirySecs?: number | undefined;
22
+
23
+ /** The memo to include in the lightning invoice. **/
24
+ memo?: string | undefined;
25
+
26
+
27
+
28
+
29
+ }
30
+
31
+ export const RequestLightningReceiveInputFromJson = (obj: any): RequestLightningReceiveInput => {
32
+ return {
33
+ network: BitcoinNetwork[obj["request_lightning_receive_input_network"]] ?? BitcoinNetwork.FUTURE_VALUE,
34
+ amountSats: obj["request_lightning_receive_input_amount_sats"],
35
+ paymentHash: obj["request_lightning_receive_input_payment_hash"],
36
+ expirySecs: obj["request_lightning_receive_input_expiry_secs"],
37
+ memo: obj["request_lightning_receive_input_memo"],
38
+
39
+ } as RequestLightningReceiveInput;
40
+
41
+ }
42
+ export const RequestLightningReceiveInputToJson = (obj: RequestLightningReceiveInput): any => {
43
+ return {
44
+ request_lightning_receive_input_network: obj.network,
45
+ request_lightning_receive_input_amount_sats: obj.amountSats,
46
+ request_lightning_receive_input_payment_hash: obj.paymentHash,
47
+ request_lightning_receive_input_expiry_secs: obj.expirySecs,
48
+ request_lightning_receive_input_memo: obj.memo,
49
+
50
+ }
51
+
52
+ }
53
+
54
+
55
+
56
+
57
+
58
+ export default RequestLightningReceiveInput;
@@ -0,0 +1,45 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+
6
+
7
+
8
+ interface RequestLightningReceiveOutput {
9
+
10
+
11
+ requestId: string;
12
+
13
+
14
+
15
+
16
+ }
17
+
18
+ export const RequestLightningReceiveOutputFromJson = (obj: any): RequestLightningReceiveOutput => {
19
+ return {
20
+ requestId: obj["request_lightning_receive_output_request"].id,
21
+
22
+ } as RequestLightningReceiveOutput;
23
+
24
+ }
25
+ export const RequestLightningReceiveOutputToJson = (obj: RequestLightningReceiveOutput): any => {
26
+ return {
27
+ request_lightning_receive_output_request: { id: obj.requestId },
28
+
29
+ }
30
+
31
+ }
32
+
33
+
34
+ export const FRAGMENT = `
35
+ fragment RequestLightningReceiveOutputFragment on RequestLightningReceiveOutput {
36
+ __typename
37
+ request_lightning_receive_output_request: request {
38
+ id
39
+ }
40
+ }`;
41
+
42
+
43
+
44
+
45
+ export default RequestLightningReceiveOutput;
@@ -0,0 +1,41 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+
6
+
7
+
8
+ interface RequestLightningSendInput {
9
+
10
+
11
+ encodedInvoice: string;
12
+
13
+ idempotencyKey: string;
14
+
15
+
16
+
17
+
18
+ }
19
+
20
+ export const RequestLightningSendInputFromJson = (obj: any): RequestLightningSendInput => {
21
+ return {
22
+ encodedInvoice: obj["request_lightning_send_input_encoded_invoice"],
23
+ idempotencyKey: obj["request_lightning_send_input_idempotency_key"],
24
+
25
+ } as RequestLightningSendInput;
26
+
27
+ }
28
+ export const RequestLightningSendInputToJson = (obj: RequestLightningSendInput): any => {
29
+ return {
30
+ request_lightning_send_input_encoded_invoice: obj.encodedInvoice,
31
+ request_lightning_send_input_idempotency_key: obj.idempotencyKey,
32
+
33
+ }
34
+
35
+ }
36
+
37
+
38
+
39
+
40
+
41
+ export default RequestLightningSendInput;
@@ -0,0 +1,45 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+
6
+
7
+
8
+ interface RequestLightningSendOutput {
9
+
10
+
11
+ requestId: string;
12
+
13
+
14
+
15
+
16
+ }
17
+
18
+ export const RequestLightningSendOutputFromJson = (obj: any): RequestLightningSendOutput => {
19
+ return {
20
+ requestId: obj["request_lightning_send_output_request"].id,
21
+
22
+ } as RequestLightningSendOutput;
23
+
24
+ }
25
+ export const RequestLightningSendOutputToJson = (obj: RequestLightningSendOutput): any => {
26
+ return {
27
+ request_lightning_send_output_request: { id: obj.requestId },
28
+
29
+ }
30
+
31
+ }
32
+
33
+
34
+ export const FRAGMENT = `
35
+ fragment RequestLightningSendOutputFragment on RequestLightningSendOutput {
36
+ __typename
37
+ request_lightning_send_output_request: request {
38
+ id
39
+ }
40
+ }`;
41
+
42
+
43
+
44
+
45
+ export default RequestLightningSendOutput;
@@ -0,0 +1,20 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+ export enum SparkCoopExitRequestStatus {
6
+ /**
7
+ * This is an enum value that represents values that could be added in the future.
8
+ * Clients should support unknown values as more of them could be added without notice.
9
+ */
10
+ FUTURE_VALUE = "FUTURE_VALUE",
11
+
12
+ INITIATED = "INITIATED",
13
+
14
+ FAILED = "FAILED",
15
+
16
+ SUCCEEDED = "SUCCEEDED",
17
+
18
+ }
19
+
20
+ export default SparkCoopExitRequestStatus;
@@ -0,0 +1,20 @@
1
+
2
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
3
+
4
+
5
+ export enum SparkLeavesSwapRequestStatus {
6
+ /**
7
+ * This is an enum value that represents values that could be added in the future.
8
+ * Clients should support unknown values as more of them could be added without notice.
9
+ */
10
+ FUTURE_VALUE = "FUTURE_VALUE",
11
+
12
+ INITIATED = "INITIATED",
13
+
14
+ FAILED = "FAILED",
15
+
16
+ SUCCEEDED = "SUCCEEDED",
17
+
18
+ }
19
+
20
+ export default SparkLeavesSwapRequestStatus;
@@ -0,0 +1,79 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import Leaf from "./Leaf.js";
4
+ import { PageInfoToJson } from "./PageInfo.js";
5
+ import { LeafToJson } from "./Leaf.js";
6
+ import { PageInfoFromJson } from "./PageInfo.js";
7
+ import { LeafFromJson } from "./Leaf.js";
8
+ import PageInfo from "./PageInfo.js";
9
+
10
+ interface SparkTransferToLeavesConnection {
11
+ /**
12
+ * The total count of objects in this connection, using the current filters. It is different from the
13
+ * number of objects returned in the current page (in the `entities` field).
14
+ **/
15
+ count: number;
16
+
17
+ /** An object that holds pagination information about the objects in this connection. **/
18
+ pageInfo: PageInfo;
19
+
20
+ /** The leaves for the current page of this connection. **/
21
+ entities: Leaf[];
22
+
23
+ /** The typename of the object **/
24
+ typename: string;
25
+ }
26
+
27
+ export const SparkTransferToLeavesConnectionFromJson = (
28
+ obj: any,
29
+ ): SparkTransferToLeavesConnection => {
30
+ return {
31
+ count: obj["spark_transfer_to_leaves_connection_count"],
32
+ pageInfo: PageInfoFromJson(
33
+ obj["spark_transfer_to_leaves_connection_page_info"],
34
+ ),
35
+ entities: obj["spark_transfer_to_leaves_connection_entities"].map((e) =>
36
+ LeafFromJson(e),
37
+ ),
38
+ typename: "SparkTransferToLeavesConnection",
39
+ } as SparkTransferToLeavesConnection;
40
+ };
41
+ export const SparkTransferToLeavesConnectionToJson = (
42
+ obj: SparkTransferToLeavesConnection,
43
+ ): any => {
44
+ return {
45
+ __typename: "SparkTransferToLeavesConnection",
46
+ spark_transfer_to_leaves_connection_count: obj.count,
47
+ spark_transfer_to_leaves_connection_page_info: PageInfoToJson(obj.pageInfo),
48
+ spark_transfer_to_leaves_connection_entities: obj.entities.map((e) =>
49
+ LeafToJson(e),
50
+ ),
51
+ };
52
+ };
53
+
54
+ export const FRAGMENT = `
55
+ fragment SparkTransferToLeavesConnectionFragment on SparkTransferToLeavesConnection {
56
+ __typename
57
+ spark_transfer_to_leaves_connection_count: count
58
+ spark_transfer_to_leaves_connection_page_info: page_info {
59
+ __typename
60
+ page_info_has_next_page: has_next_page
61
+ page_info_has_previous_page: has_previous_page
62
+ page_info_start_cursor: start_cursor
63
+ page_info_end_cursor: end_cursor
64
+ }
65
+ spark_transfer_to_leaves_connection_entities: entities {
66
+ __typename
67
+ leaf_amount: amount {
68
+ __typename
69
+ currency_amount_original_value: original_value
70
+ currency_amount_original_unit: original_unit
71
+ currency_amount_preferred_currency_unit: preferred_currency_unit
72
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
73
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
74
+ }
75
+ leaf_spark_node_id: spark_node_id
76
+ }
77
+ }`;
78
+
79
+ export default SparkTransferToLeavesConnection;