@turnkey/sdk-browser 6.1.1 → 7.0.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.
@@ -317,6 +317,99 @@ class TurnkeySDKClientBase {
317
317
  url: fullUrl,
318
318
  };
319
319
  };
320
+ this.getMfaPolicies = async (input) => {
321
+ const sessionData = await getStorageValue(StorageKeys.Session);
322
+ const session = sessionData ? parseSession(sessionData) : null;
323
+ return this.request("/public/v1/query/get_mfa_policies", {
324
+ ...input,
325
+ organizationId: input.organizationId ??
326
+ session?.organizationId ??
327
+ this.config.organizationId,
328
+ });
329
+ };
330
+ this.stampGetMfaPolicies = async (input) => {
331
+ if (!this.stamper) {
332
+ return undefined;
333
+ }
334
+ const sessionData = await getStorageValue(StorageKeys.Session);
335
+ const session = sessionData ? parseSession(sessionData) : null;
336
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_mfa_policies";
337
+ const body = {
338
+ ...input,
339
+ organizationId: input.organizationId ??
340
+ session?.organizationId ??
341
+ this.config.organizationId,
342
+ };
343
+ const stringifiedBody = JSON.stringify(body);
344
+ const stamp = await this.stamper.stamp(stringifiedBody);
345
+ return {
346
+ body: stringifiedBody,
347
+ stamp: stamp,
348
+ url: fullUrl,
349
+ };
350
+ };
351
+ this.getMfaPolicy = async (input) => {
352
+ const sessionData = await getStorageValue(StorageKeys.Session);
353
+ const session = sessionData ? parseSession(sessionData) : null;
354
+ return this.request("/public/v1/query/get_mfa_policy", {
355
+ ...input,
356
+ organizationId: input.organizationId ??
357
+ session?.organizationId ??
358
+ this.config.organizationId,
359
+ });
360
+ };
361
+ this.stampGetMfaPolicy = async (input) => {
362
+ if (!this.stamper) {
363
+ return undefined;
364
+ }
365
+ const sessionData = await getStorageValue(StorageKeys.Session);
366
+ const session = sessionData ? parseSession(sessionData) : null;
367
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_mfa_policy";
368
+ const body = {
369
+ ...input,
370
+ organizationId: input.organizationId ??
371
+ session?.organizationId ??
372
+ this.config.organizationId,
373
+ };
374
+ const stringifiedBody = JSON.stringify(body);
375
+ const stamp = await this.stamper.stamp(stringifiedBody);
376
+ return {
377
+ body: stringifiedBody,
378
+ stamp: stamp,
379
+ url: fullUrl,
380
+ };
381
+ };
382
+ this.getMfaStatus = async (input) => {
383
+ const sessionData = await getStorageValue(StorageKeys.Session);
384
+ const session = sessionData ? parseSession(sessionData) : null;
385
+ return this.request("/public/v1/query/get_mfa_status", {
386
+ ...input,
387
+ organizationId: input.organizationId ??
388
+ session?.organizationId ??
389
+ this.config.organizationId,
390
+ });
391
+ };
392
+ this.stampGetMfaStatus = async (input) => {
393
+ if (!this.stamper) {
394
+ return undefined;
395
+ }
396
+ const sessionData = await getStorageValue(StorageKeys.Session);
397
+ const session = sessionData ? parseSession(sessionData) : null;
398
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_mfa_status";
399
+ const body = {
400
+ ...input,
401
+ organizationId: input.organizationId ??
402
+ session?.organizationId ??
403
+ this.config.organizationId,
404
+ };
405
+ const stringifiedBody = JSON.stringify(body);
406
+ const stamp = await this.stamper.stamp(stringifiedBody);
407
+ return {
408
+ body: stringifiedBody,
409
+ stamp: stamp,
410
+ url: fullUrl,
411
+ };
412
+ };
320
413
  this.getNonces = async (input) => {
321
414
  const sessionData = await getStorageValue(StorageKeys.Session);
322
415
  const session = sessionData ? parseSession(sessionData) : null;
@@ -596,6 +689,68 @@ class TurnkeySDKClientBase {
596
689
  url: fullUrl,
597
690
  };
598
691
  };
