@turnkey/core 1.0.0-beta.2 → 1.0.0-beta.5

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.
Files changed (89) hide show
  1. package/dist/__clients__/core.d.ts +92 -9
  2. package/dist/__clients__/core.d.ts.map +1 -1
  3. package/dist/__clients__/core.js +699 -535
  4. package/dist/__clients__/core.js.map +1 -1
  5. package/dist/__clients__/core.mjs +702 -538
  6. package/dist/__clients__/core.mjs.map +1 -1
  7. package/dist/__generated__/sdk-client-base.d.ts +1 -1
  8. package/dist/__generated__/sdk-client-base.d.ts.map +1 -1
  9. package/dist/__generated__/sdk-client-base.js +156 -253
  10. package/dist/__generated__/sdk-client-base.js.map +1 -1
  11. package/dist/__generated__/sdk-client-base.mjs +156 -253
  12. package/dist/__generated__/sdk-client-base.mjs.map +1 -1
  13. package/dist/__generated__/version.d.ts +1 -1
  14. package/dist/__generated__/version.js +1 -1
  15. package/dist/__generated__/version.mjs +1 -1
  16. package/dist/__inputs__/public_api.types.d.ts +377 -504
  17. package/dist/__inputs__/public_api.types.d.ts.map +1 -1
  18. package/dist/__types__/base.d.ts +193 -75
  19. package/dist/__types__/base.d.ts.map +1 -1
  20. package/dist/__types__/base.js +14 -13
  21. package/dist/__types__/base.js.map +1 -1
  22. package/dist/__types__/base.mjs +15 -14
  23. package/dist/__types__/base.mjs.map +1 -1
  24. package/dist/__wallet__/base.d.ts +11 -0
  25. package/dist/__wallet__/base.d.ts.map +1 -1
  26. package/dist/__wallet__/base.js +12 -1
  27. package/dist/__wallet__/base.js.map +1 -1
  28. package/dist/__wallet__/base.mjs +12 -1
  29. package/dist/__wallet__/base.mjs.map +1 -1
  30. package/dist/__wallet__/connector.d.ts +31 -4
  31. package/dist/__wallet__/connector.d.ts.map +1 -1
  32. package/dist/__wallet__/connector.js +35 -5
  33. package/dist/__wallet__/connector.js.map +1 -1
  34. package/dist/__wallet__/connector.mjs +35 -5
  35. package/dist/__wallet__/connector.mjs.map +1 -1
  36. package/dist/__wallet__/mobile/manager.d.ts +21 -5
  37. package/dist/__wallet__/mobile/manager.d.ts.map +1 -1
  38. package/dist/__wallet__/mobile/manager.js +28 -11
  39. package/dist/__wallet__/mobile/manager.js.map +1 -1
  40. package/dist/__wallet__/mobile/manager.mjs +28 -11
  41. package/dist/__wallet__/mobile/manager.mjs.map +1 -1
  42. package/dist/__wallet__/stamper.d.ts +73 -2
  43. package/dist/__wallet__/stamper.d.ts.map +1 -1
  44. package/dist/__wallet__/stamper.js +81 -15
  45. package/dist/__wallet__/stamper.js.map +1 -1
  46. package/dist/__wallet__/stamper.mjs +82 -16
  47. package/dist/__wallet__/stamper.mjs.map +1 -1
  48. package/dist/__wallet__/wallet-connect/base.d.ts +102 -19
  49. package/dist/__wallet__/wallet-connect/base.d.ts.map +1 -1
  50. package/dist/__wallet__/wallet-connect/base.js +198 -77
  51. package/dist/__wallet__/wallet-connect/base.js.map +1 -1
  52. package/dist/__wallet__/wallet-connect/base.mjs +198 -77
  53. package/dist/__wallet__/wallet-connect/base.mjs.map +1 -1
  54. package/dist/__wallet__/wallet-connect/client.d.ts +50 -17
  55. package/dist/__wallet__/wallet-connect/client.d.ts.map +1 -1
  56. package/dist/__wallet__/wallet-connect/client.js +76 -19
  57. package/dist/__wallet__/wallet-connect/client.js.map +1 -1
  58. package/dist/__wallet__/wallet-connect/client.mjs +76 -19
  59. package/dist/__wallet__/wallet-connect/client.mjs.map +1 -1
  60. package/dist/__wallet__/web/manager.d.ts +20 -12
  61. package/dist/__wallet__/web/manager.d.ts.map +1 -1
  62. package/dist/__wallet__/web/manager.js +29 -21
  63. package/dist/__wallet__/web/manager.js.map +1 -1
  64. package/dist/__wallet__/web/manager.mjs +29 -21
  65. package/dist/__wallet__/web/manager.mjs.map +1 -1
  66. package/dist/__wallet__/web/native/ethereum.d.ts +45 -11
  67. package/dist/__wallet__/web/native/ethereum.d.ts.map +1 -1
  68. package/dist/__wallet__/web/native/ethereum.js +58 -17
  69. package/dist/__wallet__/web/native/ethereum.js.map +1 -1
  70. package/dist/__wallet__/web/native/ethereum.mjs +58 -17
  71. package/dist/__wallet__/web/native/ethereum.mjs.map +1 -1
  72. package/dist/__wallet__/web/native/solana.d.ts +56 -3
  73. package/dist/__wallet__/web/native/solana.d.ts.map +1 -1
  74. package/dist/__wallet__/web/native/solana.js +95 -36
  75. package/dist/__wallet__/web/native/solana.js.map +1 -1
  76. package/dist/__wallet__/web/native/solana.mjs +95 -36
  77. package/dist/__wallet__/web/native/solana.mjs.map +1 -1
  78. package/dist/index.d.ts +2 -1
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +2 -10
  81. package/dist/index.js.map +1 -1
  82. package/dist/index.mjs +2 -2
  83. package/dist/utils.d.ts +59 -13
  84. package/dist/utils.d.ts.map +1 -1
  85. package/dist/utils.js +105 -30
  86. package/dist/utils.js.map +1 -1
  87. package/dist/utils.mjs +103 -29
  88. package/dist/utils.mjs.map +1 -1
  89. package/package.json +8 -8
@@ -4,14 +4,12 @@ var http = require('@turnkey/http');
4
4
  var base = require('../__types__/base.js');
5
5
  var version = require('./version.js');
6
6
  var sdkTypes = require('@turnkey/sdk-types');
7
- var utils = require('../utils.js');
8
7
 
9
8
  /* @generated by codegen. DO NOT EDIT BY HAND */
