@turnkey/sdk-browser 8.0.0 → 8.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.
@@ -224,6 +224,37 @@ class TurnkeySDKClientBase {
224
224
  url: fullUrl,
225
225
  };
226
226
  };
227
+ this.getClaimEarnFeesStatus = async (input) => {
228
+ const sessionData = await getStorageValue(StorageKeys.Session);
229
+ const session = sessionData ? parseSession(sessionData) : null;
230
+ return this.request("/public/v1/query/get_claim_earn_fees_status", {
231
+ ...input,
232
+ organizationId: input.organizationId ??
233
+ session?.organizationId ??
234
+ this.config.organizationId,
235
+ });
236
+ };
237
+ this.stampGetClaimEarnFeesStatus = async (input) => {
238
+ if (!this.stamper) {
239
+ return undefined;
240
+ }
241
+ const sessionData = await getStorageValue(StorageKeys.Session);
242
+ const session = sessionData ? parseSession(sessionData) : null;
243
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_claim_earn_fees_status";
244
+ const body = {
245
+ ...input,
246
+ organizationId: input.organizationId ??
247
+ session?.organizationId ??
248
+ this.config.organizationId,
249
+ };
250
+ const stringifiedBody = JSON.stringify(body);
251
+ const stamp = await this.stamper.stamp(stringifiedBody);
252
+ return {
253
+ body: stringifiedBody,
254
+ stamp: stamp,
255
+ url: fullUrl,
256
+ };
257
+ };
227
258
  this.getEarnDeployStatus = async (input) => {
228
259
  const sessionData = await getStorageValue(StorageKeys.Session);
229
260
  const session = sessionData ? parseSession(sessionData) : null;
@@ -875,6 +906,37 @@ class TurnkeySDKClientBase {
875
906
  url: fullUrl,
876
907
  };
877
908
  };
909
+ this.getSwapStatus = async (input) => {
910
+ const sessionData = await getStorageValue(StorageKeys.Session);
911
+ const session = sessionData ? parseSession(sessionData) : null;
912
+ return this.request("/public/v1/query/get_swap_status", {
913
+ ...input,
914
+ organizationId: input.organizationId ??
915
+ session?.organizationId ??
916
+ this.config.organizationId,
917
+ });
918
+ };
919
+ this.stampGetSwapStatus = async (input) => {
920
+ if (!this.stamper) {
921
+ return undefined;
922
+ }
923
+ const sessionData = await getStorageValue(StorageKeys.Session);
924
+ const session = sessionData ? parseSession(sessionData) : null;
925
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_swap_status";
926
+ const body = {
927
+ ...input,
928
+ organizationId: input.organizationId ??
929
+ session?.organizationId ??
930
+ this.config.organizationId,
931
+ };
932
+ const stringifiedBody = JSON.stringify(body);
933
+ const stamp = await this.stamper.stamp(stringifiedBody);
934
+ return {
935
+ body: stringifiedBody,
936
+ stamp: stamp,
937
+ url: fullUrl,
938
+ };
939
+ };
878
940
  this.getTvcApp = async (input) => {
879
941
  const sessionData = await getStorageValue(StorageKeys.Session);
880
942
  const session = sessionData ? parseSession(sessionData) : null;
@@ -968,6 +1030,37 @@ class TurnkeySDKClientBase {
968
1030
  url: fullUrl,
969
1031
  };
970
1032
  };