692
+ this.getSessionProfile = async (input) => {
693
+ const sessionData = await getStorageValue(StorageKeys.Session);
694
+ const session = sessionData ? parseSession(sessionData) : null;
695
+ return this.request("/public/v1/query/get_session_profile", {
696
+ ...input,
697
+ organizationId: input.organizationId ??
698
+ session?.organizationId ??
699
+ this.config.organizationId,
700
+ });
701
+ };
702
+ this.stampGetSessionProfile = async (input) => {
703
+ if (!this.stamper) {
704
+ return undefined;
705
+ }
706
+ const sessionData = await getStorageValue(StorageKeys.Session);
707
+ const session = sessionData ? parseSession(sessionData) : null;
708
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_session_profile";
709
+ const body = {
710
+ ...input,
711
+ organizationId: input.organizationId ??
712
+ session?.organizationId ??
713
+ this.config.organizationId,
714
+ };
715
+ const stringifiedBody = JSON.stringify(body);
716
+ const stamp = await this.stamper.stamp(stringifiedBody);
717
+ return {
718
+ body: stringifiedBody,
719
+ stamp: stamp,
720
+ url: fullUrl,
721
+ };
722
+ };
723
+ this.getSessionProfiles = async (input) => {
724
+ const sessionData = await getStorageValue(StorageKeys.Session);
725
+ const session = sessionData ? parseSession(sessionData) : null;
726
+ return this.request("/public/v1/query/get_session_profiles", {
727
+ ...input,
728
+ organizationId: input.organizationId ??
729
+ session?.organizationId ??
730
+ this.config.organizationId,
731
+ });
732
+ };
733
+ this.stampGetSessionProfiles = async (input) => {
734
+ if (!this.stamper) {
735
+ return undefined;
736
+ }
737
+ const sessionData = await getStorageValue(StorageKeys.Session);
738
+ const session = sessionData ? parseSession(sessionData) : null;
739
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_session_profiles";
740
+ const body = {
741
+ ...input,
742
+ organizationId: input.organizationId ??
743
+ session?.organizationId ??
744
+ this.config.organizationId,
745
+ };
746
+ const stringifiedBody = JSON.stringify(body);
747
+ const stamp = await this.stamper.stamp(stringifiedBody);
748
+ return {
749
+ body: stringifiedBody,
750
+ stamp: stamp,
751
+ url: fullUrl,
752
+ };
753
+ };
599
754
  this.getSmartContractInterface = async (input) => {
600
755
  const sessionData = await getStorageValue(StorageKeys.Session);
601
756
  const session = sessionData ? parseSession(sessionData) : null;
@@ -689,6 +844,37 @@ class TurnkeySDKClientBase {
689
844
  url: fullUrl,
690
845
  };
691
846
  };
847
+ this.getTvcDeploymentDebugLogs = async (input) => {
848
+ const sessionData = await getStorageValue(StorageKeys.Session);
849
+ const session = sessionData ? parseSession(sessionData) : null;
850
+ return this.request("/public/v1/query/get_tvc_deployment_debug_logs", {
851
+ ...input,
852
+ organizationId: input.organizationId ??
853
+ session?.organizationId ??
854
+ this.config.organizationId,
855
+ });
856
+ };
857
+ this.stampGetTvcDeploymentDebugLogs = async (input) => {
858
+ if (!this.stamper) {
859
+ return undefined;
860
+ }
861
+ const sessionData = await getStorageValue(StorageKeys.Session);
862
+ const session = sessionData ? parseSession(sessionData) : null;
863
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_tvc_deployment_debug_logs";
864
+ const body = {
865
+ ...input,
866
+ organizationId: input.organizationId ??
867
+ session?.organizationId ??
868
+ this.config.organizationId,
869
+ };
870
+ const stringifiedBody = JSON.stringify(body);
871
+ const stamp = await this.stamper.stamp(stringifiedBody);
872
+ return {
873
+ body: stringifiedBody,
874
+ stamp: stamp,
875
+ url: fullUrl,
876
+ };
877
+ };
692
878
  this.getUser = async (input) => {
693
879
  const sessionData = await getStorageValue(StorageKeys.Session);
694
880
  const session = sessionData ? parseSession(sessionData) : null;
@@ -875,6 +1061,37 @@ class TurnkeySDKClientBase {
875
1061
  url: fullUrl,
876
1062
  };
877
1063
  };