10
9
  class TurnkeySDKClientBase {
11
10
  constructor(config) {
12
11
  this.getActivity = async (input, stampWith) => {
13
- let session = await this.storageManager?.getActiveSession();
14
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
12
+ const session = await this.storageManager?.getActiveSession();
15
13
  return this.request("/public/v1/query/get_activity", {
16
14
  ...input,
17
15
  organizationId: input.organizationId ??
@@ -40,8 +38,7 @@ class TurnkeySDKClientBase {
40
38
  };
41
39
  };
42
40
  this.getApiKey = async (input, stampWith) => {
43
- let session = await this.storageManager?.getActiveSession();
44
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
41
+ const session = await this.storageManager?.getActiveSession();
45
42
  return this.request("/public/v1/query/get_api_key", {
46
43
  ...input,
47
44
  organizationId: input.organizationId ??
@@ -70,8 +67,7 @@ class TurnkeySDKClientBase {
70
67
  };
71
68
  };
72
69
  this.getApiKeys = async (input = {}, stampWith) => {
73
- let session = await this.storageManager?.getActiveSession();
74
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
70
+ const session = await this.storageManager?.getActiveSession();
75
71
  return this.request("/public/v1/query/get_api_keys", {
76
72
  ...input,
77
73
  organizationId: input.organizationId ??
@@ -100,8 +96,7 @@ class TurnkeySDKClientBase {
100
96
  };
101
97
  };
102
98
  this.getAttestationDocument = async (input, stampWith) => {
103
- let session = await this.storageManager?.getActiveSession();
104
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
99
+ const session = await this.storageManager?.getActiveSession();
105
100
  return this.request("/public/v1/query/get_attestation", {
106
101
  ...input,
107
102
  organizationId: input.organizationId ??
@@ -130,8 +125,7 @@ class TurnkeySDKClientBase {
130
125
  };
131
126
  };
132
127
  this.getAuthenticator = async (input, stampWith) => {
133
- let session = await this.storageManager?.getActiveSession();
134
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
128
+ const session = await this.storageManager?.getActiveSession();
135
129
  return this.request("/public/v1/query/get_authenticator", {
136
130
  ...input,
137
131
  organizationId: input.organizationId ??
@@ -160,8 +154,7 @@ class TurnkeySDKClientBase {
160
154
  };
161
155
  };
162
156
  this.getAuthenticators = async (input, stampWith) => {
163
- let session = await this.storageManager?.getActiveSession();
164
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
157
+ const session = await this.storageManager?.getActiveSession();
165
158
  return this.request("/public/v1/query/get_authenticators", {
166
159
  ...input,
167
160
  organizationId: input.organizationId ??
@@ -190,8 +183,7 @@ class TurnkeySDKClientBase {
190
183
  };
191
184
  };
192
185
  this.getOauthProviders = async (input, stampWith) => {
193
- let session = await this.storageManager?.getActiveSession();
194
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
186
+ const session = await this.storageManager?.getActiveSession();
195
187
  return this.request("/public/v1/query/get_oauth_providers", {
196
188
  ...input,
197
189
  organizationId: input.organizationId ??
@@ -220,8 +212,7 @@ class TurnkeySDKClientBase {
220
212
  };
221
213
  };
222
214
  this.getOrganization = async (input = {}, stampWith) => {
223
- let session = await this.storageManager?.getActiveSession();
224
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
215
+ const session = await this.storageManager?.getActiveSession();
225
216
  return this.request("/public/v1/query/get_organization", {
226
217
  ...input,
227
218
  organizationId: input.organizationId ??
@@ -250,8 +241,7 @@ class TurnkeySDKClientBase {
250
241
  };
251
242
  };
252
243
  this.getOrganizationConfigs = async (input, stampWith) => {
253
- let session = await this.storageManager?.getActiveSession();
254
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
244
+ const session = await this.storageManager?.getActiveSession();
255
245
  return this.request("/public/v1/query/get_organization_configs", {
256
246
  ...input,
257
247
  organizationId: input.organizationId ??
@@ -280,8 +270,7 @@ class TurnkeySDKClientBase {
280
270
  };
281
271
  };
282
272
  this.getPolicy = async (input, stampWith) => {
283
- let session = await this.storageManager?.getActiveSession();
284
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
273
+ const session = await this.storageManager?.getActiveSession();
285
274
  return this.request("/public/v1/query/get_policy", {
286
275
  ...input,
287
276
  organizationId: input.organizationId ??
@@ -310,8 +299,7 @@ class TurnkeySDKClientBase {
310
299
  };
311
300
  };
312
301
  this.getPolicyEvaluations = async (input, stampWith) => {
313
- let session = await this.storageManager?.getActiveSession();
314
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
302
+ const session = await this.storageManager?.getActiveSession();
315
303
  return this.request("/public/v1/query/get_policy_evaluations", {
316
304
  ...input,
317
305
  organizationId: input.organizationId ??
@@ -340,8 +328,7 @@ class TurnkeySDKClientBase {
340
328
  };
341
329
  };
342
330
  this.getPrivateKey = async (input, stampWith) => {
343
- let session = await this.storageManager?.getActiveSession();
344
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
331
+ const session = await this.storageManager?.getActiveSession();
345
332
  return this.request("/public/v1/query/get_private_key", {
346
333
  ...input,
347
334
  organizationId: input.organizationId ??
@@ -370,8 +357,7 @@ class TurnkeySDKClientBase {
370
357
  };
371
358
  };
372
359
  this.getSmartContractInterface = async (input, stampWith) => {
373
- let session = await this.storageManager?.getActiveSession();
374
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
360
+ const session = await this.storageManager?.getActiveSession();
375
361
  return this.request("/public/v1/query/get_smart_contract_interface", {
376
362
  ...input,
377
363
  organizationId: input.organizationId ??
@@ -400,8 +386,7 @@ class TurnkeySDKClientBase {
400
386
  };
401
387
  };
402
388
  this.getUser = async (input, stampWith) => {
403
- let session = await this.storageManager?.getActiveSession();
404
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
389
+ const session = await this.storageManager?.getActiveSession();
405
390
  return this.request("/public/v1/query/get_user", {
406
391
  ...input,
407
392
  organizationId: input.organizationId ??
@@ -430,8 +415,7 @@ class TurnkeySDKClientBase {
430
415
  };
431
416
  };
432
417
  this.getWallet = async (input, stampWith) => {
433
- let session = await this.storageManager?.getActiveSession();
434
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
418
+ const session = await this.storageManager?.getActiveSession();
435
419
  return this.request("/public/v1/query/get_wallet", {
436
420
  ...input,
437
421
  organizationId: input.organizationId ??
@@ -460,8 +444,7 @@ class TurnkeySDKClientBase {
460
444
  };
461
445
  };
462
446
  this.getWalletAccount = async (input, stampWith) => {
463
- let session = await this.storageManager?.getActiveSession();
464
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
447
+ const session = await this.storageManager?.getActiveSession();
465
448
  return this.request("/public/v1/query/get_wallet_account", {
466
449
  ...input,
467
450
  organizationId: input.organizationId ??
@@ -490,8 +473,7 @@ class TurnkeySDKClientBase {
490
473
  };
491
474
  };
492
475
  this.getActivities = async (input = {}, stampWith) => {
493
- let session = await this.storageManager?.getActiveSession();
494
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
476
+ const session = await this.storageManager?.getActiveSession();
495
477
  return this.request("/public/v1/query/list_activities", {
496
478
  ...input,
497
479
  organizationId: input.organizationId ??
@@ -520,8 +502,7 @@ class TurnkeySDKClientBase {
520
502
  };
521
503
  };
522
504
  this.getPolicies = async (input = {}, stampWith) => {
523
- let session = await this.storageManager?.getActiveSession();
524
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
505
+ const session = await this.storageManager?.getActiveSession();
525
506
  return this.request("/public/v1/query/list_policies", {
526
507
  ...input,
527
508
  organizationId: input.organizationId ??
@@ -550,8 +531,7 @@ class TurnkeySDKClientBase {
550
531
  };
551
532
  };
552
533
  this.listPrivateKeyTags = async (input, stampWith) => {
553
- let session = await this.storageManager?.getActiveSession();
554
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
534
+ const session = await this.storageManager?.getActiveSession();
555
535
  return this.request("/public/v1/query/list_private_key_tags", {
556
536
  ...input,
557
537
  organizationId: input.organizationId ??
@@ -580,8 +560,7 @@ class TurnkeySDKClientBase {
580
560
  };
581
561
  };
582
562
  this.getPrivateKeys = async (input = {}, stampWith) => {
583
- let session = await this.storageManager?.getActiveSession();
584
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
563
+ const session = await this.storageManager?.getActiveSession();
585
564
  return this.request("/public/v1/query/list_private_keys", {
586
565
  ...input,
587
566
  organizationId: input.organizationId ??
@@ -610,8 +589,7 @@ class TurnkeySDKClientBase {
610
589
  };
611
590
  };
612
591
  this.getSmartContractInterfaces = async (input, stampWith) => {
613
- let session = await this.storageManager?.getActiveSession();
614
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
592
+ const session = await this.storageManager?.getActiveSession();
615
593
  return this.request("/public/v1/query/list_smart_contract_interfaces", {
616
594
  ...input,
617
595
  organizationId: input.organizationId ??
@@ -641,8 +619,7 @@ class TurnkeySDKClientBase {
641
619
  };
642
620
  };
643
621
  this.getSubOrgIds = async (input = {}, stampWith) => {
644
- let session = await this.storageManager?.getActiveSession();
645
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
622
+ const session = await this.storageManager?.getActiveSession();
646
623
  return this.request("/public/v1/query/list_suborgs", {
647
624
  ...input,
648
625
  organizationId: input.organizationId ??
@@ -671,8 +648,7 @@ class TurnkeySDKClientBase {
671
648
  };
672
649
  };
673
650
  this.listUserTags = async (input = {}, stampWith) => {
674
- let session = await this.storageManager?.getActiveSession();
675
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
651
+ const session = await this.storageManager?.getActiveSession();
676
652
  return this.request("/public/v1/query/list_user_tags", {
677
653
  ...input,
678
654
  organizationId: input.organizationId ??
@@ -701,8 +677,7 @@ class TurnkeySDKClientBase {
701
677
  };
702
678
  };
703
679
  this.getUsers = async (input = {}, stampWith) => {
704
- let session = await this.storageManager?.getActiveSession();
705
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
680
+ const session = await this.storageManager?.getActiveSession();
706
681
  return this.request("/public/v1/query/list_users", {
707
682
  ...input,
708
683
  organizationId: input.organizationId ??
@@ -731,8 +706,7 @@ class TurnkeySDKClientBase {
731
706
  };
732
707
  };
733
708
  this.getVerifiedSubOrgIds = async (input, stampWith) => {
734
- let session = await this.storageManager?.getActiveSession();
735
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
709
+ const session = await this.storageManager?.getActiveSession();
736
710
  return this.request("/public/v1/query/list_verified_suborgs", {
737
711
  ...input,
738
712
  organizationId: input.organizationId ??
@@ -761,8 +735,7 @@ class TurnkeySDKClientBase {
761
735
  };
762
736
  };
763
737
  this.getWalletAccounts = async (input, stampWith) => {
764
- let session = await this.storageManager?.getActiveSession();
765
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
738
+ const session = await this.storageManager?.getActiveSession();
766
739
  return this.request("/public/v1/query/list_wallet_accounts", {
767
740
  ...input,
768
741
  organizationId: input.organizationId ??
@@ -791,8 +764,7 @@ class TurnkeySDKClientBase {
791
764
  };
792
765
  };
793
766
  this.getWallets = async (input = {}, stampWith) => {
794
- let session = await this.storageManager?.getActiveSession();
795
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
767
+ const session = await this.storageManager?.getActiveSession();
796
768
  return this.request("/public/v1/query/list_wallets", {
797
769
  ...input,
798
770
  organizationId: input.organizationId ??
@@ -821,8 +793,7 @@ class TurnkeySDKClientBase {
821
793
  };
822
794
  };
823
795
  this.getWhoami = async (input = {}, stampWith) => {
824
- let session = await this.storageManager?.getActiveSession();
825
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
796
+ const session = await this.storageManager?.getActiveSession();
826
797
  return this.request("/public/v1/query/whoami", {
827
798
  ...input,
828
799
  organizationId: input.organizationId ??
@@ -852,8 +823,7 @@ class TurnkeySDKClientBase {
852
823
  };
853
824
  this.approveActivity = async (input, stampWith) => {
854
825
  const { organizationId, timestampMs, ...rest } = input;
855
- let session = await this.storageManager?.getActiveSession();
856
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
826
+ const session = await this.storageManager?.getActiveSession();
857
827
  return this.activityDecision("/public/v1/submit/approve_activity", {
858
828
  parameters: rest,
859
829
  organizationId: organizationId ??
@@ -886,9 +856,8 @@ class TurnkeySDKClientBase {
886
856
  };
887
857
  this.createApiKeys = async (input, stampWith) => {
888
858
  const { organizationId, timestampMs, ...rest } = input;
889
- let session = await this.storageManager?.getActiveSession();
890
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
891
- return this.command("/public/v1/submit/create_api_keys", {
859
+ const session = await this.storageManager?.getActiveSession();
860
+ return this.activity("/public/v1/submit/create_api_keys", {
892
861
  parameters: rest,
893
862
  organizationId: organizationId ??
894
863
  session?.organizationId ??
@@ -920,9 +889,8 @@ class TurnkeySDKClientBase {
920
889
  };
921
890
  this.createApiOnlyUsers = async (input, stampWith) => {
922
891
  const { organizationId, timestampMs, ...rest } = input;
923
- let session = await this.storageManager?.getActiveSession();
924
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
925
- return this.command("/public/v1/submit/create_api_only_users", {
892
+ const session = await this.storageManager?.getActiveSession();
893
+ return this.activity("/public/v1/submit/create_api_only_users", {
926
894
  parameters: rest,
927
895
  organizationId: organizationId ??
928
896
  session?.organizationId ??
@@ -954,9 +922,8 @@ class TurnkeySDKClientBase {
954
922
  };
955
923
  this.createAuthenticators = async (input, stampWith) => {
956
924
  const { organizationId, timestampMs, ...rest } = input;
957
- let session = await this.storageManager?.getActiveSession();
958
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
959
- return this.command("/public/v1/submit/create_authenticators", {
925
+ const session = await this.storageManager?.getActiveSession();
926
+ return this.activity("/public/v1/submit/create_authenticators", {
960
927
  parameters: rest,
961
928
  organizationId: organizationId ??
962
929
  session?.organizationId ??
@@ -988,9 +955,8 @@ class TurnkeySDKClientBase {
988
955
  };
989
956
  this.createInvitations = async (input, stampWith) => {
990
957
  const { organizationId, timestampMs, ...rest } = input;
991
- let session = await this.storageManager?.getActiveSession();
992
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
993
- return this.command("/public/v1/submit/create_invitations", {
958
+ const session = await this.storageManager?.getActiveSession();
959
+ return this.activity("/public/v1/submit/create_invitations", {
994
960
  parameters: rest,
995
961
  organizationId: organizationId ??
996
962
  session?.organizationId ??
@@ -1022,9 +988,8 @@ class TurnkeySDKClientBase {
1022
988
  };
1023
989
  this.createOauthProviders = async (input, stampWith) => {
1024
990
  const { organizationId, timestampMs, ...rest } = input;
1025
- let session = await this.storageManager?.getActiveSession();
1026
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1027
- return this.command("/public/v1/submit/create_oauth_providers", {
991
+ const session = await this.storageManager?.getActiveSession();
992
+ return this.activity("/public/v1/submit/create_oauth_providers", {
1028
993
  parameters: rest,
1029
994
  organizationId: organizationId ??
1030
995
  session?.organizationId ??
@@ -1056,9 +1021,8 @@ class TurnkeySDKClientBase {
1056
1021
  };
1057
1022
  this.createPolicies = async (input, stampWith) => {
1058
1023
  const { organizationId, timestampMs, ...rest } = input;
1059
- let session = await this.storageManager?.getActiveSession();
1060
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1061
- return this.command("/public/v1/submit/create_policies", {
1024
+ const session = await this.storageManager?.getActiveSession();
1025
+ return this.activity("/public/v1/submit/create_policies", {
1062
1026
  parameters: rest,
1063
1027
  organizationId: organizationId ??
1064
1028
  session?.organizationId ??
@@ -1090,9 +1054,8 @@ class TurnkeySDKClientBase {
1090
1054
  };
1091
1055
  this.createPolicy = async (input, stampWith) => {
1092
1056
  const { organizationId, timestampMs, ...rest } = input;
1093
- let session = await this.storageManager?.getActiveSession();
1094
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1095
- return this.command("/public/v1/submit/create_policy", {
1057
+ const session = await this.storageManager?.getActiveSession();
1058
+ return this.activity("/public/v1/submit/create_policy", {
1096
1059
  parameters: rest,
1097
1060
  organizationId: organizationId ??
1098
1061
  session?.organizationId ??
@@ -1124,9 +1087,8 @@ class TurnkeySDKClientBase {
1124
1087
  };
1125
1088
  this.createPrivateKeyTag = async (input, stampWith) => {
1126
1089
  const { organizationId, timestampMs, ...rest } = input;
1127
- let session = await this.storageManager?.getActiveSession();
1128
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1129
- return this.command("/public/v1/submit/create_private_key_tag", {
1090
+ const session = await this.storageManager?.getActiveSession();
1091
+ return this.activity("/public/v1/submit/create_private_key_tag", {
1130
1092
  parameters: rest,
1131
1093
  organizationId: organizationId ??
1132
1094
  session?.organizationId ??
@@ -1158,9 +1120,8 @@ class TurnkeySDKClientBase {
1158
1120
  };
1159
1121
  this.createPrivateKeys = async (input, stampWith) => {
1160
1122
  const { organizationId, timestampMs, ...rest } = input;
1161
- let session = await this.storageManager?.getActiveSession();
1162
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1163
- return this.command("/public/v1/submit/create_private_keys", {
1123
+ const session = await this.storageManager?.getActiveSession();
1124
+ return this.activity("/public/v1/submit/create_private_keys", {
1164
1125
  parameters: rest,
1165
1126
  organizationId: organizationId ??
1166
1127
  session?.organizationId ??
@@ -1192,9 +1153,8 @@ class TurnkeySDKClientBase {
1192
1153
  };
1193
1154
  this.createReadOnlySession = async (input, stampWith) => {
1194
1155
  const { organizationId, timestampMs, ...rest } = input;
1195
- let session = await this.storageManager?.getActiveSession();
1196
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1197
- return this.command("/public/v1/submit/create_read_only_session", {
1156
+ const session = await this.storageManager?.getActiveSession();
1157
+ return this.activity("/public/v1/submit/create_read_only_session", {
1198
1158
  parameters: rest,
1199
1159
  organizationId: organizationId ??
1200
1160
  session?.organizationId ??
@@ -1226,9 +1186,8 @@ class TurnkeySDKClientBase {
1226
1186
  };
1227
1187
  this.createReadWriteSession = async (input, stampWith) => {
1228
1188
  const { organizationId, timestampMs, ...rest } = input;
1229
- let session = await this.storageManager?.getActiveSession();
1230
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1231
- return this.command("/public/v1/submit/create_read_write_session", {
1189
+ const session = await this.storageManager?.getActiveSession();
1190
+ return this.activity("/public/v1/submit/create_read_write_session", {
1232
1191
  parameters: rest,
1233
1192
  organizationId: organizationId ??
1234
1193
  session?.organizationId ??
@@ -1260,9 +1219,8 @@ class TurnkeySDKClientBase {
1260
1219
  };
1261
1220
  this.createSmartContractInterface = async (input, stampWith) => {
1262
1221
  const { organizationId, timestampMs, ...rest } = input;
1263
- let session = await this.storageManager?.getActiveSession();
1264
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1265
- return this.command("/public/v1/submit/create_smart_contract_interface", {
1222
+ const session = await this.storageManager?.getActiveSession();
1223
+ return this.activity("/public/v1/submit/create_smart_contract_interface", {
1266
1224
  parameters: rest,
1267
1225
  organizationId: organizationId ??
1268
1226
  session?.organizationId ??
@@ -1295,9 +1253,8 @@ class TurnkeySDKClientBase {
1295
1253
  };
1296
1254
  this.createSubOrganization = async (input, stampWith) => {
1297
1255
  const { organizationId, timestampMs, ...rest } = input;
1298
- let session = await this.storageManager?.getActiveSession();
1299
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1300
- return this.command("/public/v1/submit/create_sub_organization", {
1256
+ const session = await this.storageManager?.getActiveSession();
1257
+ return this.activity("/public/v1/submit/create_sub_organization", {
1301
1258
  parameters: rest,
1302
1259
  organizationId: organizationId ??
1303
1260
  session?.organizationId ??
@@ -1329,9 +1286,8 @@ class TurnkeySDKClientBase {
1329
1286
  };
1330
1287
  this.createUserTag = async (input, stampWith) => {
1331
1288
  const { organizationId, timestampMs, ...rest } = input;
1332
- let session = await this.storageManager?.getActiveSession();
1333
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1334
- return this.command("/public/v1/submit/create_user_tag", {
1289
+ const session = await this.storageManager?.getActiveSession();
1290
+ return this.activity("/public/v1/submit/create_user_tag", {
1335
1291
  parameters: rest,
1336
1292
  organizationId: organizationId ??
1337
1293
  session?.organizationId ??
@@ -1363,9 +1319,8 @@ class TurnkeySDKClientBase {
1363
1319
  };
1364
1320
  this.createUsers = async (input, stampWith) => {
1365
1321
  const { organizationId, timestampMs, ...rest } = input;
1366
- let session = await this.storageManager?.getActiveSession();
1367
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1368
- return this.command("/public/v1/submit/create_users", {
1322
+ const session = await this.storageManager?.getActiveSession();
1323
+ return this.activity("/public/v1/submit/create_users", {
1369
1324
  parameters: rest,
1370
1325
  organizationId: organizationId ??
1371
1326
  session?.organizationId ??
@@ -1397,9 +1352,8 @@ class TurnkeySDKClientBase {
1397
1352
  };
1398
1353
  this.createWallet = async (input, stampWith) => {
1399
1354
  const { organizationId, timestampMs, ...rest } = input;
1400
- let session = await this.storageManager?.getActiveSession();
1401
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1402
- return this.command("/public/v1/submit/create_wallet", {
1355
+ const session = await this.storageManager?.getActiveSession();
1356
+ return this.activity("/public/v1/submit/create_wallet", {
1403
1357
  parameters: rest,
1404
1358
  organizationId: organizationId ??
1405
1359
  session?.organizationId ??
@@ -1431,9 +1385,8 @@ class TurnkeySDKClientBase {
1431
1385
  };
1432
1386
  this.createWalletAccounts = async (input, stampWith) => {
1433
1387
  const { organizationId, timestampMs, ...rest } = input;
1434
- let session = await this.storageManager?.getActiveSession();
1435
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1436
- return this.command("/public/v1/submit/create_wallet_accounts", {
1388
+ const session = await this.storageManager?.getActiveSession();
1389
+ return this.activity("/public/v1/submit/create_wallet_accounts", {
1437
1390
  parameters: rest,
1438
1391
  organizationId: organizationId ??
1439
1392
  session?.organizationId ??
@@ -1465,9 +1418,8 @@ class TurnkeySDKClientBase {
1465
1418
  };
1466
1419
  this.deleteApiKeys = async (input, stampWith) => {
1467
1420
  const { organizationId, timestampMs, ...rest } = input;
1468
- let session = await this.storageManager?.getActiveSession();
1469
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1470
- return this.command("/public/v1/submit/delete_api_keys", {
1421
+ const session = await this.storageManager?.getActiveSession();
1422
+ return this.activity("/public/v1/submit/delete_api_keys", {
1471
1423
  parameters: rest,
1472
1424
  organizationId: organizationId ??
1473
1425
  session?.organizationId ??
@@ -1499,9 +1451,8 @@ class TurnkeySDKClientBase {
1499
1451
  };
1500
1452
  this.deleteAuthenticators = async (input, stampWith) => {
1501
1453
  const { organizationId, timestampMs, ...rest } = input;
1502
- let session = await this.storageManager?.getActiveSession();
1503
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1504
- return this.command("/public/v1/submit/delete_authenticators", {
1454
+ const session = await this.storageManager?.getActiveSession();
1455
+ return this.activity("/public/v1/submit/delete_authenticators", {
1505
1456
  parameters: rest,
1506
1457
  organizationId: organizationId ??
1507
1458
  session?.organizationId ??
@@ -1533,9 +1484,8 @@ class TurnkeySDKClientBase {
1533
1484
  };
1534
1485
  this.deleteInvitation = async (input, stampWith) => {
1535
1486
  const { organizationId, timestampMs, ...rest } = input;
1536
- let session = await this.storageManager?.getActiveSession();
1537
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1538
- return this.command("/public/v1/submit/delete_invitation", {
1487
+ const session = await this.storageManager?.getActiveSession();
1488
+ return this.activity("/public/v1/submit/delete_invitation", {
1539
1489
  parameters: rest,
1540
1490
  organizationId: organizationId ??
1541
1491
  session?.organizationId ??
@@ -1567,9 +1517,8 @@ class TurnkeySDKClientBase {
1567
1517
  };
1568
1518
  this.deleteOauthProviders = async (input, stampWith) => {
1569
1519
  const { organizationId, timestampMs, ...rest } = input;
1570
- let session = await this.storageManager?.getActiveSession();
1571
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1572
- return this.command("/public/v1/submit/delete_oauth_providers", {
1520
+ const session = await this.storageManager?.getActiveSession();
1521
+ return this.activity("/public/v1/submit/delete_oauth_providers", {
1573
1522
  parameters: rest,
1574
1523
  organizationId: organizationId ??
1575
1524
  session?.organizationId ??
@@ -1601,9 +1550,8 @@ class TurnkeySDKClientBase {
1601
1550
  };
1602
1551
  this.deletePolicy = async (input, stampWith) => {
1603
1552
  const { organizationId, timestampMs, ...rest } = input;
1604
- let session = await this.storageManager?.getActiveSession();
1605
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1606
- return this.command("/public/v1/submit/delete_policy", {
1553
+ const session = await this.storageManager?.getActiveSession();
1554
+ return this.activity("/public/v1/submit/delete_policy", {
1607
1555
  parameters: rest,
1608
1556
  organizationId: organizationId ??
1609
1557
  session?.organizationId ??
@@ -1635,9 +1583,8 @@ class TurnkeySDKClientBase {
1635
1583
  };
1636
1584
  this.deletePrivateKeyTags = async (input, stampWith) => {
1637
1585
  const { organizationId, timestampMs, ...rest } = input;
1638
- let session = await this.storageManager?.getActiveSession();
1639
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1640
- return this.command("/public/v1/submit/delete_private_key_tags", {
1586
+ const session = await this.storageManager?.getActiveSession();
1587
+ return this.activity("/public/v1/submit/delete_private_key_tags", {
1641
1588
  parameters: rest,
1642
1589
  organizationId: organizationId ??
1643
1590
  session?.organizationId ??
@@ -1669,9 +1616,8 @@ class TurnkeySDKClientBase {
1669
1616
  };
1670
1617
  this.deletePrivateKeys = async (input, stampWith) => {
1671
1618
  const { organizationId, timestampMs, ...rest } = input;
1672
- let session = await this.storageManager?.getActiveSession();
1673
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1674
- return this.command("/public/v1/submit/delete_private_keys", {
1619
+ const session = await this.storageManager?.getActiveSession();
1620
+ return this.activity("/public/v1/submit/delete_private_keys", {
1675
1621
  parameters: rest,
1676
1622
  organizationId: organizationId ??
1677
1623
  session?.organizationId ??
@@ -1703,9 +1649,8 @@ class TurnkeySDKClientBase {
1703
1649
  };
1704
1650
  this.deleteSmartContractInterface = async (input, stampWith) => {
1705
1651
  const { organizationId, timestampMs, ...rest } = input;
1706
- let session = await this.storageManager?.getActiveSession();
1707
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1708
- return this.command("/public/v1/submit/delete_smart_contract_interface", {
1652
+ const session = await this.storageManager?.getActiveSession();
1653
+ return this.activity("/public/v1/submit/delete_smart_contract_interface", {
1709
1654
  parameters: rest,
1710
1655
  organizationId: organizationId ??
1711
1656
  session?.organizationId ??
@@ -1738,9 +1683,8 @@ class TurnkeySDKClientBase {
1738
1683
  };
1739
1684
  this.deleteSubOrganization = async (input, stampWith) => {
1740
1685
  const { organizationId, timestampMs, ...rest } = input;
1741
- let session = await this.storageManager?.getActiveSession();
1742
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1743
- return this.command("/public/v1/submit/delete_sub_organization", {
1686
+ const session = await this.storageManager?.getActiveSession();
1687
+ return this.activity("/public/v1/submit/delete_sub_organization", {
1744
1688
  parameters: rest,
1745
1689
  organizationId: organizationId ??
1746
1690
  session?.organizationId ??
@@ -1772,9 +1716,8 @@ class TurnkeySDKClientBase {
1772
1716
  };
1773
1717
  this.deleteUserTags = async (input, stampWith) => {
1774
1718
  const { organizationId, timestampMs, ...rest } = input;
1775
- let session = await this.storageManager?.getActiveSession();
1776
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1777
- return this.command("/public/v1/submit/delete_user_tags", {
1719
+ const session = await this.storageManager?.getActiveSession();
1720
+ return this.activity("/public/v1/submit/delete_user_tags", {
1778
1721
  parameters: rest,
1779
1722
  organizationId: organizationId ??
1780
1723
  session?.organizationId ??
@@ -1806,9 +1749,8 @@ class TurnkeySDKClientBase {
1806
1749
  };
1807
1750
  this.deleteUsers = async (input, stampWith) => {
1808
1751
  const { organizationId, timestampMs, ...rest } = input;
1809
- let session = await this.storageManager?.getActiveSession();
1810
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1811
- return this.command("/public/v1/submit/delete_users", {
1752
+ const session = await this.storageManager?.getActiveSession();
1753
+ return this.activity("/public/v1/submit/delete_users", {
1812
1754
  parameters: rest,
1813
1755
  organizationId: organizationId ??
1814
1756
  session?.organizationId ??
@@ -1840,9 +1782,8 @@ class TurnkeySDKClientBase {
1840
1782
  };
1841
1783
  this.deleteWallets = async (input, stampWith) => {
1842
1784
  const { organizationId, timestampMs, ...rest } = input;
1843
- let session = await this.storageManager?.getActiveSession();
1844
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1845
- return this.command("/public/v1/submit/delete_wallets", {
1785
+ const session = await this.storageManager?.getActiveSession();
1786
+ return this.activity("/public/v1/submit/delete_wallets", {
1846
1787
  parameters: rest,
1847
1788
  organizationId: organizationId ??
1848
1789
  session?.organizationId ??
@@ -1874,9 +1815,8 @@ class TurnkeySDKClientBase {
1874
1815
  };
1875
1816
  this.emailAuth = async (input, stampWith) => {
1876
1817
  const { organizationId, timestampMs, ...rest } = input;
1877
- let session = await this.storageManager?.getActiveSession();
1878
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1879
- return this.command("/public/v1/submit/email_auth", {
1818
+ const session = await this.storageManager?.getActiveSession();
1819
+ return this.activity("/public/v1/submit/email_auth", {
1880
1820
  parameters: rest,
1881
1821
  organizationId: organizationId ??
1882
1822
  session?.organizationId ??
@@ -1908,9 +1848,8 @@ class TurnkeySDKClientBase {
1908
1848
  };
1909
1849
  this.exportPrivateKey = async (input, stampWith) => {
1910
1850
  const { organizationId, timestampMs, ...rest } = input;
1911
- let session = await this.storageManager?.getActiveSession();
1912
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1913
- return this.command("/public/v1/submit/export_private_key", {
1851
+ const session = await this.storageManager?.getActiveSession();
1852
+ return this.activity("/public/v1/submit/export_private_key", {
1914
1853
  parameters: rest,
1915
1854
  organizationId: organizationId ??
1916
1855
  session?.organizationId ??
@@ -1942,9 +1881,8 @@ class TurnkeySDKClientBase {
1942
1881
  };
1943
1882
  this.exportWallet = async (input, stampWith) => {
1944
1883
  const { organizationId, timestampMs, ...rest } = input;
1945
- let session = await this.storageManager?.getActiveSession();
1946
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1947
- return this.command("/public/v1/submit/export_wallet", {
1884
+ const session = await this.storageManager?.getActiveSession();
1885
+ return this.activity("/public/v1/submit/export_wallet", {
1948
1886
  parameters: rest,
1949
1887
  organizationId: organizationId ??
1950
1888
  session?.organizationId ??
@@ -1976,9 +1914,8 @@ class TurnkeySDKClientBase {
1976
1914
  };
1977
1915
  this.exportWalletAccount = async (input, stampWith) => {
1978
1916
  const { organizationId, timestampMs, ...rest } = input;
1979
- let session = await this.storageManager?.getActiveSession();
1980
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
1981
- return this.command("/public/v1/submit/export_wallet_account", {
1917
+ const session = await this.storageManager?.getActiveSession();
1918
+ return this.activity("/public/v1/submit/export_wallet_account", {
1982
1919
  parameters: rest,
1983
1920
  organizationId: organizationId ??
1984
1921
  session?.organizationId ??
@@ -2010,9 +1947,8 @@ class TurnkeySDKClientBase {
2010
1947
  };
2011
1948
  this.importPrivateKey = async (input, stampWith) => {
2012
1949
  const { organizationId, timestampMs, ...rest } = input;
2013
- let session = await this.storageManager?.getActiveSession();
2014
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2015
- return this.command("/public/v1/submit/import_private_key", {
1950
+ const session = await this.storageManager?.getActiveSession();
1951
+ return this.activity("/public/v1/submit/import_private_key", {
2016
1952
  parameters: rest,
2017
1953
  organizationId: organizationId ??
2018
1954
  session?.organizationId ??
@@ -2044,9 +1980,8 @@ class TurnkeySDKClientBase {
2044
1980
  };
2045
1981
  this.importWallet = async (input, stampWith) => {
2046
1982
  const { organizationId, timestampMs, ...rest } = input;
2047
- let session = await this.storageManager?.getActiveSession();
2048
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2049
- return this.command("/public/v1/submit/import_wallet", {
1983
+ const session = await this.storageManager?.getActiveSession();
1984
+ return this.activity("/public/v1/submit/import_wallet", {
2050
1985
  parameters: rest,
2051
1986
  organizationId: organizationId ??
2052
1987
  session?.organizationId ??
@@ -2078,9 +2013,8 @@ class TurnkeySDKClientBase {
2078
2013
  };
2079
2014
  this.initFiatOnRamp = async (input, stampWith) => {
2080
2015
  const { organizationId, timestampMs, ...rest } = input;
2081
- let session = await this.storageManager?.getActiveSession();
2082
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2083
- return this.command("/public/v1/submit/init_fiat_on_ramp", {
2016
+ const session = await this.storageManager?.getActiveSession();
2017
+ return this.activity("/public/v1/submit/init_fiat_on_ramp", {
2084
2018
  parameters: rest,
2085
2019
  organizationId: organizationId ??
2086
2020
  session?.organizationId ??
@@ -2112,9 +2046,8 @@ class TurnkeySDKClientBase {
2112
2046
  };
2113
2047
  this.initImportPrivateKey = async (input, stampWith) => {
2114
2048
  const { organizationId, timestampMs, ...rest } = input;
2115
- let session = await this.storageManager?.getActiveSession();
2116
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2117
- return this.command("/public/v1/submit/init_import_private_key", {
2049
+ const session = await this.storageManager?.getActiveSession();
2050
+ return this.activity("/public/v1/submit/init_import_private_key", {
2118
2051
  parameters: rest,
2119
2052
  organizationId: organizationId ??
2120
2053
  session?.organizationId ??
@@ -2146,9 +2079,8 @@ class TurnkeySDKClientBase {
2146
2079
  };
2147
2080
  this.initImportWallet = async (input, stampWith) => {
2148
2081
  const { organizationId, timestampMs, ...rest } = input;
2149
- let session = await this.storageManager?.getActiveSession();
2150
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2151
- return this.command("/public/v1/submit/init_import_wallet", {
2082
+ const session = await this.storageManager?.getActiveSession();
2083
+ return this.activity("/public/v1/submit/init_import_wallet", {
2152
2084
  parameters: rest,
2153
2085
  organizationId: organizationId ??
2154
2086
  session?.organizationId ??
@@ -2180,9 +2112,8 @@ class TurnkeySDKClientBase {
2180
2112
  };
2181
2113
  this.initOtp = async (input, stampWith) => {
2182
2114
  const { organizationId, timestampMs, ...rest } = input;
2183
- let session = await this.storageManager?.getActiveSession();
2184
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2185
- return this.command("/public/v1/submit/init_otp", {
2115
+ const session = await this.storageManager?.getActiveSession();
2116
+ return this.activity("/public/v1/submit/init_otp", {
2186
2117
  parameters: rest,
2187
2118
  organizationId: organizationId ??
2188
2119
  session?.organizationId ??
@@ -2214,9 +2145,8 @@ class TurnkeySDKClientBase {
2214
2145
  };
2215
2146
  this.initOtpAuth = async (input, stampWith) => {
2216
2147
  const { organizationId, timestampMs, ...rest } = input;
2217
- let session = await this.storageManager?.getActiveSession();
2218
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2219
- return this.command("/public/v1/submit/init_otp_auth", {
2148
+ const session = await this.storageManager?.getActiveSession();
2149
+ return this.activity("/public/v1/submit/init_otp_auth", {
2220
2150
  parameters: rest,
2221
2151
  organizationId: organizationId ??
2222
2152
  session?.organizationId ??
@@ -2248,9 +2178,8 @@ class TurnkeySDKClientBase {
2248
2178
  };
2249
2179
  this.initUserEmailRecovery = async (input, stampWith) => {
2250
2180
  const { organizationId, timestampMs, ...rest } = input;
2251
- let session = await this.storageManager?.getActiveSession();
2252
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2253
- return this.command("/public/v1/submit/init_user_email_recovery", {
2181
+ const session = await this.storageManager?.getActiveSession();
2182
+ return this.activity("/public/v1/submit/init_user_email_recovery", {
2254
2183
  parameters: rest,
2255
2184
  organizationId: organizationId ??
2256
2185
  session?.organizationId ??
@@ -2282,9 +2211,8 @@ class TurnkeySDKClientBase {
2282
2211
  };
2283
2212
  this.oauth = async (input, stampWith) => {
2284
2213
  const { organizationId, timestampMs, ...rest } = input;
2285
- let session = await this.storageManager?.getActiveSession();
2286
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2287
- return this.command("/public/v1/submit/oauth", {
2214
+ const session = await this.storageManager?.getActiveSession();
2215
+ return this.activity("/public/v1/submit/oauth", {
2288
2216
  parameters: rest,
2289
2217
  organizationId: organizationId ??
2290
2218
  session?.organizationId ??
@@ -2316,9 +2244,8 @@ class TurnkeySDKClientBase {
2316
2244
  };
2317
2245
  this.oauthLogin = async (input, stampWith) => {
2318
2246
  const { organizationId, timestampMs, ...rest } = input;
2319
- let session = await this.storageManager?.getActiveSession();
2320
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2321
- return this.command("/public/v1/submit/oauth_login", {
2247
+ const session = await this.storageManager?.getActiveSession();
2248
+ return this.activity("/public/v1/submit/oauth_login", {
2322
2249
  parameters: rest,
2323
2250
  organizationId: organizationId ??
2324
2251
  session?.organizationId ??
@@ -2350,9 +2277,8 @@ class TurnkeySDKClientBase {
2350
2277
  };
2351
2278
  this.otpAuth = async (input, stampWith) => {
2352
2279
  const { organizationId, timestampMs, ...rest } = input;
2353
- let session = await this.storageManager?.getActiveSession();
2354
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2355
- return this.command("/public/v1/submit/otp_auth", {
2280
+ const session = await this.storageManager?.getActiveSession();
2281
+ return this.activity("/public/v1/submit/otp_auth", {
2356
2282
  parameters: rest,
2357
2283
  organizationId: organizationId ??
2358
2284
  session?.organizationId ??
@@ -2384,9 +2310,8 @@ class TurnkeySDKClientBase {
2384
2310
  };
2385
2311
  this.otpLogin = async (input, stampWith) => {
2386
2312
  const { organizationId, timestampMs, ...rest } = input;
2387
- let session = await this.storageManager?.getActiveSession();
2388
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2389
- return this.command("/public/v1/submit/otp_login", {
2313
+ const session = await this.storageManager?.getActiveSession();
2314
+ return this.activity("/public/v1/submit/otp_login", {
2390
2315
  parameters: rest,
2391
2316
  organizationId: organizationId ??
2392
2317
  session?.organizationId ??
@@ -2418,9 +2343,8 @@ class TurnkeySDKClientBase {
2418
2343
  };
2419
2344
  this.recoverUser = async (input, stampWith) => {
2420
2345
  const { organizationId, timestampMs, ...rest } = input;
2421
- let session = await this.storageManager?.getActiveSession();
2422
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2423
- return this.command("/public/v1/submit/recover_user", {
2346
+ const session = await this.storageManager?.getActiveSession();
2347
+ return this.activity("/public/v1/submit/recover_user", {
2424
2348
  parameters: rest,
2425
2349
  organizationId: organizationId ??
2426
2350
  session?.organizationId ??
@@ -2452,8 +2376,7 @@ class TurnkeySDKClientBase {
2452
2376
  };
2453
2377
  this.rejectActivity = async (input, stampWith) => {
2454
2378
  const { organizationId, timestampMs, ...rest } = input;
2455
- let session = await this.storageManager?.getActiveSession();
2456
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2379
+ const session = await this.storageManager?.getActiveSession();
2457
2380
  return this.activityDecision("/public/v1/submit/reject_activity", {
2458
2381
  parameters: rest,
2459
2382
  organizationId: organizationId ??
@@ -2486,9 +2409,8 @@ class TurnkeySDKClientBase {
2486
2409
  };
2487
2410
  this.removeOrganizationFeature = async (input, stampWith) => {
2488
2411
  const { organizationId, timestampMs, ...rest } = input;
2489
- let session = await this.storageManager?.getActiveSession();
2490
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2491
- return this.command("/public/v1/submit/remove_organization_feature", {
2412
+ const session = await this.storageManager?.getActiveSession();
2413
+ return this.activity("/public/v1/submit/remove_organization_feature", {
2492
2414
  parameters: rest,
2493
2415
  organizationId: organizationId ??
2494
2416
  session?.organizationId ??
@@ -2520,9 +2442,8 @@ class TurnkeySDKClientBase {
2520
2442
  };
2521
2443
  this.setOrganizationFeature = async (input, stampWith) => {
2522
2444
  const { organizationId, timestampMs, ...rest } = input;
2523
- let session = await this.storageManager?.getActiveSession();
2524
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2525
- return this.command("/public/v1/submit/set_organization_feature", {
2445
+ const session = await this.storageManager?.getActiveSession();
2446
+ return this.activity("/public/v1/submit/set_organization_feature", {
2526
2447
  parameters: rest,
2527
2448
  organizationId: organizationId ??
2528
2449
  session?.organizationId ??
@@ -2554,9 +2475,8 @@ class TurnkeySDKClientBase {
2554
2475
  };
2555
2476
  this.signRawPayload = async (input, stampWith) => {
2556
2477
  const { organizationId, timestampMs, ...rest } = input;
2557
- let session = await this.storageManager?.getActiveSession();
2558
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2559
- return this.command("/public/v1/submit/sign_raw_payload", {
2478
+ const session = await this.storageManager?.getActiveSession();
2479
+ return this.activity("/public/v1/submit/sign_raw_payload", {
2560
2480
  parameters: rest,
2561
2481
  organizationId: organizationId ??
2562
2482
  session?.organizationId ??
@@ -2588,9 +2508,8 @@ class TurnkeySDKClientBase {
2588
2508
  };
2589
2509
  this.signRawPayloads = async (input, stampWith) => {
2590
2510
  const { organizationId, timestampMs, ...rest } = input;
2591
- let session = await this.storageManager?.getActiveSession();
2592
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2593
- return this.command("/public/v1/submit/sign_raw_payloads", {
2511
+ const session = await this.storageManager?.getActiveSession();
2512
+ return this.activity("/public/v1/submit/sign_raw_payloads", {
2594
2513
  parameters: rest,
2595
2514
  organizationId: organizationId ??
2596
2515
  session?.organizationId ??
@@ -2622,9 +2541,8 @@ class TurnkeySDKClientBase {
2622
2541
  };
2623
2542
  this.signTransaction = async (input, stampWith) => {
2624
2543
  const { organizationId, timestampMs, ...rest } = input;
2625
- let session = await this.storageManager?.getActiveSession();
2626
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2627
- return this.command("/public/v1/submit/sign_transaction", {
2544
+ const session = await this.storageManager?.getActiveSession();
2545
+ return this.activity("/public/v1/submit/sign_transaction", {
2628
2546
  parameters: rest,
2629
2547
  organizationId: organizationId ??
2630
2548
  session?.organizationId ??
@@ -2656,9 +2574,8 @@ class TurnkeySDKClientBase {
2656
2574
  };
2657
2575
  this.stampLogin = async (input, stampWith) => {
2658
2576
  const { organizationId, timestampMs, ...rest } = input;
2659
- let session = await this.storageManager?.getActiveSession();
2660
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2661
- return this.command("/public/v1/submit/stamp_login", {
2577
+ const session = await this.storageManager?.getActiveSession();
2578
+ return this.activity("/public/v1/submit/stamp_login", {
2662
2579
  parameters: rest,
2663
2580
  organizationId: organizationId ??
2664
2581
  session?.organizationId ??
@@ -2690,9 +2607,8 @@ class TurnkeySDKClientBase {
2690
2607
  };
2691
2608
  this.updatePolicy = async (input, stampWith) => {
2692
2609
  const { organizationId, timestampMs, ...rest } = input;
2693
- let session = await this.storageManager?.getActiveSession();
2694
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2695
- return this.command("/public/v1/submit/update_policy", {
2610
+ const session = await this.storageManager?.getActiveSession();
2611
+ return this.activity("/public/v1/submit/update_policy", {
2696
2612
  parameters: rest,
2697
2613
  organizationId: organizationId ??
2698
2614
  session?.organizationId ??
@@ -2724,9 +2640,8 @@ class TurnkeySDKClientBase {
2724
2640
  };
2725
2641
  this.updatePrivateKeyTag = async (input, stampWith) => {
2726
2642
  const { organizationId, timestampMs, ...rest } = input;
2727
- let session = await this.storageManager?.getActiveSession();
2728
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2729
- return this.command("/public/v1/submit/update_private_key_tag", {
2643
+ const session = await this.storageManager?.getActiveSession();
2644
+ return this.activity("/public/v1/submit/update_private_key_tag", {
2730
2645
  parameters: rest,
2731
2646
  organizationId: organizationId ??
2732
2647
  session?.organizationId ??
@@ -2758,9 +2673,8 @@ class TurnkeySDKClientBase {
2758
2673
  };
2759
2674
  this.updateRootQuorum = async (input, stampWith) => {
2760
2675
  const { organizationId, timestampMs, ...rest } = input;
2761
- let session = await this.storageManager?.getActiveSession();
2762
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2763
- return this.command("/public/v1/submit/update_root_quorum", {
2676
+ const session = await this.storageManager?.getActiveSession();
2677
+ return this.activity("/public/v1/submit/update_root_quorum", {
2764
2678
  parameters: rest,
2765
2679
  organizationId: organizationId ??
2766
2680
  session?.organizationId ??
@@ -2792,9 +2706,8 @@ class TurnkeySDKClientBase {
2792
2706
  };
2793
2707
  this.updateUser = async (input, stampWith) => {
2794
2708
  const { organizationId, timestampMs, ...rest } = input;
2795
- let session = await this.storageManager?.getActiveSession();
2796
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2797
- return this.command("/public/v1/submit/update_user", {
2709
+ const session = await this.storageManager?.getActiveSession();
2710
+ return this.activity("/public/v1/submit/update_user", {
2798
2711
  parameters: rest,
2799
2712
  organizationId: organizationId ??
2800
2713
  session?.organizationId ??
@@ -2826,9 +2739,8 @@ class TurnkeySDKClientBase {
2826
2739
  };
2827
2740
  this.updateUserEmail = async (input, stampWith) => {
2828
2741
  const { organizationId, timestampMs, ...rest } = input;
2829
- let session = await this.storageManager?.getActiveSession();
2830
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2831
- return this.command("/public/v1/submit/update_user_email", {
2742
+ const session = await this.storageManager?.getActiveSession();
2743
+ return this.activity("/public/v1/submit/update_user_email", {
2832
2744
  parameters: rest,
2833
2745
  organizationId: organizationId ??
2834
2746
  session?.organizationId ??
@@ -2860,9 +2772,8 @@ class TurnkeySDKClientBase {
2860
2772
  };
2861
2773
  this.updateUserName = async (input, stampWith) => {
2862
2774
  const { organizationId, timestampMs, ...rest } = input;
2863
- let session = await this.storageManager?.getActiveSession();
2864
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2865
- return this.command("/public/v1/submit/update_user_name", {
2775
+ const session = await this.storageManager?.getActiveSession();
2776
+ return this.activity("/public/v1/submit/update_user_name", {
2866
2777
  parameters: rest,
2867
2778
  organizationId: organizationId ??
2868
2779
  session?.organizationId ??
@@ -2894,9 +2805,8 @@ class TurnkeySDKClientBase {
2894
2805
  };
2895
2806
  this.updateUserPhoneNumber = async (input, stampWith) => {
2896
2807
  const { organizationId, timestampMs, ...rest } = input;
2897
- let session = await this.storageManager?.getActiveSession();
2898
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2899
- return this.command("/public/v1/submit/update_user_phone_number", {
2808
+ const session = await this.storageManager?.getActiveSession();
2809
+ return this.activity("/public/v1/submit/update_user_phone_number", {
2900
2810
  parameters: rest,
2901
2811
  organizationId: organizationId ??
2902
2812
  session?.organizationId ??
@@ -2928,9 +2838,8 @@ class TurnkeySDKClientBase {
2928
2838
  };
2929
2839
  this.updateUserTag = async (input, stampWith) => {
2930
2840
  const { organizationId, timestampMs, ...rest } = input;
2931
- let session = await this.storageManager?.getActiveSession();
2932
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2933
- return this.command("/public/v1/submit/update_user_tag", {
2841
+ const session = await this.storageManager?.getActiveSession();
2842
+ return this.activity("/public/v1/submit/update_user_tag", {
2934
2843
  parameters: rest,
2935
2844
  organizationId: organizationId ??
2936
2845
  session?.organizationId ??
@@ -2962,9 +2871,8 @@ class TurnkeySDKClientBase {
2962
2871
  };
2963
2872
  this.updateWallet = async (input, stampWith) => {
2964
2873
  const { organizationId, timestampMs, ...rest } = input;
2965
- let session = await this.storageManager?.getActiveSession();
2966
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2967
- return this.command("/public/v1/submit/update_wallet", {
2874
+ const session = await this.storageManager?.getActiveSession();
2875
+ return this.activity("/public/v1/submit/update_wallet", {
2968
2876
  parameters: rest,
2969
2877
  organizationId: organizationId ??
2970
2878
  session?.organizationId ??
@@ -2996,9 +2904,8 @@ class TurnkeySDKClientBase {
2996
2904
  };
2997
2905
  this.verifyOtp = async (input, stampWith) => {
2998
2906
  const { organizationId, timestampMs, ...rest } = input;
2999
- let session = await this.storageManager?.getActiveSession();
3000
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
3001
- return this.command("/public/v1/submit/verify_otp", {
2907
+ const session = await this.storageManager?.getActiveSession();
2908
+ return this.activity("/public/v1/submit/verify_otp", {
3002
2909
  parameters: rest,
3003
2910
  organizationId: organizationId ??
3004
2911
  session?.organizationId ??
@@ -3029,8 +2936,7 @@ class TurnkeySDKClientBase {
3029
2936
  };
3030
2937
  };
3031
2938
  this.testRateLimits = async (input, stampWith) => {
3032
- let session = await this.storageManager?.getActiveSession();
3033
- session = utils.parseSession(session); // TODO (Amir): We may not need this anymore since we want to store the full session object in storage
2939
+ const session = await this.storageManager?.getActiveSession();
3034
2940
  return this.request("/tkhq/api/v1/test_rate_limits", {
3035
2941
  ...input,
3036
2942
  organizationId: input.organizationId ??
@@ -3119,9 +3025,6 @@ class TurnkeySDKClientBase {
3119
3025
  const stamp = await activeStamper.stamp(stringifiedBody);
3120
3026
  headers[stamp.stampHeaderName] = stamp.stampHeaderValue;
3121
3027
  }
3122
- if (this.config.readOnlySession) {
3123
- headers["X-Session"] = this.config.readOnlySession;
3124
- }
3125
3028
  const response = await fetch(fullUrl, {
3126
3029
  method: "POST",
3127
3030
  headers: headers,
@@ -3141,7 +3044,7 @@ class TurnkeySDKClientBase {
3141
3044
  const data = await response.json();
3142
3045
  return data;
3143
3046
  }
3144
- async command(url, body, resultKey, stampWith) {
3047
+ async activity(url, body, resultKey, stampWith) {
3145
3048
  const pollingDuration = this.config.activityPoller?.intervalMs ?? 1000;
3146
3049
  const maxRetries = this.config.activityPoller?.numRetries ?? 3;
3147
3050
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));