@turnkey/sdk-browser 7.0.0 → 8.1.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.
- package/CHANGELOG.md +80 -0
- package/dist/__generated__/sdk-client-base.d.ts +36 -0
- package/dist/__generated__/sdk-client-base.d.ts.map +1 -1
- package/dist/__generated__/sdk-client-base.js +593 -3
- package/dist/__generated__/sdk-client-base.js.map +1 -1
- package/dist/__generated__/sdk-client-base.mjs +593 -3
- package/dist/__generated__/sdk-client-base.mjs.map +1 -1
- package/dist/__generated__/sdk_api_types.d.ts +91 -1
- package/dist/__generated__/sdk_api_types.d.ts.map +1 -1
- package/dist/__generated__/version.d.ts +1 -1
- package/dist/__generated__/version.js +1 -1
- package/dist/__generated__/version.mjs +1 -1
- package/dist/__inputs__/public_api.types.d.ts +960 -330
- package/dist/__inputs__/public_api.types.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -226,6 +226,130 @@ class TurnkeySDKClientBase {
|
|
|
226
226
|
url: fullUrl,
|
|
227
227
|
};
|
|
228
228
|
};
|
|
229
|
+
this.getClaimEarnFeesStatus = async (input) => {
|
|
230
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
231
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
232
|
+
return this.request("/public/v1/query/get_claim_earn_fees_status", {
|
|
233
|
+
...input,
|
|
234
|
+
organizationId: input.organizationId ??
|
|
235
|
+
session?.organizationId ??
|
|
236
|
+
this.config.organizationId,
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
this.stampGetClaimEarnFeesStatus = async (input) => {
|
|
240
|
+
if (!this.stamper) {
|
|
241
|
+
return undefined;
|
|
242
|
+
}
|
|
243
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
244
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
245
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_claim_earn_fees_status";
|
|
246
|
+
const body = {
|
|
247
|
+
...input,
|
|
248
|
+
organizationId: input.organizationId ??
|
|
249
|
+
session?.organizationId ??
|
|
250
|
+
this.config.organizationId,
|
|
251
|
+
};
|
|
252
|
+
const stringifiedBody = JSON.stringify(body);
|
|
253
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
254
|
+
return {
|
|
255
|
+
body: stringifiedBody,
|
|
256
|
+
stamp: stamp,
|
|
257
|
+
url: fullUrl,
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
this.getEarnDeployStatus = async (input) => {
|
|
261
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
262
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
263
|
+
return this.request("/public/v1/query/get_earn_deploy_status", {
|
|
264
|
+
...input,
|
|
265
|
+
organizationId: input.organizationId ??
|
|
266
|
+
session?.organizationId ??
|
|
267
|
+
this.config.organizationId,
|
|
268
|
+
});
|
|
269
|
+
};
|
|
270
|
+
this.stampGetEarnDeployStatus = async (input) => {
|
|
271
|
+
if (!this.stamper) {
|
|
272
|
+
return undefined;
|
|
273
|
+
}
|
|
274
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
275
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
276
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_earn_deploy_status";
|
|
277
|
+
const body = {
|
|
278
|
+
...input,
|
|
279
|
+
organizationId: input.organizationId ??
|
|
280
|
+
session?.organizationId ??
|
|
281
|
+
this.config.organizationId,
|
|
282
|
+
};
|
|
283
|
+
const stringifiedBody = JSON.stringify(body);
|
|
284
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
285
|
+
return {
|
|
286
|
+
body: stringifiedBody,
|
|
287
|
+
stamp: stamp,
|
|
288
|
+
url: fullUrl,
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
this.getEarnDepositStatus = async (input) => {
|
|
292
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
293
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
294
|
+
return this.request("/public/v1/query/get_earn_deposit_status", {
|
|
295
|
+
...input,
|
|
296
|
+
organizationId: input.organizationId ??
|
|
297
|
+
session?.organizationId ??
|
|
298
|
+
this.config.organizationId,
|
|
299
|
+
});
|
|
300
|
+
};
|
|
301
|
+
this.stampGetEarnDepositStatus = async (input) => {
|
|
302
|
+
if (!this.stamper) {
|
|
303
|
+
return undefined;
|
|
304
|
+
}
|
|
305
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
306
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
307
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_earn_deposit_status";
|
|
308
|
+
const body = {
|
|
309
|
+
...input,
|
|
310
|
+
organizationId: input.organizationId ??
|
|
311
|
+
session?.organizationId ??
|
|
312
|
+
this.config.organizationId,
|
|
313
|
+
};
|
|
314
|
+
const stringifiedBody = JSON.stringify(body);
|
|
315
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
316
|
+
return {
|
|
317
|
+
body: stringifiedBody,
|
|
318
|
+
stamp: stamp,
|
|
319
|
+
url: fullUrl,
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
this.getEarnWithdrawStatus = async (input) => {
|
|
323
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
324
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
325
|
+
return this.request("/public/v1/query/get_earn_withdraw_status", {
|
|
326
|
+
...input,
|
|
327
|
+
organizationId: input.organizationId ??
|
|
328
|
+
session?.organizationId ??
|
|
329
|
+
this.config.organizationId,
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
this.stampGetEarnWithdrawStatus = async (input) => {
|
|
333
|
+
if (!this.stamper) {
|
|
334
|
+
return undefined;
|
|
335
|
+
}
|
|
336
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
337
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
338
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_earn_withdraw_status";
|
|
339
|
+
const body = {
|
|
340
|
+
...input,
|
|
341
|
+
organizationId: input.organizationId ??
|
|
342
|
+
session?.organizationId ??
|
|
343
|
+
this.config.organizationId,
|
|
344
|
+
};
|
|
345
|
+
const stringifiedBody = JSON.stringify(body);
|
|
346
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
347
|
+
return {
|
|
348
|
+
body: stringifiedBody,
|
|
349
|
+
stamp: stamp,
|
|
350
|
+
url: fullUrl,
|
|
351
|
+
};
|
|
352
|
+
};
|
|
229
353
|
this.getGasUsage = async (input) => {
|
|
230
354
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
231
355
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -784,6 +908,37 @@ class TurnkeySDKClientBase {
|
|
|
784
908
|
url: fullUrl,
|
|
785
909
|
};
|
|
786
910
|
};
|
|
911
|
+
this.getSwapStatus = async (input) => {
|
|
912
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
913
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
914
|
+
return this.request("/public/v1/query/get_swap_status", {
|
|
915
|
+
...input,
|
|
916
|
+
organizationId: input.organizationId ??
|
|
917
|
+
session?.organizationId ??
|
|
918
|
+
this.config.organizationId,
|
|
919
|
+
});
|
|
920
|
+
};
|
|
921
|
+
this.stampGetSwapStatus = async (input) => {
|
|
922
|
+
if (!this.stamper) {
|
|
923
|
+
return undefined;
|
|
924
|
+
}
|
|
925
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
926
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
927
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_swap_status";
|
|
928
|
+
const body = {
|
|
929
|
+
...input,
|
|
930
|
+
organizationId: input.organizationId ??
|
|
931
|
+
session?.organizationId ??
|
|
932
|
+
this.config.organizationId,
|
|
933
|
+
};
|
|
934
|
+
const stringifiedBody = JSON.stringify(body);
|
|
935
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
936
|
+
return {
|
|
937
|
+
body: stringifiedBody,
|
|
938
|
+
stamp: stamp,
|
|
939
|
+
url: fullUrl,
|
|
940
|
+
};
|
|
941
|
+
};
|
|
787
942
|
this.getTvcApp = async (input) => {
|
|
788
943
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
789
944
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -1063,6 +1218,99 @@ class TurnkeySDKClientBase {
|
|
|
1063
1218
|
url: fullUrl,
|
|
1064
1219
|
};
|
|
1065
1220
|
};
|
|
1221
|
+
this.listEarnEnabledVaults = async (input) => {
|
|
1222
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1223
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1224
|
+
return this.request("/public/v1/query/list_earn_enabled_vaults", {
|
|
1225
|
+
...input,
|
|
1226
|
+
organizationId: input.organizationId ??
|
|
1227
|
+
session?.organizationId ??
|
|
1228
|
+
this.config.organizationId,
|
|
1229
|
+
});
|
|
1230
|
+
};
|
|
1231
|
+
this.stampListEarnEnabledVaults = async (input) => {
|
|
1232
|
+
if (!this.stamper) {
|
|
1233
|
+
return undefined;
|
|
1234
|
+
}
|
|
1235
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1236
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1237
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_earn_enabled_vaults";
|
|
1238
|
+
const body = {
|
|
1239
|
+
...input,
|
|
1240
|
+
organizationId: input.organizationId ??
|
|
1241
|
+
session?.organizationId ??
|
|
1242
|
+
this.config.organizationId,
|
|
1243
|
+
};
|
|
1244
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1245
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
1246
|
+
return {
|
|
1247
|
+
body: stringifiedBody,
|
|
1248
|
+
stamp: stamp,
|
|
1249
|
+
url: fullUrl,
|
|
1250
|
+
};
|
|
1251
|
+
};
|
|
1252
|
+
this.listEarnPositions = async (input) => {
|
|
1253
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1254
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1255
|
+
return this.request("/public/v1/query/list_earn_positions", {
|
|
1256
|
+
...input,
|
|
1257
|
+
organizationId: input.organizationId ??
|
|
1258
|
+
session?.organizationId ??
|
|
1259
|
+
this.config.organizationId,
|
|
1260
|
+
});
|
|
1261
|
+
};
|
|
1262
|
+
this.stampListEarnPositions = async (input) => {
|
|
1263
|
+
if (!this.stamper) {
|
|
1264
|
+
return undefined;
|
|
1265
|
+
}
|
|
1266
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1267
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1268
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_earn_positions";
|
|
1269
|
+
const body = {
|
|
1270
|
+
...input,
|
|
1271
|
+
organizationId: input.organizationId ??
|
|
1272
|
+
session?.organizationId ??
|
|
1273
|
+
this.config.organizationId,
|
|
1274
|
+
};
|
|
1275
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1276
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
1277
|
+
return {
|
|
1278
|
+
body: stringifiedBody,
|
|
1279
|
+
stamp: stamp,
|
|
1280
|
+
url: fullUrl,
|
|
1281
|
+
};
|
|
1282
|
+
};
|
|
1283
|
+
this.listEarnVaults = async (input) => {
|
|
1284
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1285
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1286
|
+
return this.request("/public/v1/query/list_earn_vaults", {
|
|
1287
|
+
...input,
|
|
1288
|
+
organizationId: input.organizationId ??
|
|
1289
|
+
session?.organizationId ??
|
|
1290
|
+
this.config.organizationId,
|
|
1291
|
+
});
|
|
1292
|
+
};
|
|
1293
|
+
this.stampListEarnVaults = async (input) => {
|
|
1294
|
+
if (!this.stamper) {
|
|
1295
|
+
return undefined;
|
|
1296
|
+
}
|
|
1297
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1298
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1299
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_earn_vaults";
|
|
1300
|
+
const body = {
|
|
1301
|
+
...input,
|
|
1302
|
+
organizationId: input.organizationId ??
|
|
1303
|
+
session?.organizationId ??
|
|
1304
|
+
this.config.organizationId,
|
|
1305
|
+
};
|
|
1306
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1307
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
1308
|
+
return {
|
|
1309
|
+
body: stringifiedBody,
|
|
1310
|
+
stamp: stamp,
|
|
1311
|
+
url: fullUrl,
|
|
1312
|
+
};
|
|
1313
|
+
};
|
|
1066
1314
|
this.listEmailEvents = async (input) => {
|
|
1067
1315
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1068
1316
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -1094,6 +1342,37 @@ class TurnkeySDKClientBase {
|
|
|
1094
1342
|
url: fullUrl,
|
|
1095
1343
|
};
|
|
1096
1344
|
};
|
|
1345
|
+
this.listEthTransactionHistory = async (input) => {
|
|
1346
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1347
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1348
|
+
return this.request("/public/v1/query/list_eth_transaction_history", {
|
|
1349
|
+
...input,
|
|
1350
|
+
organizationId: input.organizationId ??
|
|
1351
|
+
session?.organizationId ??
|
|
1352
|
+
this.config.organizationId,
|
|
1353
|
+
});
|
|
1354
|
+
};
|
|
1355
|
+
this.stampListEthTransactionHistory = async (input) => {
|
|
1356
|
+
if (!this.stamper) {
|
|
1357
|
+
return undefined;
|
|
1358
|
+
}
|
|
1359
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1360
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1361
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_eth_transaction_history";
|
|
1362
|
+
const body = {
|
|
1363
|
+
...input,
|
|
1364
|
+
organizationId: input.organizationId ??
|
|
1365
|
+
session?.organizationId ??
|
|
1366
|
+
this.config.organizationId,
|
|
1367
|
+
};
|
|
1368
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1369
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
1370
|
+
return {
|
|
1371
|
+
body: stringifiedBody,
|
|
1372
|
+
stamp: stamp,
|
|
1373
|
+
url: fullUrl,
|
|
1374
|
+
};
|
|
1375
|
+
};
|
|
1097
1376
|
this.listFiatOnRampCredentials = async (input) => {
|
|
1098
1377
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1099
1378
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -1281,6 +1560,37 @@ class TurnkeySDKClientBase {
|
|
|
1281
1560
|
url: fullUrl,
|
|
1282
1561
|
};
|
|
1283
1562
|
};
|
|
1563
|
+
this.listSolTransactionHistory = async (input) => {
|
|
1564
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1565
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1566
|
+
return this.request("/public/v1/query/list_sol_transaction_history", {
|
|
1567
|
+
...input,
|
|
1568
|
+
organizationId: input.organizationId ??
|
|
1569
|
+
session?.organizationId ??
|
|
1570
|
+
this.config.organizationId,
|
|
1571
|
+
});
|
|
1572
|
+
};
|
|
1573
|
+
this.stampListSolTransactionHistory = async (input) => {
|
|
1574
|
+
if (!this.stamper) {
|
|
1575
|
+
return undefined;
|
|
1576
|
+
}
|
|
1577
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1578
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1579
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_sol_transaction_history";
|
|
1580
|
+
const body = {
|
|
1581
|
+
...input,
|
|
1582
|
+
organizationId: input.organizationId ??
|
|
1583
|
+
session?.organizationId ??
|
|
1584
|
+
this.config.organizationId,
|
|
1585
|
+
};
|
|
1586
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1587
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
1588
|
+
return {
|
|
1589
|
+
body: stringifiedBody,
|
|
1590
|
+
stamp: stamp,
|
|
1591
|
+
url: fullUrl,
|
|
1592
|
+
};
|
|
1593
|
+
};
|
|
1284
1594
|
this.getSubOrgIds = async (input = {}) => {
|
|
1285
1595
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1286
1596
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -1686,6 +1996,76 @@ class TurnkeySDKClientBase {
|
|
|
1686
1996
|
url: fullUrl,
|
|
1687
1997
|
};
|
|
1688
1998
|
};
|
|
1999
|
+
this.claimEarnFees = async (input) => {
|
|
2000
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
2001
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
2002
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2003
|
+
return this.command("/public/v1/submit/claim_earn_fees", {
|
|
2004
|
+
parameters: rest,
|
|
2005
|
+
organizationId: organizationId ??
|
|
2006
|
+
session?.organizationId ??
|
|
2007
|
+
this.config.organizationId,
|
|
2008
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2009
|
+
type: "ACTIVITY_TYPE_CLAIM_EARN_FEES",
|
|
2010
|
+
}, "claimEarnFeesResult");
|
|
2011
|
+
};
|
|
2012
|
+
this.stampClaimEarnFees = async (input) => {
|
|
2013
|
+
if (!this.stamper) {
|
|
2014
|
+
return undefined;
|
|
2015
|
+
}
|
|
2016
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
2017
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
2018
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2019
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/claim_earn_fees";
|
|
2020
|
+
const bodyWithType = {
|
|
2021
|
+
parameters,
|
|
2022
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2023
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2024
|
+
type: "ACTIVITY_TYPE_CLAIM_EARN_FEES",
|
|
2025
|
+
};
|
|
2026
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2027
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
2028
|
+
return {
|
|
2029
|
+
body: stringifiedBody,
|
|
2030
|
+
stamp: stamp,
|
|
2031
|
+
url: fullUrl,
|
|
2032
|
+
};
|
|
2033
|
+
};
|
|
2034
|
+
this.claimSwapFees = async (input) => {
|
|
2035
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
2036
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
2037
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2038
|
+
return this.command("/public/v1/submit/claim_swap_fees", {
|
|
2039
|
+
parameters: rest,
|
|
2040
|
+
organizationId: organizationId ??
|
|
2041
|
+
session?.organizationId ??
|
|
2042
|
+
this.config.organizationId,
|
|
2043
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2044
|
+
type: "ACTIVITY_TYPE_CLAIM_SWAP_FEES",
|
|
2045
|
+
}, "claimSwapFeesResult");
|
|
2046
|
+
};
|
|
2047
|
+
this.stampClaimSwapFees = async (input) => {
|
|
2048
|
+
if (!this.stamper) {
|
|
2049
|
+
return undefined;
|
|
2050
|
+
}
|
|
2051
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
2052
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
2053
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2054
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/claim_swap_fees";
|
|
2055
|
+
const bodyWithType = {
|
|
2056
|
+
parameters,
|
|
2057
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2058
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2059
|
+
type: "ACTIVITY_TYPE_CLAIM_SWAP_FEES",
|
|
2060
|
+
};
|
|
2061
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2062
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
2063
|
+
return {
|
|
2064
|
+
body: stringifiedBody,
|
|
2065
|
+
stamp: stamp,
|
|
2066
|
+
url: fullUrl,
|
|
2067
|
+
};
|
|
2068
|
+
};
|
|
1689
2069
|
this.createApiKeys = async (input) => {
|
|
1690
2070
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1691
2071
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -3232,6 +3612,146 @@ class TurnkeySDKClientBase {
|
|
|
3232
3612
|
url: fullUrl,
|
|
3233
3613
|
};
|
|
3234
3614
|
};
|
|
3615
|
+
this.earnDeployWrapper = async (input) => {
|
|
3616
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3617
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3618
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3619
|
+
return this.command("/public/v1/submit/earn_deploy_wrapper", {
|
|
3620
|
+
parameters: rest,
|
|
3621
|
+
organizationId: organizationId ??
|
|
3622
|
+
session?.organizationId ??
|
|
3623
|
+
this.config.organizationId,
|
|
3624
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3625
|
+
type: "ACTIVITY_TYPE_EARN_DEPLOY_WRAPPER",
|
|
3626
|
+
}, "earnDeployWrapperResult");
|
|
3627
|
+
};
|
|
3628
|
+
this.stampEarnDeployWrapper = async (input) => {
|
|
3629
|
+
if (!this.stamper) {
|
|
3630
|
+
return undefined;
|
|
3631
|
+
}
|
|
3632
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3633
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3634
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3635
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_deploy_wrapper";
|
|
3636
|
+
const bodyWithType = {
|
|
3637
|
+
parameters,
|
|
3638
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3639
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3640
|
+
type: "ACTIVITY_TYPE_EARN_DEPLOY_WRAPPER",
|
|
3641
|
+
};
|
|
3642
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3643
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
3644
|
+
return {
|
|
3645
|
+
body: stringifiedBody,
|
|
3646
|
+
stamp: stamp,
|
|
3647
|
+
url: fullUrl,
|
|
3648
|
+
};
|
|
3649
|
+
};
|
|
3650
|
+
this.earnDeposit = async (input) => {
|
|
3651
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3652
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3653
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3654
|
+
return this.command("/public/v1/submit/earn_deposit", {
|
|
3655
|
+
parameters: rest,
|
|
3656
|
+
organizationId: organizationId ??
|
|
3657
|
+
session?.organizationId ??
|
|
3658
|
+
this.config.organizationId,
|
|
3659
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3660
|
+
type: "ACTIVITY_TYPE_EARN_DEPOSIT",
|
|
3661
|
+
}, "earnDepositResult");
|
|
3662
|
+
};
|
|
3663
|
+
this.stampEarnDeposit = async (input) => {
|
|
3664
|
+
if (!this.stamper) {
|
|
3665
|
+
return undefined;
|
|
3666
|
+
}
|
|
3667
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3668
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3669
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3670
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_deposit";
|
|
3671
|
+
const bodyWithType = {
|
|
3672
|
+
parameters,
|
|
3673
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3674
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3675
|
+
type: "ACTIVITY_TYPE_EARN_DEPOSIT",
|
|
3676
|
+
};
|
|
3677
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3678
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
3679
|
+
return {
|
|
3680
|
+
body: stringifiedBody,
|
|
3681
|
+
stamp: stamp,
|
|
3682
|
+
url: fullUrl,
|
|
3683
|
+
};
|
|
3684
|
+
};
|
|
3685
|
+
this.earnSetWrapperState = async (input) => {
|
|
3686
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3687
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3688
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3689
|
+
return this.command("/public/v1/submit/earn_set_wrapper_state", {
|
|
3690
|
+
parameters: rest,
|
|
3691
|
+
organizationId: organizationId ??
|
|
3692
|
+
session?.organizationId ??
|
|
3693
|
+
this.config.organizationId,
|
|
3694
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3695
|
+
type: "ACTIVITY_TYPE_EARN_SET_WRAPPER_STATE",
|
|
3696
|
+
}, "earnSetWrapperStateResult");
|
|
3697
|
+
};
|
|
3698
|
+
this.stampEarnSetWrapperState = async (input) => {
|
|
3699
|
+
if (!this.stamper) {
|
|
3700
|
+
return undefined;
|
|
3701
|
+
}
|
|
3702
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3703
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3704
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3705
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_set_wrapper_state";
|
|
3706
|
+
const bodyWithType = {
|
|
3707
|
+
parameters,
|
|
3708
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3709
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3710
|
+
type: "ACTIVITY_TYPE_EARN_SET_WRAPPER_STATE",
|
|
3711
|
+
};
|
|
3712
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3713
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
3714
|
+
return {
|
|
3715
|
+
body: stringifiedBody,
|
|
3716
|
+
stamp: stamp,
|
|
3717
|
+
url: fullUrl,
|
|
3718
|
+
};
|
|
3719
|
+
};
|
|
3720
|
+
this.earnWithdraw = async (input) => {
|
|
3721
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3722
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3723
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3724
|
+
return this.command("/public/v1/submit/earn_withdraw", {
|
|
3725
|
+
parameters: rest,
|
|
3726
|
+
organizationId: organizationId ??
|
|
3727
|
+
session?.organizationId ??
|
|
3728
|
+
this.config.organizationId,
|
|
3729
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3730
|
+
type: "ACTIVITY_TYPE_EARN_WITHDRAW",
|
|
3731
|
+
}, "earnWithdrawResult");
|
|
3732
|
+
};
|
|
3733
|
+
this.stampEarnWithdraw = async (input) => {
|
|
3734
|
+
if (!this.stamper) {
|
|
3735
|
+
return undefined;
|
|
3736
|
+
}
|
|
3737
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3738
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3739
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3740
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_withdraw";
|
|
3741
|
+
const bodyWithType = {
|
|
3742
|
+
parameters,
|
|
3743
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3744
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3745
|
+
type: "ACTIVITY_TYPE_EARN_WITHDRAW",
|
|
3746
|
+
};
|
|
3747
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3748
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
3749
|
+
return {
|
|
3750
|
+
body: stringifiedBody,
|
|
3751
|
+
stamp: stamp,
|
|
3752
|
+
url: fullUrl,
|
|
3753
|
+
};
|
|
3754
|
+
};
|
|
3235
3755
|
this.emailAuth = async (input) => {
|
|
3236
3756
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3237
3757
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -3302,6 +3822,41 @@ class TurnkeySDKClientBase {
|
|
|
3302
3822
|
url: fullUrl,
|
|
3303
3823
|
};
|
|
3304
3824
|
};
|
|
3825
|
+
this.ethUndelegate7702 = async (input) => {
|
|
3826
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3827
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3828
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3829
|
+
return this.command("/public/v1/submit/eth_undelegate_7702", {
|
|
3830
|
+
parameters: rest,
|
|
3831
|
+
organizationId: organizationId ??
|
|
3832
|
+
session?.organizationId ??
|
|
3833
|
+
this.config.organizationId,
|
|
3834
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3835
|
+
type: "ACTIVITY_TYPE_ETH_UNDELEGATE7702",
|
|
3836
|
+
}, "ethUndelegate7702Result");
|
|
3837
|
+
};
|
|
3838
|
+
this.stampEthUndelegate7702 = async (input) => {
|
|
3839
|
+
if (!this.stamper) {
|
|
3840
|
+
return undefined;
|
|
3841
|
+
}
|
|
3842
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3843
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3844
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3845
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/eth_undelegate_7702";
|
|
3846
|
+
const bodyWithType = {
|
|
3847
|
+
parameters,
|
|
3848
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3849
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3850
|
+
type: "ACTIVITY_TYPE_ETH_UNDELEGATE7702",
|
|
3851
|
+
};
|
|
3852
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3853
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
3854
|
+
return {
|
|
3855
|
+
body: stringifiedBody,
|
|
3856
|
+
stamp: stamp,
|
|
3857
|
+
url: fullUrl,
|
|
3858
|
+
};
|
|
3859
|
+
};
|
|
3305
3860
|
this.exportPrivateKey = async (input) => {
|
|
3306
3861
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3307
3862
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -4255,8 +4810,8 @@ class TurnkeySDKClientBase {
|
|
|
4255
4810
|
session?.organizationId ??
|
|
4256
4811
|
this.config.organizationId,
|
|
4257
4812
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
4258
|
-
type: "
|
|
4259
|
-
}, "
|
|
4813
|
+
type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION_V2",
|
|
4814
|
+
}, "solSendTransactionResultV2");
|
|
4260
4815
|
};
|
|
4261
4816
|
this.stampSolSendTransaction = async (input) => {
|
|
4262
4817
|
if (!this.stamper) {
|
|
@@ -4270,7 +4825,7 @@ class TurnkeySDKClientBase {
|
|
|
4270
4825
|
parameters,
|
|
4271
4826
|
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
4272
4827
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
4273
|
-
type: "
|
|
4828
|
+
type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION_V2",
|
|
4274
4829
|
};
|
|
4275
4830
|
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
4276
4831
|
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
@@ -4947,6 +5502,41 @@ class TurnkeySDKClientBase {
|
|
|
4947
5502
|
url: fullUrl,
|
|
4948
5503
|
};
|
|
4949
5504
|
};
|
|
5505
|
+
this.upsertSwapConfig = async (input) => {
|
|
5506
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
5507
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
5508
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
5509
|
+
return this.command("/public/v1/submit/upsert_swap_config", {
|
|
5510
|
+
parameters: rest,
|
|
5511
|
+
organizationId: organizationId ??
|
|
5512
|
+
session?.organizationId ??
|
|
5513
|
+
this.config.organizationId,
|
|
5514
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
5515
|
+
type: "ACTIVITY_TYPE_UPSERT_SWAP_CONFIG",
|
|
5516
|
+
}, "upsertSwapConfigResult");
|
|
5517
|
+
};
|
|
5518
|
+
this.stampUpsertSwapConfig = async (input) => {
|
|
5519
|
+
if (!this.stamper) {
|
|
5520
|
+
return undefined;
|
|
5521
|
+
}
|
|
5522
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
5523
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
5524
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
5525
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/upsert_swap_config";
|
|
5526
|
+
const bodyWithType = {
|
|
5527
|
+
parameters,
|
|
5528
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
5529
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
5530
|
+
type: "ACTIVITY_TYPE_UPSERT_SWAP_CONFIG",
|
|
5531
|
+
};
|
|
5532
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
5533
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
5534
|
+
return {
|
|
5535
|
+
body: stringifiedBody,
|
|
5536
|
+
stamp: stamp,
|
|
5537
|
+
url: fullUrl,
|
|
5538
|
+
};
|
|
5539
|
+
};
|
|
4950
5540
|
this.verifyOtp = async (input) => {
|
|
4951
5541
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
4952
5542
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|