@turnkey/core 2.5.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.
@@ -995,6 +995,36 @@ class TurnkeySDKClientBase {
995
995
  url: fullUrl,
996
996
  };
997
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
+ };
998
1028
  this.getUser = async (input, stampWith) => {
999
1029
  const session = await this.storageManager?.getActiveSession();
1000
1030
  return this.request("/public/v1/query/get_user", {
@@ -1475,6 +1505,36 @@ class TurnkeySDKClientBase {
1475
1505
  url: fullUrl,
1476
1506
  };
1477
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
+ };
1478
1538
  this.getSmartContractInterfaces = async (input, stampWith) => {
1479
1539
  const session = await this.storageManager?.getActiveSession();
1480
1540
  return this.request("/public/v1/query/list_smart_contract_interfaces", {
@@ -2600,6 +2660,43 @@ class TurnkeySDKClientBase {
2600
2660
  url: fullUrl,
2601
2661
  };
2602
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
+ };
2603
2700
  this.createTvcApp = async (input, stampWith) => {
2604
2701
  const { organizationId, timestampMs, ...rest } = input;
2605
2702
  //@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
@@ -3862,6 +3959,43 @@ class TurnkeySDKClientBase {
3862
3959
  url: fullUrl,
3863
3960
  };
3864
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
+ };
3865
3999
  this.exportPrivateKey = async (input, stampWith) => {
3866
4000
  const { organizationId, timestampMs, ...rest } = input;
3867
4001
  //@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
@@ -3899,6 +4033,43 @@ class TurnkeySDKClientBase {
3899
4033
  url: fullUrl,
3900
4034
  };
3901
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
+ };
3902
4073
  this.exportWallet = async (input, stampWith) => {
3903
4074
  const { organizationId, timestampMs, ...rest } = input;
3904
4075
  //@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
@@ -4010,6 +4181,43 @@ class TurnkeySDKClientBase {
4010
4181
  url: fullUrl,
4011
4182
  };
4012
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
+ };
4013
4221
  this.importWallet = async (input, stampWith) => {
4014
4222
  const { organizationId, timestampMs, ...rest } = input;
4015
4223
  //@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it