1064
+ this.listEmailEvents = async (input) => {
1065
+ const sessionData = await getStorageValue(StorageKeys.Session);
1066
+ const session = sessionData ? parseSession(sessionData) : null;
1067
+ return this.request("/public/v1/query/list_email_events", {
1068
+ ...input,
1069
+ organizationId: input.organizationId ??
1070
+ session?.organizationId ??
1071
+ this.config.organizationId,
1072
+ });
1073
+ };
1074
+ this.stampListEmailEvents = async (input) => {
1075
+ if (!this.stamper) {
1076
+ return undefined;
1077
+ }
1078
+ const sessionData = await getStorageValue(StorageKeys.Session);
1079
+ const session = sessionData ? parseSession(sessionData) : null;
1080
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_email_events";
1081
+ const body = {
1082
+ ...input,
1083
+ organizationId: input.organizationId ??
1084
+ session?.organizationId ??
1085
+ this.config.organizationId,
1086
+ };
1087
+ const stringifiedBody = JSON.stringify(body);
1088
+ const stamp = await this.stamper.stamp(stringifiedBody);
1089
+ return {
1090
+ body: stringifiedBody,
1091
+ stamp: stamp,
1092
+ url: fullUrl,
1093
+ };
1094
+ };
878
1095
  this.listFiatOnRampCredentials = async (input) => {
879
1096
  const sessionData = await getStorageValue(StorageKeys.Session);
880
1097
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1608,6 +1825,41 @@ class TurnkeySDKClientBase {
1608
1825
  url: fullUrl,
1609
1826
  };
1610
1827
  };
1828
+ this.createMfaPolicy = async (input) => {
1829
+ const sessionData = await getStorageValue(StorageKeys.Session);
1830
+ const session = sessionData ? parseSession(sessionData) : null;
1831
+ const { organizationId, timestampMs, ...rest } = input;
1832
+ return this.command("/public/v1/submit/create_mfa_policy", {
1833
+ parameters: rest,
1834
+ organizationId: organizationId ??
1835
+ session?.organizationId ??
1836
+ this.config.organizationId,
1837
+ timestampMs: timestampMs ?? String(Date.now()),
1838
+ type: "ACTIVITY_TYPE_CREATE_MFA_POLICY",
1839
+ }, "createMfaPolicyResult");
1840
+ };
1841
+ this.stampCreateMfaPolicy = async (input) => {
1842
+ if (!this.stamper) {
1843
+ return undefined;
1844
+ }
1845
+ const sessionData = await getStorageValue(StorageKeys.Session);
1846
+ const session = sessionData ? parseSession(sessionData) : null;
1847
+ const { organizationId, timestampMs, ...parameters } = input;
1848
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_mfa_policy";
1849
+ const bodyWithType = {
1850
+ parameters,
1851
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1852
+ timestampMs: timestampMs ?? String(Date.now()),
1853
+ type: "ACTIVITY_TYPE_CREATE_MFA_POLICY",
1854
+ };
1855
+ const stringifiedBody = JSON.stringify(bodyWithType);
1856
+ const stamp = await this.stamper.stamp(stringifiedBody);
1857
+ return {
1858
+ body: stringifiedBody,
1859
+ stamp: stamp,
1860
+ url: fullUrl,
1861
+ };
1862
+ };
1611
1863
  this.createOauth2Credential = async (input) => {
1612
1864
  const sessionData = await getStorageValue(StorageKeys.Session);
1613
1865
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1888,6 +2140,41 @@ class TurnkeySDKClientBase {
1888
2140
  url: fullUrl,
1889
2141
  };
1890
2142
  };
