@turnkey/core 2.3.0 → 2.4.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/dist/__clients__/core.d.ts +7 -0
- package/dist/__clients__/core.d.ts.map +1 -1
- package/dist/__clients__/core.js +35 -26
- package/dist/__clients__/core.js.map +1 -1
- package/dist/__clients__/core.mjs +35 -26
- package/dist/__clients__/core.mjs.map +1 -1
- package/dist/__generated__/sdk-client-base.d.ts +36 -7
- package/dist/__generated__/sdk-client-base.d.ts.map +1 -1
- package/dist/__generated__/sdk-client-base.js +514 -46
- package/dist/__generated__/sdk-client-base.js.map +1 -1
- package/dist/__generated__/sdk-client-base.mjs +514 -46
- package/dist/__generated__/sdk-client-base.mjs.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/__tests__/sol-send-transaction-helper-test.d.ts +2 -0
- package/dist/__tests__/sol-send-transaction-helper-test.d.ts.map +1 -0
- package/dist/__tests__/sol-send-transaction-test.d.ts +2 -0
- package/dist/__tests__/sol-send-transaction-test.d.ts.map +1 -0
- package/dist/__types__/method-types/shared.d.ts +10 -2
- package/dist/__types__/method-types/shared.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/utils.d.ts +3 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +26 -0
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs +26 -1
- package/dist/utils.mjs.map +1 -1
- package/package.json +8 -8
|
@@ -215,6 +215,96 @@ class TurnkeySDKClientBase {
|
|
|
215
215
|
url: fullUrl,
|
|
216
216
|
};
|
|
217
217
|
};
|
|
218
|
+
this.getEarnDeployStatus = async (input, stampWith) => {
|
|
219
|
+
const session = await this.storageManager?.getActiveSession();
|
|
220
|
+
return this.request("/public/v1/query/get_earn_deploy_status", {
|
|
221
|
+
...input,
|
|
222
|
+
organizationId: input.organizationId ??
|
|
223
|
+
session?.organizationId ??
|
|
224
|
+
this.config.organizationId,
|
|
225
|
+
}, stampWith);
|
|
226
|
+
};
|
|
227
|
+
this.stampGetEarnDeployStatus = async (input, stampWith) => {
|
|
228
|
+
const activeStamper = this.getStamper(stampWith);
|
|
229
|
+
if (!activeStamper) {
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
const session = await this.storageManager?.getActiveSession();
|
|
233
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_earn_deploy_status";
|
|
234
|
+
const body = {
|
|
235
|
+
...input,
|
|
236
|
+
organizationId: input.organizationId ??
|
|
237
|
+
session?.organizationId ??
|
|
238
|
+
this.config.organizationId,
|
|
239
|
+
};
|
|
240
|
+
const stringifiedBody = JSON.stringify(body);
|
|
241
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
242
|
+
return {
|
|
243
|
+
body: stringifiedBody,
|
|
244
|
+
stamp: stamp,
|
|
245
|
+
url: fullUrl,
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
this.getEarnDepositStatus = async (input, stampWith) => {
|
|
249
|
+
const session = await this.storageManager?.getActiveSession();
|
|
250
|
+
return this.request("/public/v1/query/get_earn_deposit_status", {
|
|
251
|
+
...input,
|
|
252
|
+
organizationId: input.organizationId ??
|
|
253
|
+
session?.organizationId ??
|
|
254
|
+
this.config.organizationId,
|
|
255
|
+
}, stampWith);
|
|
256
|
+
};
|
|
257
|
+
this.stampGetEarnDepositStatus = async (input, stampWith) => {
|
|
258
|
+
const activeStamper = this.getStamper(stampWith);
|
|
259
|
+
if (!activeStamper) {
|
|
260
|
+
return undefined;
|
|
261
|
+
}
|
|
262
|
+
const session = await this.storageManager?.getActiveSession();
|
|
263
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_earn_deposit_status";
|
|
264
|
+
const body = {
|
|
265
|
+
...input,
|
|
266
|
+
organizationId: input.organizationId ??
|
|
267
|
+
session?.organizationId ??
|
|
268
|
+
this.config.organizationId,
|
|
269
|
+
};
|
|
270
|
+
const stringifiedBody = JSON.stringify(body);
|
|
271
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
272
|
+
return {
|
|
273
|
+
body: stringifiedBody,
|
|
274
|
+
stamp: stamp,
|
|
275
|
+
url: fullUrl,
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
this.getEarnWithdrawStatus = async (input, stampWith) => {
|
|
279
|
+
const session = await this.storageManager?.getActiveSession();
|
|
280
|
+
return this.request("/public/v1/query/get_earn_withdraw_status", {
|
|
281
|
+
...input,
|
|
282
|
+
organizationId: input.organizationId ??
|
|
283
|
+
session?.organizationId ??
|
|
284
|
+
this.config.organizationId,
|
|
285
|
+
}, stampWith);
|
|
286
|
+
};
|
|
287
|
+
this.stampGetEarnWithdrawStatus = async (input, stampWith) => {
|
|
288
|
+
const activeStamper = this.getStamper(stampWith);
|
|
289
|
+
if (!activeStamper) {
|
|
290
|
+
return undefined;
|
|
291
|
+
}
|
|
292
|
+
const session = await this.storageManager?.getActiveSession();
|
|
293
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_earn_withdraw_status";
|
|
294
|
+
const body = {
|
|
295
|
+
...input,
|
|
296
|
+
organizationId: input.organizationId ??
|
|
297
|
+
session?.organizationId ??
|
|
298
|
+
this.config.organizationId,
|
|
299
|
+
};
|
|
300
|
+
const stringifiedBody = JSON.stringify(body);
|
|
301
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
302
|
+
return {
|
|
303
|
+
body: stringifiedBody,
|
|
304
|
+
stamp: stamp,
|
|
305
|
+
url: fullUrl,
|
|
306
|
+
};
|
|
307
|
+
};
|
|
218
308
|
this.getGasUsage = async (input, stampWith) => {
|
|
219
309
|
const session = await this.storageManager?.getActiveSession();
|
|
220
310
|
return this.request("/public/v1/query/get_gas_usage", {
|
|
@@ -1025,6 +1115,96 @@ class TurnkeySDKClientBase {
|
|
|
1025
1115
|
url: fullUrl,
|
|
1026
1116
|
};
|
|
1027
1117
|
};
|
|
1118
|
+
this.listEarnEnabledVaults = async (input, stampWith) => {
|
|
1119
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1120
|
+
return this.request("/public/v1/query/list_earn_enabled_vaults", {
|
|
1121
|
+
...input,
|
|
1122
|
+
organizationId: input.organizationId ??
|
|
1123
|
+
session?.organizationId ??
|
|
1124
|
+
this.config.organizationId,
|
|
1125
|
+
}, stampWith);
|
|
1126
|
+
};
|
|
1127
|
+
this.stampListEarnEnabledVaults = async (input, stampWith) => {
|
|
1128
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1129
|
+
if (!activeStamper) {
|
|
1130
|
+
return undefined;
|
|
1131
|
+
}
|
|
1132
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1133
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_earn_enabled_vaults";
|
|
1134
|
+
const body = {
|
|
1135
|
+
...input,
|
|
1136
|
+
organizationId: input.organizationId ??
|
|
1137
|
+
session?.organizationId ??
|
|
1138
|
+
this.config.organizationId,
|
|
1139
|
+
};
|
|
1140
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1141
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1142
|
+
return {
|
|
1143
|
+
body: stringifiedBody,
|
|
1144
|
+
stamp: stamp,
|
|
1145
|
+
url: fullUrl,
|
|
1146
|
+
};
|
|
1147
|
+
};
|
|
1148
|
+
this.listEarnPositions = async (input, stampWith) => {
|
|
1149
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1150
|
+
return this.request("/public/v1/query/list_earn_positions", {
|
|
1151
|
+
...input,
|
|
1152
|
+
organizationId: input.organizationId ??
|
|
1153
|
+
session?.organizationId ??
|
|
1154
|
+
this.config.organizationId,
|
|
1155
|
+
}, stampWith);
|
|
1156
|
+
};
|
|
1157
|
+
this.stampListEarnPositions = async (input, stampWith) => {
|
|
1158
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1159
|
+
if (!activeStamper) {
|
|
1160
|
+
return undefined;
|
|
1161
|
+
}
|
|
1162
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1163
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_earn_positions";
|
|
1164
|
+
const body = {
|
|
1165
|
+
...input,
|
|
1166
|
+
organizationId: input.organizationId ??
|
|
1167
|
+
session?.organizationId ??
|
|
1168
|
+
this.config.organizationId,
|
|
1169
|
+
};
|
|
1170
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1171
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1172
|
+
return {
|
|
1173
|
+
body: stringifiedBody,
|
|
1174
|
+
stamp: stamp,
|
|
1175
|
+
url: fullUrl,
|
|
1176
|
+
};
|
|
1177
|
+
};
|
|
1178
|
+
this.listEarnVaults = async (input, stampWith) => {
|
|
1179
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1180
|
+
return this.request("/public/v1/query/list_earn_vaults", {
|
|
1181
|
+
...input,
|
|
1182
|
+
organizationId: input.organizationId ??
|
|
1183
|
+
session?.organizationId ??
|
|
1184
|
+
this.config.organizationId,
|
|
1185
|
+
}, stampWith);
|
|
1186
|
+
};
|
|
1187
|
+
this.stampListEarnVaults = async (input, stampWith) => {
|
|
1188
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1189
|
+
if (!activeStamper) {
|
|
1190
|
+
return undefined;
|
|
1191
|
+
}
|
|
1192
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1193
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_earn_vaults";
|
|
1194
|
+
const body = {
|
|
1195
|
+
...input,
|
|
1196
|
+
organizationId: input.organizationId ??
|
|
1197
|
+
session?.organizationId ??
|
|
1198
|
+
this.config.organizationId,
|
|
1199
|
+
};
|
|
1200
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1201
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1202
|
+
return {
|
|
1203
|
+
body: stringifiedBody,
|
|
1204
|
+
stamp: stamp,
|
|
1205
|
+
url: fullUrl,
|
|
1206
|
+
};
|
|
1207
|
+
};
|
|
1028
1208
|
this.listEmailEvents = async (input, stampWith) => {
|
|
1029
1209
|
const session = await this.storageManager?.getActiveSession();
|
|
1030
1210
|
return this.request("/public/v1/query/list_email_events", {
|
|
@@ -1055,6 +1235,36 @@ class TurnkeySDKClientBase {
|
|
|
1055
1235
|
url: fullUrl,
|
|
1056
1236
|
};
|
|
1057
1237
|
};
|
|
1238
|
+
this.listEthTransactionHistory = async (input, stampWith) => {
|
|
1239
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1240
|
+
return this.request("/public/v1/query/list_eth_transaction_history", {
|
|
1241
|
+
...input,
|
|
1242
|
+
organizationId: input.organizationId ??
|
|
1243
|
+
session?.organizationId ??
|
|
1244
|
+
this.config.organizationId,
|
|
1245
|
+
}, stampWith);
|
|
1246
|
+
};
|
|
1247
|
+
this.stampListEthTransactionHistory = async (input, stampWith) => {
|
|
1248
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1249
|
+
if (!activeStamper) {
|
|
1250
|
+
return undefined;
|
|
1251
|
+
}
|
|
1252
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1253
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_eth_transaction_history";
|
|
1254
|
+
const body = {
|
|
1255
|
+
...input,
|
|
1256
|
+
organizationId: input.organizationId ??
|
|
1257
|
+
session?.organizationId ??
|
|
1258
|
+
this.config.organizationId,
|
|
1259
|
+
};
|
|
1260
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1261
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1262
|
+
return {
|
|
1263
|
+
body: stringifiedBody,
|
|
1264
|
+
stamp: stamp,
|
|
1265
|
+
url: fullUrl,
|
|
1266
|
+
};
|
|
1267
|
+
};
|
|
1058
1268
|
this.listFiatOnRampCredentials = async (input, stampWith) => {
|
|
1059
1269
|
const session = await this.storageManager?.getActiveSession();
|
|
1060
1270
|
return this.request("/public/v1/query/list_fiat_on_ramp_credentials", {
|
|
@@ -1236,6 +1446,36 @@ class TurnkeySDKClientBase {
|
|
|
1236
1446
|
url: fullUrl,
|
|
1237
1447
|
};
|
|
1238
1448
|
};
|
|
1449
|
+
this.listSolTransactionHistory = async (input, stampWith) => {
|
|
1450
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1451
|
+
return this.request("/public/v1/query/list_sol_transaction_history", {
|
|
1452
|
+
...input,
|
|
1453
|
+
organizationId: input.organizationId ??
|
|
1454
|
+
session?.organizationId ??
|
|
1455
|
+
this.config.organizationId,
|
|
1456
|
+
}, stampWith);
|
|
1457
|
+
};
|
|
1458
|
+
this.stampListSolTransactionHistory = async (input, stampWith) => {
|
|
1459
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1460
|
+
if (!activeStamper) {
|
|
1461
|
+
return undefined;
|
|
1462
|
+
}
|
|
1463
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1464
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_sol_transaction_history";
|
|
1465
|
+
const body = {
|
|
1466
|
+
...input,
|
|
1467
|
+
organizationId: input.organizationId ??
|
|
1468
|
+
session?.organizationId ??
|
|
1469
|
+
this.config.organizationId,
|
|
1470
|
+
};
|
|
1471
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1472
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1473
|
+
return {
|
|
1474
|
+
body: stringifiedBody,
|
|
1475
|
+
stamp: stamp,
|
|
1476
|
+
url: fullUrl,
|
|
1477
|
+
};
|
|
1478
|
+
};
|
|
1239
1479
|
this.getSubOrgIds = async (input = {}, stampWith) => {
|
|
1240
1480
|
const session = await this.storageManager?.getActiveSession();
|
|
1241
1481
|
return this.request("/public/v1/query/list_suborgs", {
|
|
@@ -1632,6 +1872,43 @@ class TurnkeySDKClientBase {
|
|
|
1632
1872
|
url: fullUrl,
|
|
1633
1873
|
};
|
|
1634
1874
|
};
|
|
1875
|
+
this.claimEarnFees = async (input, stampWith) => {
|
|
1876
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1877
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
1878
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
1879
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1880
|
+
return this.activity("/public/v1/submit/claim_earn_fees", {
|
|
1881
|
+
parameters: rest,
|
|
1882
|
+
organizationId: organizationId ??
|
|
1883
|
+
session?.organizationId ??
|
|
1884
|
+
this.config.organizationId,
|
|
1885
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1886
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
1887
|
+
type: "ACTIVITY_TYPE_CLAIM_EARN_FEES",
|
|
1888
|
+
}, "claimEarnFeesResult", stampWith);
|
|
1889
|
+
};
|
|
1890
|
+
this.stampClaimEarnFees = async (input, stampWith) => {
|
|
1891
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1892
|
+
if (!activeStamper) {
|
|
1893
|
+
return undefined;
|
|
1894
|
+
}
|
|
1895
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1896
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1897
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/claim_earn_fees";
|
|
1898
|
+
const bodyWithType = {
|
|
1899
|
+
parameters,
|
|
1900
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1901
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1902
|
+
type: "ACTIVITY_TYPE_CLAIM_EARN_FEES",
|
|
1903
|
+
};
|
|
1904
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1905
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1906
|
+
return {
|
|
1907
|
+
body: stringifiedBody,
|
|
1908
|
+
stamp: stamp,
|
|
1909
|
+
url: fullUrl,
|
|
1910
|
+
};
|
|
1911
|
+
};
|
|
1635
1912
|
this.createApiKeys = async (input, stampWith) => {
|
|
1636
1913
|
const { organizationId, timestampMs, ...rest } = input;
|
|
1637
1914
|
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
@@ -3266,6 +3543,154 @@ class TurnkeySDKClientBase {
|
|
|
3266
3543
|
url: fullUrl,
|
|
3267
3544
|
};
|
|
3268
3545
|
};
|
|
3546
|
+
this.earnDeployWrapper = async (input, stampWith) => {
|
|
3547
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3548
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
3549
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
3550
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3551
|
+
return this.activity("/public/v1/submit/earn_deploy_wrapper", {
|
|
3552
|
+
parameters: rest,
|
|
3553
|
+
organizationId: organizationId ??
|
|
3554
|
+
session?.organizationId ??
|
|
3555
|
+
this.config.organizationId,
|
|
3556
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3557
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
3558
|
+
type: "ACTIVITY_TYPE_EARN_DEPLOY_WRAPPER",
|
|
3559
|
+
}, "earnDeployWrapperResult", stampWith);
|
|
3560
|
+
};
|
|
3561
|
+
this.stampEarnDeployWrapper = async (input, stampWith) => {
|
|
3562
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3563
|
+
if (!activeStamper) {
|
|
3564
|
+
return undefined;
|
|
3565
|
+
}
|
|
3566
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3567
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3568
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_deploy_wrapper";
|
|
3569
|
+
const bodyWithType = {
|
|
3570
|
+
parameters,
|
|
3571
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3572
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3573
|
+
type: "ACTIVITY_TYPE_EARN_DEPLOY_WRAPPER",
|
|
3574
|
+
};
|
|
3575
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3576
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3577
|
+
return {
|
|
3578
|
+
body: stringifiedBody,
|
|
3579
|
+
stamp: stamp,
|
|
3580
|
+
url: fullUrl,
|
|
3581
|
+
};
|
|
3582
|
+
};
|
|
3583
|
+
this.earnDeposit = async (input, stampWith) => {
|
|
3584
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3585
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
3586
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
3587
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3588
|
+
return this.activity("/public/v1/submit/earn_deposit", {
|
|
3589
|
+
parameters: rest,
|
|
3590
|
+
organizationId: organizationId ??
|
|
3591
|
+
session?.organizationId ??
|
|
3592
|
+
this.config.organizationId,
|
|
3593
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3594
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
3595
|
+
type: "ACTIVITY_TYPE_EARN_DEPOSIT",
|
|
3596
|
+
}, "earnDepositResult", stampWith);
|
|
3597
|
+
};
|
|
3598
|
+
this.stampEarnDeposit = async (input, stampWith) => {
|
|
3599
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3600
|
+
if (!activeStamper) {
|
|
3601
|
+
return undefined;
|
|
3602
|
+
}
|
|
3603
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3604
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3605
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_deposit";
|
|
3606
|
+
const bodyWithType = {
|
|
3607
|
+
parameters,
|
|
3608
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3609
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3610
|
+
type: "ACTIVITY_TYPE_EARN_DEPOSIT",
|
|
3611
|
+
};
|
|
3612
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3613
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3614
|
+
return {
|
|
3615
|
+
body: stringifiedBody,
|
|
3616
|
+
stamp: stamp,
|
|
3617
|
+
url: fullUrl,
|
|
3618
|
+
};
|
|
3619
|
+
};
|
|
3620
|
+
this.earnSetWrapperState = async (input, stampWith) => {
|
|
3621
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3622
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
3623
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
3624
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3625
|
+
return this.activity("/public/v1/submit/earn_set_wrapper_state", {
|
|
3626
|
+
parameters: rest,
|
|
3627
|
+
organizationId: organizationId ??
|
|
3628
|
+
session?.organizationId ??
|
|
3629
|
+
this.config.organizationId,
|
|
3630
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3631
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
3632
|
+
type: "ACTIVITY_TYPE_EARN_SET_WRAPPER_STATE",
|
|
3633
|
+
}, "earnSetWrapperStateResult", stampWith);
|
|
3634
|
+
};
|
|
3635
|
+
this.stampEarnSetWrapperState = async (input, stampWith) => {
|
|
3636
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3637
|
+
if (!activeStamper) {
|
|
3638
|
+
return undefined;
|
|
3639
|
+
}
|
|
3640
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3641
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3642
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_set_wrapper_state";
|
|
3643
|
+
const bodyWithType = {
|
|
3644
|
+
parameters,
|
|
3645
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3646
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3647
|
+
type: "ACTIVITY_TYPE_EARN_SET_WRAPPER_STATE",
|
|
3648
|
+
};
|
|
3649
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3650
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3651
|
+
return {
|
|
3652
|
+
body: stringifiedBody,
|
|
3653
|
+
stamp: stamp,
|
|
3654
|
+
url: fullUrl,
|
|
3655
|
+
};
|
|
3656
|
+
};
|
|
3657
|
+
this.earnWithdraw = async (input, stampWith) => {
|
|
3658
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3659
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
3660
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
3661
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3662
|
+
return this.activity("/public/v1/submit/earn_withdraw", {
|
|
3663
|
+
parameters: rest,
|
|
3664
|
+
organizationId: organizationId ??
|
|
3665
|
+
session?.organizationId ??
|
|
3666
|
+
this.config.organizationId,
|
|
3667
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3668
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
3669
|
+
type: "ACTIVITY_TYPE_EARN_WITHDRAW",
|
|
3670
|
+
}, "earnWithdrawResult", stampWith);
|
|
3671
|
+
};
|
|
3672
|
+
this.stampEarnWithdraw = async (input, stampWith) => {
|
|
3673
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3674
|
+
if (!activeStamper) {
|
|
3675
|
+
return undefined;
|
|
3676
|
+
}
|
|
3677
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3678
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3679
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/earn_withdraw";
|
|
3680
|
+
const bodyWithType = {
|
|
3681
|
+
parameters,
|
|
3682
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3683
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3684
|
+
type: "ACTIVITY_TYPE_EARN_WITHDRAW",
|
|
3685
|
+
};
|
|
3686
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3687
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3688
|
+
return {
|
|
3689
|
+
body: stringifiedBody,
|
|
3690
|
+
stamp: stamp,
|
|
3691
|
+
url: fullUrl,
|
|
3692
|
+
};
|
|
3693
|
+
};
|
|
3269
3694
|
this.emailAuth = async (input, stampWith) => {
|
|
3270
3695
|
const { organizationId, timestampMs, ...rest } = input;
|
|
3271
3696
|
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
@@ -4301,43 +4726,6 @@ class TurnkeySDKClientBase {
|
|
|
4301
4726
|
url: fullUrl,
|
|
4302
4727
|
};
|
|
4303
4728
|
};
|
|
4304
|
-
this.solSendTransaction = async (input, stampWith) => {
|
|
4305
|
-
const { organizationId, timestampMs, ...rest } = input;
|
|
4306
|
-
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
4307
|
-
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
4308
|
-
const session = await this.storageManager?.getActiveSession();
|
|
4309
|
-
return this.activity("/public/v1/submit/sol_send_transaction", {
|
|
4310
|
-
parameters: rest,
|
|
4311
|
-
organizationId: organizationId ??
|
|
4312
|
-
session?.organizationId ??
|
|
4313
|
-
this.config.organizationId,
|
|
4314
|
-
timestampMs: timestampMs ?? String(Date.now()),
|
|
4315
|
-
generateAppProofs: generateAppProofs ?? false,
|
|
4316
|
-
type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION",
|
|
4317
|
-
}, "solSendTransactionResult", stampWith);
|
|
4318
|
-
};
|
|
4319
|
-
this.stampSolSendTransaction = async (input, stampWith) => {
|
|
4320
|
-
const activeStamper = this.getStamper(stampWith);
|
|
4321
|
-
if (!activeStamper) {
|
|
4322
|
-
return undefined;
|
|
4323
|
-
}
|
|
4324
|
-
const { organizationId, timestampMs, ...parameters } = input;
|
|
4325
|
-
const session = await this.storageManager?.getActiveSession();
|
|
4326
|
-
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/sol_send_transaction";
|
|
4327
|
-
const bodyWithType = {
|
|
4328
|
-
parameters,
|
|
4329
|
-
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
4330
|
-
timestampMs: timestampMs ?? String(Date.now()),
|
|
4331
|
-
type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION",
|
|
4332
|
-
};
|
|
4333
|
-
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
4334
|
-
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
4335
|
-
return {
|
|
4336
|
-
body: stringifiedBody,
|
|
4337
|
-
stamp: stamp,
|
|
4338
|
-
url: fullUrl,
|
|
4339
|
-
};
|
|
4340
|
-
};
|
|
4341
4729
|
this.sparkClaimTransfer = async (input, stampWith) => {
|
|
4342
4730
|
const { organizationId, timestampMs, ...rest } = input;
|
|
4343
4731
|
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
@@ -5154,6 +5542,80 @@ class TurnkeySDKClientBase {
|
|
|
5154
5542
|
url: fullUrl,
|
|
5155
5543
|
};
|
|
5156
5544
|
};
|
|
5545
|
+
this.solSendTransaction = async (input, stampWith) => {
|
|
5546
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
5547
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
5548
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
5549
|
+
const session = await this.storageManager?.getActiveSession();
|
|
5550
|
+
return this.activity("/public/v1/submit/sol_send_transaction", {
|
|
5551
|
+
parameters: rest,
|
|
5552
|
+
organizationId: organizationId ??
|
|
5553
|
+
session?.organizationId ??
|
|
5554
|
+
this.config.organizationId,
|
|
5555
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
5556
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
5557
|
+
type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION",
|
|
5558
|
+
}, "solSendTransactionResult", stampWith);
|
|
5559
|
+
};
|
|
5560
|
+
this.stampSolSendTransaction = async (input, stampWith) => {
|
|
5561
|
+
const activeStamper = this.getStamper(stampWith);
|
|
5562
|
+
if (!activeStamper) {
|
|
5563
|
+
return undefined;
|
|
5564
|
+
}
|
|
5565
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
5566
|
+
const session = await this.storageManager?.getActiveSession();
|
|
5567
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/sol_send_transaction";
|
|
5568
|
+
const bodyWithType = {
|
|
5569
|
+
parameters,
|
|
5570
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
5571
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
5572
|
+
type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION",
|
|
5573
|
+
};
|
|
5574
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
5575
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
5576
|
+
return {
|
|
5577
|
+
body: stringifiedBody,
|
|
5578
|
+
stamp: stamp,
|
|
5579
|
+
url: fullUrl,
|
|
5580
|
+
};
|
|
5581
|
+
};
|
|
5582
|
+
this.solSendTransactionV2 = async (input, stampWith) => {
|
|
5583
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
5584
|
+
//@ts-ignore - generateAppProofs does not exist on all request types, so we ignore the type error here for those that are missing it
|
|
5585
|
+
const generateAppProofs = input?.generateAppProofs ?? false;
|
|
5586
|
+
const session = await this.storageManager?.getActiveSession();
|
|
5587
|
+
return this.activity("/public/v1/submit/sol_send_transaction", {
|
|
5588
|
+
parameters: rest,
|
|
5589
|
+
organizationId: organizationId ??
|
|
5590
|
+
session?.organizationId ??
|
|
5591
|
+
this.config.organizationId,
|
|
5592
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
5593
|
+
generateAppProofs: generateAppProofs ?? false,
|
|
5594
|
+
type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION_V2",
|
|
5595
|
+
}, "solSendTransactionResultV2", stampWith);
|
|
5596
|
+
};
|
|
5597
|
+
this.stampSolSendTransactionV2 = async (input, stampWith) => {
|
|
5598
|
+
const activeStamper = this.getStamper(stampWith);
|
|
5599
|
+
if (!activeStamper) {
|
|
5600
|
+
return undefined;
|
|
5601
|
+
}
|
|
5602
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
5603
|
+
const session = await this.storageManager?.getActiveSession();
|
|
5604
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/sol_send_transaction";
|
|
5605
|
+
const bodyWithType = {
|
|
5606
|
+
parameters,
|
|
5607
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
5608
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
5609
|
+
type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION_V2",
|
|
5610
|
+
};
|
|
5611
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
5612
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
5613
|
+
return {
|
|
5614
|
+
body: stringifiedBody,
|
|
5615
|
+
stamp: stamp,
|
|
5616
|
+
url: fullUrl,
|
|
5617
|
+
};
|
|
5618
|
+
};
|
|
5157
5619
|
this.proxyGetAccount = async (input) => {
|
|
5158
5620
|
return this.authProxyRequest("/v1/account", input);
|
|
5159
5621
|
};
|
|
@@ -5163,11 +5625,11 @@ class TurnkeySDKClientBase {
|
|
|
5163
5625
|
this.proxyOAuthLogin = async (input) => {
|
|
5164
5626
|
return this.authProxyRequest("/v1/oauth_login", input);
|
|
5165
5627
|
};
|
|
5166
|
-
this.proxyInitOtp = async (input) => {
|
|
5167
|
-
return this.authProxyRequest("/v1/otp_init", input);
|
|
5628
|
+
this.proxyInitOtp = async (input, captchaToken) => {
|
|
5629
|
+
return this.authProxyRequest("/v1/otp_init", input, captchaToken);
|
|
5168
5630
|
};
|
|
5169
|
-
this.proxyInitOtpV2 = async (input) => {
|
|
5170
|
-
return this.authProxyRequest("/v1/otp_init_v2", input);
|
|
5631
|
+
this.proxyInitOtpV2 = async (input, captchaToken) => {
|
|
5632
|
+
return this.authProxyRequest("/v1/otp_init_v2", input, captchaToken);
|
|
5171
5633
|
};
|
|
5172
5634
|
this.proxyOtpLogin = async (input) => {
|
|
5173
5635
|
return this.authProxyRequest("/v1/otp_login", input);
|
|
@@ -5181,11 +5643,14 @@ class TurnkeySDKClientBase {
|
|
|
5181
5643
|
this.proxyVerifyOtpV2 = async (input) => {
|
|
5182
5644
|
return this.authProxyRequest("/v1/otp_verify_v2", input);
|
|
5183
5645
|
};
|
|
5184
|
-
this.proxySignup = async (input) => {
|
|
5185
|
-
return this.authProxyRequest("/v1/signup", input);
|
|
5646
|
+
this.proxySignup = async (input, captchaToken) => {
|
|
5647
|
+
return this.authProxyRequest("/v1/signup", input, captchaToken);
|
|
5648
|
+
};
|
|
5649
|
+
this.proxySignupV2 = async (input, captchaToken) => {
|
|
5650
|
+
return this.authProxyRequest("/v1/signup_v2", input, captchaToken);
|
|
5186
5651
|
};
|
|
5187
|
-
this.
|
|
5188
|
-
return this.authProxyRequest("/v1/
|
|
5652
|
+
this.proxyGetWalletKitClientParams = async (input) => {
|
|
5653
|
+
return this.authProxyRequest("/v1/wallet_kit_client_params", input);
|
|
5189
5654
|
};
|
|
5190
5655
|
this.proxyGetWalletKitConfig = async (input) => {
|
|
5191
5656
|
return this.authProxyRequest("/v1/wallet_kit_config", input);
|
|
@@ -5333,7 +5798,7 @@ class TurnkeySDKClientBase {
|
|
|
5333
5798
|
...activityData,
|
|
5334
5799
|
};
|
|
5335
5800
|
}
|
|
5336
|
-
async authProxyRequest(url, body) {
|
|
5801
|
+
async authProxyRequest(url, body, captchaToken) {
|
|
5337
5802
|
if (!this.config.authProxyUrl || !this.config.authProxyConfigId) {
|
|
5338
5803
|
throw new TurnkeyError("Auth Proxy URL or ID is not configured.", TurnkeyErrorCodes.INVALID_CONFIGURATION);
|
|
5339
5804
|
}
|
|
@@ -5343,6 +5808,9 @@ class TurnkeySDKClientBase {
|
|
|
5343
5808
|
"Content-Type": "application/json",
|
|
5344
5809
|
"X-Auth-Proxy-Config-ID": this.config.authProxyConfigId,
|
|
5345
5810
|
};
|
|
5811
|
+
if (captchaToken) {
|
|
5812
|
+
headers["X-Captcha-Token"] = captchaToken;
|
|
5813
|
+
}
|
|
5346
5814
|
const response = await fetch(fullUrl, {
|
|
5347
5815
|
method: "POST",
|
|
5348
5816
|
headers: headers,
|