@coinlist-co/react 0.12.2-rc.9fb6364 → 0.12.2-rc.a59b344
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 +70 -40
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +20 -5
- package/dist/server/index.d.ts +20 -5
- package/dist/server/index.js +7 -6
- package/dist/server/index.js.map +1 -1
- 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
|
@@ -1180,12 +1180,13 @@ var ServerAuthNamespaceImpl = class {
|
|
|
1180
1180
|
}
|
|
1181
1181
|
});
|
|
1182
1182
|
} catch (err) {
|
|
1183
|
-
if (
|
|
1183
|
+
if (this.config.strict) {
|
|
1184
1184
|
throw err;
|
|
1185
1185
|
}
|
|
1186
|
-
this.log.child({ op: "logout" }).
|
|
1187
|
-
msg: "
|
|
1188
|
-
|
|
1186
|
+
this.log.child({ op: "logout" }).warning(
|
|
1187
|
+
() => ({ msg: "revoke failed; local session cleared regardless" }),
|
|
1188
|
+
err
|
|
1189
|
+
);
|
|
1189
1190
|
}
|
|
1190
1191
|
await setSession(null);
|
|
1191
1192
|
}
|
|
@@ -1292,40 +1293,6 @@ async function fetchAllPages(fetchPage, baseParams) {
|
|
|
1292
1293
|
return items;
|
|
1293
1294
|
}
|
|
1294
1295
|
|
|
1295
|
-
// src/universal/core/shared/utils/wire.ts
|
|
1296
|
-
function unknownTypeError(dto, model) {
|
|
1297
|
-
const type = dto.type;
|
|
1298
|
-
throw new ValidationError(
|
|
1299
|
-
`${model}.type: unknown type ${JSON.stringify(type)}`
|
|
1300
|
-
);
|
|
1301
|
-
}
|
|
1302
|
-
function requiredString(value, field) {
|
|
1303
|
-
const text = notBlankStringOrNull(value);
|
|
1304
|
-
if (text === null) {
|
|
1305
|
-
throw new ValidationError(
|
|
1306
|
-
`${field}: expected a non-blank string, got ${typeof value === "string" ? "a blank string" : String(value)}`
|
|
1307
|
-
);
|
|
1308
|
-
}
|
|
1309
|
-
return text;
|
|
1310
|
-
}
|
|
1311
|
-
function requiredDate(value, field) {
|
|
1312
|
-
const date = typeof value === "string" ? new Date(value) : null;
|
|
1313
|
-
if (date === null || Number.isNaN(date.getTime())) {
|
|
1314
|
-
throw new ValidationError(
|
|
1315
|
-
`${field}: expected a date, got ${JSON.stringify(value)}`
|
|
1316
|
-
);
|
|
1317
|
-
}
|
|
1318
|
-
return date;
|
|
1319
|
-
}
|
|
1320
|
-
function requiredArray(value, field) {
|
|
1321
|
-
if (!Array.isArray(value)) {
|
|
1322
|
-
throw new ValidationError(
|
|
1323
|
-
`${field}: expected an array, got ${typeof value}`
|
|
1324
|
-
);
|
|
1325
|
-
}
|
|
1326
|
-
return value;
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
1296
|
// src/universal/types/blockchain/core.ts
|
|
1330
1297
|
var ETHEREUM_CHAINS = {
|
|
1331
1298
|
ethereum_mainnet: true,
|
|
@@ -1414,13 +1381,51 @@ function combineAmounts(a, b, op) {
|
|
|
1414
1381
|
}
|
|
1415
1382
|
var AssetSymbol = (value) => value;
|
|
1416
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
|
+
|
|
1417
1421
|
// src/universal/types/offer.ts
|
|
1418
1422
|
var OfferId = (value) => value;
|
|
1419
1423
|
var OfferSlug = (value) => value;
|
|
1420
1424
|
var OFFER_TYPES = {
|
|
1421
1425
|
"coinlist::token_sale": true,
|
|
1422
1426
|
"superstate::swap": true,
|
|
1423
|
-
"ondo::swap": true
|
|
1427
|
+
"ondo::swap": true,
|
|
1428
|
+
"centrifuge::vault": true
|
|
1424
1429
|
};
|
|
1425
1430
|
var isOfferType = (value) => Object.keys(OFFER_TYPES).includes(value);
|
|
1426
1431
|
var OfferEditorial = {
|
|
@@ -1462,6 +1467,7 @@ var Offer = {
|
|
|
1462
1467
|
// on the wire: copying them would hand every consumer a `startsAt` that
|
|
1463
1468
|
// is 1970 for one variant and a date for the others.
|
|
1464
1469
|
case "ondo::swap":
|
|
1470
|
+
case "centrifuge::vault":
|
|
1465
1471
|
return {
|
|
1466
1472
|
...base2,
|
|
1467
1473
|
type: dto.type,
|
|
@@ -1526,6 +1532,19 @@ var OfferSwapContract = {
|
|
|
1526
1532
|
address: EvmContractAddress(dto.address)
|
|
1527
1533
|
})
|
|
1528
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
|
+
};
|
|
1529
1548
|
var OfferDetail = {
|
|
1530
1549
|
fromDto: (dto) => {
|
|
1531
1550
|
const fundingAssets = requiredArray(
|
|
@@ -1588,6 +1607,18 @@ var OfferDetail = {
|
|
|
1588
1607
|
"OfferDetail.swap_contracts"
|
|
1589
1608
|
).map(OfferSwapContract.fromDto)
|
|
1590
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
|
+
};
|
|
1591
1622
|
default:
|
|
1592
1623
|
return unknownTypeError(dto, "OfferDetail");
|
|
1593
1624
|
}
|
|
@@ -2221,7 +2252,6 @@ var OndoTradingStatus = {
|
|
|
2221
2252
|
};
|
|
2222
2253
|
}
|
|
2223
2254
|
};
|
|
2224
|
-
var decimalOrNull = (value) => value === null ? null : DecimalString(value);
|
|
2225
2255
|
var OndoQuote = {
|
|
2226
2256
|
fromDto: (dto) => {
|
|
2227
2257
|
const assetDecimals = AssetDecimals(dto.asset_decimals);
|