1033
+ this.getTvcQosVersions = async (input) => {
1034
+ const sessionData = await getStorageValue(StorageKeys.Session);
1035
+ const session = sessionData ? parseSession(sessionData) : null;
1036
+ return this.request("/public/v1/query/get_tvc_qos_versions", {
1037
+ ...input,
1038
+ organizationId: input.organizationId ??
1039
+ session?.organizationId ??
1040
+ this.config.organizationId,
1041
+ });
1042
+ };
1043
+ this.stampGetTvcQosVersions = async (input) => {
1044
+ if (!this.stamper) {
1045
+ return undefined;
1046
+ }
1047
+ const sessionData = await getStorageValue(StorageKeys.Session);
1048
+ const session = sessionData ? parseSession(sessionData) : null;
1049
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_tvc_qos_versions";
1050
+ const body = {
1051
+ ...input,
1052
+ organizationId: input.organizationId ??
1053
+ session?.organizationId ??
1054
+ this.config.organizationId,
1055
+ };
1056
+ const stringifiedBody = JSON.stringify(body);
1057
+ const stamp = await this.stamper.stamp(stringifiedBody);
1058
+ return {
1059
+ body: stringifiedBody,
1060
+ stamp: stamp,
1061
+ url: fullUrl,
1062
+ };
1063
+ };
971
1064
  this.getUser = async (input) => {
972
1065
  const sessionData = await getStorageValue(StorageKeys.Session);
973
1066
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1464,6 +1557,37 @@ class TurnkeySDKClientBase {
1464
1557
  url: fullUrl,
1465
1558
  };
1466
1559
  };
1560
+ this.listSecrets = async (input) => {
1561
+ const sessionData = await getStorageValue(StorageKeys.Session);
1562
+ const session = sessionData ? parseSession(sessionData) : null;
1563
+ return this.request("/public/v1/query/list_secrets", {
1564
+ ...input,
1565
+ organizationId: input.organizationId ??
1566
+ session?.organizationId ??
1567
+ this.config.organizationId,
1568
+ });
1569
+ };
1570
+ this.stampListSecrets = async (input) => {
1571
+ if (!this.stamper) {
1572
+ return undefined;
1573
+ }
1574
+ const sessionData = await getStorageValue(StorageKeys.Session);
1575
+ const session = sessionData ? parseSession(sessionData) : null;
1576
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_secrets";
1577
+ const body = {
1578
+ ...input,
1579
+ organizationId: input.organizationId ??
1580
+ session?.organizationId ??
1581
+ this.config.organizationId,
1582
+ };
1583
+ const stringifiedBody = JSON.stringify(body);
1584
+ const stamp = await this.stamper.stamp(stringifiedBody);
1585
+ return {
1586
+ body: stringifiedBody,
1587
+ stamp: stamp,
1588
+ url: fullUrl,
1589
+ };
1590
+ };
1467
1591
  this.getSmartContractInterfaces = async (input) => {
1468
1592
  const sessionData = await getStorageValue(StorageKeys.Session);
1469
1593
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1967,6 +2091,41 @@ class TurnkeySDKClientBase {
1967
2091
  url: fullUrl,
1968
2092
  };
1969
2093
  };
2094
+ this.claimSwapFees = async (input) => {
2095
+ const sessionData = await getStorageValue(StorageKeys.Session);
2096
+ const session = sessionData ? parseSession(sessionData) : null;
2097
+ const { organizationId, timestampMs, ...rest } = input;
2098
+ return this.command("/public/v1/submit/claim_swap_fees", {
2099
+ parameters: rest,
2100
+ organizationId: organizationId ??
2101
+ session?.organizationId ??
2102
+ this.config.organizationId,
2103
+ timestampMs: timestampMs ?? String(Date.now()),
2104
+ type: "ACTIVITY_TYPE_CLAIM_SWAP_FEES",
2105
+ }, "claimSwapFeesResult");
2106
+ };
2107
+ this.stampClaimSwapFees = async (input) => {
2108
+ if (!this.stamper) {
2109
+ return undefined;
2110
+ }
2111
+ const sessionData = await getStorageValue(StorageKeys.Session);
2112
+ const session = sessionData ? parseSession(sessionData) : null;
2113
+ const { organizationId, timestampMs, ...parameters } = input;
2114
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/claim_swap_fees";
2115
+ const bodyWithType = {
2116
+ parameters,
2117
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2118
+ timestampMs: timestampMs ?? String(Date.now()),
2119
+ type: "ACTIVITY_TYPE_CLAIM_SWAP_FEES",
2120
+ };
2121
+ const stringifiedBody = JSON.stringify(bodyWithType);
2122
+ const stamp = await this.stamper.stamp(stringifiedBody);
2123
+ return {
2124
+ body: stringifiedBody,
2125
+ stamp: stamp,
2126
+ url: fullUrl,
2127
+ };
2128
+ };
1970
2129
  this.createApiKeys = async (input) => {
1971
2130
  const sessionData = await getStorageValue(StorageKeys.Session);
1972
2131
  const session = sessionData ? parseSession(sessionData) : null;
@@ -2529,6 +2688,41 @@ class TurnkeySDKClientBase {
2529
2688
  url: fullUrl,
2530
2689
  };
2531
2690
  };
