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