@turnkey/sdk-browser 7.0.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -224,6 +224,99 @@ class TurnkeySDKClientBase {
224
224
  url: fullUrl,
225
225
  };
226
226
  };
227
+ this.getEarnDeployStatus = async (input) => {
228
+ const sessionData = await getStorageValue(StorageKeys.Session);
229
+ const session = sessionData ? parseSession(sessionData) : null;
230
+ return this.request("/public/v1/query/get_earn_deploy_status", {
231
+ ...input,
232
+ organizationId: input.organizationId ??
233
+ session?.organizationId ??
234
+ this.config.organizationId,
235
+ });
236
+ };
237
+ this.stampGetEarnDeployStatus = async (input) => {
238
+ if (!this.stamper) {
239
+ return undefined;
240
+ }
241
+ const sessionData = await getStorageValue(StorageKeys.Session);
242
+ const session = sessionData ? parseSession(sessionData) : null;
243
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_earn_deploy_status";
244
+ const body = {
245
+ ...input,
246
+ organizationId: input.organizationId ??
247
+ session?.organizationId ??
248
+ this.config.organizationId,
249
+ };
250
+ const stringifiedBody = JSON.stringify(body);
251
+ const stamp = await this.stamper.stamp(stringifiedBody);
252
+ return {
253
+ body: stringifiedBody,
254
+ stamp: stamp,
255
+ url: fullUrl,
256
+ };
257
+ };
258
+ this.getEarnDepositStatus = async (input) => {
259
+ const sessionData = await getStorageValue(StorageKeys.Session);
260
+ const session = sessionData ? parseSession(sessionData) : null;
261
+ return this.request("/public/v1/query/get_earn_deposit_status", {
262
+ ...input,
263
+ organizationId: input.organizationId ??
264
+ session?.organizationId ??
265
+ this.config.organizationId,
266
+ });
267
+ };
268
+ this.stampGetEarnDepositStatus = async (input) => {
269
+ if (!this.stamper) {
270
+ return undefined;
271
+ }
272
+ const sessionData = await getStorageValue(StorageKeys.Session);
273
+ const session = sessionData ? parseSession(sessionData) : null;
274
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_earn_deposit_status";
275
+ const body = {
276
+ ...input,
277
+ organizationId: input.organizationId ??
278
+ session?.organizationId ??
279
+ this.config.organizationId,
280
+ };
281
+ const stringifiedBody = JSON.stringify(body);
282
+ const stamp = await this.stamper.stamp(stringifiedBody);
283
+ return {
284
+ body: stringifiedBody,
285
+ stamp: stamp,
286
+ url: fullUrl,
287
+ };
288
+ };
289
+ this.getEarnWithdrawStatus = async (input) => {
290
+ const sessionData = await getStorageValue(StorageKeys.Session);
291
+ const session = sessionData ? parseSession(sessionData) : null;
292
+ return this.request("/public/v1/query/get_earn_withdraw_status", {
293
+ ...input,
294
+ organizationId: input.organizationId ??
295
+ session?.organizationId ??
296
+ this.config.organizationId,
297
+ });
298
+ };
299
+ this.stampGetEarnWithdrawStatus = async (input) => {
300
+ if (!this.stamper) {
301
+ return undefined;
302
+ }
303
+ const sessionData = await getStorageValue(StorageKeys.Session);
304
+ const session = sessionData ? parseSession(sessionData) : null;
305
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_earn_withdraw_status";
306
+ const body = {
307
+ ...input,
308
+ organizationId: input.organizationId ??
309
+ session?.organizationId ??
310
+ this.config.organizationId,
311
+ };
312
+ const stringifiedBody = JSON.stringify(body);
313
+ const stamp = await this.stamper.stamp(stringifiedBody);
314
+ return {
315
+ body: stringifiedBody,
316
+ stamp: stamp,
317
+ url: fullUrl,
318
+ };
319
+ };
227
320
  this.getGasUsage = async (input) => {
228
321
  const sessionData = await getStorageValue(StorageKeys.Session);
229
322
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1061,6 +1154,99 @@ class TurnkeySDKClientBase {
1061
1154
  url: fullUrl,
1062
1155
  };
1063
1156
  };
