@turnkey/sdk-browser 8.1.0 → 8.2.1

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.
@@ -1030,6 +1030,37 @@ class TurnkeySDKClientBase {
1030
1030
  url: fullUrl,
1031
1031
  };
1032
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
+ };
1033
1064
  this.getUser = async (input) => {
1034
1065
  const sessionData = await getStorageValue(StorageKeys.Session);
1035
1066
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1526,6 +1557,37 @@ class TurnkeySDKClientBase {
1526
1557
  url: fullUrl,
1527
1558
  };
1528
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
+ };
1529
1591
  this.getSmartContractInterfaces = async (input) => {
1530
1592
  const sessionData = await getStorageValue(StorageKeys.Session);
1531
1593
  const session = sessionData ? parseSession(sessionData) : null;
@@ -2626,6 +2688,41 @@ class TurnkeySDKClientBase {
2626
2688
  url: fullUrl,
2627
2689
  };
2628
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
+ };
2629
2726
  this.createTvcApp = async (input) => {
2630
2727
  const sessionData = await getStorageValue(StorageKeys.Session);
2631
2728
  const session = sessionData ? parseSession(sessionData) : null;
@@ -3855,6 +3952,41 @@ class TurnkeySDKClientBase {
3855
3952
  url: fullUrl,
3856
3953
  };
3857
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
+ };
3858
3990
  this.exportPrivateKey = async (input) => {
3859
3991
  const sessionData = await getStorageValue(StorageKeys.Session);
3860
3992
  const session = sessionData ? parseSession(sessionData) : null;
@@ -3890,6 +4022,41 @@ class TurnkeySDKClientBase {
3890
4022
  url: fullUrl,
3891
4023
  };
3892
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
+ };
3893
4060
  this.exportWallet = async (input) => {
3894
4061
  const sessionData = await getStorageValue(StorageKeys.Session);
3895
4062
  const session = sessionData ? parseSession(sessionData) : null;
@@ -3995,6 +4162,41 @@ class TurnkeySDKClientBase {
3995
4162
  url: fullUrl,
3996
4163
  };
3997
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
+ };
3998
4200
  this.importWallet = async (input) => {
3999
4201
  const sessionData = await getStorageValue(StorageKeys.Session);
4000
4202
  const session = sessionData ? parseSession(sessionData) : null;