@funkit/api-base 1.12.0 → 1.12.2
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 +15 -0
- package/dist/index.js +14 -228
- package/dist/index.js.map +4 -4
- package/dist/src/consts/api.d.ts.map +1 -1
- package/dist/src/services/exchange-rates/endpoints.d.ts +8 -0
- package/dist/src/services/exchange-rates/endpoints.d.ts.map +1 -0
- package/dist/src/services/exchange-rates/index.d.ts.map +1 -0
- package/dist/src/services/exchange-rates/types.d.ts +2 -0
- package/dist/src/services/exchange-rates/types.d.ts.map +1 -0
- package/dist/src/services/index.d.ts +1 -1
- package/dist/src/services/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/src/services/mesh/endpoints.d.ts +0 -84
- package/dist/src/services/mesh/endpoints.d.ts.map +0 -1
- package/dist/src/services/mesh/index.d.ts.map +0 -1
- package/dist/src/services/mesh/types.d.ts +0 -294
- package/dist/src/services/mesh/types.d.ts.map +0 -1
- /package/dist/src/services/{mesh → exchange-rates}/index.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @funkit/api-base
|
|
2
2
|
|
|
3
|
+
## 1.12.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 910178d: remove mesh apiendpoint
|
|
8
|
+
- Updated dependencies [1796835]
|
|
9
|
+
- @funkit/utils@1.1.10
|
|
10
|
+
|
|
11
|
+
## 1.12.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [f553f09]
|
|
16
|
+
- @funkit/utils@1.1.9
|
|
17
|
+
|
|
3
18
|
## 1.12.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -1361,219 +1361,6 @@ var MELD_PROVIDER_CATEGORIES = [
|
|
|
1361
1361
|
"FIAT_PAYMENTS"
|
|
1362
1362
|
];
|
|
1363
1363
|
|
|
1364
|
-
// src/services/mesh/endpoints.ts
|
|
1365
|
-
async function meshGetCryptocurrencyHoldings({
|
|
1366
|
-
authToken,
|
|
1367
|
-
type,
|
|
1368
|
-
...options
|
|
1369
|
-
}) {
|
|
1370
|
-
return sendPostRequest({
|
|
1371
|
-
uri: `${API_BASE_URL}/mesh/holdings/get`,
|
|
1372
|
-
body: { authToken, type },
|
|
1373
|
-
...options
|
|
1374
|
-
});
|
|
1375
|
-
}
|
|
1376
|
-
async function meshGetCryptocurrencyHoldingsProxy({
|
|
1377
|
-
brokerType,
|
|
1378
|
-
deviceId,
|
|
1379
|
-
...options
|
|
1380
|
-
}) {
|
|
1381
|
-
return sendPostRequest({
|
|
1382
|
-
uri: `${MESH_API_BASE_URL}/mesh/holdings/get`,
|
|
1383
|
-
body: { brokerType, deviceId },
|
|
1384
|
-
...options
|
|
1385
|
-
});
|
|
1386
|
-
}
|
|
1387
|
-
async function meshGetTransferIntegrations(options) {
|
|
1388
|
-
return sendGetRequest({
|
|
1389
|
-
uri: `${API_BASE_URL}/mesh/transfers/managed/integrations`,
|
|
1390
|
-
...options
|
|
1391
|
-
});
|
|
1392
|
-
}
|
|
1393
|
-
async function meshGetLinkToken({
|
|
1394
|
-
userId,
|
|
1395
|
-
integrationId,
|
|
1396
|
-
restrictMultipleAccounts,
|
|
1397
|
-
transferOptions,
|
|
1398
|
-
...options
|
|
1399
|
-
}) {
|
|
1400
|
-
const body = {
|
|
1401
|
-
userId,
|
|
1402
|
-
...integrationId && { integrationId },
|
|
1403
|
-
...restrictMultipleAccounts && { restrictMultipleAccounts },
|
|
1404
|
-
...transferOptions && { transferOptions }
|
|
1405
|
-
};
|
|
1406
|
-
return sendPostRequest({
|
|
1407
|
-
uri: `${API_BASE_URL}/mesh/linktoken`,
|
|
1408
|
-
body,
|
|
1409
|
-
...options
|
|
1410
|
-
});
|
|
1411
|
-
}
|
|
1412
|
-
async function meshConfigureTransfer({
|
|
1413
|
-
params,
|
|
1414
|
-
...options
|
|
1415
|
-
}) {
|
|
1416
|
-
return sendPostRequest({
|
|
1417
|
-
uri: `${API_BASE_URL}/mesh/transfers/managed/configure`,
|
|
1418
|
-
body: params,
|
|
1419
|
-
retryOptions: { maxAttempts: 1 },
|
|
1420
|
-
...options
|
|
1421
|
-
});
|
|
1422
|
-
}
|
|
1423
|
-
async function meshConfigureTransferProxy({
|
|
1424
|
-
params,
|
|
1425
|
-
...options
|
|
1426
|
-
}) {
|
|
1427
|
-
return sendPostRequest({
|
|
1428
|
-
uri: `${MESH_API_BASE_URL}/mesh/transfers/managed/configure`,
|
|
1429
|
-
body: params,
|
|
1430
|
-
retryOptions: { maxAttempts: 1 },
|
|
1431
|
-
...options
|
|
1432
|
-
});
|
|
1433
|
-
}
|
|
1434
|
-
async function meshPreviewTransfer({
|
|
1435
|
-
fromAuthToken,
|
|
1436
|
-
fromType,
|
|
1437
|
-
toAuthToken,
|
|
1438
|
-
toType,
|
|
1439
|
-
networkId,
|
|
1440
|
-
symbol,
|
|
1441
|
-
toAddress,
|
|
1442
|
-
amount,
|
|
1443
|
-
amountInFiat,
|
|
1444
|
-
fiatCurrency,
|
|
1445
|
-
...options
|
|
1446
|
-
}) {
|
|
1447
|
-
const body = {
|
|
1448
|
-
fromAuthToken,
|
|
1449
|
-
fromType,
|
|
1450
|
-
...toAuthToken && { toAuthToken },
|
|
1451
|
-
...toType && { toType },
|
|
1452
|
-
...networkId && { networkId },
|
|
1453
|
-
...symbol && { symbol },
|
|
1454
|
-
...toAddress && { toAddress },
|
|
1455
|
-
...amount && { amount },
|
|
1456
|
-
...amountInFiat && { amountInFiat },
|
|
1457
|
-
...fiatCurrency && { fiatCurrency }
|
|
1458
|
-
};
|
|
1459
|
-
return sendPostRequest({
|
|
1460
|
-
uri: `${API_BASE_URL}/mesh/transfers/managed/preview`,
|
|
1461
|
-
body,
|
|
1462
|
-
retryOptions: { maxAttempts: 1 },
|
|
1463
|
-
...options
|
|
1464
|
-
});
|
|
1465
|
-
}
|
|
1466
|
-
async function meshPreviewTransferProxy({
|
|
1467
|
-
apiKey,
|
|
1468
|
-
logger,
|
|
1469
|
-
signal,
|
|
1470
|
-
...props
|
|
1471
|
-
}) {
|
|
1472
|
-
const body = { ...props };
|
|
1473
|
-
return sendPostRequest({
|
|
1474
|
-
uri: `${MESH_API_BASE_URL}/mesh/transfers/managed/preview`,
|
|
1475
|
-
body,
|
|
1476
|
-
apiKey,
|
|
1477
|
-
logger,
|
|
1478
|
-
retryOptions: { maxAttempts: 1 },
|
|
1479
|
-
signal
|
|
1480
|
-
});
|
|
1481
|
-
}
|
|
1482
|
-
async function meshExecuteTransfer({
|
|
1483
|
-
fromAuthToken,
|
|
1484
|
-
fromType,
|
|
1485
|
-
previewId,
|
|
1486
|
-
mfaCode,
|
|
1487
|
-
...options
|
|
1488
|
-
}) {
|
|
1489
|
-
const body = {
|
|
1490
|
-
fromAuthToken,
|
|
1491
|
-
fromType,
|
|
1492
|
-
previewId,
|
|
1493
|
-
...mfaCode && { mfaCode }
|
|
1494
|
-
};
|
|
1495
|
-
return sendPostRequest({
|
|
1496
|
-
uri: `${API_BASE_URL}/mesh/transfers/managed/execute`,
|
|
1497
|
-
body,
|
|
1498
|
-
...options
|
|
1499
|
-
});
|
|
1500
|
-
}
|
|
1501
|
-
async function meshExecuteTransferProxy({
|
|
1502
|
-
apiKey,
|
|
1503
|
-
logger,
|
|
1504
|
-
signal,
|
|
1505
|
-
...props
|
|
1506
|
-
}) {
|
|
1507
|
-
const body = { ...props };
|
|
1508
|
-
return sendPostRequest({
|
|
1509
|
-
uri: `${MESH_API_BASE_URL}/mesh/transfers/managed/execute`,
|
|
1510
|
-
body,
|
|
1511
|
-
apiKey,
|
|
1512
|
-
logger,
|
|
1513
|
-
signal
|
|
1514
|
-
});
|
|
1515
|
-
}
|
|
1516
|
-
async function saveTokensToMeshProxy({
|
|
1517
|
-
apiKey,
|
|
1518
|
-
logger,
|
|
1519
|
-
signal,
|
|
1520
|
-
...props
|
|
1521
|
-
}) {
|
|
1522
|
-
const body = { ...props };
|
|
1523
|
-
return sendPostRequest({
|
|
1524
|
-
uri: `${MESH_API_BASE_URL}/api/tokens`,
|
|
1525
|
-
body,
|
|
1526
|
-
apiKey,
|
|
1527
|
-
logger,
|
|
1528
|
-
signal
|
|
1529
|
-
});
|
|
1530
|
-
}
|
|
1531
|
-
async function removeTokensFromMeshProxy({
|
|
1532
|
-
deviceId,
|
|
1533
|
-
brokerType,
|
|
1534
|
-
...options
|
|
1535
|
-
}) {
|
|
1536
|
-
return await sendDeleteRequest({
|
|
1537
|
-
uri: `${MESH_API_BASE_URL}/api/tokens?deviceId=${deviceId}&brokerType=${brokerType}`,
|
|
1538
|
-
...options
|
|
1539
|
-
});
|
|
1540
|
-
}
|
|
1541
|
-
|
|
1542
|
-
// src/services/mesh/types.ts
|
|
1543
|
-
var MeshExecuteTransferStatus = /* @__PURE__ */ ((MeshExecuteTransferStatus2) => {
|
|
1544
|
-
MeshExecuteTransferStatus2["succeeded"] = "succeeded";
|
|
1545
|
-
MeshExecuteTransferStatus2["failed"] = "failed";
|
|
1546
|
-
MeshExecuteTransferStatus2["mfaRequired"] = "mfaRequired";
|
|
1547
|
-
MeshExecuteTransferStatus2["emailConfirmationRequired"] = "emailConfirmationRequired";
|
|
1548
|
-
MeshExecuteTransferStatus2["emailConfirmationApprovalRequired"] = "emailConfirmationApprovalRequired";
|
|
1549
|
-
MeshExecuteTransferStatus2["deviceConfirmationRequired"] = "deviceConfirmationRequired";
|
|
1550
|
-
MeshExecuteTransferStatus2["mfaFailed"] = "mfaFailed";
|
|
1551
|
-
MeshExecuteTransferStatus2["addressWhitelistRequired"] = "addressWhitelistRequired";
|
|
1552
|
-
MeshExecuteTransferStatus2["secondMfaRequired"] = "secondMfaRequired";
|
|
1553
|
-
return MeshExecuteTransferStatus2;
|
|
1554
|
-
})(MeshExecuteTransferStatus || {});
|
|
1555
|
-
var MeshExecuteTransferMfaType = /* @__PURE__ */ ((MeshExecuteTransferMfaType2) => {
|
|
1556
|
-
MeshExecuteTransferMfaType2["unspecified"] = "unspecified";
|
|
1557
|
-
MeshExecuteTransferMfaType2["phone"] = "phone";
|
|
1558
|
-
MeshExecuteTransferMfaType2["email"] = "email";
|
|
1559
|
-
MeshExecuteTransferMfaType2["totp"] = "totp";
|
|
1560
|
-
MeshExecuteTransferMfaType2["face"] = "face";
|
|
1561
|
-
MeshExecuteTransferMfaType2["tradingPin"] = "tradingPin";
|
|
1562
|
-
MeshExecuteTransferMfaType2["mobile"] = "mobile";
|
|
1563
|
-
return MeshExecuteTransferMfaType2;
|
|
1564
|
-
})(MeshExecuteTransferMfaType || {});
|
|
1565
|
-
var MeshConfigureTransferStatus = /* @__PURE__ */ ((MeshConfigureTransferStatus2) => {
|
|
1566
|
-
MeshConfigureTransferStatus2["failed"] = "failed";
|
|
1567
|
-
MeshConfigureTransferStatus2["fromIntegrationNotSupported"] = "fromIntegrationNotSupported";
|
|
1568
|
-
MeshConfigureTransferStatus2["kycRequired"] = "kycRequired";
|
|
1569
|
-
MeshConfigureTransferStatus2["notAuthorizedFrom"] = "notAuthorizedFrom";
|
|
1570
|
-
MeshConfigureTransferStatus2["notAuthorizedTo"] = "notAuthorizedTo";
|
|
1571
|
-
MeshConfigureTransferStatus2["succeeded"] = "succeeded";
|
|
1572
|
-
MeshConfigureTransferStatus2["toIntegrationNotSupported"] = "toIntegrationNotSupported";
|
|
1573
|
-
MeshConfigureTransferStatus2["validationFailed"] = "validationFailed";
|
|
1574
|
-
return MeshConfigureTransferStatus2;
|
|
1575
|
-
})(MeshConfigureTransferStatus || {});
|
|
1576
|
-
|
|
1577
1364
|
// src/services/moonpay/endpoints.ts
|
|
1578
1365
|
import { ErrorCode as ErrorCode3, InternalFailureError as InternalFailureError2 } from "@funkit/utils";
|
|
1579
1366
|
async function getMoonpayUrlSignature({
|
|
@@ -1723,6 +1510,19 @@ async function sendSupportMessage({
|
|
|
1723
1510
|
return false;
|
|
1724
1511
|
}
|
|
1725
1512
|
}
|
|
1513
|
+
|
|
1514
|
+
// src/services/exchange-rates/endpoints.ts
|
|
1515
|
+
async function getFiatExchangeRates({
|
|
1516
|
+
...options
|
|
1517
|
+
} = {}) {
|
|
1518
|
+
return sendGetRequest({
|
|
1519
|
+
uri: `${MESH_API_BASE_URL}/api/exchange-rates`,
|
|
1520
|
+
apiKey: "",
|
|
1521
|
+
// Just a hack to make typescript happy as we don't require an API Key for this endpoint
|
|
1522
|
+
...options,
|
|
1523
|
+
retryOptions: { maxAttempts: 2 }
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1726
1526
|
export {
|
|
1727
1527
|
API_BASE_URL,
|
|
1728
1528
|
AuthType,
|
|
@@ -1756,9 +1556,6 @@ export {
|
|
|
1756
1556
|
MESH_API_BASE_URL,
|
|
1757
1557
|
MONKEY_TILT_API_KEY,
|
|
1758
1558
|
MeldServiceProvider,
|
|
1759
|
-
MeshConfigureTransferStatus,
|
|
1760
|
-
MeshExecuteTransferMfaType,
|
|
1761
|
-
MeshExecuteTransferStatus,
|
|
1762
1559
|
OSTIUM_API_KEY,
|
|
1763
1560
|
OperationStatus,
|
|
1764
1561
|
OperationType,
|
|
@@ -1806,6 +1603,7 @@ export {
|
|
|
1806
1603
|
getCheckoutsByUserId,
|
|
1807
1604
|
getDirectExecutionByTxHash,
|
|
1808
1605
|
getDirectExecutionsByUserId,
|
|
1606
|
+
getFiatExchangeRates,
|
|
1809
1607
|
getFrogAccount,
|
|
1810
1608
|
getFullReceipt,
|
|
1811
1609
|
getGroups,
|
|
@@ -1832,20 +1630,8 @@ export {
|
|
|
1832
1630
|
initializeCheckout,
|
|
1833
1631
|
initializeCheckoutTokenTransferAddress,
|
|
1834
1632
|
initializeWalletAccess,
|
|
1835
|
-
meshConfigureTransfer,
|
|
1836
|
-
meshConfigureTransferProxy,
|
|
1837
|
-
meshExecuteTransfer,
|
|
1838
|
-
meshExecuteTransferProxy,
|
|
1839
|
-
meshGetCryptocurrencyHoldings,
|
|
1840
|
-
meshGetCryptocurrencyHoldingsProxy,
|
|
1841
|
-
meshGetLinkToken,
|
|
1842
|
-
meshGetTransferIntegrations,
|
|
1843
|
-
meshPreviewTransfer,
|
|
1844
|
-
meshPreviewTransferProxy,
|
|
1845
1633
|
randomBytes,
|
|
1846
|
-
removeTokensFromMeshProxy,
|
|
1847
1634
|
roundToNearestBottomTenth,
|
|
1848
|
-
saveTokensToMeshProxy,
|
|
1849
1635
|
scheduleOp,
|
|
1850
1636
|
sendDeleteRequest,
|
|
1851
1637
|
sendGetRequest,
|