2691
+ this.createSwapQuote = async (input) => {
2692
+ const sessionData = await getStorageValue(StorageKeys.Session);
2693
+ const session = sessionData ? parseSession(sessionData) : null;
2694
+ const { organizationId, timestampMs, ...rest } = input;
2695
+ return this.command("/public/v1/submit/create_swap_quote", {
2696
+ parameters: rest,
2697
+ organizationId: organizationId ??
2698
+ session?.organizationId ??
2699
+ this.config.organizationId,
2700
+ timestampMs: timestampMs ?? String(Date.now()),
2701
+ type: "ACTIVITY_TYPE_CREATE_SWAP_QUOTE",
2702
+ }, "createSwapQuoteResult");
2703
+ };
2704
+ this.stampCreateSwapQuote = async (input) => {
2705
+ if (!this.stamper) {
2706
+ return undefined;
2707
+ }
2708
+ const sessionData = await getStorageValue(StorageKeys.Session);
2709
+ const session = sessionData ? parseSession(sessionData) : null;
2710
+ const { organizationId, timestampMs, ...parameters } = input;
2711
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_swap_quote";
2712
+ const bodyWithType = {
2713
+ parameters,
2714
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2715
+ timestampMs: timestampMs ?? String(Date.now()),
2716
+ type: "ACTIVITY_TYPE_CREATE_SWAP_QUOTE",
2717
+ };
2718
+ const stringifiedBody = JSON.stringify(bodyWithType);
2719
+ const stamp = await this.stamper.stamp(stringifiedBody);
2720
+ return {
2721
+ body: stringifiedBody,
2722
+ stamp: stamp,
2723
+ url: fullUrl,
2724
+ };
2725
+ };
2532
2726
  this.createTvcApp = async (input) => {
2533
2727
  const sessionData = await getStorageValue(StorageKeys.Session);
2534
2728
  const session = sessionData ? parseSession(sessionData) : null;
@@ -3723,6 +3917,76 @@ class TurnkeySDKClientBase {
3723
3917
  url: fullUrl,
3724
3918
  };
3725
3919
  };
