@turnkey/core 1.6.0 → 1.8.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.
Files changed (49) hide show
  1. package/dist/__clients__/core.d.ts +10 -5
  2. package/dist/__clients__/core.d.ts.map +1 -1
  3. package/dist/__clients__/core.js +94 -37
  4. package/dist/__clients__/core.js.map +1 -1
  5. package/dist/__clients__/core.mjs +95 -38
  6. package/dist/__clients__/core.mjs.map +1 -1
  7. package/dist/__generated__/sdk-client-base.d.ts +12 -0
  8. package/dist/__generated__/sdk-client-base.d.ts.map +1 -1
  9. package/dist/__generated__/sdk-client-base.js +325 -204
  10. package/dist/__generated__/sdk-client-base.js.map +1 -1
  11. package/dist/__generated__/sdk-client-base.mjs +325 -204
  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 +296 -6
  17. package/dist/__inputs__/public_api.types.d.ts.map +1 -1
  18. package/dist/__types__/external-wallets.d.ts +19 -0
  19. package/dist/__types__/external-wallets.d.ts.map +1 -1
  20. package/dist/__types__/method-types.d.ts +7 -1
  21. package/dist/__types__/method-types.d.ts.map +1 -1
  22. package/dist/__wallet__/mobile/manager.d.ts.map +1 -1
  23. package/dist/__wallet__/mobile/manager.js +5 -2
  24. package/dist/__wallet__/mobile/manager.js.map +1 -1
  25. package/dist/__wallet__/mobile/manager.mjs +5 -2
  26. package/dist/__wallet__/mobile/manager.mjs.map +1 -1
  27. package/dist/__wallet__/wallet-connect/base.d.ts +25 -11
  28. package/dist/__wallet__/wallet-connect/base.d.ts.map +1 -1
  29. package/dist/__wallet__/wallet-connect/base.js +112 -30
  30. package/dist/__wallet__/wallet-connect/base.js.map +1 -1
  31. package/dist/__wallet__/wallet-connect/base.mjs +112 -30
  32. package/dist/__wallet__/wallet-connect/base.mjs.map +1 -1
  33. package/dist/__wallet__/wallet-connect/client.d.ts.map +1 -1
  34. package/dist/__wallet__/wallet-connect/client.js +4 -0
  35. package/dist/__wallet__/wallet-connect/client.js.map +1 -1
  36. package/dist/__wallet__/wallet-connect/client.mjs +4 -0
  37. package/dist/__wallet__/wallet-connect/client.mjs.map +1 -1
  38. package/dist/__wallet__/web/manager.d.ts +11 -0
  39. package/dist/__wallet__/web/manager.d.ts.map +1 -1
  40. package/dist/__wallet__/web/manager.js +36 -21
  41. package/dist/__wallet__/web/manager.js.map +1 -1
  42. package/dist/__wallet__/web/manager.mjs +36 -21
  43. package/dist/__wallet__/web/manager.mjs.map +1 -1
  44. package/dist/__wallet__/web/native/ethereum.d.ts.map +1 -1
  45. package/dist/__wallet__/web/native/ethereum.js +27 -4
  46. package/dist/__wallet__/web/native/ethereum.js.map +1 -1
  47. package/dist/__wallet__/web/native/ethereum.mjs +27 -4
  48. package/dist/__wallet__/web/native/ethereum.mjs.map +1 -1
  49. package/package.json +8 -8
