@turnkey/sdk-browser 5.14.3 → 5.15.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.
@@ -100,37 +100,6 @@ class TurnkeySDKClientBase {
100
100
  url: fullUrl,
101
101
  };
102
102
  };
103
- this.getAttestationDocument = async (input) => {
104
- const sessionData = await getStorageValue(StorageKeys.Session);
105
- const session = sessionData ? parseSession(sessionData) : null;
106
- return this.request("/public/v1/query/get_attestation", {
107
- ...input,
108
- organizationId: input.organizationId ??
109
- session?.organizationId ??
110
- this.config.organizationId,
111
- });
112
- };
113
- this.stampGetAttestationDocument = async (input) => {
114
- if (!this.stamper) {
115
- return undefined;
116
- }
117
- const sessionData = await getStorageValue(StorageKeys.Session);
118
- const session = sessionData ? parseSession(sessionData) : null;
119
- const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_attestation";
120
- const body = {
121
- ...input,
122
- organizationId: input.organizationId ??
123
- session?.organizationId ??
124
- this.config.organizationId,
125
- };
126
- const stringifiedBody = JSON.stringify(body);
127
- const stamp = await this.stamper.stamp(stringifiedBody);
128
- return {
129
- body: stringifiedBody,
130
- stamp: stamp,
131
- url: fullUrl,
132
- };
133
- };
134
103
  this.getAuthenticator = async (input) => {
135
104
  const sessionData = await getStorageValue(StorageKeys.Session);
136
105
  const session = sessionData ? parseSession(sessionData) : null;
@@ -410,37 +379,6 @@ class TurnkeySDKClientBase {
410
379
  url: fullUrl,
411
380
  };
412
381
  };
413
- this.getOrganization = async (input = {}) => {
414
- const sessionData = await getStorageValue(StorageKeys.Session);
415
- const session = sessionData ? parseSession(sessionData) : null;
416
- return this.request("/public/v1/query/get_organization", {
417
- ...input,
418
- organizationId: input.organizationId ??
419
- session?.organizationId ??
420
- this.config.organizationId,
421
- });
422
- };
423
- this.stampGetOrganization = async (input) => {
424
- if (!this.stamper) {
425
- return undefined;
426
- }
427
- const sessionData = await getStorageValue(StorageKeys.Session);
428
- const session = sessionData ? parseSession(sessionData) : null;
429
- const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_organization";
430
- const body = {
431
- ...input,
432
- organizationId: input.organizationId ??
433
- session?.organizationId ??
434
- this.config.organizationId,
435
- };
436
- const stringifiedBody = JSON.stringify(body);
437
- const stamp = await this.stamper.stamp(stringifiedBody);
438
- return {
439
- body: stringifiedBody,
440
- stamp: stamp,
441
- url: fullUrl,
442
- };
443
- };
444
382
  this.getOrganizationConfigs = async (input) => {
445
383
  const sessionData = await getStorageValue(StorageKeys.Session);
446
384
  const session = sessionData ? parseSession(sessionData) : null;
@@ -720,6 +658,37 @@ class TurnkeySDKClientBase {
720
658
  url: fullUrl,
721
659
  };
722
660
  };
661
+ this.getWalletAddressBalances = async (input) => {
662
+ const sessionData = await getStorageValue(StorageKeys.Session);
663
+ const session = sessionData ? parseSession(sessionData) : null;
664
+ return this.request("/public/v1/query/get_wallet_address_balances", {
665
+ ...input,
666
+ organizationId: input.organizationId ??
667
+ session?.organizationId ??
668
+ this.config.organizationId,
669
+ });
670
+ };
671
+ this.stampGetWalletAddressBalances = async (input) => {
672
+ if (!this.stamper) {
673
+ return undefined;
674
+ }
675
+ const sessionData = await getStorageValue(StorageKeys.Session);
676
+ const session = sessionData ? parseSession(sessionData) : null;
677
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_wallet_address_balances";
678
+ const body = {
679
+ ...input,
680
+ organizationId: input.organizationId ??
681
+ session?.organizationId ??
682
+ this.config.organizationId,
683
+ };
684
+ const stringifiedBody = JSON.stringify(body);
685
+ const stamp = await this.stamper.stamp(stringifiedBody);
686
+ return {
687
+ body: stringifiedBody,
688
+ stamp: stamp,
689
+ url: fullUrl,
690
+ };
691
+ };
723
692
  this.getActivities = async (input = {}) => {
724
693
  const sessionData = await getStorageValue(StorageKeys.Session);
725
694
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1000,6 +969,37 @@ class TurnkeySDKClientBase {
1000
969
  url: fullUrl,
1001
970
  };
1002
971
  };