3920
+ this.ethUndelegate7702 = async (input) => {
3921
+ const sessionData = await getStorageValue(StorageKeys.Session);
3922
+ const session = sessionData ? parseSession(sessionData) : null;
3923
+ const { organizationId, timestampMs, ...rest } = input;
3924
+ return this.command("/public/v1/submit/eth_undelegate_7702", {
3925
+ parameters: rest,
3926
+ organizationId: organizationId ??
3927
+ session?.organizationId ??
3928
+ this.config.organizationId,
3929
+ timestampMs: timestampMs ?? String(Date.now()),
3930
+ type: "ACTIVITY_TYPE_ETH_UNDELEGATE7702",
3931
+ }, "ethUndelegate7702Result");
3932
+ };
3933
+ this.stampEthUndelegate7702 = async (input) => {
3934
+ if (!this.stamper) {
3935
+ return undefined;
3936
+ }
3937
+ const sessionData = await getStorageValue(StorageKeys.Session);
3938
+ const session = sessionData ? parseSession(sessionData) : null;
3939
+ const { organizationId, timestampMs, ...parameters } = input;
3940
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/eth_undelegate_7702";
3941
+ const bodyWithType = {
3942
+ parameters,
3943
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3944
+ timestampMs: timestampMs ?? String(Date.now()),
3945
+ type: "ACTIVITY_TYPE_ETH_UNDELEGATE7702",
3946
+ };
3947
+ const stringifiedBody = JSON.stringify(bodyWithType);
3948
+ const stamp = await this.stamper.stamp(stringifiedBody);
3949
+ return {
3950
+ body: stringifiedBody,
3951
+ stamp: stamp,
3952
+ url: fullUrl,
3953
+ };
3954
+ };
3955
+ this.executeSwap = async (input) => {
3956
+ const sessionData = await getStorageValue(StorageKeys.Session);
3957
+ const session = sessionData ? parseSession(sessionData) : null;
3958
+ const { organizationId, timestampMs, ...rest } = input;
3959
+ return this.command("/public/v1/submit/execute_swap", {
3960
+ parameters: rest,
3961
+ organizationId: organizationId ??
3962
+ session?.organizationId ??
3963
+ this.config.organizationId,
3964
+ timestampMs: timestampMs ?? String(Date.now()),
3965
+ type: "ACTIVITY_TYPE_EXECUTE_SWAP_V2",
3966
+ }, "executeSwapResult");
3967
+ };
3968
+ this.stampExecuteSwap = async (input) => {
3969
+ if (!this.stamper) {
3970
+ return undefined;
3971
+ }
3972
+ const sessionData = await getStorageValue(StorageKeys.Session);
3973
+ const session = sessionData ? parseSession(sessionData) : null;
3974
+ const { organizationId, timestampMs, ...parameters } = input;
3975
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/execute_swap";
3976
+ const bodyWithType = {
3977
+ parameters,
3978
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3979
+ timestampMs: timestampMs ?? String(Date.now()),
3980
+ type: "ACTIVITY_TYPE_EXECUTE_SWAP_V2",
3981
+ };
3982
+ const stringifiedBody = JSON.stringify(bodyWithType);
3983
+ const stamp = await this.stamper.stamp(stringifiedBody);
3984
+ return {
3985
+ body: stringifiedBody,
3986
+ stamp: stamp,
3987
+ url: fullUrl,
3988
+ };
3989
+ };
3726
3990
  this.exportPrivateKey = async (input) => {
3727
3991
  const sessionData = await getStorageValue(StorageKeys.Session);
3728
3992
  const session = sessionData ? parseSession(sessionData) : null;
@@ -3758,6 +4022,41 @@ class TurnkeySDKClientBase {
3758
4022
  url: fullUrl,
3759
4023
  };
3760
4024
  };
4025
+ this.exportSecrets = async (input) => {
4026
+ const sessionData = await getStorageValue(StorageKeys.Session);
4027
+ const session = sessionData ? parseSession(sessionData) : null;
4028
+ const { organizationId, timestampMs, ...rest } = input;
4029
+ return this.command("/public/v1/submit/export_secrets", {
4030
+ parameters: rest,
4031
+ organizationId: organizationId ??
4032
+ session?.organizationId ??
4033
+ this.config.organizationId,
4034
+ timestampMs: timestampMs ?? String(Date.now()),
4035
+ type: "ACTIVITY_TYPE_EXPORT_SECRETS",
4036
+ }, "exportSecretsResult");
4037
+ };
4038
+ this.stampExportSecrets = async (input) => {
4039
+ if (!this.stamper) {
4040
+ return undefined;
4041
+ }
4042
+ const sessionData = await getStorageValue(StorageKeys.Session);
4043
+ const session = sessionData ? parseSession(sessionData) : null;
4044
+ const { organizationId, timestampMs, ...parameters } = input;
4045
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/export_secrets";
4046
+ const bodyWithType = {
4047
+ parameters,
4048
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
4049
+ timestampMs: timestampMs ?? String(Date.now()),
4050
+ type: "ACTIVITY_TYPE_EXPORT_SECRETS",
4051
+ };
4052
+ const stringifiedBody = JSON.stringify(bodyWithType);
4053
+ const stamp = await this.stamper.stamp(stringifiedBody);
4054
+ return {
4055
+ body: stringifiedBody,
4056
+ stamp: stamp,
4057
+ url: fullUrl,
4058
+ };
4059
+ };
3761
4060
  this.exportWallet = async (input) => {
3762
4061
  const sessionData = await getStorageValue(StorageKeys.Session);
3763
4062
  const session = sessionData ? parseSession(sessionData) : null;
@@ -3863,6 +4162,41 @@ class TurnkeySDKClientBase {
3863
4162
  url: fullUrl,
3864
4163
  };
3865
4164
  };
