@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.
- package/dist/services/wallet-config.d.ts +1 -0
- package/dist/services/wallet-config.js +1 -0
- package/dist/services/wallet-config.js.map +1 -1
- package/dist/spark-sdk.d.ts +1 -1
- package/dist/spark-sdk.js +3 -3
- package/dist/spark-sdk.js.map +1 -1
- package/package.json +4 -3
- package/src/examples/example.js +247 -0
- package/src/examples/example.ts +207 -0
- package/src/graphql/client.ts +282 -0
- package/src/graphql/mutations/CompleteCoopExit.ts +19 -0
- package/src/graphql/mutations/CompleteLeavesSwap.ts +17 -0
- package/src/graphql/mutations/RequestCoopExit.ts +20 -0
- package/src/graphql/mutations/RequestLightningReceive.ts +26 -0
- package/src/graphql/mutations/RequestLightningSend.ts +17 -0
- package/src/graphql/mutations/RequestSwapLeaves.ts +24 -0
- package/src/graphql/objects/BitcoinNetwork.ts +22 -0
- package/src/graphql/objects/CompleteCoopExitInput.ts +41 -0
- package/src/graphql/objects/CompleteCoopExitOutput.ts +45 -0
- package/src/graphql/objects/CompleteLeavesSwapInput.ts +45 -0
- package/src/graphql/objects/CompleteLeavesSwapOutput.ts +45 -0
- package/src/graphql/objects/CompleteSeedReleaseInput.ts +41 -0
- package/src/graphql/objects/CompleteSeedReleaseOutput.ts +43 -0
- package/src/graphql/objects/Connection.ts +90 -0
- package/src/graphql/objects/CoopExitFeeEstimateInput.ts +41 -0
- package/src/graphql/objects/CoopExitFeeEstimateOutput.ts +52 -0
- package/src/graphql/objects/CoopExitRequest.ts +118 -0
- package/src/graphql/objects/CurrencyAmount.ts +74 -0
- package/src/graphql/objects/CurrencyUnit.ts +32 -0
- package/src/graphql/objects/Entity.ts +202 -0
- package/src/graphql/objects/GetChallengeInput.ts +37 -0
- package/src/graphql/objects/GetChallengeOutput.ts +43 -0
- package/src/graphql/objects/Invoice.ts +83 -0
- package/src/graphql/objects/Leaf.ts +59 -0
- package/src/graphql/objects/LeavesSwapFeeEstimateInput.ts +37 -0
- package/src/graphql/objects/LeavesSwapFeeEstimateOutput.ts +52 -0
- package/src/graphql/objects/LeavesSwapRequest.ts +192 -0
- package/src/graphql/objects/LightningReceiveFeeEstimateInput.ts +41 -0
- package/src/graphql/objects/LightningReceiveFeeEstimateOutput.ts +52 -0
- package/src/graphql/objects/LightningReceiveRequest.ts +147 -0
- package/src/graphql/objects/LightningReceiveRequestStatus.ts +34 -0
- package/src/graphql/objects/LightningSendFeeEstimateInput.ts +37 -0
- package/src/graphql/objects/LightningSendFeeEstimateOutput.ts +52 -0
- package/src/graphql/objects/LightningSendRequest.ts +134 -0
- package/src/graphql/objects/LightningSendRequestStatus.ts +28 -0
- package/src/graphql/objects/NotifyReceiverTransferInput.ts +41 -0
- package/src/graphql/objects/PageInfo.ts +58 -0
- package/src/graphql/objects/Provider.ts +41 -0
- package/src/graphql/objects/RequestCoopExitInput.ts +41 -0
- package/src/graphql/objects/RequestCoopExitOutput.ts +45 -0
- package/src/graphql/objects/RequestLeavesSwapInput.ts +55 -0
- package/src/graphql/objects/RequestLeavesSwapOutput.ts +45 -0
- package/src/graphql/objects/RequestLightningReceiveInput.ts +58 -0
- package/src/graphql/objects/RequestLightningReceiveOutput.ts +45 -0
- package/src/graphql/objects/RequestLightningSendInput.ts +41 -0
- package/src/graphql/objects/RequestLightningSendOutput.ts +45 -0
- package/src/graphql/objects/SparkCoopExitRequestStatus.ts +20 -0
- package/src/graphql/objects/SparkLeavesSwapRequestStatus.ts +20 -0
- package/src/graphql/objects/SparkTransferToLeavesConnection.ts +79 -0
- package/src/graphql/objects/SparkWalletUser.ts +86 -0
- package/src/graphql/objects/StartSeedReleaseInput.ts +37 -0
- package/src/graphql/objects/SwapLeaf.ts +53 -0
- package/src/graphql/objects/Transfer.ts +98 -0
- package/src/graphql/objects/UserLeafInput.ts +28 -0
- package/src/graphql/objects/VerifyChallengeInput.ts +51 -0
- package/src/graphql/objects/VerifyChallengeOutput.ts +43 -0
- package/src/graphql/objects/WalletUserIdentityPublicKeyInput.ts +37 -0
- package/src/graphql/objects/WalletUserIdentityPublicKeyOutput.ts +43 -0
- package/src/graphql/objects/index.ts +67 -0
- package/src/graphql/queries/CoopExitFeeEstimate.ts +18 -0
- package/src/graphql/queries/CurrentUser.ts +10 -0
- package/src/graphql/queries/LightningReceiveFeeEstimate.ts +18 -0
- package/src/graphql/queries/LightningSendFeeEstimate.ts +16 -0
- package/src/proto/common.ts +431 -0
- package/src/proto/google/protobuf/descriptor.ts +6625 -0
- package/src/proto/google/protobuf/duration.ts +197 -0
- package/src/proto/google/protobuf/empty.ts +83 -0
- package/src/proto/google/protobuf/timestamp.ts +226 -0
- package/src/proto/mock.ts +151 -0
- package/src/proto/spark.ts +12727 -0
- package/src/proto/spark_authn.ts +673 -0
- package/src/proto/validate/validate.ts +6047 -0
- package/src/services/config.ts +71 -0
- package/src/services/connection.ts +264 -0
- package/src/services/coop-exit.ts +190 -0
- package/src/services/deposit.ts +327 -0
- package/src/services/lightning.ts +341 -0
- package/src/services/lrc20.ts +42 -0
- package/src/services/token-transactions.ts +499 -0
- package/src/services/transfer.ts +1188 -0
- package/src/services/tree-creation.ts +618 -0
- package/src/services/wallet-config.ts +141 -0
- package/src/signer/signer.ts +531 -0
- package/src/spark-sdk.ts +1644 -0
- package/src/tests/adaptor-signature.test.ts +64 -0
- package/src/tests/bitcoin.test.ts +122 -0
- package/src/tests/coop-exit.test.ts +233 -0
- package/src/tests/deposit.test.ts +98 -0
- package/src/tests/keys.test.ts +82 -0
- package/src/tests/lightning.test.ts +307 -0
- package/src/tests/secret-sharing.test.ts +63 -0
- package/src/tests/swap.test.ts +252 -0
- package/src/tests/test-util.ts +92 -0
- package/src/tests/tokens.test.ts +47 -0
- package/src/tests/transfer.test.ts +371 -0
- package/src/tests/tree-creation.test.ts +56 -0
- package/src/tests/utils/spark-testing-wallet.ts +37 -0
- package/src/tests/utils/test-faucet.ts +257 -0
- package/src/types/grpc.ts +8 -0
- package/src/types/index.ts +3 -0
- package/src/utils/adaptor-signature.ts +189 -0
- package/src/utils/bitcoin.ts +138 -0
- package/src/utils/crypto.ts +14 -0
- package/src/utils/index.ts +12 -0
- package/src/utils/keys.ts +92 -0
- package/src/utils/mempool.ts +42 -0
- package/src/utils/network.ts +70 -0
- package/src/utils/proof.ts +17 -0
- package/src/utils/response-validation.ts +26 -0
- package/src/utils/secret-sharing.ts +263 -0
- package/src/utils/signing.ts +96 -0
- package/src/utils/token-hashing.ts +163 -0
- package/src/utils/token-keyshares.ts +31 -0
- package/src/utils/token-transactions.ts +71 -0
- package/src/utils/transaction.ts +45 -0
- package/src/utils/wasm-wrapper.ts +57 -0
- package/src/utils/wasm.ts +154 -0
- package/src/wasm/spark_bindings.d.ts +208 -0
- package/src/wasm/spark_bindings.js +1161 -0
- package/src/wasm/spark_bindings_bg.wasm +0 -0
- package/src/wasm/spark_bindings_bg.wasm.d.ts +136 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
|
|
2
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
3
|
+
|
|
4
|
+
import Entity from './Entity.js';
|
|
5
|
+
import { Query, isObject } from '@lightsparkdev/core';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
interface SparkWalletUser {
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
13
|
+
* string.
|
|
14
|
+
**/
|
|
15
|
+
id: string;
|
|
16
|
+
|
|
17
|
+
/** The date and time when the entity was first created. **/
|
|
18
|
+
createdAt: string;
|
|
19
|
+
|
|
20
|
+
/** The date and time when the entity was last updated. **/
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
|
|
23
|
+
/** The identity public key of the user. **/
|
|
24
|
+
identityPublicKey: string;
|
|
25
|
+
|
|
26
|
+
/** The typename of the object **/
|
|
27
|
+
typename: string;
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const SparkWalletUserFromJson = (obj: any): SparkWalletUser => {
|
|
35
|
+
return {
|
|
36
|
+
id: obj["spark_wallet_user_id"],
|
|
37
|
+
createdAt: obj["spark_wallet_user_created_at"],
|
|
38
|
+
updatedAt: obj["spark_wallet_user_updated_at"],
|
|
39
|
+
identityPublicKey: obj["spark_wallet_user_identity_public_key"],
|
|
40
|
+
typename: "SparkWalletUser",
|
|
41
|
+
} as SparkWalletUser;
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
export const SparkWalletUserToJson = (obj: SparkWalletUser): any => {
|
|
45
|
+
return {
|
|
46
|
+
__typename: "SparkWalletUser",spark_wallet_user_id: obj.id,
|
|
47
|
+
spark_wallet_user_created_at: obj.createdAt,
|
|
48
|
+
spark_wallet_user_updated_at: obj.updatedAt,
|
|
49
|
+
spark_wallet_user_identity_public_key: obj.identityPublicKey,
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
export const FRAGMENT = `
|
|
57
|
+
fragment SparkWalletUserFragment on SparkWalletUser {
|
|
58
|
+
__typename
|
|
59
|
+
spark_wallet_user_id: id
|
|
60
|
+
spark_wallet_user_created_at: created_at
|
|
61
|
+
spark_wallet_user_updated_at: updated_at
|
|
62
|
+
spark_wallet_user_identity_public_key: identity_public_key
|
|
63
|
+
}`;
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
export const getSparkWalletUserQuery = (id: string): Query<SparkWalletUser> => {
|
|
68
|
+
return {
|
|
69
|
+
queryPayload: `
|
|
70
|
+
query GetSparkWalletUser($id: ID!) {
|
|
71
|
+
entity(id: $id) {
|
|
72
|
+
... on SparkWalletUser {
|
|
73
|
+
...SparkWalletUserFragment
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
${FRAGMENT}
|
|
79
|
+
`,
|
|
80
|
+
variables: {id},
|
|
81
|
+
constructObject: (data: unknown) => isObject(data) && "entity" in data && isObject(data.entity) ? SparkWalletUserFromJson(data.entity) : null,
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
export default SparkWalletUser;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
interface StartSeedReleaseInput {
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
phoneNumber: string;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const StartSeedReleaseInputFromJson = (obj: any): StartSeedReleaseInput => {
|
|
19
|
+
return {
|
|
20
|
+
phoneNumber: obj["start_seed_release_input_phone_number"],
|
|
21
|
+
|
|
22
|
+
} as StartSeedReleaseInput;
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
export const StartSeedReleaseInputToJson = (obj: StartSeedReleaseInput): any => {
|
|
26
|
+
return {
|
|
27
|
+
start_seed_release_input_phone_number: obj.phoneNumber,
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export default StartSeedReleaseInput;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
interface SwapLeaf {
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
leafId: string;
|
|
12
|
+
|
|
13
|
+
rawUnsignedRefundTransaction: string;
|
|
14
|
+
|
|
15
|
+
adaptorSignedSignature: string;
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const SwapLeafFromJson = (obj: any): SwapLeaf => {
|
|
23
|
+
return {
|
|
24
|
+
leafId: obj["swap_leaf_leaf_id"],
|
|
25
|
+
rawUnsignedRefundTransaction: obj["swap_leaf_raw_unsigned_refund_transaction"],
|
|
26
|
+
adaptorSignedSignature: obj["swap_leaf_adaptor_signed_signature"],
|
|
27
|
+
|
|
28
|
+
} as SwapLeaf;
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
export const SwapLeafToJson = (obj: SwapLeaf): any => {
|
|
32
|
+
return {
|
|
33
|
+
swap_leaf_leaf_id: obj.leafId,
|
|
34
|
+
swap_leaf_raw_unsigned_refund_transaction: obj.rawUnsignedRefundTransaction,
|
|
35
|
+
swap_leaf_adaptor_signed_signature: obj.adaptorSignedSignature,
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export const FRAGMENT = `
|
|
43
|
+
fragment SwapLeafFragment on SwapLeaf {
|
|
44
|
+
__typename
|
|
45
|
+
swap_leaf_leaf_id: leaf_id
|
|
46
|
+
swap_leaf_raw_unsigned_refund_transaction: raw_unsigned_refund_transaction
|
|
47
|
+
swap_leaf_adaptor_signed_signature: adaptor_signed_signature
|
|
48
|
+
}`;
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
export default SwapLeaf;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import autoBind from "auto-bind";
|
|
4
|
+
import type LightsparkClient from "../client.js";
|
|
5
|
+
import CurrencyAmount, {
|
|
6
|
+
CurrencyAmountFromJson,
|
|
7
|
+
CurrencyAmountToJson,
|
|
8
|
+
} from "./CurrencyAmount.js";
|
|
9
|
+
import SparkTransferToLeavesConnection, {
|
|
10
|
+
SparkTransferToLeavesConnectionFromJson,
|
|
11
|
+
} from "./SparkTransferToLeavesConnection.js";
|
|
12
|
+
|
|
13
|
+
class Transfer {
|
|
14
|
+
constructor(
|
|
15
|
+
/** The total amount of the transfer. **/
|
|
16
|
+
public readonly totalAmount: CurrencyAmount,
|
|
17
|
+
/** The id of the transfer known at signing operators. If not set, the transfer hasn't been
|
|
18
|
+
* initialized. **/
|
|
19
|
+
public readonly sparkId?: string | undefined,
|
|
20
|
+
) {
|
|
21
|
+
autoBind(this);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public async getLeaves(
|
|
25
|
+
client: LightsparkClient,
|
|
26
|
+
first: number | undefined = undefined,
|
|
27
|
+
after: string | undefined = undefined,
|
|
28
|
+
): Promise<SparkTransferToLeavesConnection> {
|
|
29
|
+
return (await client.executeRawQuery({
|
|
30
|
+
queryPayload: `
|
|
31
|
+
query FetchSparkTransferToLeavesConnection($entity_id: ID!, $first: Int, $after: String) {
|
|
32
|
+
entity(id: $entity_id) {
|
|
33
|
+
... on Transfer {
|
|
34
|
+
leaves(, first: $first, after: $after) {
|
|
35
|
+
__typename
|
|
36
|
+
spark_transfer_to_leaves_connection_count: count
|
|
37
|
+
spark_transfer_to_leaves_connection_page_info: page_info {
|
|
38
|
+
__typename
|
|
39
|
+
page_info_has_next_page: has_next_page
|
|
40
|
+
page_info_has_previous_page: has_previous_page
|
|
41
|
+
page_info_start_cursor: start_cursor
|
|
42
|
+
page_info_end_cursor: end_cursor
|
|
43
|
+
}
|
|
44
|
+
spark_transfer_to_leaves_connection_entities: entities {
|
|
45
|
+
__typename
|
|
46
|
+
leaf_amount: amount {
|
|
47
|
+
__typename
|
|
48
|
+
currency_amount_original_value: original_value
|
|
49
|
+
currency_amount_original_unit: original_unit
|
|
50
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
51
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
52
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
53
|
+
}
|
|
54
|
+
leaf_spark_node_id: spark_node_id
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
`,
|
|
61
|
+
variables: { entity_id: this.sparkId, first: first, after: after },
|
|
62
|
+
constructObject: (json) => {
|
|
63
|
+
const connection = json["entity"]["leaves"];
|
|
64
|
+
return SparkTransferToLeavesConnectionFromJson(connection);
|
|
65
|
+
},
|
|
66
|
+
}))!;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public toJson() {
|
|
70
|
+
return {
|
|
71
|
+
transfer_total_amount: CurrencyAmountToJson(this.totalAmount),
|
|
72
|
+
transfer_spark_id: this.sparkId,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const TransferFromJson = (obj: any): Transfer => {
|
|
78
|
+
return new Transfer(
|
|
79
|
+
CurrencyAmountFromJson(obj["transfer_total_amount"]),
|
|
80
|
+
obj["transfer_spark_id"],
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const FRAGMENT = `
|
|
85
|
+
fragment TransferFragment on Transfer {
|
|
86
|
+
__typename
|
|
87
|
+
transfer_total_amount: total_amount {
|
|
88
|
+
__typename
|
|
89
|
+
currency_amount_original_value: original_value
|
|
90
|
+
currency_amount_original_unit: original_unit
|
|
91
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
92
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
93
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
94
|
+
}
|
|
95
|
+
transfer_spark_id: spark_id
|
|
96
|
+
}`;
|
|
97
|
+
|
|
98
|
+
export default Transfer;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
interface UserLeafInput {
|
|
4
|
+
leaf_id: string;
|
|
5
|
+
|
|
6
|
+
raw_unsigned_refund_transaction: string;
|
|
7
|
+
|
|
8
|
+
adaptor_added_signature: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const UserLeafInputFromJson = (obj: any): UserLeafInput => {
|
|
12
|
+
return {
|
|
13
|
+
leaf_id: obj["user_leaf_input_leaf_id"],
|
|
14
|
+
raw_unsigned_refund_transaction:
|
|
15
|
+
obj["user_leaf_input_raw_unsigned_refund_transaction"],
|
|
16
|
+
adaptor_added_signature: obj["user_leaf_input_adaptor_added_signature"],
|
|
17
|
+
} as UserLeafInput;
|
|
18
|
+
};
|
|
19
|
+
export const UserLeafInputToJson = (obj: UserLeafInput): any => {
|
|
20
|
+
return {
|
|
21
|
+
user_leaf_input_leaf_id: obj.leaf_id,
|
|
22
|
+
user_leaf_input_raw_unsigned_refund_transaction:
|
|
23
|
+
obj.raw_unsigned_refund_transaction,
|
|
24
|
+
user_leaf_input_adaptor_added_signature: obj.adaptor_added_signature,
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default UserLeafInput;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import Provider from './Provider.js';
|
|
6
|
+
import {ProviderToJson} from './Provider.js';
|
|
7
|
+
import {ProviderFromJson} from './Provider.js';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
interface VerifyChallengeInput {
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
protectedChallenge: string;
|
|
14
|
+
|
|
15
|
+
signature: string;
|
|
16
|
+
|
|
17
|
+
identityPublicKey: string;
|
|
18
|
+
|
|
19
|
+
provider?: Provider | undefined;
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const VerifyChallengeInputFromJson = (obj: any): VerifyChallengeInput => {
|
|
27
|
+
return {
|
|
28
|
+
protectedChallenge: obj["verify_challenge_input_protected_challenge"],
|
|
29
|
+
signature: obj["verify_challenge_input_signature"],
|
|
30
|
+
identityPublicKey: obj["verify_challenge_input_identity_public_key"],
|
|
31
|
+
provider: (!!obj["verify_challenge_input_provider"] ? ProviderFromJson(obj["verify_challenge_input_provider"]) : undefined),
|
|
32
|
+
|
|
33
|
+
} as VerifyChallengeInput;
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
export const VerifyChallengeInputToJson = (obj: VerifyChallengeInput): any => {
|
|
37
|
+
return {
|
|
38
|
+
verify_challenge_input_protected_challenge: obj.protectedChallenge,
|
|
39
|
+
verify_challenge_input_signature: obj.signature,
|
|
40
|
+
verify_challenge_input_identity_public_key: obj.identityPublicKey,
|
|
41
|
+
verify_challenge_input_provider: (obj.provider ? ProviderToJson(obj.provider) : undefined),
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
export default VerifyChallengeInput;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
interface VerifyChallengeOutput {
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
validUntil: string;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const VerifyChallengeOutputFromJson = (obj: any): VerifyChallengeOutput => {
|
|
19
|
+
return {
|
|
20
|
+
validUntil: obj["verify_challenge_output_valid_until"],
|
|
21
|
+
|
|
22
|
+
} as VerifyChallengeOutput;
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
export const VerifyChallengeOutputToJson = (obj: VerifyChallengeOutput): any => {
|
|
26
|
+
return {
|
|
27
|
+
verify_challenge_output_valid_until: obj.validUntil,
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export const FRAGMENT = `
|
|
35
|
+
fragment VerifyChallengeOutputFragment on VerifyChallengeOutput {
|
|
36
|
+
__typename
|
|
37
|
+
verify_challenge_output_valid_until: valid_until
|
|
38
|
+
}`;
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
export default VerifyChallengeOutput;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
interface WalletUserIdentityPublicKeyInput {
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
phoneNumber: string;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const WalletUserIdentityPublicKeyInputFromJson = (obj: any): WalletUserIdentityPublicKeyInput => {
|
|
19
|
+
return {
|
|
20
|
+
phoneNumber: obj["wallet_user_identity_public_key_input_phone_number"],
|
|
21
|
+
|
|
22
|
+
} as WalletUserIdentityPublicKeyInput;
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
export const WalletUserIdentityPublicKeyInputToJson = (obj: WalletUserIdentityPublicKeyInput): any => {
|
|
26
|
+
return {
|
|
27
|
+
wallet_user_identity_public_key_input_phone_number: obj.phoneNumber,
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export default WalletUserIdentityPublicKeyInput;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
interface WalletUserIdentityPublicKeyOutput {
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
identityPublicKey: string;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const WalletUserIdentityPublicKeyOutputFromJson = (obj: any): WalletUserIdentityPublicKeyOutput => {
|
|
19
|
+
return {
|
|
20
|
+
identityPublicKey: obj["wallet_user_identity_public_key_output_identity_public_key"],
|
|
21
|
+
|
|
22
|
+
} as WalletUserIdentityPublicKeyOutput;
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
export const WalletUserIdentityPublicKeyOutputToJson = (obj: WalletUserIdentityPublicKeyOutput): any => {
|
|
26
|
+
return {
|
|
27
|
+
wallet_user_identity_public_key_output_identity_public_key: obj.identityPublicKey,
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export const FRAGMENT = `
|
|
35
|
+
fragment WalletUserIdentityPublicKeyOutputFragment on WalletUserIdentityPublicKeyOutput {
|
|
36
|
+
__typename
|
|
37
|
+
wallet_user_identity_public_key_output_identity_public_key: identity_public_key
|
|
38
|
+
}`;
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
export default WalletUserIdentityPublicKeyOutput;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export { default as BitcoinNetwork } from "./BitcoinNetwork.js";
|
|
2
|
+
export { default as CompleteCoopExitInput } from "./CompleteCoopExitInput.js";
|
|
3
|
+
export { default as CompleteCoopExitOutput } from "./CompleteCoopExitOutput.js";
|
|
4
|
+
export { default as CompleteLeavesSwapInput } from "./CompleteLeavesSwapInput.js";
|
|
5
|
+
export { default as CompleteLeavesSwapOutput } from "./CompleteLeavesSwapOutput.js";
|
|
6
|
+
export { default as CompleteSeedReleaseInput } from "./CompleteSeedReleaseInput.js";
|
|
7
|
+
export { default as CompleteSeedReleaseOutput } from "./CompleteSeedReleaseOutput.js";
|
|
8
|
+
export { default as Connection } from "./Connection.js";
|
|
9
|
+
export { default as CoopExitFeeEstimateInput } from "./CoopExitFeeEstimateInput.js";
|
|
10
|
+
export { default as CoopExitFeeEstimateOutput } from "./CoopExitFeeEstimateOutput.js";
|
|
11
|
+
export {
|
|
12
|
+
default as CoopExitRequest,
|
|
13
|
+
getCoopExitRequestQuery,
|
|
14
|
+
} from "./CoopExitRequest.js";
|
|
15
|
+
export { default as CurrencyAmount } from "./CurrencyAmount.js";
|
|
16
|
+
export { default as CurrencyUnit } from "./CurrencyUnit.js";
|
|
17
|
+
export { default as Entity } from "./Entity.js";
|
|
18
|
+
export { default as GetChallengeInput } from "./GetChallengeInput.js";
|
|
19
|
+
export { default as GetChallengeOutput } from "./GetChallengeOutput.js";
|
|
20
|
+
export { default as Invoice } from "./Invoice.js";
|
|
21
|
+
export { default as Leaf } from "./Leaf.js";
|
|
22
|
+
export { default as LeavesSwapFeeEstimateInput } from "./LeavesSwapFeeEstimateInput.js";
|
|
23
|
+
export { default as LeavesSwapFeeEstimateOutput } from "./LeavesSwapFeeEstimateOutput.js";
|
|
24
|
+
export {
|
|
25
|
+
getLeavesSwapRequestQuery,
|
|
26
|
+
default as LeavesSwapRequest,
|
|
27
|
+
} from "./LeavesSwapRequest.js";
|
|
28
|
+
export { default as LightningReceiveFeeEstimateInput } from "./LightningReceiveFeeEstimateInput.js";
|
|
29
|
+
export { default as LightningReceiveFeeEstimateOutput } from "./LightningReceiveFeeEstimateOutput.js";
|
|
30
|
+
export {
|
|
31
|
+
getLightningReceiveRequestQuery,
|
|
32
|
+
default as LightningReceiveRequest,
|
|
33
|
+
} from "./LightningReceiveRequest.js";
|
|
34
|
+
export { default as LightningReceiveRequestStatus } from "./LightningReceiveRequestStatus.js";
|
|
35
|
+
export { default as LightningSendFeeEstimateInput } from "./LightningSendFeeEstimateInput.js";
|
|
36
|
+
export { default as LightningSendFeeEstimateOutput } from "./LightningSendFeeEstimateOutput.js";
|
|
37
|
+
export {
|
|
38
|
+
getLightningSendRequestQuery,
|
|
39
|
+
default as LightningSendRequest,
|
|
40
|
+
} from "./LightningSendRequest.js";
|
|
41
|
+
export { default as LightningSendRequestStatus } from "./LightningSendRequestStatus.js";
|
|
42
|
+
export { default as NotifyReceiverTransferInput } from "./NotifyReceiverTransferInput.js";
|
|
43
|
+
export { default as PageInfo } from "./PageInfo.js";
|
|
44
|
+
export { default as Provider } from "./Provider.js";
|
|
45
|
+
export { default as RequestCoopExitInput } from "./RequestCoopExitInput.js";
|
|
46
|
+
export { default as RequestCoopExitOutput } from "./RequestCoopExitOutput.js";
|
|
47
|
+
export { default as RequestLeavesSwapInput } from "./RequestLeavesSwapInput.js";
|
|
48
|
+
export { default as RequestLeavesSwapOutput } from "./RequestLeavesSwapOutput.js";
|
|
49
|
+
export { default as RequestLightningReceiveInput } from "./RequestLightningReceiveInput.js";
|
|
50
|
+
export { default as RequestLightningReceiveOutput } from "./RequestLightningReceiveOutput.js";
|
|
51
|
+
export { default as RequestLightningSendInput } from "./RequestLightningSendInput.js";
|
|
52
|
+
export { default as RequestLightningSendOutput } from "./RequestLightningSendOutput.js";
|
|
53
|
+
export { default as SparkCoopExitRequestStatus } from "./SparkCoopExitRequestStatus.js";
|
|
54
|
+
export { default as SparkLeavesSwapRequestStatus } from "./SparkLeavesSwapRequestStatus.js";
|
|
55
|
+
export { default as SparkTransferToLeavesConnection } from "./SparkTransferToLeavesConnection.js";
|
|
56
|
+
export {
|
|
57
|
+
getSparkWalletUserQuery,
|
|
58
|
+
default as SparkWalletUser,
|
|
59
|
+
} from "./SparkWalletUser.js";
|
|
60
|
+
export { default as StartSeedReleaseInput } from "./StartSeedReleaseInput.js";
|
|
61
|
+
export { default as SwapLeaf } from "./SwapLeaf.js";
|
|
62
|
+
export { default as Transfer } from "./Transfer.js";
|
|
63
|
+
export { default as UserLeafInput } from "./UserLeafInput.js";
|
|
64
|
+
export { default as VerifyChallengeInput } from "./VerifyChallengeInput.js";
|
|
65
|
+
export { default as VerifyChallengeOutput } from "./VerifyChallengeOutput.js";
|
|
66
|
+
export { default as WalletUserIdentityPublicKeyInput } from "./WalletUserIdentityPublicKeyInput.js";
|
|
67
|
+
export { default as WalletUserIdentityPublicKeyOutput } from "./WalletUserIdentityPublicKeyOutput.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FRAGMENT as CoopExitFeeEstimateOutputFragment } from "../objects/CoopExitFeeEstimateOutput.js";
|
|
2
|
+
|
|
3
|
+
export const CoopExitFeeEstimate = `
|
|
4
|
+
query CoopExitFeeEstimate(
|
|
5
|
+
$leaf_external_ids: [UUID!]!
|
|
6
|
+
$withdrawal_address: String!
|
|
7
|
+
) {
|
|
8
|
+
coop_exit_fee_estimate(
|
|
9
|
+
input: {
|
|
10
|
+
leaf_external_ids: $leaf_external_ids
|
|
11
|
+
withdrawal_address: $withdrawal_address
|
|
12
|
+
}
|
|
13
|
+
) {
|
|
14
|
+
...CoopExitFeeEstimateOutputFragment
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
${CoopExitFeeEstimateOutputFragment}
|
|
18
|
+
`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FRAGMENT as LightningReceiveFeeEstimateOutputFragment } from "../objects/LightningReceiveFeeEstimateOutput.js";
|
|
2
|
+
|
|
3
|
+
export const LightningReceiveFeeEstimate = `
|
|
4
|
+
query LightningReceiveFeeEstimate(
|
|
5
|
+
$network: BitcoinNetwork!
|
|
6
|
+
$amount_sats: Long!
|
|
7
|
+
) {
|
|
8
|
+
lightning_receive_fee_estimate(
|
|
9
|
+
input: {
|
|
10
|
+
network: $network
|
|
11
|
+
amount_sats: $amount_sats
|
|
12
|
+
}
|
|
13
|
+
) {
|
|
14
|
+
...LightningReceiveFeeEstimateOutputFragment
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
${LightningReceiveFeeEstimateOutputFragment}
|
|
18
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FRAGMENT as LightningSendFeeEstimateOutputFragment } from "../objects/LightningSendFeeEstimateOutput.js";
|
|
2
|
+
|
|
3
|
+
export const LightningSendFeeEstimate = `
|
|
4
|
+
query LightningSendFeeEstimate(
|
|
5
|
+
$encoded_invoice: String!
|
|
6
|
+
) {
|
|
7
|
+
lightning_send_fee_estimate(
|
|
8
|
+
input: {
|
|
9
|
+
encoded_invoice: $encoded_invoice
|
|
10
|
+
}
|
|
11
|
+
) {
|
|
12
|
+
...LightningSendFeeEstimateOutputFragment
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
${LightningSendFeeEstimateOutputFragment}
|
|
16
|
+
`;
|