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