1157
+ this.listEarnEnabledVaults = async (input) => {
1158
+ const sessionData = await getStorageValue(StorageKeys.Session);
1159
+ const session = sessionData ? parseSession(sessionData) : null;
1160
+ return this.request("/public/v1/query/list_earn_enabled_vaults", {
1161
+ ...input,
1162
+ organizationId: input.organizationId ??
1163
+ session?.organizationId ??
1164
+ this.config.organizationId,
1165
+ });
1166
+ };
1167
+ this.stampListEarnEnabledVaults = async (input) => {
1168
+ if (!this.stamper) {
1169
+ return undefined;
1170
+ }
1171
+ const sessionData = await getStorageValue(StorageKeys.Session);
1172
+ const session = sessionData ? parseSession(sessionData) : null;
1173
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_earn_enabled_vaults";
1174
+ const body = {
1175
+ ...input,
1176
+ organizationId: input.organizationId ??
1177
+ session?.organizationId ??
1178
+ this.config.organizationId,
1179
+ };
1180
+ const stringifiedBody = JSON.stringify(body);
1181
+ const stamp = await this.stamper.stamp(stringifiedBody);
1182
+ return {
1183
+ body: stringifiedBody,
1184
+ stamp: stamp,
1185
+ url: fullUrl,
1186
+ };
1187
+ };
1188
+ this.listEarnPositions = async (input) => {
1189
+ const sessionData = await getStorageValue(StorageKeys.Session);
1190
+ const session = sessionData ? parseSession(sessionData) : null;
1191
+ return this.request("/public/v1/query/list_earn_positions", {
1192
+ ...input,
1193
+ organizationId: input.organizationId ??
1194
+ session?.organizationId ??
1195
+ this.config.organizationId,
1196
+ });
1197
+ };
1198
+ this.stampListEarnPositions = async (input) => {
1199
+ if (!this.stamper) {
1200
+ return undefined;
1201
+ }
1202
+ const sessionData = await getStorageValue(StorageKeys.Session);
1203
+ const session = sessionData ? parseSession(sessionData) : null;
1204
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_earn_positions";
1205
+ const body = {
1206
+ ...input,
1207
+ organizationId: input.organizationId ??
1208
+ session?.organizationId ??
1209
+ this.config.organizationId,
1210
+ };
1211
+ const stringifiedBody = JSON.stringify(body);
1212
+ const stamp = await this.stamper.stamp(stringifiedBody);
1213
+ return {
1214
+ body: stringifiedBody,
1215
+ stamp: stamp,
1216
+ url: fullUrl,
1217
+ };
1218
+ };
1219
+ this.listEarnVaults = async (input) => {
1220
+ const sessionData = await getStorageValue(StorageKeys.Session);
1221
+ const session = sessionData ? parseSession(sessionData) : null;
1222
+ return this.request("/public/v1/query/list_earn_vaults", {
1223
+ ...input,
1224
+ organizationId: input.organizationId ??
1225
+ session?.organizationId ??
1226
+ this.config.organizationId,
1227
+ });
1228
+ };
1229
+ this.stampListEarnVaults = async (input) => {
1230
+ if (!this.stamper) {
1231
+ return undefined;
1232
+ }
1233
+ const sessionData = await getStorageValue(StorageKeys.Session);
1234
+ const session = sessionData ? parseSession(sessionData) : null;
1235
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_earn_vaults";
1236
+ const body = {
1237
+ ...input,
1238
+ organizationId: input.organizationId ??
1239
+ session?.organizationId ??
1240
+ this.config.organizationId,
1241
+ };
1242
+ const stringifiedBody = JSON.stringify(body);
1243
+ const stamp = await this.stamper.stamp(stringifiedBody);
1244
+ return {
1245
+ body: stringifiedBody,
1246
+ stamp: stamp,
1247
+ url: fullUrl,
1248
+ };
1249
+ };
1064
1250
  this.listEmailEvents = async (input) => {
1065
1251
  const sessionData = await getStorageValue(StorageKeys.Session);
1066
1252
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1092,6 +1278,37 @@ class TurnkeySDKClientBase {
1092
1278
  url: fullUrl,
1093
1279
  };
1094
1280
  };