2143
+ this.createSessionProfile = async (input) => {
2144
+ const sessionData = await getStorageValue(StorageKeys.Session);
2145
+ const session = sessionData ? parseSession(sessionData) : null;
2146
+ const { organizationId, timestampMs, ...rest } = input;
2147
+ return this.command("/public/v1/submit/create_session_profile", {
2148
+ parameters: rest,
2149
+ organizationId: organizationId ??
2150
+ session?.organizationId ??
2151
+ this.config.organizationId,
2152
+ timestampMs: timestampMs ?? String(Date.now()),
2153
+ type: "ACTIVITY_TYPE_CREATE_SESSION_PROFILE",
2154
+ }, "createSessionProfileResult");
2155
+ };
2156
+ this.stampCreateSessionProfile = async (input) => {
2157
+ if (!this.stamper) {
2158
+ return undefined;
2159
+ }
2160
+ const sessionData = await getStorageValue(StorageKeys.Session);
2161
+ const session = sessionData ? parseSession(sessionData) : null;
2162
+ const { organizationId, timestampMs, ...parameters } = input;
2163
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_session_profile";
2164
+ const bodyWithType = {
2165
+ parameters,
2166
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2167
+ timestampMs: timestampMs ?? String(Date.now()),
2168
+ type: "ACTIVITY_TYPE_CREATE_SESSION_PROFILE",
2169
+ };
2170
+ const stringifiedBody = JSON.stringify(bodyWithType);
2171
+ const stamp = await this.stamper.stamp(stringifiedBody);
2172
+ return {
2173
+ body: stringifiedBody,
2174
+ stamp: stamp,
2175
+ url: fullUrl,
2176
+ };
2177
+ };
1891
2178
  this.createSmartContractInterface = async (input) => {
1892
2179
  const sessionData = await getStorageValue(StorageKeys.Session);
1893
2180
  const session = sessionData ? parseSession(sessionData) : null;
@@ -2381,6 +2668,41 @@ class TurnkeySDKClientBase {
2381
2668
  url: fullUrl,
2382
2669
  };
2383
2670
  };
2671
+ this.deleteMfaPolicy = async (input) => {
2672
+ const sessionData = await getStorageValue(StorageKeys.Session);
2673
+ const session = sessionData ? parseSession(sessionData) : null;
2674
+ const { organizationId, timestampMs, ...rest } = input;
2675
+ return this.command("/public/v1/submit/delete_mfa_policy", {
2676
+ parameters: rest,
2677
+ organizationId: organizationId ??
2678
+ session?.organizationId ??
2679
+ this.config.organizationId,
2680
+ timestampMs: timestampMs ?? String(Date.now()),
2681
+ type: "ACTIVITY_TYPE_DELETE_MFA_POLICY",
2682
+ }, "deleteMfaPolicyResult");
2683
+ };
2684
+ this.stampDeleteMfaPolicy = async (input) => {
2685
+ if (!this.stamper) {
2686
+ return undefined;
2687
+ }
2688
+ const sessionData = await getStorageValue(StorageKeys.Session);
2689
+ const session = sessionData ? parseSession(sessionData) : null;
2690
+ const { organizationId, timestampMs, ...parameters } = input;
2691
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_mfa_policy";
2692
+ const bodyWithType = {
2693
+ parameters,
2694
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2695
+ timestampMs: timestampMs ?? String(Date.now()),
2696
+ type: "ACTIVITY_TYPE_DELETE_MFA_POLICY",
2697
+ };
2698
+ const stringifiedBody = JSON.stringify(bodyWithType);
2699
+ const stamp = await this.stamper.stamp(stringifiedBody);
2700
+ return {
2701
+ body: stringifiedBody,
2702
+ stamp: stamp,
2703
+ url: fullUrl,
2704
+ };
2705
+ };
2384
2706
  this.deleteOauth2Credential = async (input) => {
2385
2707
  const sessionData = await getStorageValue(StorageKeys.Session);
2386
2708
  const session = sessionData ? parseSession(sessionData) : null;
@@ -2953,8 +3275,8 @@ class TurnkeySDKClientBase {
2953
3275
  session?.organizationId ??
2954
3276
  this.config.organizationId,
2955
3277
  timestampMs: timestampMs ?? String(Date.now()),
2956
- type: "ACTIVITY_TYPE_ETH_SEND_TRANSACTION",
2957
- }, "ethSendTransactionResult");
3278
+ type: "ACTIVITY_TYPE_ETH_SEND_TRANSACTION_V2",
3279
+ }, "ethSendTransactionResultV2");
2958
3280
  };