972
+ this.listSupportedAssets = async (input) => {
973
+ const sessionData = await getStorageValue(StorageKeys.Session);
974
+ const session = sessionData ? parseSession(sessionData) : null;
975
+ return this.request("/public/v1/query/list_supported_assets", {
976
+ ...input,
977
+ organizationId: input.organizationId ??
978
+ session?.organizationId ??
979
+ this.config.organizationId,
980
+ });
981
+ };
982
+ this.stampListSupportedAssets = async (input) => {
983
+ if (!this.stamper) {
984
+ return undefined;
985
+ }
986
+ const sessionData = await getStorageValue(StorageKeys.Session);
987
+ const session = sessionData ? parseSession(sessionData) : null;
988
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_supported_assets";
989
+ const body = {
990
+ ...input,
991
+ organizationId: input.organizationId ??
992
+ session?.organizationId ??
993
+ this.config.organizationId,
994
+ };
995
+ const stringifiedBody = JSON.stringify(body);
996
+ const stamp = await this.stamper.stamp(stringifiedBody);
997
+ return {
998
+ body: stringifiedBody,
999
+ stamp: stamp,
1000
+ url: fullUrl,
1001
+ };
1002
+ };
1003
1003
  this.listUserTags = async (input = {}) => {
1004
1004
  const sessionData = await getStorageValue(StorageKeys.Session);
1005
1005
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1254,41 +1254,6 @@ class TurnkeySDKClientBase {
1254
1254
  url: fullUrl,
1255
1255
  };
1256
1256
  };
1257
- this.createApiOnlyUsers = async (input) => {
1258
- const sessionData = await getStorageValue(StorageKeys.Session);
1259
- const session = sessionData ? parseSession(sessionData) : null;
1260
- const { organizationId, timestampMs, ...rest } = input;
1261
- return this.command("/public/v1/submit/create_api_only_users", {
1262
- parameters: rest,
1263
- organizationId: organizationId ??
1264
- session?.organizationId ??
1265
- this.config.organizationId,
1266
- timestampMs: timestampMs ?? String(Date.now()),
1267
- type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS",
1268
- }, "createApiOnlyUsersResult");
1269
- };
1270
- this.stampCreateApiOnlyUsers = async (input) => {
1271
- if (!this.stamper) {
1272
- return undefined;
1273
- }
1274
- const sessionData = await getStorageValue(StorageKeys.Session);
1275
- const session = sessionData ? parseSession(sessionData) : null;
1276
- const { organizationId, timestampMs, ...parameters } = input;
1277
- const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_api_only_users";
1278
- const bodyWithType = {
1279
- parameters,
1280
- organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1281
- timestampMs: timestampMs ?? String(Date.now()),
1282
- type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS",
1283
- };
1284
- const stringifiedBody = JSON.stringify(bodyWithType);
1285
- const stamp = await this.stamper.stamp(stringifiedBody);
1286
- return {
1287
- body: stringifiedBody,
1288
- stamp: stamp,
1289
- url: fullUrl,
1290
- };
1291
- };
1292
1257
  this.createAuthenticators = async (input) => {
1293
1258
  const sessionData = await getStorageValue(StorageKeys.Session);
1294
1259
  const session = sessionData ? parseSession(sessionData) : null;
@@ -2483,41 +2448,6 @@ class TurnkeySDKClientBase {
2483
2448
  url: fullUrl,
2484
2449
  };
2485
2450
  };
