@funkit/api-base 3.0.2 → 3.0.4

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/index.js +0 -298
  3. package/dist/index.js.map +4 -4
  4. package/dist/src/consts/api.d.ts.map +1 -1
  5. package/dist/src/services/bluvo/types.d.ts +9 -1
  6. package/dist/src/services/bluvo/types.d.ts.map +1 -1
  7. package/dist/src/services/fops/types.d.ts +4 -0
  8. package/dist/src/services/fops/types.d.ts.map +1 -1
  9. package/dist/src/services/fw-operation/index.d.ts +0 -1
  10. package/dist/src/services/fw-operation/index.d.ts.map +1 -1
  11. package/dist/src/services/fw-operation/types.d.ts +1 -122
  12. package/dist/src/services/fw-operation/types.d.ts.map +1 -1
  13. package/dist/src/services/index.d.ts +0 -3
  14. package/dist/src/services/index.d.ts.map +1 -1
  15. package/package.json +5 -5
  16. package/dist/src/services/fw-access/endpoints.d.ts +0 -4
  17. package/dist/src/services/fw-access/endpoints.d.ts.map +0 -1
  18. package/dist/src/services/fw-access/index.d.ts +0 -3
  19. package/dist/src/services/fw-access/index.d.ts.map +0 -1
  20. package/dist/src/services/fw-access/types.d.ts +0 -10
  21. package/dist/src/services/fw-access/types.d.ts.map +0 -1
  22. package/dist/src/services/fw-group/endpoints.d.ts +0 -3
  23. package/dist/src/services/fw-group/endpoints.d.ts.map +0 -1
  24. package/dist/src/services/fw-group/index.d.ts +0 -3
  25. package/dist/src/services/fw-group/index.d.ts.map +0 -1
  26. package/dist/src/services/fw-group/types.d.ts +0 -14
  27. package/dist/src/services/fw-group/types.d.ts.map +0 -1
  28. package/dist/src/services/fw-operation/endpoints.d.ts +0 -12
  29. package/dist/src/services/fw-operation/endpoints.d.ts.map +0 -1
  30. package/dist/src/services/fw-user/endpoints.d.ts +0 -11
  31. package/dist/src/services/fw-user/endpoints.d.ts.map +0 -1
  32. package/dist/src/services/fw-user/index.d.ts +0 -3
  33. package/dist/src/services/fw-user/index.d.ts.map +0 -1
  34. package/dist/src/services/fw-user/types.d.ts +0 -33
  35. package/dist/src/services/fw-user/types.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @funkit/api-base
2
2
 
3
+ ## 3.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 0ddaf2e: feat: add fop min limit
8
+ - 156e238: chore: remove unused api and tests
9
+ - c7ac6cb: chore(connect): fix tsconfig
10
+ - 867e355: Remove deprecated Access, Group, User, and Operation endpoint functions (backend deprecation). Retain only UserOperation and ExecutionReceipt types from fw-operation.
11
+ - d9d62d1: Upgrade @bluvo/react and @bluvo/sdk-ts to 3.0.0-beta.1 and fix brokerage type forwarding
12
+ - Updated dependencies [6ba7d50]
13
+ - Updated dependencies [c7ac6cb]
14
+ - @funkit/utils@1.2.6
15
+
16
+ ## 3.0.3
17
+
18
+ ### Patch Changes
19
+
20
+ - cc8cf8b: bump ts version
21
+ - Updated dependencies [cc8cf8b]
22
+ - @funkit/utils@1.2.5
23
+
3
24
  ## 3.0.2
4
25
 
5
26
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1039,41 +1039,6 @@ var PaymentGroup = {
1039
1039
  ["VIPPS" /* VIPPS */]: "vipps"
1040
1040
  };
1041
1041
 
1042
- // src/services/fw-access/endpoints.ts
1043
- async function initializeWalletAccess({
1044
- walletAddr,
1045
- creatorAddr,
1046
- ...options
1047
- }) {
1048
- await sendPostRequest({
1049
- uri: `${API_BASE_URL}/access/wallet`,
1050
- body: { walletAddr, creatorAddr },
1051
- ...options
1052
- });
1053
- }
1054
- async function checkWalletAccessInitialization({
1055
- walletAddr,
1056
- ...options
1057
- }) {
1058
- return (await sendGetRequest({
1059
- uri: `${API_BASE_URL}/access/wallet/${walletAddr}`,
1060
- ...options
1061
- })).initialized;
1062
- }
1063
-
1064
- // src/services/fw-group/endpoints.ts
1065
- async function getGroups({
1066
- groupIds,
1067
- chainId,
1068
- ...options
1069
- }) {
1070
- return (await sendPostRequest({
1071
- uri: `${API_BASE_URL}/group/get-groups`,
1072
- body: { groupIds, chainId },
1073
- ...options
1074
- })).groups;
1075
- }
1076
-
1077
1042
  // src/services/fw-info/endpoints.ts
