@turnkey/sdk-browser 8.0.0 → 8.1.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;
@@ -1967,6 +2029,41 @@ class TurnkeySDKClientBase {
1967
2029
  url: fullUrl,
1968
2030
  };
1969
2031
  };
2032
+ this.claimSwapFees = async (input) => {
2033
+ const sessionData = await getStorageValue(StorageKeys.Session);
2034
+ const session = sessionData ? parseSession(sessionData) : null;
2035
+ const { organizationId, timestampMs, ...rest } = input;
2036
+ return this.command("/public/v1/submit/claim_swap_fees", {
2037
+ parameters: rest,
2038
+ organizationId: organizationId ??
2039
+ session?.organizationId ??
2040
+ this.config.organizationId,
2041
+ timestampMs: timestampMs ?? String(Date.now()),
2042
+ type: "ACTIVITY_TYPE_CLAIM_SWAP_FEES",
2043
+ }, "claimSwapFeesResult");
2044
+ };
2045
+ this.stampClaimSwapFees = async (input) => {
2046
+ if (!this.stamper) {
2047
+ return undefined;
2048
+ }
2049
+ const sessionData = await getStorageValue(StorageKeys.Session);
2050
+ const session = sessionData ? parseSession(sessionData) : null;
2051
+ const { organizationId, timestampMs, ...parameters } = input;
2052
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/claim_swap_fees";
2053
+ const bodyWithType = {
2054
+ parameters,
2055
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2056
+ timestampMs: timestampMs ?? String(Date.now()),
2057
+ type: "ACTIVITY_TYPE_CLAIM_SWAP_FEES",
2058
+ };
2059
+ const stringifiedBody = JSON.stringify(bodyWithType);
2060
+ const stamp = await this.stamper.stamp(stringifiedBody);
2061
+ return {
2062
+ body: stringifiedBody,
2063
+ stamp: stamp,
2064
+ url: fullUrl,
2065
+ };
2066
+ };
1970
2067
  this.createApiKeys = async (input) => {
1971
2068
  const sessionData = await getStorageValue(StorageKeys.Session);
1972
2069
  const session = sessionData ? parseSession(sessionData) : null;
@@ -3723,6 +3820,41 @@ class TurnkeySDKClientBase {
3723
3820
  url: fullUrl,
3724
3821
  };
3725
3822
  };
3823
+ this.ethUndelegate7702 = async (input) => {
3824
+ const sessionData = await getStorageValue(StorageKeys.Session);
3825
+ const session = sessionData ? parseSession(sessionData) : null;
3826
+ const { organizationId, timestampMs, ...rest } = input;
3827
+ return this.command("/public/v1/submit/eth_undelegate_7702", {
3828
+ parameters: rest,
3829
+ organizationId: organizationId ??
3830
+ session?.organizationId ??
3831
+ this.config.organizationId,
3832
+ timestampMs: timestampMs ?? String(Date.now()),
3833
+ type: "ACTIVITY_TYPE_ETH_UNDELEGATE7702",
3834
+ }, "ethUndelegate7702Result");
3835
+ };
3836
+ this.stampEthUndelegate7702 = async (input) => {
3837
+ if (!this.stamper) {
3838
+ return undefined;
3839
+ }
3840
+ const sessionData = await getStorageValue(StorageKeys.Session);
3841
+ const session = sessionData ? parseSession(sessionData) : null;
3842
+ const { organizationId, timestampMs, ...parameters } = input;
3843
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/eth_undelegate_7702";
3844
+ const bodyWithType = {
3845
+ parameters,
3846
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3847
+ timestampMs: timestampMs ?? String(Date.now()),
3848
+ type: "ACTIVITY_TYPE_ETH_UNDELEGATE7702",
3849
+ };
3850
+ const stringifiedBody = JSON.stringify(bodyWithType);
3851
+ const stamp = await this.stamper.stamp(stringifiedBody);
3852
+ return {
3853
+ body: stringifiedBody,
3854
+ stamp: stamp,
3855
+ url: fullUrl,
3856
+ };
3857
+ };
3726
3858
  this.exportPrivateKey = async (input) => {
3727
3859
  const sessionData = await getStorageValue(StorageKeys.Session);
3728
3860
  const session = sessionData ? parseSession(sessionData) : null;
@@ -5368,6 +5500,41 @@ class TurnkeySDKClientBase {
5368
5500
  url: fullUrl,
5369
5501
  };
5370
5502
  };
5503
+ this.upsertSwapConfig = async (input) => {
5504
+ const sessionData = await getStorageValue(StorageKeys.Session);
5505
+ const session = sessionData ? parseSession(sessionData) : null;
5506
+ const { organizationId, timestampMs, ...rest } = input;
5507
+ return this.command("/public/v1/submit/upsert_swap_config", {
5508
+ parameters: rest,
5509
+ organizationId: organizationId ??
5510
+ session?.organizationId ??
5511
+ this.config.organizationId,
5512
+ timestampMs: timestampMs ?? String(Date.now()),
5513
+ type: "ACTIVITY_TYPE_UPSERT_SWAP_CONFIG",
5514
+ }, "upsertSwapConfigResult");
5515
+ };
5516
+ this.stampUpsertSwapConfig = async (input) => {
5517
+ if (!this.stamper) {
5518
+ return undefined;
5519
+ }
5520
+ const sessionData = await getStorageValue(StorageKeys.Session);
5521
+ const session = sessionData ? parseSession(sessionData) : null;
5522
+ const { organizationId, timestampMs, ...parameters } = input;
5523
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/upsert_swap_config";
5524
+ const bodyWithType = {
5525
+ parameters,
5526
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
5527
+ timestampMs: timestampMs ?? String(Date.now()),
5528
+ type: "ACTIVITY_TYPE_UPSERT_SWAP_CONFIG",
5529
+ };
5530
+ const stringifiedBody = JSON.stringify(bodyWithType);
5531
+ const stamp = await this.stamper.stamp(stringifiedBody);
5532
+ return {
5533
+ body: stringifiedBody,
5534
+ stamp: stamp,
5535
+ url: fullUrl,
5536
+ };
5537
+ };
5371
5538
  this.verifyOtp = async (input) => {
5372
5539
  const sessionData = await getStorageValue(StorageKeys.Session);
5373
5540
  const session = sessionData ? parseSession(sessionData) : null;