1281
+ this.listEthTransactionHistory = async (input) => {
1282
+ const sessionData = await getStorageValue(StorageKeys.Session);
1283
+ const session = sessionData ? parseSession(sessionData) : null;
1284
+ return this.request("/public/v1/query/list_eth_transaction_history", {
1285
+ ...input,
1286
+ organizationId: input.organizationId ??
1287
+ session?.organizationId ??
1288
+ this.config.organizationId,
1289
+ });
1290
+ };
1291
+ this.stampListEthTransactionHistory = async (input) => {
1292
+ if (!this.stamper) {
1293
+ return undefined;
1294
+ }
1295
+ const sessionData = await getStorageValue(StorageKeys.Session);
1296
+ const session = sessionData ? parseSession(sessionData) : null;
1297
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_eth_transaction_history";
1298
+ const body = {
1299
+ ...input,
1300
+ organizationId: input.organizationId ??
1301
+ session?.organizationId ??
1302
+ this.config.organizationId,
1303
+ };
1304
+ const stringifiedBody = JSON.stringify(body);
1305
+ const stamp = await this.stamper.stamp(stringifiedBody);
1306
+ return {
1307
+ body: stringifiedBody,
1308
+ stamp: stamp,
1309
+ url: fullUrl,
1310
+ };
1311
+ };
1095
1312
  this.listFiatOnRampCredentials = async (input) => {
1096
1313
  const sessionData = await getStorageValue(StorageKeys.Session);
1097
1314
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1279,6 +1496,37 @@ class TurnkeySDKClientBase {
1279
1496
  url: fullUrl,
1280
1497
  };
1281
1498
  };
1499
+ this.listSolTransactionHistory = async (input) => {
1500
+ const sessionData = await getStorageValue(StorageKeys.Session);
1501
+ const session = sessionData ? parseSession(sessionData) : null;
1502
+ return this.request("/public/v1/query/list_sol_transaction_history", {
1503
+ ...input,
1504
+ organizationId: input.organizationId ??
1505
+ session?.organizationId ??
1506
+ this.config.organizationId,
1507
+ });
1508
+ };
1509
+ this.stampListSolTransactionHistory = async (input) => {
1510
+ if (!this.stamper) {
1511
+ return undefined;
1512
+ }
1513
+ const sessionData = await getStorageValue(StorageKeys.Session);
1514
+ const session = sessionData ? parseSession(sessionData) : null;
1515
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_sol_transaction_history";
1516
+ const body = {
1517
+ ...input,
1518
+ organizationId: input.organizationId ??
1519
+ session?.organizationId ??
1520
+ this.config.organizationId,
1521
+ };
1522
+ const stringifiedBody = JSON.stringify(body);
1523
+ const stamp = await this.stamper.stamp(stringifiedBody);
1524
+ return {
1525
+ body: stringifiedBody,
1526
+ stamp: stamp,
1527
+ url: fullUrl,
1528
+ };
1529
+ };
1282
1530
  this.getSubOrgIds = async (input = {}) => {
1283
1531
  const sessionData = await getStorageValue(StorageKeys.Session);
1284
1532
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1684,6 +1932,41 @@ class TurnkeySDKClientBase {
1684
1932
  url: fullUrl,
1685
1933
  };
1686
1934
  };
1935
+ this.claimEarnFees = async (input) => {
1936
+ const sessionData = await getStorageValue(StorageKeys.Session);
1937
+ const session = sessionData ? parseSession(sessionData) : null;
1938
+ const { organizationId, timestampMs, ...rest } = input;
1939
+ return this.command("/public/v1/submit/claim_earn_fees", {
1940
+ parameters: rest,
1941
+ organizationId: organizationId ??
1942
+ session?.organizationId ??
1943
+ this.config.organizationId,
1944
+ timestampMs: timestampMs ?? String(Date.now()),
1945
+ type: "ACTIVITY_TYPE_CLAIM_EARN_FEES",
1946
+ }, "claimEarnFeesResult");
1947
+ };
1948
+ this.stampClaimEarnFees = async (input) => {
1949
+ if (!this.stamper) {
1950
+ return undefined;
1951
+ }
1952
+ const sessionData = await getStorageValue(StorageKeys.Session);
1953
+ const session = sessionData ? parseSession(sessionData) : null;
1954
+ const { organizationId, timestampMs, ...parameters } = input;
1955
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/claim_earn_fees";
1956
+ const bodyWithType = {
1957
+ parameters,
1958
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1959
+ timestampMs: timestampMs ?? String(Date.now()),
1960
+ type: "ACTIVITY_TYPE_CLAIM_EARN_FEES",
1961
+ };
1962
+ const stringifiedBody = JSON.stringify(bodyWithType);
1963
+ const stamp = await this.stamper.stamp(stringifiedBody);
1964
+ return {
1965
+ body: stringifiedBody,
1966
+ stamp: stamp,
1967
+ url: fullUrl,
1968
+ };
1969
+ };
1687
1970
  this.createApiKeys = async (input) => {
1688
1971
  const sessionData = await getStorageValue(StorageKeys.Session);
1689
1972
  const session = sessionData ? parseSession(sessionData) : null;
@@ -3230,6 +3513,146 @@ class TurnkeySDKClientBase {
3230
3513
  url: fullUrl,
3231
3514
  };
3232
3515
  };