@@ -23,14 +23,12 @@ class TurnkeySDKClientBase {
23
23
  if (!activeStamper) {
24
24
  return undefined;
25
25
  }
26
- const { organizationId, ...parameters } = input;
27
26
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_activity";
28
- const bodyWithType = {
29
- parameters,
30
- organizationId,
31
- type: "ACTIVITY_TYPE_GET_ACTIVITY",
27
+ const body = {
28
+ ...input,
29
+ organizationId: input.organizationId,
32
30
  };
33
- const stringifiedBody = JSON.stringify(bodyWithType);
31
+ const stringifiedBody = JSON.stringify(body);
34
32
  const stamp = await activeStamper.stamp(stringifiedBody);
35
33
  return {
36
34
  body: stringifiedBody,
@@ -52,14 +50,12 @@ class TurnkeySDKClientBase {
52
50
  if (!activeStamper) {
53
51
  return undefined;
54
52
  }
55
- const { organizationId, ...parameters } = input;
56
53
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_api_key";
57
- const bodyWithType = {
58
- parameters,
59
- organizationId,
60
- type: "ACTIVITY_TYPE_GET_API_KEY",
54
+ const body = {
55
+ ...input,
56
+ organizationId: input.organizationId,
61
57
  };
62
- const stringifiedBody = JSON.stringify(bodyWithType);
58
+ const stringifiedBody = JSON.stringify(body);
63
59
  const stamp = await activeStamper.stamp(stringifiedBody);
64
60
  return {
65
61
  body: stringifiedBody,
@@ -81,14 +77,12 @@ class TurnkeySDKClientBase {
81
77
  if (!activeStamper) {
82
78
  return undefined;
83
79
  }
84
- const { organizationId, ...parameters } = input;
85
80
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_api_keys";
86
- const bodyWithType = {
87
- parameters,
88
- organizationId,
89
- type: "ACTIVITY_TYPE_GET_API_KEYS",
81
+ const body = {
82
+ ...input,
83
+ organizationId: input.organizationId,
90
84
  };
91
- const stringifiedBody = JSON.stringify(bodyWithType);
85
+ const stringifiedBody = JSON.stringify(body);
92
86
  const stamp = await activeStamper.stamp(stringifiedBody);
93
87
  return {
94
88
  body: stringifiedBody,
@@ -110,14 +104,12 @@ class TurnkeySDKClientBase {
110
104
  if (!activeStamper) {
111
105
  return undefined;
112
106
  }
113
- const { organizationId, ...parameters } = input;
114
107
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_attestation";
115
- const bodyWithType = {
116
- parameters,
117
- organizationId,
118
- type: "ACTIVITY_TYPE_GET_ATTESTATION_DOCUMENT",
108
+ const body = {
109
+ ...input,
110
+ organizationId: input.organizationId,
119
111
  };
120
- const stringifiedBody = JSON.stringify(bodyWithType);
112
+ const stringifiedBody = JSON.stringify(body);
121
113
  const stamp = await activeStamper.stamp(stringifiedBody);
122
114
  return {
123
115
  body: stringifiedBody,
@@ -139,14 +131,12 @@ class TurnkeySDKClientBase {
139
131
  if (!activeStamper) {
140
132
  return undefined;
141
133
  }
142
- const { organizationId, ...parameters } = input;
143
134
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_authenticator";
144
- const bodyWithType = {
145
- parameters,
146
- organizationId,
147
- type: "ACTIVITY_TYPE_GET_AUTHENTICATOR",
135
+ const body = {
136
+ ...input,
137
+ organizationId: input.organizationId,
148
138
  };
149
- const stringifiedBody = JSON.stringify(bodyWithType);
139
+ const stringifiedBody = JSON.stringify(body);
150
140
  const stamp = await activeStamper.stamp(stringifiedBody);
151
141
  return {
152
142
  body: stringifiedBody,
@@ -168,14 +158,12 @@ class TurnkeySDKClientBase {
168
158
  if (!activeStamper) {
169
159
  return undefined;
170
160
  }
171
- const { organizationId, ...parameters } = input;
172
161
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_authenticators";
173
- const bodyWithType = {
174
- parameters,
175
- organizationId,
176
- type: "ACTIVITY_TYPE_GET_AUTHENTICATORS",
162
+ const body = {
163
+ ...input,
164
+ organizationId: input.organizationId,
177
165
  };
178
- const stringifiedBody = JSON.stringify(bodyWithType);
166
+ const stringifiedBody = JSON.stringify(body);
179
167
  const stamp = await activeStamper.stamp(stringifiedBody);
180
168
  return {
181
169
  body: stringifiedBody,
@@ -197,14 +185,12 @@ class TurnkeySDKClientBase {
197
185
  if (!activeStamper) {
198
186
  return undefined;
199
187
  }
200
- const { organizationId, ...parameters } = input;
201
188
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_boot_proof";
202
- const bodyWithType = {
203
- parameters,
204
- organizationId,
205
- type: "ACTIVITY_TYPE_GET_BOOT_PROOF",
189
+ const body = {
190
+ ...input,
191
+ organizationId: input.organizationId,
206
192
  };
207
- const stringifiedBody = JSON.stringify(bodyWithType);
193
+ const stringifiedBody = JSON.stringify(body);
208
194
  const stamp = await activeStamper.stamp(stringifiedBody);
209
195
  return {
210
196
  body: stringifiedBody,
@@ -226,14 +212,12 @@ class TurnkeySDKClientBase {
226
212
  if (!activeStamper) {
227
213
  return undefined;
228
214
  }
229
- const { organizationId, ...parameters } = input;
230
215
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_latest_boot_proof";
231
- const bodyWithType = {
232
- parameters,
233
- organizationId,
234
- type: "ACTIVITY_TYPE_GET_LATEST_BOOT_PROOF",
216
+ const body = {
217
+ ...input,
218
+ organizationId: input.organizationId,
235
219
  };
236
- const stringifiedBody = JSON.stringify(bodyWithType);
220
+ const stringifiedBody = JSON.stringify(body);
237
221
  const stamp = await activeStamper.stamp(stringifiedBody);
238
222
  return {
239
223
  body: stringifiedBody,
@@ -255,14 +239,12 @@ class TurnkeySDKClientBase {
255
239
  if (!activeStamper) {
256
240
  return undefined;
257
241
  }
258
- const { organizationId, ...parameters } = input;
259
242
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_oauth2_credential";
260
- const bodyWithType = {
261
- parameters,
262
- organizationId,
263
- type: "ACTIVITY_TYPE_GET_OAUTH2CREDENTIAL",
243
+ const body = {
244
+ ...input,
245
+ organizationId: input.organizationId,
264
246
  };
265
- const stringifiedBody = JSON.stringify(bodyWithType);
247
+ const stringifiedBody = JSON.stringify(body);
266
248
  const stamp = await activeStamper.stamp(stringifiedBody);
267
249
  return {
268
250
  body: stringifiedBody,
@@ -284,14 +266,39 @@ class TurnkeySDKClientBase {
284
266
  if (!activeStamper) {
285
267
  return undefined;
286
268
  }
287
- const { organizationId, ...parameters } = input;
288
269
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_oauth_providers";
289
- const bodyWithType = {
290
- parameters,
291
- organizationId,
292
- type: "ACTIVITY_TYPE_GET_OAUTH_PROVIDERS",
270
+ const body = {
271
+ ...input,
272
+ organizationId: input.organizationId,
293
273
  };
294
- const stringifiedBody = JSON.stringify(bodyWithType);
274
+ const stringifiedBody = JSON.stringify(body);
275
+ const stamp = await activeStamper.stamp(stringifiedBody);
276
+ return {
277
+ body: stringifiedBody,
278
+ stamp: stamp,
279
+ url: fullUrl,
280
+ };
281
+ };
282
+ this.getOnRampTransactionStatus = async (input, stampWith) => {
283
+ const session = await this.storageManager?.getActiveSession();
284
+ return this.request("/public/v1/query/get_onramp_transaction_status", {
285
+ ...input,
286
+ organizationId: input.organizationId ??
287
+ session?.organizationId ??
288
+ this.config.organizationId,
289
+ }, stampWith);
290
+ };
291
+ this.stampGetOnRampTransactionStatus = async (input, stampWith) => {
292
+ const activeStamper = this.getStamper(stampWith);
293
+ if (!activeStamper) {
294
+ return undefined;
295
+ }
296
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_onramp_transaction_status";
297
+ const body = {
298
+ ...input,
299
+ organizationId: input.organizationId,
300
+ };
301
+ const stringifiedBody = JSON.stringify(body);
295
302
  const stamp = await activeStamper.stamp(stringifiedBody);
296
303
  return {
297
304
  body: stringifiedBody,
@@ -313,14 +320,12 @@ class TurnkeySDKClientBase {
313
320
  if (!activeStamper) {
314
321
  return undefined;
315
322
  }
316
- const { organizationId, ...parameters } = input;
317
323
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_organization";
318
- const bodyWithType = {
319
- parameters,
320
- organizationId,
321
- type: "ACTIVITY_TYPE_GET_ORGANIZATION",
324
+ const body = {
325
+ ...input,
326
+ organizationId: input.organizationId,
322
327
  };
323
- const stringifiedBody = JSON.stringify(bodyWithType);
328
+ const stringifiedBody = JSON.stringify(body);
324
329
  const stamp = await activeStamper.stamp(stringifiedBody);
325
330
  return {
326
331
  body: stringifiedBody,
@@ -342,14 +347,12 @@ class TurnkeySDKClientBase {
342
347
  if (!activeStamper) {
343
348
  return undefined;
344
349
  }
345
- const { organizationId, ...parameters } = input;
346
350
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_organization_configs";
347
- const bodyWithType = {
348
- parameters,
349
- organizationId,
350
- type: "ACTIVITY_TYPE_GET_ORGANIZATION_CONFIGS",
351
+ const body = {
352
+ ...input,
353
+ organizationId: input.organizationId,
351
354
  };
352
- const stringifiedBody = JSON.stringify(bodyWithType);
355
+ const stringifiedBody = JSON.stringify(body);
353
356
  const stamp = await activeStamper.stamp(stringifiedBody);
354
357
  return {
355
358
  body: stringifiedBody,
@@ -371,14 +374,12 @@ class TurnkeySDKClientBase {
371
374
  if (!activeStamper) {
372
375
  return undefined;
373
376
  }
374
- const { organizationId, ...parameters } = input;
375
377
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_policy";
376
- const bodyWithType = {
377
- parameters,
378
- organizationId,
379
- type: "ACTIVITY_TYPE_GET_POLICY",
378
+ const body = {
379
+ ...input,
380
+ organizationId: input.organizationId,
380
381
  };
381
- const stringifiedBody = JSON.stringify(bodyWithType);
382
+ const stringifiedBody = JSON.stringify(body);
382
383
  const stamp = await activeStamper.stamp(stringifiedBody);
383
384
  return {
384
385
  body: stringifiedBody,
@@ -400,14 +401,12 @@ class TurnkeySDKClientBase {
400
401
  if (!activeStamper) {
401
402
  return undefined;
402
403
  }
403
- const { organizationId, ...parameters } = input;
404
404
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_policy_evaluations";
405
- const bodyWithType = {
406
- parameters,
407
- organizationId,
408
- type: "ACTIVITY_TYPE_GET_POLICY_EVALUATIONS",
405
+ const body = {
406
+ ...input,
407
+ organizationId: input.organizationId,
409
408
  };
410
- const stringifiedBody = JSON.stringify(bodyWithType);
409
+ const stringifiedBody = JSON.stringify(body);
411
410
  const stamp = await activeStamper.stamp(stringifiedBody);
412
411
  return {
413
412
  body: stringifiedBody,
@@ -429,14 +428,12 @@ class TurnkeySDKClientBase {
429
428
  if (!activeStamper) {
430
429
  return undefined;
431
430
  }
432
- const { organizationId, ...parameters } = input;
433
431
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_private_key";
434
- const bodyWithType = {
435
- parameters,
436
- organizationId,
437
- type: "ACTIVITY_TYPE_GET_PRIVATE_KEY",
432
+ const body = {
433
+ ...input,
434
+ organizationId: input.organizationId,
438
435
  };
439
- const stringifiedBody = JSON.stringify(bodyWithType);
436
+ const stringifiedBody = JSON.stringify(body);
440
437
  const stamp = await activeStamper.stamp(stringifiedBody);
441
438
  return {
442
439
  body: stringifiedBody,
@@ -458,14 +455,12 @@ class TurnkeySDKClientBase {
458
455
  if (!activeStamper) {
459
456
  return undefined;
460
457
  }
461
- const { organizationId, ...parameters } = input;
462
458
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_smart_contract_interface";
463
- const bodyWithType = {
464
- parameters,
465
- organizationId,
466
- type: "ACTIVITY_TYPE_GET_SMART_CONTRACT_INTERFACE",
459
+ const body = {
460
+ ...input,
461
+ organizationId: input.organizationId,
467
462
  };
468
- const stringifiedBody = JSON.stringify(bodyWithType);
463
+ const stringifiedBody = JSON.stringify(body);
469
464
  const stamp = await activeStamper.stamp(stringifiedBody);
470
465
  return {
471
466
  body: stringifiedBody,
@@ -487,14 +482,12 @@ class TurnkeySDKClientBase {
487
482
  if (!activeStamper) {
488
483
  return undefined;
489
484
  }
490
- const { organizationId, ...parameters } = input;
491
485
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_user";
492
- const bodyWithType = {
493
- parameters,
494
- organizationId,
495
- type: "ACTIVITY_TYPE_GET_USER",
486
+ const body = {
487
+ ...input,
488
+ organizationId: input.organizationId,
496
489
  };
497
- const stringifiedBody = JSON.stringify(bodyWithType);
490
+ const stringifiedBody = JSON.stringify(body);
498
491
  const stamp = await activeStamper.stamp(stringifiedBody);
499
492
  return {
500
493
  body: stringifiedBody,
@@ -516,14 +509,12 @@ class TurnkeySDKClientBase {
516
509
  if (!activeStamper) {
517
510
  return undefined;
518
511
  }
519
- const { organizationId, ...parameters } = input;
520
512
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_wallet";
521
- const bodyWithType = {
522
- parameters,
523
- organizationId,
524
- type: "ACTIVITY_TYPE_GET_WALLET",
513
+ const body = {
514
+ ...input,
515
+ organizationId: input.organizationId,
525
516
  };
526
- const stringifiedBody = JSON.stringify(bodyWithType);
517
+ const stringifiedBody = JSON.stringify(body);
527
518
  const stamp = await activeStamper.stamp(stringifiedBody);
528
519
  return {
529
520
  body: stringifiedBody,
@@ -545,14 +536,12 @@ class TurnkeySDKClientBase {
545
536
  if (!activeStamper) {
546
537
  return undefined;
547
538
  }
548
- const { organizationId, ...parameters } = input;
549
539
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_wallet_account";
550
- const bodyWithType = {
551
- parameters,
552
- organizationId,
553
- type: "ACTIVITY_TYPE_GET_WALLET_ACCOUNT",
540
+ const body = {
541
+ ...input,
542
+ organizationId: input.organizationId,
554
543
  };
555
- const stringifiedBody = JSON.stringify(bodyWithType);
544
+ const stringifiedBody = JSON.stringify(body);
556
545
  const stamp = await activeStamper.stamp(stringifiedBody);
557
546
  return {
558
547
  body: stringifiedBody,
@@ -574,14 +563,12 @@ class TurnkeySDKClientBase {
574
563
  if (!activeStamper) {
575
564
  return undefined;
576
565
  }
577
- const { organizationId, ...parameters } = input;
578
566
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_activities";
579
- const bodyWithType = {
580
- parameters,
581
- organizationId,
582
- type: "ACTIVITY_TYPE_GET_ACTIVITIES",
567
+ const body = {
568
+ ...input,
569
+ organizationId: input.organizationId,
583
570
  };
584
- const stringifiedBody = JSON.stringify(bodyWithType);
571
+ const stringifiedBody = JSON.stringify(body);
585
572
  const stamp = await activeStamper.stamp(stringifiedBody);
586
573
  return {
587
574
  body: stringifiedBody,
@@ -603,14 +590,39 @@ class TurnkeySDKClientBase {
603
590
  if (!activeStamper) {
604
591
  return undefined;
605
592
  }
606
- const { organizationId, ...parameters } = input;
607
593
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_app_proofs";
608
- const bodyWithType = {
609
- parameters,
610
- organizationId,
611
- type: "ACTIVITY_TYPE_GET_APP_PROOFS",
594
+ const body = {
595
+ ...input,
596
+ organizationId: input.organizationId,
612
597
  };
613
- const stringifiedBody = JSON.stringify(bodyWithType);
598
+ const stringifiedBody = JSON.stringify(body);
599
+ const stamp = await activeStamper.stamp(stringifiedBody);
600
+ return {
601
+ body: stringifiedBody,
602
+ stamp: stamp,
603
+ url: fullUrl,
604
+ };
605
+ };
606
+ this.listFiatOnRampCredentials = async (input, stampWith) => {
607
+ const session = await this.storageManager?.getActiveSession();
608
+ return this.request("/public/v1/query/list_fiat_on_ramp_credentials", {
609
+ ...input,
610
+ organizationId: input.organizationId ??
611
+ session?.organizationId ??
612
+ this.config.organizationId,
613
+ }, stampWith);
614
+ };
615
+ this.stampListFiatOnRampCredentials = async (input, stampWith) => {
616
+ const activeStamper = this.getStamper(stampWith);
617
+ if (!activeStamper) {
618
+ return undefined;
619
+ }
620
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_fiat_on_ramp_credentials";
621
+ const body = {
622
+ ...input,
623
+ organizationId: input.organizationId,
624
+ };
625
+ const stringifiedBody = JSON.stringify(body);
614
626
  const stamp = await activeStamper.stamp(stringifiedBody);
615
627
  return {
616
628
  body: stringifiedBody,
@@ -632,14 +644,12 @@ class TurnkeySDKClientBase {
632
644
  if (!activeStamper) {
633
645
  return undefined;
634
646
  }
635
- const { organizationId, ...parameters } = input;
636
647
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_oauth2_credentials";
637
- const bodyWithType = {
638
- parameters,
639
- organizationId,
640
- type: "ACTIVITY_TYPE_LIST_OAUTH2CREDENTIALS",
648
+ const body = {
649
+ ...input,
650
+ organizationId: input.organizationId,
641
651
  };
642
- const stringifiedBody = JSON.stringify(bodyWithType);
652
+ const stringifiedBody = JSON.stringify(body);
643
653
  const stamp = await activeStamper.stamp(stringifiedBody);
644
654
  return {
645
655
  body: stringifiedBody,
@@ -661,14 +671,12 @@ class TurnkeySDKClientBase {
661
671
  if (!activeStamper) {
662
672
  return undefined;
663
673
  }
664
- const { organizationId, ...parameters } = input;
665
674
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_policies";
666
- const bodyWithType = {
667
- parameters,
668
- organizationId,
669
- type: "ACTIVITY_TYPE_GET_POLICIES",
675
+ const body = {
676
+ ...input,
677
+ organizationId: input.organizationId,
670
678
  };
671
- const stringifiedBody = JSON.stringify(bodyWithType);
679
+ const stringifiedBody = JSON.stringify(body);
672
680
  const stamp = await activeStamper.stamp(stringifiedBody);
673
681
  return {
674
682
  body: stringifiedBody,
@@ -690,14 +698,12 @@ class TurnkeySDKClientBase {
690
698
  if (!activeStamper) {
691
699
  return undefined;
692
700
  }
693
- const { organizationId, ...parameters } = input;
694
701
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_private_key_tags";
695
- const bodyWithType = {
696
- parameters,
697
- organizationId,
698
- type: "ACTIVITY_TYPE_LIST_PRIVATE_KEY_TAGS",
702
+ const body = {
703
+ ...input,
704
+ organizationId: input.organizationId,
699
705
  };
700
- const stringifiedBody = JSON.stringify(bodyWithType);
706
+ const stringifiedBody = JSON.stringify(body);
701
707
  const stamp = await activeStamper.stamp(stringifiedBody);
702
708
  return {
703
709
  body: stringifiedBody,
@@ -719,14 +725,12 @@ class TurnkeySDKClientBase {
719
725
  if (!activeStamper) {
720
726
  return undefined;
721
727
  }
722
- const { organizationId, ...parameters } = input;
723
728
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_private_keys";
724
- const bodyWithType = {
725
- parameters,
726
- organizationId,
727
- type: "ACTIVITY_TYPE_GET_PRIVATE_KEYS",
729
+ const body = {
730
+ ...input,
731
+ organizationId: input.organizationId,
728
732
  };
729
- const stringifiedBody = JSON.stringify(bodyWithType);
733
+ const stringifiedBody = JSON.stringify(body);
730
734
  const stamp = await activeStamper.stamp(stringifiedBody);
731
735
  return {
732
736
  body: stringifiedBody,
@@ -748,15 +752,13 @@ class TurnkeySDKClientBase {
748
752
  if (!activeStamper) {
749
753
  return undefined;
750
754
  }
751
- const { organizationId, ...parameters } = input;
752
755
  const fullUrl = this.config.apiBaseUrl +
753
756
  "/public/v1/query/list_smart_contract_interfaces";
754
- const bodyWithType = {
755
- parameters,
756
- organizationId,
757
- type: "ACTIVITY_TYPE_GET_SMART_CONTRACT_INTERFACES",
757
+ const body = {
758
+ ...input,
759
+ organizationId: input.organizationId,
758
760
  };
759
- const stringifiedBody = JSON.stringify(bodyWithType);
761
+ const stringifiedBody = JSON.stringify(body);
760
762
  const stamp = await activeStamper.stamp(stringifiedBody);
761
763
  return {
762
764
  body: stringifiedBody,
@@ -778,14 +780,12 @@ class TurnkeySDKClientBase {
778
780
  if (!activeStamper) {
779
781
  return undefined;
780
782
  }
781
- const { organizationId, ...parameters } = input;
782
783
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_suborgs";
783
- const bodyWithType = {
784
- parameters,
785
- organizationId,
786
- type: "ACTIVITY_TYPE_GET_SUB_ORG_IDS",
784
+ const body = {
785
+ ...input,
786
+ organizationId: input.organizationId,
787
787
  };
788
- const stringifiedBody = JSON.stringify(bodyWithType);
788
+ const stringifiedBody = JSON.stringify(body);
789
789
  const stamp = await activeStamper.stamp(stringifiedBody);
790
790
  return {
791
791
  body: stringifiedBody,
@@ -807,14 +807,12 @@ class TurnkeySDKClientBase {
807
807
  if (!activeStamper) {
808
808
  return undefined;
809
809
  }
810
- const { organizationId, ...parameters } = input;
811
810
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_user_tags";
812
- const bodyWithType = {
813
- parameters,
814
- organizationId,
815
- type: "ACTIVITY_TYPE_LIST_USER_TAGS",
811
+ const body = {
812
+ ...input,
813
+ organizationId: input.organizationId,
816
814
  };
817
- const stringifiedBody = JSON.stringify(bodyWithType);
815
+ const stringifiedBody = JSON.stringify(body);
818
816
  const stamp = await activeStamper.stamp(stringifiedBody);
819
817
  return {
820
818
  body: stringifiedBody,
@@ -836,14 +834,12 @@ class TurnkeySDKClientBase {
836
834
  if (!activeStamper) {
837
835
  return undefined;
838
836
  }
839
- const { organizationId, ...parameters } = input;
840
837
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_users";
841
- const bodyWithType = {
842
- parameters,
843
- organizationId,
844
- type: "ACTIVITY_TYPE_GET_USERS",
838
+ const body = {
839
+ ...input,
840
+ organizationId: input.organizationId,
845
841
  };
846
- const stringifiedBody = JSON.stringify(bodyWithType);
842
+ const stringifiedBody = JSON.stringify(body);
847
843
  const stamp = await activeStamper.stamp(stringifiedBody);
848
844
  return {
849
845
  body: stringifiedBody,
@@ -865,14 +861,12 @@ class TurnkeySDKClientBase {
865
861
  if (!activeStamper) {
866
862
  return undefined;
867
863
  }
868
- const { organizationId, ...parameters } = input;
869
864
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_verified_suborgs";
870
- const bodyWithType = {
871
- parameters,
872
- organizationId,
873
- type: "ACTIVITY_TYPE_GET_VERIFIED_SUB_ORG_IDS",
865
+ const body = {
866
+ ...input,
867
+ organizationId: input.organizationId,
874
868
  };
875
- const stringifiedBody = JSON.stringify(bodyWithType);
869
+ const stringifiedBody = JSON.stringify(body);
876
870
  const stamp = await activeStamper.stamp(stringifiedBody);
877
871
  return {
878
872
  body: stringifiedBody,
@@ -894,14 +888,12 @@ class TurnkeySDKClientBase {
894
888
  if (!activeStamper) {
895
889
  return undefined;
896
890
  }
897
- const { organizationId, ...parameters } = input;
898
891
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_wallet_accounts";
899
- const bodyWithType = {
900
- parameters,
901
- organizationId,
902
- type: "ACTIVITY_TYPE_GET_WALLET_ACCOUNTS",
892
+ const body = {
893
+ ...input,
894
+ organizationId: input.organizationId,
903
895
  };
904
- const stringifiedBody = JSON.stringify(bodyWithType);
896
+ const stringifiedBody = JSON.stringify(body);
905
897
  const stamp = await activeStamper.stamp(stringifiedBody);
906
898
  return {
907
899
  body: stringifiedBody,
@@ -923,14 +915,12 @@ class TurnkeySDKClientBase {
923
915
  if (!activeStamper) {
924
916
  return undefined;
925
917
  }
926
- const { organizationId, ...parameters } = input;
927
918
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_wallets";
928
- const bodyWithType = {
929
- parameters,
930
- organizationId,
931
- type: "ACTIVITY_TYPE_GET_WALLETS",
919
+ const body = {
920
+ ...input,
921
+ organizationId: input.organizationId,
932
922
  };
933
- const stringifiedBody = JSON.stringify(bodyWithType);
923
+ const stringifiedBody = JSON.stringify(body);
934
924
  const stamp = await activeStamper.stamp(stringifiedBody);
935
925
  return {
936
926
  body: stringifiedBody,
@@ -952,14 +942,12 @@ class TurnkeySDKClientBase {
952
942
  if (!activeStamper) {
953
943
  return undefined;
954
944
  }
955
- const { organizationId, ...parameters } = input;
956
945
  const fullUrl = this.config.apiBaseUrl + "/public/v1/query/whoami";
957
- const bodyWithType = {
958
- parameters,
959
- organizationId,
960
- type: "ACTIVITY_TYPE_GET_WHOAMI",
946
+ const body = {
947
+ ...input,
948
+ organizationId: input.organizationId,
961
949
  };
962
- const stringifiedBody = JSON.stringify(bodyWithType);
950
+ const stringifiedBody = JSON.stringify(body);
963
951
  const stamp = await activeStamper.stamp(stringifiedBody);
964
952
  return {
965
953
  body: stringifiedBody,
@@ -1099,6 +1087,40 @@ class TurnkeySDKClientBase {
1099
1087
  url: fullUrl,
1100
1088
  };
1101
1089
  };
1090
+ this.createFiatOnRampCredential = async (input, stampWith) => {
1091
+ const { organizationId, timestampMs, ...rest } = input;
1092
+ const session = await this.storageManager?.getActiveSession();
1093
+ return this.activity("/public/v1/submit/create_fiat_on_ramp_credential", {
1094
+ parameters: rest,
1095
+ organizationId: organizationId ??
1096
+ session?.organizationId ??
1097
+ this.config.organizationId,
1098
+ timestampMs: timestampMs ?? String(Date.now()),
1099
+ type: "ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL",
1100
+ }, "createFiatOnRampCredentialResult", stampWith);
1101
+ };
1102
+ this.stampCreateFiatOnRampCredential = async (input, stampWith) => {
1103
+ const activeStamper = this.getStamper(stampWith);
1104
+ if (!activeStamper) {
1105
+ return undefined;
1106
+ }
1107
+ const { organizationId, timestampMs, ...parameters } = input;
1108
+ const fullUrl = this.config.apiBaseUrl +
1109
+ "/public/v1/submit/create_fiat_on_ramp_credential";
1110
+ const bodyWithType = {
1111
+ parameters,
1112
+ organizationId,
1113
+ timestampMs: timestampMs ?? String(Date.now()),
1114
+ type: "ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL",
1115
+ };
1116
+ const stringifiedBody = JSON.stringify(bodyWithType);
1117
+ const stamp = await activeStamper.stamp(stringifiedBody);
1118
+ return {
1119
+ body: stringifiedBody,
1120
+ stamp: stamp,
1121
+ url: fullUrl,
1122
+ };
1123
+ };
1102
1124
  this.createInvitations = async (input, stampWith) => {
1103
1125
  const { organizationId, timestampMs, ...rest } = input;
1104
1126
  const session = await this.storageManager?.getActiveSession();
@@ -1661,6 +1683,40 @@ class TurnkeySDKClientBase {
1661
1683
  url: fullUrl,
1662
1684
  };
1663
1685
  };
1686
+ this.deleteFiatOnRampCredential = async (input, stampWith) => {
1687
+ const { organizationId, timestampMs, ...rest } = input;
1688
+ const session = await this.storageManager?.getActiveSession();
1689
+ return this.activity("/public/v1/submit/delete_fiat_on_ramp_credential", {
1690
+ parameters: rest,
1691
+ organizationId: organizationId ??
1692
+ session?.organizationId ??
1693
+ this.config.organizationId,
1694
+ timestampMs: timestampMs ?? String(Date.now()),
1695
+ type: "ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL",
1696
+ }, "deleteFiatOnRampCredentialResult", stampWith);
1697
+ };
1698
+ this.stampDeleteFiatOnRampCredential = async (input, stampWith) => {
1699
+ const activeStamper = this.getStamper(stampWith);
1700
+ if (!activeStamper) {
1701
+ return undefined;
1702
+ }
1703
+ const { organizationId, timestampMs, ...parameters } = input;
1704
+ const fullUrl = this.config.apiBaseUrl +
1705
+ "/public/v1/submit/delete_fiat_on_ramp_credential";
1706
+ const bodyWithType = {
1707
+ parameters,
1708
+ organizationId,
1709
+ timestampMs: timestampMs ?? String(Date.now()),
1710
+ type: "ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL",
1711
+ };
1712
+ const stringifiedBody = JSON.stringify(bodyWithType);
1713
+ const stamp = await activeStamper.stamp(stringifiedBody);
1714
+ return {
1715
+ body: stringifiedBody,
1716
+ stamp: stamp,
1717
+ url: fullUrl,
1718
+ };
1719
+ };
1664
1720
  this.deleteInvitation = async (input, stampWith) => {
1665
1721
  const { organizationId, timestampMs, ...rest } = input;
1666
1722
  const session = await this.storageManager?.getActiveSession();
@@ -2157,6 +2213,39 @@ class TurnkeySDKClientBase {
2157
2213
  url: fullUrl,
2158
2214
  };
2159
2215
  };
2216
+ this.ethSendTransaction = async (input, stampWith) => {
2217
+ const { organizationId, timestampMs, ...rest } = input;
2218
+ const session = await this.storageManager?.getActiveSession();
2219
+ return this.activity("/public/v1/submit/eth_send_transaction", {
2220
+ parameters: rest,
2221
+ organizationId: organizationId ??
2222
+ session?.organizationId ??
2223
+ this.config.organizationId,
2224
+ timestampMs: timestampMs ?? String(Date.now()),
2225
+ type: "ACTIVITY_TYPE_ETH_SEND_TRANSACTION",
2226
+ }, "ethSendTransactionResult", stampWith);
2227
+ };
2228
+ this.stampEthSendTransaction = async (input, stampWith) => {
2229
+ const activeStamper = this.getStamper(stampWith);
2230
+ if (!activeStamper) {
2231
+ return undefined;
2232
+ }
2233
+ const { organizationId, timestampMs, ...parameters } = input;
2234
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/eth_send_transaction";
2235
+ const bodyWithType = {
2236
+ parameters,
2237
+ organizationId,
2238
+ timestampMs: timestampMs ?? String(Date.now()),
2239
+ type: "ACTIVITY_TYPE_ETH_SEND_TRANSACTION",
2240
+ };
2241
+ const stringifiedBody = JSON.stringify(bodyWithType);
2242
+ const stamp = await activeStamper.stamp(stringifiedBody);
2243
+ return {
2244
+ body: stringifiedBody,
2245
+ stamp: stamp,
2246
+ url: fullUrl,
2247
+ };
2248
+ };
2160
2249
  this.exportPrivateKey = async (input, stampWith) => {
2161
2250
  const { organizationId, timestampMs, ...rest } = input;
2162
2251
  const session = await this.storageManager?.getActiveSession();
@@ -2949,6 +3038,40 @@ class TurnkeySDKClientBase {
2949
3038
  url: fullUrl,
2950
3039
  };
2951
3040
  };
3041
+ this.updateFiatOnRampCredential = async (input, stampWith) => {
3042
+ const { organizationId, timestampMs, ...rest } = input;
3043
+ const session = await this.storageManager?.getActiveSession();
3044
+ return this.activity("/public/v1/submit/update_fiat_on_ramp_credential", {
3045
+ parameters: rest,
3046
+ organizationId: organizationId ??
3047
+ session?.organizationId ??
3048
+ this.config.organizationId,
3049
+ timestampMs: timestampMs ?? String(Date.now()),
3050
+ type: "ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL",
3051
+ }, "updateFiatOnRampCredentialResult", stampWith);
3052
+ };
3053
+ this.stampUpdateFiatOnRampCredential = async (input, stampWith) => {
3054
+ const activeStamper = this.getStamper(stampWith);
3055
+ if (!activeStamper) {
3056
+ return undefined;
3057
+ }
3058
+ const { organizationId, timestampMs, ...parameters } = input;
3059
+ const fullUrl = this.config.apiBaseUrl +
3060
+ "/public/v1/submit/update_fiat_on_ramp_credential";
3061
+ const bodyWithType = {
3062
+ parameters,
3063
+ organizationId,
3064
+ timestampMs: timestampMs ?? String(Date.now()),
3065
+ type: "ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL",
3066
+ };
3067
+ const stringifiedBody = JSON.stringify(bodyWithType);
3068
+ const stamp = await activeStamper.stamp(stringifiedBody);
3069
+ return {
3070
+ body: stringifiedBody,
3071
+ stamp: stamp,
3072
+ url: fullUrl,
3073
+ };
3074
+ };
2952
3075
  this.updateOauth2Credential = async (input, stampWith) => {
2953
3076
  const { organizationId, timestampMs, ...rest } = input;
2954
3077
  const session = await this.storageManager?.getActiveSession();
@@ -3326,14 +3449,12 @@ class TurnkeySDKClientBase {
3326
3449
  if (!activeStamper) {
3327
3450
  return undefined;
3328
3451
  }
3329
- const { organizationId, ...parameters } = input;
3330
3452
  const fullUrl = this.config.apiBaseUrl + "/tkhq/api/v1/test_rate_limits";
3331
- const bodyWithType = {
3332
- parameters,
3333
- organizationId,
3334
- type: "ACTIVITY_TYPE_TEST_RATE_LIMITS",
3453
+ const body = {
3454
+ ...input,
3455
+ organizationId: input.organizationId,
3335
3456
  };
3336
- const stringifiedBody = JSON.stringify(bodyWithType);
3457
+ const stringifiedBody = JSON.stringify(body);
3337
3458
  const stamp = await activeStamper.stamp(stringifiedBody);
3338
3459
  return {
3339
3460
  body: stringifiedBody,