2486
- this.ethSendRawTransaction = async (input) => {
2487
- const sessionData = await getStorageValue(StorageKeys.Session);
2488
- const session = sessionData ? parseSession(sessionData) : null;
2489
- const { organizationId, timestampMs, ...rest } = input;
2490
- return this.command("/public/v1/submit/eth_send_raw_transaction", {
2491
- parameters: rest,
2492
- organizationId: organizationId ??
2493
- session?.organizationId ??
2494
- this.config.organizationId,
2495
- timestampMs: timestampMs ?? String(Date.now()),
2496
- type: "ACTIVITY_TYPE_ETH_SEND_RAW_TRANSACTION",
2497
- }, "ethSendRawTransactionResult");
2498
- };
2499
- this.stampEthSendRawTransaction = async (input) => {
2500
- if (!this.stamper) {
2501
- return undefined;
2502
- }
2503
- const sessionData = await getStorageValue(StorageKeys.Session);
2504
- const session = sessionData ? parseSession(sessionData) : null;
2505
- const { organizationId, timestampMs, ...parameters } = input;
2506
- const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/eth_send_raw_transaction";
2507
- const bodyWithType = {
2508
- parameters,
2509
- organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2510
- timestampMs: timestampMs ?? String(Date.now()),
2511
- type: "ACTIVITY_TYPE_ETH_SEND_RAW_TRANSACTION",
2512
- };
2513
- const stringifiedBody = JSON.stringify(bodyWithType);
2514
- const stamp = await this.stamper.stamp(stringifiedBody);
2515
- return {
2516
- body: stringifiedBody,
2517
- stamp: stamp,
2518
- url: fullUrl,
2519
- };
2520
- };
2521
2451
  this.ethSendTransaction = async (input) => {
2522
2452
  const sessionData = await getStorageValue(StorageKeys.Session);
2523
2453
  const session = sessionData ? parseSession(sessionData) : null;
@@ -3356,6 +3286,41 @@ class TurnkeySDKClientBase {
3356
3286
  url: fullUrl,
3357
3287
  };
3358
3288
  };
3289
+ this.solSendTransaction = async (input) => {
3290
+ const sessionData = await getStorageValue(StorageKeys.Session);
3291
+ const session = sessionData ? parseSession(sessionData) : null;
3292
+ const { organizationId, timestampMs, ...rest } = input;
3293
+ return this.command("/public/v1/submit/sol_send_transaction", {
3294
+ parameters: rest,
3295
+ organizationId: organizationId ??
3296
+ session?.organizationId ??
3297
+ this.config.organizationId,
3298
+ timestampMs: timestampMs ?? String(Date.now()),
3299
+ type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION",
3300
+ }, "solSendTransactionResult");
3301
+ };
3302
+ this.stampSolSendTransaction = async (input) => {
3303
+ if (!this.stamper) {
3304
+ return undefined;
3305
+ }
3306
+ const sessionData = await getStorageValue(StorageKeys.Session);
3307
+ const session = sessionData ? parseSession(sessionData) : null;
3308
+ const { organizationId, timestampMs, ...parameters } = input;
3309
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/sol_send_transaction";
3310
+ const bodyWithType = {
3311
+ parameters,
3312
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3313
+ timestampMs: timestampMs ?? String(Date.now()),
3314
+ type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION",
3315
+ };
3316
+ const stringifiedBody = JSON.stringify(bodyWithType);
3317
+ const stamp = await this.stamper.stamp(stringifiedBody);
3318
+ return {
3319
+ body: stringifiedBody,
3320
+ stamp: stamp,
3321
+ url: fullUrl,
3322
+ };
3323
+ };
3359
3324
  this.stampLogin = async (input) => {
3360
3325
  const sessionData = await getStorageValue(StorageKeys.Session);
3361
3326
  const session = sessionData ? parseSession(sessionData) : null;
@@ -3812,37 +3777,6 @@ class TurnkeySDKClientBase {
3812
3777
  url: fullUrl,
3813
3778
  };
3814
3779
  };
3815
- this.testRateLimits = async (input) => {
3816
- const sessionData = await getStorageValue(StorageKeys.Session);
3817
- const session = sessionData ? parseSession(sessionData) : null;
3818
- return this.request("/tkhq/api/v1/test_rate_limits", {
3819
- ...input,
3820
- organizationId: input.organizationId ??
3821
- session?.organizationId ??
3822
- this.config.organizationId,
3823
- });
3824
- };
3825
- this.stampTestRateLimits = async (input) => {
3826
- if (!this.stamper) {
3827
- return undefined;
3828
- }
3829
- const sessionData = await getStorageValue(StorageKeys.Session);
3830
- const session = sessionData ? parseSession(sessionData) : null;
3831
- const fullUrl = this.config.apiBaseUrl + "/tkhq/api/v1/test_rate_limits";
3832
- const body = {
3833
- ...input,
3834
- organizationId: input.organizationId ??
3835
- session?.organizationId ??
3836
- this.config.organizationId,
3837
- };
3838
- const stringifiedBody = JSON.stringify(body);
3839
- const stamp = await this.stamper.stamp(stringifiedBody);
3840
- return {
3841
- body: stringifiedBody,
3842
- stamp: stamp,
3843
- url: fullUrl,
3844
- };
3845
- };
3846
3780
  this.config = config;
3847
3781
  if (config.stamper) {
3848
3782
  this.stamper = config.stamper;