@coinlist-co/react 0.12.2-rc.0fda52c → 0.12.2-rc.31c2f50
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/{chunk-STAHYDLY.js → chunk-4IZ2F732.js} +2 -2
- package/dist/{chunk-BNMF2HMW.js → chunk-NBO5E2RO.js} +39 -3
- package/dist/chunk-NBO5E2RO.js.map +1 -0
- package/dist/{chunk-KRA6EM2L.js → chunk-UJYSXXJF.js} +168 -3
- package/dist/chunk-UJYSXXJF.js.map +1 -0
- package/dist/client/index.cjs +147 -49
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +92 -29
- package/dist/client/index.d.ts +92 -29
- package/dist/client/index.js +75 -15
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.cjs +65 -36
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +2 -2
- package/dist/{time-BY3apBpc.d.cts → time-CFocgYyl.d.cts} +1 -1
- package/dist/{time-B5YOQxuh.d.ts → time-DvgN98Q9.d.ts} +1 -1
- package/dist/{token-registry-snapshot-C1NxdBmF.d.ts → token-registry-snapshot-BsAfBL_b.d.ts} +9 -7
- package/dist/{token-registry-snapshot-DyjrA32p.d.cts → token-registry-snapshot-Cc_eA5zM.d.cts} +9 -7
- package/dist/{tokens-namespace-BJfFeowE.d.cts → tokens-namespace-D_XSpiS-.d.cts} +102 -19
- package/dist/{tokens-namespace-BJfFeowE.d.ts → tokens-namespace-D_XSpiS-.d.ts} +102 -19
- package/dist/universal/index.cjs +233 -37
- package/dist/universal/index.cjs.map +1 -1
- package/dist/universal/index.d.cts +341 -6
- package/dist/universal/index.d.ts +341 -6
- package/dist/universal/index.js +18 -2
- package/package.json +1 -1
- package/dist/chunk-BNMF2HMW.js.map +0 -1
- package/dist/chunk-KRA6EM2L.js.map +0 -1
- /package/dist/{chunk-STAHYDLY.js.map → chunk-4IZ2F732.js.map} +0 -0
package/dist/server/index.cjs
CHANGED
|
@@ -1293,40 +1293,6 @@ async function fetchAllPages(fetchPage, baseParams) {
|
|
|
1293
1293
|
return items;
|
|
1294
1294
|
}
|
|
1295
1295
|
|
|
1296
|
-
// src/universal/core/shared/utils/wire.ts
|
|
1297
|
-
function unknownTypeError(dto, model) {
|
|
1298
|
-
const type = dto.type;
|
|
1299
|
-
throw new ValidationError(
|
|
1300
|
-
`${model}.type: unknown type ${JSON.stringify(type)}`
|
|
1301
|
-
);
|
|
1302
|
-
}
|
|
1303
|
-
function requiredString(value, field) {
|
|
1304
|
-
const text = notBlankStringOrNull(value);
|
|
1305
|
-
if (text === null) {
|
|
1306
|
-
throw new ValidationError(
|
|
1307
|
-
`${field}: expected a non-blank string, got ${typeof value === "string" ? "a blank string" : String(value)}`
|
|
1308
|
-
);
|
|
1309
|
-
}
|
|
1310
|
-
return text;
|
|
1311
|
-
}
|
|
1312
|
-
function requiredDate(value, field) {
|
|
1313
|
-
const date = typeof value === "string" ? new Date(value) : null;
|
|
1314
|
-
if (date === null || Number.isNaN(date.getTime())) {
|
|
1315
|
-
throw new ValidationError(
|
|
1316
|
-
`${field}: expected a date, got ${JSON.stringify(value)}`
|
|
1317
|
-
);
|
|
1318
|
-
}
|
|
1319
|
-
return date;
|
|
1320
|
-
}
|
|
1321
|
-
function requiredArray(value, field) {
|
|
1322
|
-
if (!Array.isArray(value)) {
|
|
1323
|
-
throw new ValidationError(
|
|
1324
|
-
`${field}: expected an array, got ${typeof value}`
|
|
1325
|
-
);
|
|
1326
|
-
}
|
|
1327
|
-
return value;
|
|
1328
|
-
}
|
|
1329
|
-
|
|
1330
1296
|
// src/universal/types/blockchain/core.ts
|
|
1331
1297
|
var ETHEREUM_CHAINS = {
|
|
1332
1298
|
ethereum_mainnet: true,
|
|
@@ -1415,13 +1381,51 @@ function combineAmounts(a, b, op) {
|
|
|
1415
1381
|
}
|
|
1416
1382
|
var AssetSymbol = (value) => value;
|
|
1417
1383
|
|
|
1384
|
+
// src/universal/core/shared/utils/wire.ts
|
|
1385
|
+
function unknownTypeError(dto, model) {
|
|
1386
|
+
const type = dto.type;
|
|
1387
|
+
throw new ValidationError(
|
|
1388
|
+
`${model}.type: unknown type ${JSON.stringify(type)}`
|
|
1389
|
+
);
|
|
1390
|
+
}
|
|
1391
|
+
function requiredString(value, field) {
|
|
1392
|
+
const text = notBlankStringOrNull(value);
|
|
1393
|
+
if (text === null) {
|
|
1394
|
+
throw new ValidationError(
|
|
1395
|
+
`${field}: expected a non-blank string, got ${typeof value === "string" ? "a blank string" : String(value)}`
|
|
1396
|
+
);
|
|
1397
|
+
}
|
|
1398
|
+
return text;
|
|
1399
|
+
}
|
|
1400
|
+
function requiredDate(value, field) {
|
|
1401
|
+
const date = typeof value === "string" ? new Date(value) : null;
|
|
1402
|
+
if (date === null || Number.isNaN(date.getTime())) {
|
|
1403
|
+
throw new ValidationError(
|
|
1404
|
+
`${field}: expected a date, got ${JSON.stringify(value)}`
|
|
1405
|
+
);
|
|
1406
|
+
}
|
|
1407
|
+
return date;
|
|
1408
|
+
}
|
|
1409
|
+
function decimalOrNull(value) {
|
|
1410
|
+
return value === null ? null : DecimalString(value);
|
|
1411
|
+
}
|
|
1412
|
+
function requiredArray(value, field) {
|
|
1413
|
+
if (!Array.isArray(value)) {
|
|
1414
|
+
throw new ValidationError(
|
|
1415
|
+
`${field}: expected an array, got ${typeof value}`
|
|
1416
|
+
);
|
|
1417
|
+
}
|
|
1418
|
+
return value;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1418
1421
|
// src/universal/types/offer.ts
|
|
1419
1422
|
var OfferId = (value) => value;
|
|
1420
1423
|
var OfferSlug = (value) => value;
|
|
1421
1424
|
var OFFER_TYPES = {
|
|
1422
1425
|
"coinlist::token_sale": true,
|
|
1423
1426
|
"superstate::swap": true,
|
|
1424
|
-
"ondo::swap": true
|
|
1427
|
+
"ondo::swap": true,
|
|
1428
|
+
"centrifuge::vault": true
|
|
1425
1429
|
};
|
|
1426
1430
|
var isOfferType = (value) => Object.keys(OFFER_TYPES).includes(value);
|
|
1427
1431
|
var OfferEditorial = {
|
|
@@ -1463,6 +1467,7 @@ var Offer = {
|
|
|
1463
1467
|
// on the wire: copying them would hand every consumer a `startsAt` that
|
|
1464
1468
|
// is 1970 for one variant and a date for the others.
|
|
1465
1469
|
case "ondo::swap":
|
|
1470
|
+
case "centrifuge::vault":
|
|
1466
1471
|
return {
|
|
1467
1472
|
...base2,
|
|
1468
1473
|
type: dto.type,
|
|
@@ -1527,6 +1532,19 @@ var OfferSwapContract = {
|
|
|
1527
1532
|
address: EvmContractAddress(dto.address)
|
|
1528
1533
|
})
|
|
1529
1534
|
};
|
|
1535
|
+
var OfferVaultContract = {
|
|
1536
|
+
fromDto: (dto) => ({
|
|
1537
|
+
chain: Chain(dto.chain),
|
|
1538
|
+
address: EvmContractAddress(dto.address)
|
|
1539
|
+
}),
|
|
1540
|
+
/**
|
|
1541
|
+
* Drops every proxy on a chain this SDK does not name, as
|
|
1542
|
+
* `OfferToken.listFromDto` does: frontline publishes the full offer-token
|
|
1543
|
+
* chain list, which runs ahead of {@link Chain}, and one unmodelled chain
|
|
1544
|
+
* should not throw away the proxies the SDK can use.
|
|
1545
|
+
*/
|
|
1546
|
+
listFromDto: (dtos) => dtos.filter((dto) => isChain(dto.chain)).map(OfferVaultContract.fromDto)
|
|
1547
|
+
};
|
|
1530
1548
|
var OfferDetail = {
|
|
1531
1549
|
fromDto: (dto) => {
|
|
1532
1550
|
const fundingAssets = requiredArray(
|
|
@@ -1589,6 +1607,18 @@ var OfferDetail = {
|
|
|
1589
1607
|
"OfferDetail.swap_contracts"
|
|
1590
1608
|
).map(OfferSwapContract.fromDto)
|
|
1591
1609
|
};
|
|
1610
|
+
// No editorial, as for Ondo. `[]` is fine and a missing key is not, for
|
|
1611
|
+
// the same reason as `swap_contracts`: this is the spender a user
|
|
1612
|
+
// approves.
|
|
1613
|
+
case "centrifuge::vault":
|
|
1614
|
+
return {
|
|
1615
|
+
...base2,
|
|
1616
|
+
type: dto.type,
|
|
1617
|
+
logoUrl: notBlankStringOrNull(dto.logo_url),
|
|
1618
|
+
vaultContracts: OfferVaultContract.listFromDto(
|
|
1619
|
+
requiredArray(dto.vault_contracts, "OfferDetail.vault_contracts")
|
|
1620
|
+
)
|
|
1621
|
+
};
|
|
1592
1622
|
default:
|
|
1593
1623
|
return unknownTypeError(dto, "OfferDetail");
|
|
1594
1624
|
}
|
|
@@ -2222,7 +2252,6 @@ var OndoTradingStatus = {
|
|
|
2222
2252
|
};
|
|
2223
2253
|
}
|
|
2224
2254
|
};
|
|
2225
|
-
var decimalOrNull = (value) => value === null ? null : DecimalString(value);
|
|
2226
2255
|
var OndoQuote = {
|
|
2227
2256
|
fromDto: (dto) => {
|
|
2228
2257
|
const assetDecimals = AssetDecimals(dto.asset_decimals);
|