1078
1043
  async function getChainFromId({
1079
1044
  chainId,
@@ -1102,170 +1067,6 @@ async function getChainFromName({
1102
1067
  return res;
1103
1068
  }
1104
1069
 
1105
- // src/services/fw-operation/endpoints.ts
1106
- async function createOp({
1107
- op,
1108
- ...options
1109
- }) {
1110
- return (await sendPostRequest({
1111
- uri: `${API_BASE_URL}/operation`,
1112
- body: { ...op },
1113
- ...options
1114
- })).opId;
1115
- }
1116
- async function getOpsOfWallet({
1117
- walletAddr,
1118
- chainId,
1119
- status,
1120
- ...options
1121
- }) {
1122
- const endpoint = status ? `${API_BASE_URL}/operation/wallet/${walletAddr}/chain/${chainId}?status=${status}` : `${API_BASE_URL}/operation/wallet/${walletAddr}/chain/${chainId}`;
1123
- return (await sendGetRequest({ uri: endpoint, ...options })).operations;
1124
- }
1125
- async function getOps({
1126
- opIds,
1127
- chainId,
1128
- ...options
1129
- }) {
1130
- return (await sendPostRequest({
1131
- uri: `${API_BASE_URL}/operation/get-operations`,
1132
- body: {
1133
- opIds,
1134
- chainId
1135
- },
1136
- ...options
1137
- })).operations;
1138
- }
1139
- async function deleteOp({
1140
- opId,
1141
- chainId,
1142
- ...options
1143
- }) {
1144
- await sendDeleteRequest({
1145
- uri: `${API_BASE_URL}/operation/${opId}/chain/${chainId}`,
1146
- ...options
1147
- });
1148
- }
1149
- async function signOp({
1150
- opId,
1151
- chainId,
1152
- signature,
1153
- signedBy,
1154
- threshold,
1155
- ...options
1156
- }) {
1157
- await sendPostRequest({
1158
- uri: `${API_BASE_URL}/operation/sign`,
1159
- body: {
1160
- opId,
1161
- chainId,
1162
- signature,
1163
- signedBy,
1164
- threshold
1165
- },
1166
- ...options
1167
- });
1168
- }
1169
- async function executeOp({
1170
- input,
1171
- ...options
1172
- }) {
1173
- return await sendPostRequest({
1174
- uri: `${API_BASE_URL}/operation/execute`,
1175
- body: input,
1176
- ...options
1177
- });
1178
- }
1179
- async function estimateOp({
1180
- input,
1181
- ...options
1182
- }) {
1183
- return await sendPostRequest({
1184
- uri: `${API_BASE_URL}/operation/estimate`,
1185
- body: input,
1186
- ...options
1187
- });
1188
- }
1189
- async function scheduleOp({
1190
- input,
1191
- ...options
1192
- }) {
1193
- await sendPostRequest({
1194
- uri: `${API_BASE_URL}/operation/schedule`,
1195
- body: input,
1196
- ...options
1197
- });
1198
- }
1199
- var getFullReceipt = async ({
1200
- opId,
1201
- chainId,
1202
- userOpHash,
1203
- ...options
1204
- }) => {
1205
- const retries = 20;
1206
- let result = {
1207
- status: "pending"
1208
- };
1209
- for (let i = 0; i < retries; i++) {
1210
- try {
1211
- result = await sendGetRequest({
1212
- uri: `${API_BASE_URL}/operation/${opId}/chain/${chainId}/receipt?userOpHash=${userOpHash}`,
1213
- ...options
1214
- });
1215
- if (result.status === "included") {
1216
- break;
1217
- }
1218
- } catch (_err) {
1219
- }
1220
- await new Promise((resolve) => setTimeout(resolve, 2500));
1221
- }
1222
- if (!result.receipt) {
1223
- result.receipt = {
1224
- // TODO: this is obviously wrong but it was what we had before
1225
- txId: "Failed to find.",
1226
- gasUsed: "Failed to find.",
1227
- opFeeUSD: "Failed to find.",
1228
- opFee: "Failed to find.",
1229
- userOpHash: "Failed to find."
1230
- };
1231
- }
1232
- return {
1233
- ...result.receipt
1234
- };
1235
- };
1236
- var getUserOpGasPrice = async ({
1237
- chainId,
1238
- ...options
1239
- }) => {
1240
- return await sendGetRequest({
1241
- uri: `${API_BASE_URL}/operation/chain/${chainId}/gas-price`,
1242
- ...options
1243
- });
1244
- };
1245
-
1246
- // src/services/fw-operation/types.ts
1247
- var OperationStatus = /* @__PURE__ */ ((OperationStatus2) => {
1248
- OperationStatus2["ALL"] = "";
1249
- OperationStatus2["PENDING_APPROVED"] = "PENDING_APPROVED";
1250
- OperationStatus2["APPROVED"] = "APPROVED";
1251
- OperationStatus2["PENDING"] = "PENDING";
1252
- OperationStatus2["OP_SUCCEED"] = "OP_SUCCEED";
1253
- OperationStatus2["OP_REVERTED"] = "OP_REVERTED";
1254
- OperationStatus2["SCHEDULED"] = "SCHEDULED";
1255
- return OperationStatus2;
1256
- })(OperationStatus || {});
1257
- var AuthType = /* @__PURE__ */ ((AuthType2) => {
1258
- AuthType2[AuthType2["ECDSA"] = 0] = "ECDSA";
1259
- AuthType2[AuthType2["MULTI_SIG"] = 1] = "MULTI_SIG";
1260
- return AuthType2;
1261
- })(AuthType || {});
1262
- var OperationType = /* @__PURE__ */ ((OperationType2) => {
1263
- OperationType2["SINGLE_OPERATION"] = "SINGLE_OPERATION";
1264
- OperationType2["GROUP_OPERATION"] = "GROUP_OPERATION";
1265
- OperationType2["REJECTION"] = "REJECTION";
1266
- return OperationType2;
1267
- })(OperationType || {});
1268
-
1269
1070
  // src/services/fw-paymaster/endpoints.ts
1270
1071
  async function addTransaction({
1271
1072
  chainId,
@@ -1300,84 +1101,6 @@ var PaymasterType = /* @__PURE__ */ ((PaymasterType2) => {
1300
1101
  return PaymasterType2;
1301
1102
  })(PaymasterType || {});
1302
1103
 
1303
- // src/services/fw-user/endpoints.ts
1304
- import { ResourceNotFoundError as ResourceNotFoundError4 } from "@funkit/utils";
1305
- import { InvalidParameterError as InvalidParameterError3 } from "viem";
1306
- async function createUser({
1307
- authId,
1308
- addr,
1309
- method,
1310
- userUniqueId,
1311
- ...options
1312
- }) {
1313
- await sendPostRequest({
1314
- uri: `${API_BASE_URL}/user`,
1315
- body: {
1316
- authId,
1317
- addr,
1318
- method,
1319
- userUniqueId
1320
- },
1321
- ...options
1322
- });
1323
- }
1324
- async function getUserUniqueId({
1325
- authId,
1326
- ...options
1327
- }) {
1328
- try {
1329
- return (await sendGetRequest({
1330
- uri: `${API_BASE_URL}/user/auth/${authId}/unique-id`,
1331
- ...options
1332
- })).userUniqueId;
1333
- } catch (err) {
1334
- if (err instanceof ResourceNotFoundError4) {
1335
- return "";
1336
- }
1337
- throw err;
1338
- }
1339
- }
1340
- async function getUserWalletsByAddr({
1341
- addr,
1342
- chainId,
1343
- ...options
1344
- }) {
1345
- const endpoint = chainId ? `${API_BASE_URL}/user/addr/${addr}/wallets?chainId=${chainId}` : `${API_BASE_URL}/user/addr/${addr}/wallets`;
1346
- return (await sendGetRequest({ uri: endpoint, ...options })).wallets;
1347
- }
1348
- async function addUserToWallet({
1349
- authId,
1350
- chainId,
1351
- walletAddr,
1352
- userIds,
1353
- walletUniqueId,
1354
- ...options
1355
- }) {
1356
- try {
1357
- await sendPostRequest({
1358
- uri: `${API_BASE_URL}/user/auth/${authId}/chain/${chainId}/wallet`,
1359
- body: { walletAddr, userIds, walletUniqueId },
1360
- ...options
1361
- });
1362
- } catch (err) {
1363
- if (err instanceof InvalidParameterError3) {
1364
- return;
1365
- }
1366
- throw err;
1367
- }
1368
- }
1369
- async function getUserWalletIdentities({
1370
- authId,
1371
- chainId,
1372
- walletAddr,
1373
- ...options
1374
- }) {
1375
- return (await sendGetRequest({
1376
- uri: `${API_BASE_URL}/user/auth/${authId}/chain/${chainId}/wallet/${walletAddr}/identities`,
1377
- ...options
1378
- })).ids ?? [];
1379
- }
1380
-
1381
1104
  // src/services/meld/endpoints.ts
1382
1105
  async function getMeldSupportedFiat({
1383
1106
  ...options
@@ -1694,7 +1417,6 @@ var BluvoWithdrawalError = class extends Error {
1694
1417
  export {
1695
1418
  API_BASE_URL,
1696
1419
  AVANTIS_API_KEY,
1697
- AuthType,
1698
1420
  BASED_API_KEY,
1699
1421
  BENQI_API_KEY,
1700
1422
  BENTO_API_KEY,
@@ -1738,8 +1460,6 @@ export {
1738
1460
  MeldServiceProvider,
1739
1461
  OPINION_API_KEY,
1740
1462
  OSTIUM_API_KEY,
1741
- OperationStatus,
1742
- OperationType,
1743
1463
  PERPL_API_KEY,
1744
1464
  POLYMARKET_API_KEY,
1745
1465
  PaymasterType,
@@ -1754,26 +1474,19 @@ export {
1754
1474
  TRADEFOX_API_KEY,
1755
1475
  VENTUALS_API_KEY,
1756
1476
  addTransaction,
1757
- addUserToWallet,
1758
1477
  bluvoExecuteWithdrawal,
1759
1478
  bluvoGetWalletById,
1760
1479
  bluvoGetWithdrawableBalanceById,
1761
1480
  bluvoListExchanges,
1762
1481
  bluvoRequestQuotation,
1763
- checkWalletAccessInitialization,
1764
1482
  createBridgeBankAccount,
1765
1483
  createBridgeBankAccountRequestChainNames,
1766
1484
  createBridgeCustomer,
1767
1485
  createDirectExecution,
1768
1486
  createFrogAccount,
1769
- createOp,
1770
1487
  createStripeBuySession,
1771
- createUser,
1772
1488
  deactivateCheckout,
1773
- deleteOp,
1774
1489
  errorAbortHandler,
1775
- estimateOp,
1776
- executeOp,
1777
1490
  generateRandomCheckoutSalt,
1778
1491
  getAllWalletTokens,
1779
1492
  getAllWalletTokensByChainId,
@@ -1797,14 +1510,10 @@ export {
1797
1510
  getFiatExchangeRates,
1798
1511
  getFops,
1799
1512
  getFrogAccount,
1800
- getFullReceipt,
1801
- getGroups,
1802
1513
  getMeldDefaultFiat,
1803
1514
  getMeldFiatLimits,
1804
1515
  getMeldQuotes,
1805
1516
  getMeldSupportedFiat,
1806
- getOps,
1807
- getOpsOfWallet,
1808
1517
  getOrganizationIdByApiKey,
1809
1518
  getPaymasterDataForCheckoutSponsoredTransfer,
1810
1519
  getRiskAssessmentForAddress,
@@ -1812,17 +1521,11 @@ export {
1812
1521
  getStripeBuySession,
1813
1522
  getSupportedAssets,
1814
1523
  getSwappedSupportedCountries,
1815
- getUserOpGasPrice,
1816
- getUserUniqueId,
1817
- getUserWalletIdentities,
1818
- getUserWalletsByAddr,
1819
1524
  getWalletLidoWithdrawalsByChainId,
1820
1525
  initializeCheckout,
1821
1526
  initializeCheckoutTokenTransferAddress,
1822
- initializeWalletAccess,
1823
1527
  randomBytes,
1824
1528
  roundToNearestBottomTenth,
1825
- scheduleOp,
1826
1529
  sendDeleteRequest,
1827
1530
  sendGetRequest,
1828
1531
  sendPostRequest,
@@ -1830,7 +1533,6 @@ export {
1830
1533
  sendRequest,
1831
1534
  sendSupportMessage,
1832
1535
  serializeHeaders,
1833
- signOp,
1834
1536
  startMeldSession
1835
1537
  };
1836
1538
  //# sourceMappingURL=index.js.map