@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.
- package/CHANGELOG.md +46 -0
- package/dist/__generated__/sdk-client-base.d.ts +26 -0
- package/dist/__generated__/sdk-client-base.d.ts.map +1 -1
- package/dist/__generated__/sdk-client-base.js +426 -3
- package/dist/__generated__/sdk-client-base.js.map +1 -1
- package/dist/__generated__/sdk-client-base.mjs +426 -3
- package/dist/__generated__/sdk-client-base.mjs.map +1 -1
- package/dist/__generated__/sdk_api_types.d.ts +66 -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 +741 -253
- package/dist/__inputs__/public_api.types.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -226,6 +226,99 @@ class TurnkeySDKClientBase {
|
|
|
226
226
|
url: fullUrl,
|
|
227
227
|
};
|
|
228
228
|
};
|
|
229
|
+
this.getEarnDeployStatus = 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_earn_deploy_status", {
|
|
233
|
+
...input,
|
|
234
|
+
organizationId: input.organizationId ??
|
|
235
|
+
session?.organizationId ??
|
|
236
|
+
this.config.organizationId,
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
this.stampGetEarnDeployStatus = 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_earn_deploy_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.getEarnDepositStatus = 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_deposit_status", {
|
|
264
|
+
...input,
|
|
265
|
+
organizationId: input.organizationId ??
|
|
266
|
+
session?.organizationId ??
|
|
267
|
+
this.config.organizationId,
|
|
268
|
+
});
|
|
269
|
+
};
|
|
270
|
+
this.stampGetEarnDepositStatus = 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_deposit_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.getEarnWithdrawStatus = 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_withdraw_status", {
|
|
295
|
+
...input,
|
|
296
|
+
organizationId: input.organizationId ??
|
|
297
|
+
session?.organizationId ??
|
|
298
|
+
this.config.organizationId,
|
|
299
|
+
});
|
|
300
|
+
};
|
|
301
|
+
this.stampGetEarnWithdrawStatus = 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_withdraw_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
|
+
};
|
|
229
322
|
this.getGasUsage = async (input) => {
|
|
230
323
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
231
324
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -1063,6 +1156,99 @@ class TurnkeySDKClientBase {
|
|
|
1063
1156
|
url: fullUrl,
|
|
1064
1157
|
};
|
|
1065
1158
|
};
|
|
1159
|
+
this.listEarnEnabledVaults = async (input) => {
|
|
1160
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1161
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1162
|
+
return this.request("/public/v1/query/list_earn_enabled_vaults", {
|
|
1163
|
+
...input,
|
|
1164
|
+
organizationId: input.organizationId ??
|
|
1165
|
+
session?.organizationId ??
|
|
1166
|
+
this.config.organizationId,
|
|
1167
|
+
});
|
|
1168
|
+
};
|
|
1169
|
+
this.stampListEarnEnabledVaults = async (input) => {
|
|
1170
|
+
if (!this.stamper) {
|
|
1171
|
+
return undefined;
|
|
1172
|
+
}
|
|
1173
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1174
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1175
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_earn_enabled_vaults";
|
|
1176
|
+
const body = {
|
|
1177
|
+
...input,
|
|
1178
|
+
organizationId: input.organizationId ??
|
|
1179
|
+
session?.organizationId ??
|
|
1180
|
+
this.config.organizationId,
|
|
1181
|
+
};
|
|
1182
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1183
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
1184
|
+
return {
|
|
1185
|
+
body: stringifiedBody,
|
|
1186
|
+
stamp: stamp,
|
|
1187
|
+
url: fullUrl,
|
|
1188
|
+
};
|
|
1189
|
+
};
|
|
1190
|
+
this.listEarnPositions = async (input) => {
|
|
1191
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1192
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1193
|
+
return this.request("/public/v1/query/list_earn_positions", {
|
|
1194
|
+
...input,
|
|
1195
|
+
organizationId: input.organizationId ??
|
|
1196
|
+
session?.organizationId ??
|
|
1197
|
+
this.config.organizationId,
|
|
1198
|
+
});
|
|
1199
|
+
};
|
|
1200
|
+
this.stampListEarnPositions = async (input) => {
|
|
1201
|
+
if (!this.stamper) {
|
|
1202
|
+
return undefined;
|
|
1203
|
+
}
|
|
1204
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1205
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1206
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_earn_positions";
|
|
1207
|
+
const body = {
|
|
1208
|
+
...input,
|
|
1209
|
+
organizationId: input.organizationId ??
|
|
1210
|
+
session?.organizationId ??
|
|
1211
|
+
this.config.organizationId,
|
|
1212
|
+
};
|
|
1213
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1214
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
1215
|
+
return {
|
|
1216
|
+
body: stringifiedBody,
|
|
1217
|
+
stamp: stamp,
|
|
1218
|
+
url: fullUrl,
|
|
1219
|
+
};
|
|
1220
|
+
};
|
|
1221
|
+
this.listEarnVaults = 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_vaults", {
|
|
1225
|
+
...input,
|
|
1226
|
+
organizationId: input.organizationId ??
|
|
1227
|
+
session?.organizationId ??
|
|
1228
|
+
this.config.organizationId,
|
|
1229
|
+
});
|
|
1230
|
+
};
|
|
1231
|
+
this.stampListEarnVaults = 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_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
|
+
};
|
|
1066
1252
|
this.listEmailEvents = async (input) => {
|
|
1067
1253
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1068
1254
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -1094,6 +1280,37 @@ class TurnkeySDKClientBase {
|
|
|
1094
1280
|
url: fullUrl,
|
|
1095
1281
|
};
|
|
1096
1282
|
};
|
|
1283
|
+
this.listEthTransactionHistory = 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_eth_transaction_history", {
|
|
1287
|
+
...input,
|
|
1288
|
+
organizationId: input.organizationId ??
|
|
1289
|
+
session?.organizationId ??
|
|
1290
|
+
this.config.organizationId,
|
|
1291
|
+
});
|
|
1292
|
+
};
|
|
1293
|
+
this.stampListEthTransactionHistory = 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_eth_transaction_history";
|
|
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
|
+
};
|
|
1097
1314
|
this.listFiatOnRampCredentials = async (input) => {
|
|
1098
1315
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1099
1316
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -1281,6 +1498,37 @@ class TurnkeySDKClientBase {
|
|
|
1281
1498
|
url: fullUrl,
|
|
1282
1499
|
};
|
|
1283
1500
|
};
|
|
1501
|
+
this.listSolTransactionHistory = async (input) => {
|
|
1502
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1503
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1504
|
+
return this.request("/public/v1/query/list_sol_transaction_history", {
|
|
1505
|
+
...input,
|
|
1506
|
+
organizationId: input.organizationId ??
|
|
1507
|
+
session?.organizationId ??
|
|
1508
|
+
this.config.organizationId,
|
|
1509
|
+
});
|
|
1510
|
+
};
|
|
1511
|
+
this.stampListSolTransactionHistory = async (input) => {
|
|
1512
|
+
if (!this.stamper) {
|
|
1513
|
+
return undefined;
|
|
1514
|
+
}
|
|
1515
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1516
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1517
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_sol_transaction_history";
|
|
1518
|
+
const body = {
|
|
1519
|
+
...input,
|
|
1520
|
+
organizationId: input.organizationId ??
|
|
1521
|
+
session?.organizationId ??
|
|
1522
|
+
this.config.organizationId,
|
|
1523
|
+
};
|
|
1524
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1525
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
1526
|
+
return {
|
|
1527
|
+
body: stringifiedBody,
|
|
1528
|
+
stamp: stamp,
|
|
1529
|
+
url: fullUrl,
|
|
1530
|
+
};
|
|
1531
|
+
};
|
|
1284
1532
|
this.getSubOrgIds = async (input = {}) => {
|
|
1285
1533
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1286
1534
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -1686,6 +1934,41 @@ class TurnkeySDKClientBase {
|
|
|
1686
1934
|
url: fullUrl,
|
|
1687
1935
|
};
|
|
1688
1936
|
};
|
|
1937
|
+
this.claimEarnFees = async (input) => {
|
|
1938
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1939
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1940
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1941
|
+
return this.command("/public/v1/submit/claim_earn_fees", {
|
|
1942
|
+
parameters: rest,
|
|
1943
|
+
organizationId: organizationId ??
|
|
1944
|
+
session?.organizationId ??
|
|
1945
|
+
this.config.organizationId,
|
|
1946
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1947
|
+
type: "ACTIVITY_TYPE_CLAIM_EARN_FEES",
|
|
1948
|
+
}, "claimEarnFeesResult");
|
|
1949
|
+
};
|
|
1950
|
+
this.stampClaimEarnFees = async (input) => {
|
|
1951
|
+
if (!this.stamper) {
|
|
1952
|
+
return undefined;
|
|
1953
|
+
}
|
|
1954
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1955
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
1956
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1957
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/claim_earn_fees";
|
|
1958
|
+
const bodyWithType = {
|
|
1959
|
+
parameters,
|
|
1960
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1961
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1962
|
+
type: "ACTIVITY_TYPE_CLAIM_EARN_FEES",
|
|
1963
|
+
};
|
|
1964
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1965
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
1966
|
+
return {
|
|
1967
|
+
body: stringifiedBody,
|
|
1968
|
+
stamp: stamp,
|
|
1969
|
+
url: fullUrl,
|
|
1970
|
+
};
|
|
1971
|
+
};
|
|
1689
1972
|
this.createApiKeys = async (input) => {
|
|
1690
1973
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
1691
1974
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -3232,6 +3515,146 @@ class TurnkeySDKClientBase {
|
|
|
3232
3515
|
url: fullUrl,
|
|
3233
3516
|
};
|
|
3234
3517
|
};
|
|
3518
|
+
this.earnDeployWrapper = async (input) => {
|
|
3519
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3520
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3521
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3522
|
+
return this.command("/public/v1/submit/earn_deploy_wrapper", {
|
|
3523
|
+
parameters: rest,
|
|
3524
|
+
organizationId: organizationId ??
|
|
3525
|
+
session?.organizationId ??
|
|
3526
|
+
this.config.organizationId,
|
|
3527
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3528
|
+
type: "ACTIVITY_TYPE_EARN_DEPLOY_WRAPPER",
|
|
3529
|
+
}, "earnDeployWrapperResult");
|
|
3530
|
+
};
|
|
3531
|
+
this.stampEarnDeployWrapper = async (input) => {
|
|
3532
|
+
if (!this.stamper) {
|
|
3533
|
+
return undefined;
|
|
3534
|
+
}
|
|
3535
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3536
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3537
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3538
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_deploy_wrapper";
|
|
3539
|
+
const bodyWithType = {
|
|
3540
|
+
parameters,
|
|
3541
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3542
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3543
|
+
type: "ACTIVITY_TYPE_EARN_DEPLOY_WRAPPER",
|
|
3544
|
+
};
|
|
3545
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3546
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
3547
|
+
return {
|
|
3548
|
+
body: stringifiedBody,
|
|
3549
|
+
stamp: stamp,
|
|
3550
|
+
url: fullUrl,
|
|
3551
|
+
};
|
|
3552
|
+
};
|
|
3553
|
+
this.earnDeposit = async (input) => {
|
|
3554
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3555
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3556
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3557
|
+
return this.command("/public/v1/submit/earn_deposit", {
|
|
3558
|
+
parameters: rest,
|
|
3559
|
+
organizationId: organizationId ??
|
|
3560
|
+
session?.organizationId ??
|
|
3561
|
+
this.config.organizationId,
|
|
3562
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3563
|
+
type: "ACTIVITY_TYPE_EARN_DEPOSIT",
|
|
3564
|
+
}, "earnDepositResult");
|
|
3565
|
+
};
|
|
3566
|
+
this.stampEarnDeposit = async (input) => {
|
|
3567
|
+
if (!this.stamper) {
|
|
3568
|
+
return undefined;
|
|
3569
|
+
}
|
|
3570
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3571
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3572
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3573
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_deposit";
|
|
3574
|
+
const bodyWithType = {
|
|
3575
|
+
parameters,
|
|
3576
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3577
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3578
|
+
type: "ACTIVITY_TYPE_EARN_DEPOSIT",
|
|
3579
|
+
};
|
|
3580
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3581
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
3582
|
+
return {
|
|
3583
|
+
body: stringifiedBody,
|
|
3584
|
+
stamp: stamp,
|
|
3585
|
+
url: fullUrl,
|
|
3586
|
+
};
|
|
3587
|
+
};
|
|
3588
|
+
this.earnSetWrapperState = async (input) => {
|
|
3589
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3590
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3591
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3592
|
+
return this.command("/public/v1/submit/earn_set_wrapper_state", {
|
|
3593
|
+
parameters: rest,
|
|
3594
|
+
organizationId: organizationId ??
|
|
3595
|
+
session?.organizationId ??
|
|
3596
|
+
this.config.organizationId,
|
|
3597
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3598
|
+
type: "ACTIVITY_TYPE_EARN_SET_WRAPPER_STATE",
|
|
3599
|
+
}, "earnSetWrapperStateResult");
|
|
3600
|
+
};
|
|
3601
|
+
this.stampEarnSetWrapperState = async (input) => {
|
|
3602
|
+
if (!this.stamper) {
|
|
3603
|
+
return undefined;
|
|
3604
|
+
}
|
|
3605
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3606
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3607
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3608
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_set_wrapper_state";
|
|
3609
|
+
const bodyWithType = {
|
|
3610
|
+
parameters,
|
|
3611
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3612
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3613
|
+
type: "ACTIVITY_TYPE_EARN_SET_WRAPPER_STATE",
|
|
3614
|
+
};
|
|
3615
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3616
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
3617
|
+
return {
|
|
3618
|
+
body: stringifiedBody,
|
|
3619
|
+
stamp: stamp,
|
|
3620
|
+
url: fullUrl,
|
|
3621
|
+
};
|
|
3622
|
+
};
|
|
3623
|
+
this.earnWithdraw = async (input) => {
|
|
3624
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3625
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3626
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3627
|
+
return this.command("/public/v1/submit/earn_withdraw", {
|
|
3628
|
+
parameters: rest,
|
|
3629
|
+
organizationId: organizationId ??
|
|
3630
|
+
session?.organizationId ??
|
|
3631
|
+
this.config.organizationId,
|
|
3632
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3633
|
+
type: "ACTIVITY_TYPE_EARN_WITHDRAW",
|
|
3634
|
+
}, "earnWithdrawResult");
|
|
3635
|
+
};
|
|
3636
|
+
this.stampEarnWithdraw = async (input) => {
|
|
3637
|
+
if (!this.stamper) {
|
|
3638
|
+
return undefined;
|
|
3639
|
+
}
|
|
3640
|
+
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3641
|
+
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
3642
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3643
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_withdraw";
|
|
3644
|
+
const bodyWithType = {
|
|
3645
|
+
parameters,
|
|
3646
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3647
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3648
|
+
type: "ACTIVITY_TYPE_EARN_WITHDRAW",
|
|
3649
|
+
};
|
|
3650
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3651
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
3652
|
+
return {
|
|
3653
|
+
body: stringifiedBody,
|
|
3654
|
+
stamp: stamp,
|
|
3655
|
+
url: fullUrl,
|
|
3656
|
+
};
|
|
3657
|
+
};
|
|
3235
3658
|
this.emailAuth = async (input) => {
|
|
3236
3659
|
const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
3237
3660
|
const session = sessionData ? utils.parseSession(sessionData) : null;
|
|
@@ -4255,8 +4678,8 @@ class TurnkeySDKClientBase {
|
|
|
4255
4678
|
session?.organizationId ??
|
|
4256
4679
|
this.config.organizationId,
|
|
4257
4680
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
4258
|
-
type: "
|
|
4259
|
-
}, "
|
|
4681
|
+
type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION_V2",
|
|
4682
|
+
}, "solSendTransactionResultV2");
|
|
4260
4683
|
};
|
|
4261
4684
|
this.stampSolSendTransaction = async (input) => {
|
|
4262
4685
|
if (!this.stamper) {
|
|
@@ -4270,7 +4693,7 @@ class TurnkeySDKClientBase {
|
|
|
4270
4693
|
parameters,
|
|
4271
4694
|
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
4272
4695
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
4273
|
-
type: "
|
|
4696
|
+
type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION_V2",
|
|
4274
4697
|
};
|
|
4275
4698
|
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
4276
4699
|
const stamp = await this.stamper.stamp(stringifiedBody);
|