@turnkey/core 2.4.0 → 2.6.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/dist/__clients__/core.d.ts +15 -1
- package/dist/__clients__/core.d.ts.map +1 -1
- package/dist/__clients__/core.js +15 -1
- package/dist/__clients__/core.js.map +1 -1
- package/dist/__clients__/core.mjs +15 -1
- package/dist/__clients__/core.mjs.map +1 -1
- package/dist/__generated__/sdk-client-base.d.ts +22 -0
- package/dist/__generated__/sdk-client-base.d.ts.map +1 -1
- package/dist/__generated__/sdk-client-base.js +379 -0
- package/dist/__generated__/sdk-client-base.js.map +1 -1
- package/dist/__generated__/sdk-client-base.mjs +379 -0
- package/dist/__generated__/sdk-client-base.mjs.map +1 -1
- package/dist/__generated__/version.d.ts +1 -1
- package/dist/__generated__/version.js +1 -1
- package/dist/__generated__/version.mjs +1 -1
- package/package.json +7 -7
|
@@ -215,6 +215,36 @@ class TurnkeySDKClientBase {
|
|
|
215
215
|
url: fullUrl,
|
|
216
216
|
};
|
|
217
217
|
};
|
|
218
|
+
this.getClaimEarnFeesStatus = async (input, stampWith) => {
|
|
219
|
+
const session = await this.storageManager?.getActiveSession();
|
|
220
|
+
return this.request("/public/v1/query/get_claim_earn_fees_status", {
|
|
221
|
+
...input,
|
|
222
|
+
organizationId: input.organizationId ??
|
|
223
|
+
session?.organizationId ??
|
|
224
|
+
this.config.organizationId,
|
|
225
|
+
}, stampWith);
|
|
226
|
+
};
|
|
227
|
+
this.stampGetClaimEarnFeesStatus = async (input, stampWith) => {
|
|
228
|
+
const activeStamper = this.getStamper(stampWith);
|
|
229
|
+
if (!activeStamper) {
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
const session = await this.storageManager?.getActiveSession();
|
|
233
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_claim_earn_fees_status";
|
|
234
|
+
const body = {
|
|
235
|
+
...input,
|
|
236
|
+
organizationId: input.organizationId ??
|
|
237
|
+
session?.organizationId ??
|
|
238
|
+
this.config.organizationId,
|
|
239
|
+
};
|
|
240
|
+
const stringifiedBody = JSON.stringify(body);
|
|
241
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
242
|
+
return {
|
|
243
|
+
body: stringifiedBody,
|
|
244
|
+
stamp: stamp,
|
|
245
|
+
url: fullUrl,
|
|
246
|
+
};
|
|
247
|
+
};
|
|
218
248
|
this.getEarnDeployStatus = async (input, stampWith) => {
|
|
219
249
|
const session = await this.storageManager?.getActiveSession();
|
|
220
250
|
return this.request("/public/v1/query/get_earn_deploy_status", {
|
|
@@ -845,6 +875,36 @@ class TurnkeySDKClientBase {
|
|
|
845
875
|
url: fullUrl,
|
|
846
876
|
};
|
|
847
877
|
};
|
|
878
|
+
this.getSwapStatus = async (input, stampWith) => {
|
|
879
|
+
const session = await this.storageManager?.getActiveSession();
|
|
880
|
+
return this.request("/public/v1/query/get_swap_status", {
|
|
881
|
+
...input,
|
|
882
|
+
organizationId: input.organizationId ??
|
|
883
|
+
session?.organizationId ??
|
|
884
|
+
this.config.organizationId,
|
|
885
|
+
}, stampWith);
|
|
886
|
+
};
|
|
887
|
+
this.stampGetSwapStatus = async (input, stampWith) => {
|
|
888
|
+
const activeStamper = this.getStamper(stampWith);
|
|
889
|
+
if (!activeStamper) {
|
|
890
|
+
return undefined;
|
|
891
|
+
}
|
|
892
|
+
const session = await this.storageManager?.getActiveSession();
|
|
893
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_swap_status";
|
|
894
|
+
const body = {
|
|
895
|
+
...input,
|
|
896
|
+
organizationId: input.organizationId ??
|
|
897
|
+
session?.organizationId ??
|
|
898
|
+
this.config.organizationId,
|
|
899
|
+
};
|
|
900
|
+
const stringifiedBody = JSON.stringify(body);
|
|
901
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
902
|
+
return {
|
|
903
|
+
body: stringifiedBody,
|
|
904
|
+
stamp: stamp,
|
|
905
|
+
url: fullUrl,
|
|
906
|
+
};
|
|
907
|
+
};
|
|
848
908
|
this.getTvcApp = async (input, stampWith) => {
|
|
849
909
|
const session = await this.storageManager?.getActiveSession();
|
|
850
910
|
return this.request("/public/v1/query/get_tvc_app", {
|
|
@@ -935,6 +995,36 @@ class TurnkeySDKClientBase {
|
|
|
935
995
|
url: fullUrl,
|
|
936
996
|
};
|
|
937
997
|
};
|
|
998
|
+
this.getTvcQosVersions = async (input, stampWith) => {
|
|
999
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1000
|
+
return this.request("/public/v1/query/get_tvc_qos_versions", {
|
|
1001
|
+
...input,
|
|
1002
|
+
organizationId: input.organizationId ??
|
|
1003
|
+
session?.organizationId ??
|
|
1004
|
+
this.config.organizationId,
|
|
1005
|
+
}, stampWith);
|
|
1006
|
+
};
|
|
1007
|
+
this.stampGetTvcQosVersions = async (input, stampWith) => {
|
|
1008
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1009
|
+
if (!activeStamper) {
|
|
1010
|
+
return undefined;
|
|
1011
|
+
}
|
|
1012
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1013
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_tvc_qos_versions";
|
|
1014
|
+
const body = {
|
|
1015
|
+
...input,
|
|
1016
|
+
organizationId: input.organizationId ??
|
|
1017
|
+
session?.organizationId ??
|
|
1018
|
+
this.config.organizationId,
|
|
1019
|
+
};
|
|
1020
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1021
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1022
|
+
return {
|
|
1023
|
+
body: stringifiedBody,
|
|
1024
|
+
stamp: stamp,
|
|
1025
|
+
url: fullUrl,
|
|
1026
|
+
};
|
|
1027
|
+
};
|
|
938
1028
|
this.getUser = async (input, stampWith) => {
|
|
939
1029
|
const session = await this.storageManager?.getActiveSession();
|
|
940
1030
|
return this.request("/public/v1/query/get_user", {
|
|
@@ -1415,6 +1505,36 @@ class TurnkeySDKClientBase {
|
|
|
1415
1505
|
url: fullUrl,
|
|
1416
1506
|
};
|
|
1417
1507
|
};
|
|
1508
|
+
this.listSecrets = async (input, stampWith) => {
|
|
1509
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1510
|
+
return this.request("/public/v1/query/list_secrets", {
|
|
1511
|
+
...input,
|
|
1512
|
+
organizationId: input.organizationId ??
|
|
1513
|
+
session?.organizationId ??
|
|
1514
|
+
this.config.organizationId,
|
|
1515
|
+
}, stampWith);
|
|
1516
|
+
};
|
|
1517
|
+
this.stampListSecrets = async (input, stampWith) => {
|
|
1518
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1519
|
+
if (!activeStamper) {
|
|
1520
|
+
return undefined;
|
|
1521
|
+
}
|
|
1522
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1523
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_secrets";
|
|
1524
|
+
const body = {
|
|
1525
|
+
...input,
|
|
1526
|
+
organizationId: input.organizationId ??
|
|
1527
|
+
session?.organizationId ??
|
|
1528
|
+
this.config.organizationId,
|
|
1529
|
+
};
|
|
1530
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1531
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1532
|
+
return {
|
|
1533
|
+
body: stringifiedBody,
|
|
1534
|
+
stamp: stamp,
|
|
1535
|
+
url: fullUrl,
|
|
1536
|
+
};
|
|
1537
|
+
};
|
|
1418
1538
|
this.getSmartContractInterfaces = async (input, stampWith) => {
|
|
1419
1539
|
const session = await this.storageManager?.getActiveSession();
|
|
1420
1540
|
return this.request("/public/v1/query/list_smart_contract_interfaces", {
|
|
@@ -1909,6 +2029,43 @@ class TurnkeySDKClientBase {
|
|
|
1909
2029
|
url: fullUrl,
|
|
1910
2030
|
};
|
|
1911
2031
|
};
|
|
2032
|
+
this.claimSwapFees = async (input, stampWith) => {
|
|
2033
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2034
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
2035
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
2036
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2037
|
+
return this.activity("/public/v1/submit/claim_swap_fees", {
|
|
2038
|
+
parameters: rest,
|
|
2039
|
+
organizationId: organizationId ??
|
|
2040
|
+
session?.organizationId ??
|
|
2041
|
+
this.config.organizationId,
|
|
2042
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2043
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
2044
|
+
type: "ACTIVITY_TYPE_CLAIM_SWAP_FEES",
|
|
2045
|
+
}, "claimSwapFeesResult", stampWith);
|
|
2046
|
+
};
|
|
2047
|
+
this.stampClaimSwapFees = async (input, stampWith) => {
|
|
2048
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2049
|
+
if (!activeStamper) {
|
|
2050
|
+
return undefined;
|
|
2051
|
+
}
|
|
2052
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2053
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2054
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/claim_swap_fees";
|
|
2055
|
+
const bodyWithType = {
|
|
2056
|
+
parameters,
|
|
2057
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2058
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2059
|
+
type: "ACTIVITY_TYPE_CLAIM_SWAP_FEES",
|
|
2060
|
+
};
|
|
2061
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2062
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2063
|
+
return {
|
|
2064
|
+
body: stringifiedBody,
|
|
2065
|
+
stamp: stamp,
|
|
2066
|
+
url: fullUrl,
|
|
2067
|
+
};
|
|
2068
|
+
};
|
|
1912
2069
|
this.createApiKeys = async (input, stampWith) => {
|
|
1913
2070
|
const { organizationId, timestampMs, ...rest } = input;
|
|
1914
2071
|
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
@@ -2503,6 +2660,43 @@ class TurnkeySDKClientBase {
|
|
|
2503
2660
|
url: fullUrl,
|
|
2504
2661
|
};
|
|
2505
2662
|
};
|
|
2663
|
+
this.createSwapQuote = async (input, stampWith) => {
|
|
2664
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2665
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
2666
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
2667
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2668
|
+
return this.activity("/public/v1/submit/create_swap_quote", {
|
|
2669
|
+
parameters: rest,
|
|
2670
|
+
organizationId: organizationId ??
|
|
2671
|
+
session?.organizationId ??
|
|
2672
|
+
this.config.organizationId,
|
|
2673
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2674
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
2675
|
+
type: "ACTIVITY_TYPE_CREATE_SWAP_QUOTE",
|
|
2676
|
+
}, "createSwapQuoteResult", stampWith);
|
|
2677
|
+
};
|
|
2678
|
+
this.stampCreateSwapQuote = async (input, stampWith) => {
|
|
2679
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2680
|
+
if (!activeStamper) {
|
|
2681
|
+
return undefined;
|
|
2682
|
+
}
|
|
2683
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2684
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2685
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_swap_quote";
|
|
2686
|
+
const bodyWithType = {
|
|
2687
|
+
parameters,
|
|
2688
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2689
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2690
|
+
type: "ACTIVITY_TYPE_CREATE_SWAP_QUOTE",
|
|
2691
|
+
};
|
|
2692
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2693
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2694
|
+
return {
|
|
2695
|
+
body: stringifiedBody,
|
|
2696
|
+
stamp: stamp,
|
|
2697
|
+
url: fullUrl,
|
|
2698
|
+
};
|
|
2699
|
+
};
|
|
2506
2700
|
this.createTvcApp = async (input, stampWith) => {
|
|
2507
2701
|
const { organizationId, timestampMs, ...rest } = input;
|
|
2508
2702
|
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
@@ -3728,6 +3922,80 @@ class TurnkeySDKClientBase {
|
|
|
3728
3922
|
url: fullUrl,
|
|
3729
3923
|
};
|
|
3730
3924
|
};
|
|
3925
|
+
this.ethUndelegate7702 = async (input, stampWith) => {
|
|
3926
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3927
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
3928
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
3929
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3930
|
+
return this.activity("/public/v1/submit/eth_undelegate_7702", {
|
|
3931
|
+
parameters: rest,
|
|
3932
|
+
organizationId: organizationId ??
|
|
3933
|
+
session?.organizationId ??
|
|
3934
|
+
this.config.organizationId,
|
|
3935
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3936
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
3937
|
+
type: "ACTIVITY_TYPE_ETH_UNDELEGATE_7702",
|
|
3938
|
+
}, "ethUndelegate7702Result", stampWith);
|
|
3939
|
+
};
|
|
3940
|
+
this.stampEthUndelegate7702 = async (input, stampWith) => {
|
|
3941
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3942
|
+
if (!activeStamper) {
|
|
3943
|
+
return undefined;
|
|
3944
|
+
}
|
|
3945
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3946
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3947
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/eth_undelegate_7702";
|
|
3948
|
+
const bodyWithType = {
|
|
3949
|
+
parameters,
|
|
3950
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3951
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3952
|
+
type: "ACTIVITY_TYPE_ETH_UNDELEGATE_7702",
|
|
3953
|
+
};
|
|
3954
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3955
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3956
|
+
return {
|
|
3957
|
+
body: stringifiedBody,
|
|
3958
|
+
stamp: stamp,
|
|
3959
|
+
url: fullUrl,
|
|
3960
|
+
};
|
|
3961
|
+
};
|
|
3962
|
+
this.executeSwap = async (input, stampWith) => {
|
|
3963
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3964
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
3965
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
3966
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3967
|
+
return this.activity("/public/v1/submit/execute_swap", {
|
|
3968
|
+
parameters: rest,
|
|
3969
|
+
organizationId: organizationId ??
|
|
3970
|
+
session?.organizationId ??
|
|
3971
|
+
this.config.organizationId,
|
|
3972
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3973
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
3974
|
+
type: "ACTIVITY_TYPE_EXECUTE_SWAP_V2",
|
|
3975
|
+
}, "executeSwapResult", stampWith);
|
|
3976
|
+
};
|
|
3977
|
+
this.stampExecuteSwap = async (input, stampWith) => {
|
|
3978
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3979
|
+
if (!activeStamper) {
|
|
3980
|
+
return undefined;
|
|
3981
|
+
}
|
|
3982
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3983
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3984
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/execute_swap";
|
|
3985
|
+
const bodyWithType = {
|
|
3986
|
+
parameters,
|
|
3987
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3988
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3989
|
+
type: "ACTIVITY_TYPE_EXECUTE_SWAP_V2",
|
|
3990
|
+
};
|
|
3991
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3992
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3993
|
+
return {
|
|
3994
|
+
body: stringifiedBody,
|
|
3995
|
+
stamp: stamp,
|
|
3996
|
+
url: fullUrl,
|
|
3997
|
+
};
|
|
3998
|
+
};
|
|
3731
3999
|
this.exportPrivateKey = async (input, stampWith) => {
|
|
3732
4000
|
const { organizationId, timestampMs, ...rest } = input;
|
|
3733
4001
|
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
@@ -3765,6 +4033,43 @@ class TurnkeySDKClientBase {
|
|
|
3765
4033
|
url: fullUrl,
|
|
3766
4034
|
};
|
|
3767
4035
|
};
|
|
4036
|
+
this.exportSecrets = async (input, stampWith) => {
|
|
4037
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
4038
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
4039
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
4040
|
+
const session = await this.storageManager?.getActiveSession();
|
|
4041
|
+
return this.activity("/public/v1/submit/export_secrets", {
|
|
4042
|
+
parameters: rest,
|
|
4043
|
+
organizationId: organizationId ??
|
|
4044
|
+
session?.organizationId ??
|
|
4045
|
+
this.config.organizationId,
|
|
4046
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
4047
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
4048
|
+
type: "ACTIVITY_TYPE_EXPORT_SECRETS",
|
|
4049
|
+
}, "exportSecretsResult", stampWith);
|
|
4050
|
+
};
|
|
4051
|
+
this.stampExportSecrets = async (input, stampWith) => {
|
|
4052
|
+
const activeStamper = this.getStamper(stampWith);
|
|
4053
|
+
if (!activeStamper) {
|
|
4054
|
+
return undefined;
|
|
4055
|
+
}
|
|
4056
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
4057
|
+
const session = await this.storageManager?.getActiveSession();
|
|
4058
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/export_secrets";
|
|
4059
|
+
const bodyWithType = {
|
|
4060
|
+
parameters,
|
|
4061
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
4062
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
4063
|
+
type: "ACTIVITY_TYPE_EXPORT_SECRETS",
|
|
4064
|
+
};
|
|
4065
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
4066
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
4067
|
+
return {
|
|
4068
|
+
body: stringifiedBody,
|
|
4069
|
+
stamp: stamp,
|
|
4070
|
+
url: fullUrl,
|
|
4071
|
+
};
|
|
4072
|
+
};
|
|
3768
4073
|
this.exportWallet = async (input, stampWith) => {
|
|
3769
4074
|
const { organizationId, timestampMs, ...rest } = input;
|
|
3770
4075
|
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
@@ -3876,6 +4181,43 @@ class TurnkeySDKClientBase {
|
|
|
3876
4181
|
url: fullUrl,
|
|
3877
4182
|
};
|
|
3878
4183
|
};
|
|
4184
|
+
this.importSecrets = async (input, stampWith) => {
|
|
4185
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
4186
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
4187
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
4188
|
+
const session = await this.storageManager?.getActiveSession();
|
|
4189
|
+
return this.activity("/public/v1/submit/import_secrets", {
|
|
4190
|
+
parameters: rest,
|
|
4191
|
+
organizationId: organizationId ??
|
|
4192
|
+
session?.organizationId ??
|
|
4193
|
+
this.config.organizationId,
|
|
4194
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
4195
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
4196
|
+
type: "ACTIVITY_TYPE_IMPORT_SECRETS",
|
|
4197
|
+
}, "importSecretsResult", stampWith);
|
|
4198
|
+
};
|
|
4199
|
+
this.stampImportSecrets = async (input, stampWith) => {
|
|
4200
|
+
const activeStamper = this.getStamper(stampWith);
|
|
4201
|
+
if (!activeStamper) {
|
|
4202
|
+
return undefined;
|
|
4203
|
+
}
|
|
4204
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
4205
|
+
const session = await this.storageManager?.getActiveSession();
|
|
4206
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/import_secrets";
|
|
4207
|
+
const bodyWithType = {
|
|
4208
|
+
parameters,
|
|
4209
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
4210
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
4211
|
+
type: "ACTIVITY_TYPE_IMPORT_SECRETS",
|
|
4212
|
+
};
|
|
4213
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
4214
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
4215
|
+
return {
|
|
4216
|
+
body: stringifiedBody,
|
|
4217
|
+
stamp: stamp,
|
|
4218
|
+
url: fullUrl,
|
|
4219
|
+
};
|
|
4220
|
+
};
|
|
3879
4221
|
this.importWallet = async (input, stampWith) => {
|
|
3880
4222
|
const { organizationId, timestampMs, ...rest } = input;
|
|
3881
4223
|
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
@@ -5431,6 +5773,43 @@ class TurnkeySDKClientBase {
|
|
|
5431
5773
|
url: fullUrl,
|
|
5432
5774
|
};
|
|
5433
5775
|
};
|
|
5776
|
+
this.upsertSwapConfig = async (input, stampWith) => {
|
|
5777
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
5778
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
5779
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
5780
|
+
const session = await this.storageManager?.getActiveSession();
|
|
5781
|
+
return this.activity("/public/v1/submit/upsert_swap_config", {
|
|
5782
|
+
parameters: rest,
|
|
5783
|
+
organizationId: organizationId ??
|
|
5784
|
+
session?.organizationId ??
|
|
5785
|
+
this.config.organizationId,
|
|
5786
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
5787
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
5788
|
+
type: "ACTIVITY_TYPE_UPSERT_SWAP_CONFIG",
|
|
5789
|
+
}, "upsertSwapConfigResult", stampWith);
|
|
5790
|
+
};
|
|
5791
|
+
this.stampUpsertSwapConfig = async (input, stampWith) => {
|
|
5792
|
+
const activeStamper = this.getStamper(stampWith);
|
|
5793
|
+
if (!activeStamper) {
|
|
5794
|
+
return undefined;
|
|
5795
|
+
}
|
|
5796
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
5797
|
+
const session = await this.storageManager?.getActiveSession();
|
|
5798
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/upsert_swap_config";
|
|
5799
|
+
const bodyWithType = {
|
|
5800
|
+
parameters,
|
|
5801
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
5802
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
5803
|
+
type: "ACTIVITY_TYPE_UPSERT_SWAP_CONFIG",
|
|
5804
|
+
};
|
|
5805
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
5806
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
5807
|
+
return {
|
|
5808
|
+
body: stringifiedBody,
|
|
5809
|
+
stamp: stamp,
|
|
5810
|
+
url: fullUrl,
|
|
5811
|
+
};
|
|
5812
|
+
};
|
|
5434
5813
|
this.verifyOtp = async (input, stampWith) => {
|
|
5435
5814
|
const { organizationId, timestampMs, ...rest } = input;
|
|
5436
5815
|
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|