3516
+ this.earnDeployWrapper = async (input) => {
3517
+ const sessionData = await getStorageValue(StorageKeys.Session);
3518
+ const session = sessionData ? parseSession(sessionData) : null;
3519
+ const { organizationId, timestampMs, ...rest } = input;
3520
+ return this.command("/public/v1/submit/earn_deploy_wrapper", {
3521
+ parameters: rest,
3522
+ organizationId: organizationId ??
3523
+ session?.organizationId ??
3524
+ this.config.organizationId,
3525
+ timestampMs: timestampMs ?? String(Date.now()),
3526
+ type: "ACTIVITY_TYPE_EARN_DEPLOY_WRAPPER",
3527
+ }, "earnDeployWrapperResult");
3528
+ };
3529
+ this.stampEarnDeployWrapper = async (input) => {
3530
+ if (!this.stamper) {
3531
+ return undefined;
3532
+ }
3533
+ const sessionData = await getStorageValue(StorageKeys.Session);
3534
+ const session = sessionData ? parseSession(sessionData) : null;
3535
+ const { organizationId, timestampMs, ...parameters } = input;
3536
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_deploy_wrapper";
3537
+ const bodyWithType = {
3538
+ parameters,
3539
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3540
+ timestampMs: timestampMs ?? String(Date.now()),
3541
+ type: "ACTIVITY_TYPE_EARN_DEPLOY_WRAPPER",
3542
+ };
3543
+ const stringifiedBody = JSON.stringify(bodyWithType);
3544
+ const stamp = await this.stamper.stamp(stringifiedBody);
3545
+ return {
3546
+ body: stringifiedBody,
3547
+ stamp: stamp,
3548
+ url: fullUrl,
3549
+ };
3550
+ };
3551
+ this.earnDeposit = async (input) => {
3552
+ const sessionData = await getStorageValue(StorageKeys.Session);
3553
+ const session = sessionData ? parseSession(sessionData) : null;
3554
+ const { organizationId, timestampMs, ...rest } = input;
3555
+ return this.command("/public/v1/submit/earn_deposit", {
3556
+ parameters: rest,
3557
+ organizationId: organizationId ??
3558
+ session?.organizationId ??
3559
+ this.config.organizationId,
3560
+ timestampMs: timestampMs ?? String(Date.now()),
3561
+ type: "ACTIVITY_TYPE_EARN_DEPOSIT",
3562
+ }, "earnDepositResult");
3563
+ };
3564
+ this.stampEarnDeposit = async (input) => {
3565
+ if (!this.stamper) {
3566
+ return undefined;
3567
+ }
3568
+ const sessionData = await getStorageValue(StorageKeys.Session);
3569
+ const session = sessionData ? parseSession(sessionData) : null;
3570
+ const { organizationId, timestampMs, ...parameters } = input;
3571
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_deposit";
3572
+ const bodyWithType = {
3573
+ parameters,
3574
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3575
+ timestampMs: timestampMs ?? String(Date.now()),
3576
+ type: "ACTIVITY_TYPE_EARN_DEPOSIT",
3577
+ };
3578
+ const stringifiedBody = JSON.stringify(bodyWithType);
3579
+ const stamp = await this.stamper.stamp(stringifiedBody);
3580
+ return {
3581
+ body: stringifiedBody,
3582
+ stamp: stamp,
3583
+ url: fullUrl,
3584
+ };
3585
+ };
3586
+ this.earnSetWrapperState = async (input) => {
3587
+ const sessionData = await getStorageValue(StorageKeys.Session);
3588
+ const session = sessionData ? parseSession(sessionData) : null;
3589
+ const { organizationId, timestampMs, ...rest } = input;
3590
+ return this.command("/public/v1/submit/earn_set_wrapper_state", {
3591
+ parameters: rest,
3592
+ organizationId: organizationId ??
3593
+ session?.organizationId ??
3594
+ this.config.organizationId,
3595
+ timestampMs: timestampMs ?? String(Date.now()),
3596
+ type: "ACTIVITY_TYPE_EARN_SET_WRAPPER_STATE",
3597
+ }, "earnSetWrapperStateResult");
3598
+ };
3599
+ this.stampEarnSetWrapperState = async (input) => {
3600
+ if (!this.stamper) {
3601
+ return undefined;
3602
+ }
3603
+ const sessionData = await getStorageValue(StorageKeys.Session);
3604
+ const session = sessionData ? parseSession(sessionData) : null;
3605
+ const { organizationId, timestampMs, ...parameters } = input;
3606
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_set_wrapper_state";
3607
+ const bodyWithType = {
3608
+ parameters,
3609
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3610
+ timestampMs: timestampMs ?? String(Date.now()),
3611
+ type: "ACTIVITY_TYPE_EARN_SET_WRAPPER_STATE",
3612
+ };
3613
+ const stringifiedBody = JSON.stringify(bodyWithType);
3614
+ const stamp = await this.stamper.stamp(stringifiedBody);
3615
+ return {
3616
+ body: stringifiedBody,
3617
+ stamp: stamp,
3618
+ url: fullUrl,
3619
+ };
3620
+ };
3621
+ this.earnWithdraw = async (input) => {
3622
+ const sessionData = await getStorageValue(StorageKeys.Session);
3623
+ const session = sessionData ? parseSession(sessionData) : null;
3624
+ const { organizationId, timestampMs, ...rest } = input;
3625
+ return this.command("/public/v1/submit/earn_withdraw", {
3626
+ parameters: rest,
3627
+ organizationId: organizationId ??
3628
+ session?.organizationId ??
3629
+ this.config.organizationId,
3630
+ timestampMs: timestampMs ?? String(Date.now()),
3631
+ type: "ACTIVITY_TYPE_EARN_WITHDRAW",
3632
+ }, "earnWithdrawResult");
3633
+ };
3634
+ this.stampEarnWithdraw = async (input) => {
3635
+ if (!this.stamper) {
3636
+ return undefined;
3637
+ }
3638
+ const sessionData = await getStorageValue(StorageKeys.Session);
3639
+ const session = sessionData ? parseSession(sessionData) : null;
3640
+ const { organizationId, timestampMs, ...parameters } = input;
3641
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_withdraw";
3642
+ const bodyWithType = {
3643
+ parameters,
3644
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3645
+ timestampMs: timestampMs ?? String(Date.now()),
3646
+ type: "ACTIVITY_TYPE_EARN_WITHDRAW",
3647
+ };
3648
+ const stringifiedBody = JSON.stringify(bodyWithType);
3649
+ const stamp = await this.stamper.stamp(stringifiedBody);
3650
+ return {
3651
+ body: stringifiedBody,
3652
+ stamp: stamp,
3653
+ url: fullUrl,
3654
+ };
3655
+ };
3233
3656
  this.emailAuth = async (input) => {
3234
3657
  const sessionData = await getStorageValue(StorageKeys.Session);
3235
3658
  const session = sessionData ? parseSession(sessionData) : null;
@@ -4253,8 +4676,8 @@ class TurnkeySDKClientBase {
4253
4676
  session?.organizationId ??
4254
4677
  this.config.organizationId,
4255
4678
  timestampMs: timestampMs ?? String(Date.now()),
4256
- type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION",
4257
- }, "solSendTransactionResult");
4679
+ type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION_V2",
4680
+ }, "solSendTransactionResultV2");
4258
4681
  };
4259
4682
  this.stampSolSendTransaction = async (input) => {
4260
4683
  if (!this.stamper) {
@@ -4268,7 +4691,7 @@ class TurnkeySDKClientBase {
4268
4691
  parameters,
4269
4692
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
4270
4693
  timestampMs: timestampMs ?? String(Date.now()),
4271
- type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION",
4694
+ type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION_V2",
4272
4695
  };
4273
4696
  const stringifiedBody = JSON.stringify(bodyWithType);
4274
4697
  const stamp = await this.stamper.stamp(stringifiedBody);