2959
3281
  this.stampEthSendTransaction = async (input) => {
2960
3282
  if (!this.stamper) {
@@ -2968,7 +3290,7 @@ class TurnkeySDKClientBase {
2968
3290
  parameters,
2969
3291
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2970
3292
  timestampMs: timestampMs ?? String(Date.now()),
2971
- type: "ACTIVITY_TYPE_ETH_SEND_TRANSACTION",
3293
+ type: "ACTIVITY_TYPE_ETH_SEND_TRANSACTION_V2",
2972
3294
  };
2973
3295
  const stringifiedBody = JSON.stringify(bodyWithType);
2974
3296
  const stamp = await this.stamper.stamp(stringifiedBody);
@@ -4168,6 +4490,41 @@ class TurnkeySDKClientBase {
4168
4490
  url: fullUrl,
4169
4491
  };
4170
4492
  };
4493
+ this.updateMfaPolicy = async (input) => {
4494
+ const sessionData = await getStorageValue(StorageKeys.Session);
4495
+ const session = sessionData ? parseSession(sessionData) : null;
4496
+ const { organizationId, timestampMs, ...rest } = input;
4497
+ return this.command("/public/v1/submit/update_mfa_policy", {
4498
+ parameters: rest,
4499
+ organizationId: organizationId ??
4500
+ session?.organizationId ??
4501
+ this.config.organizationId,
4502
+ timestampMs: timestampMs ?? String(Date.now()),
4503
+ type: "ACTIVITY_TYPE_UPDATE_MFA_POLICY",
4504
+ }, "updateMfaPolicyResult");
4505
+ };
4506
+ this.stampUpdateMfaPolicy = async (input) => {
4507
+ if (!this.stamper) {
4508
+ return undefined;
4509
+ }
4510
+ const sessionData = await getStorageValue(StorageKeys.Session);
4511
+ const session = sessionData ? parseSession(sessionData) : null;
4512
+ const { organizationId, timestampMs, ...parameters } = input;
4513
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_mfa_policy";
4514
+ const bodyWithType = {
4515
+ parameters,
4516
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
4517
+ timestampMs: timestampMs ?? String(Date.now()),
4518
+ type: "ACTIVITY_TYPE_UPDATE_MFA_POLICY",
4519
+ };
4520
+ const stringifiedBody = JSON.stringify(bodyWithType);
4521
+ const stamp = await this.stamper.stamp(stringifiedBody);
4522
+ return {
4523
+ body: stringifiedBody,
4524
+ stamp: stamp,
4525
+ url: fullUrl,
4526
+ };
4527
+ };
4171
4528
  this.updateOauth2Credential = async (input) => {
4172
4529
  const sessionData = await getStorageValue(StorageKeys.Session);
4173
4530
  const session = sessionData ? parseSession(sessionData) : null;