4165
+ this.importSecrets = async (input) => {
4166
+ const sessionData = await getStorageValue(StorageKeys.Session);
4167
+ const session = sessionData ? parseSession(sessionData) : null;
4168
+ const { organizationId, timestampMs, ...rest } = input;
4169
+ return this.command("/public/v1/submit/import_secrets", {
4170
+ parameters: rest,
4171
+ organizationId: organizationId ??
4172
+ session?.organizationId ??
4173
+ this.config.organizationId,
4174
+ timestampMs: timestampMs ?? String(Date.now()),
4175
+ type: "ACTIVITY_TYPE_IMPORT_SECRETS",
4176
+ }, "importSecretsResult");
4177
+ };
4178
+ this.stampImportSecrets = async (input) => {
4179
+ if (!this.stamper) {
4180
+ return undefined;
4181
+ }
4182
+ const sessionData = await getStorageValue(StorageKeys.Session);
4183
+ const session = sessionData ? parseSession(sessionData) : null;
4184
+ const { organizationId, timestampMs, ...parameters } = input;
4185
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/import_secrets";
4186
+ const bodyWithType = {
4187
+ parameters,
4188
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
4189
+ timestampMs: timestampMs ?? String(Date.now()),
4190
+ type: "ACTIVITY_TYPE_IMPORT_SECRETS",
4191
+ };
4192
+ const stringifiedBody = JSON.stringify(bodyWithType);
4193
+ const stamp = await this.stamper.stamp(stringifiedBody);
4194
+ return {
4195
+ body: stringifiedBody,
4196
+ stamp: stamp,
4197
+ url: fullUrl,
4198
+ };
4199
+ };
3866
4200
  this.importWallet = async (input) => {
3867
4201
  const sessionData = await getStorageValue(StorageKeys.Session);
3868
4202
  const session = sessionData ? parseSession(sessionData) : null;
@@ -5368,6 +5702,41 @@ class TurnkeySDKClientBase {
5368
5702
  url: fullUrl,
5369
5703
  };
5370
5704
  };
5705
+ this.upsertSwapConfig = async (input) => {
5706
+ const sessionData = await getStorageValue(StorageKeys.Session);
5707
+ const session = sessionData ? parseSession(sessionData) : null;
5708
+ const { organizationId, timestampMs, ...rest } = input;
5709
+ return this.command("/public/v1/submit/upsert_swap_config", {
5710
+ parameters: rest,
5711
+ organizationId: organizationId ??
5712
+ session?.organizationId ??
5713
+ this.config.organizationId,
5714
+ timestampMs: timestampMs ?? String(Date.now()),
5715
+ type: "ACTIVITY_TYPE_UPSERT_SWAP_CONFIG",
5716
+ }, "upsertSwapConfigResult");
5717
+ };
5718
+ this.stampUpsertSwapConfig = async (input) => {
5719
+ if (!this.stamper) {
5720
+ return undefined;
5721
+ }
5722
+ const sessionData = await getStorageValue(StorageKeys.Session);
5723
+ const session = sessionData ? parseSession(sessionData) : null;
5724
+ const { organizationId, timestampMs, ...parameters } = input;
5725
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/upsert_swap_config";
5726
+ const bodyWithType = {
5727
+ parameters,
5728
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
5729
+ timestampMs: timestampMs ?? String(Date.now()),
5730
+ type: "ACTIVITY_TYPE_UPSERT_SWAP_CONFIG",
5731
+ };
5732
+ const stringifiedBody = JSON.stringify(bodyWithType);
5733
+ const stamp = await this.stamper.stamp(stringifiedBody);
5734
+ return {
5735
+ body: stringifiedBody,
5736
+ stamp: stamp,
5737
+ url: fullUrl,
5738
+ };
5739
+ };
5371
5740
  this.verifyOtp = async (input) => {
5372
5741
  const sessionData = await getStorageValue(StorageKeys.Session);
5373
5742
  const session = sessionData ? parseSession(sessionData) : null;