@coinlist-co/react 0.12.1-rc.14ac67e → 0.12.1-rc.a230abc
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-3ATIDGVR.js → chunk-GFLU5OMP.js} +19 -5
- package/dist/chunk-GFLU5OMP.js.map +1 -0
- package/dist/{chunk-SOMNMOBU.js → chunk-HLL7IBIS.js} +2 -2
- package/dist/{chunk-2XBPKC4C.js → chunk-RPE7XIBV.js} +2 -2
- package/dist/client/index.cjs +414 -273
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +212 -85
- package/dist/client/index.d.ts +212 -85
- package/dist/client/index.js +365 -242
- package/dist/client/index.js.map +1 -1
- package/dist/{collections-DNbBE6Pk.d.cts → collections-CAfs2Eww.d.cts} +1 -1
- package/dist/{collections-DVCh4jUp.d.ts → collections-DZZFrizd.d.ts} +1 -1
- package/dist/{config-DFYAM0GD.d.cts → config-D19ktBr0.d.cts} +19 -1
- package/dist/{config-DFYAM0GD.d.ts → config-D19ktBr0.d.ts} +19 -1
- package/dist/server/index.cjs +17 -4
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +2 -2
- package/dist/shared/index.cjs +19 -4
- package/dist/shared/index.cjs.map +1 -1
- package/dist/shared/index.d.cts +4 -4
- package/dist/shared/index.d.ts +4 -4
- package/dist/shared/index.js +4 -2
- package/package.json +1 -1
- package/dist/chunk-3ATIDGVR.js.map +0 -1
- /package/dist/{chunk-SOMNMOBU.js.map → chunk-HLL7IBIS.js.map} +0 -0
- /package/dist/{chunk-2XBPKC4C.js.map → chunk-RPE7XIBV.js.map} +0 -0
|
@@ -248,8 +248,9 @@ var SolanaChain = (value) => {
|
|
|
248
248
|
}
|
|
249
249
|
return value;
|
|
250
250
|
};
|
|
251
|
+
var isChain = (value) => Object.keys(ETHEREUM_CHAINS).includes(value) || Object.keys(SOLANA_CHAINS).includes(value);
|
|
251
252
|
var Chain = (value) => {
|
|
252
|
-
if (!
|
|
253
|
+
if (!isChain(value)) {
|
|
253
254
|
throw new ValidationError(`Unsupported chain: "${value}"`);
|
|
254
255
|
}
|
|
255
256
|
return value;
|
|
@@ -916,7 +917,7 @@ var Offer = {
|
|
|
916
917
|
logoUrl: dto.logo_url,
|
|
917
918
|
startsAt: new Date(dto.starts_at),
|
|
918
919
|
endsAt: dto.ends_at ? new Date(dto.ends_at) : null,
|
|
919
|
-
tokens: dto.tokens
|
|
920
|
+
tokens: OfferToken.listFromDto(dto.tokens)
|
|
920
921
|
};
|
|
921
922
|
}
|
|
922
923
|
};
|
|
@@ -925,7 +926,19 @@ var OfferToken = {
|
|
|
925
926
|
role: dto.role,
|
|
926
927
|
chain: Chain(dto.chain),
|
|
927
928
|
address: EvmContractAddress(dto.address)
|
|
928
|
-
})
|
|
929
|
+
}),
|
|
930
|
+
/**
|
|
931
|
+
* Maps an offer's token list, dropping every token on a chain this SDK does
|
|
932
|
+
* not name. Frontline's chain registry runs ahead of {@link Chain}, and a
|
|
933
|
+
* plain `.map` would throw out of `Offer.fromDto` and, through
|
|
934
|
+
* `PaginatedResponse.fromDto`, reject the whole offers page - which is how
|
|
935
|
+
* one Base token blanked production's offers list. Dropping costs that
|
|
936
|
+
* token's metadata alone: `coinlist.tokens.get` takes an `EthereumChain`,
|
|
937
|
+
* so nobody could have looked it up anyway.
|
|
938
|
+
*
|
|
939
|
+
* Same shape as `TokenMetadata.fromRegistryDto`.
|
|
940
|
+
*/
|
|
941
|
+
listFromDto: (dtos) => dtos.filter((dto) => isChain(dto.chain)).map(OfferToken.fromDto)
|
|
929
942
|
};
|
|
930
943
|
|
|
931
944
|
// src/shared/core/utils/crypto.ts
|
|
@@ -1037,7 +1050,7 @@ var OfferDetail = {
|
|
|
1037
1050
|
name: dto.name,
|
|
1038
1051
|
asset: Asset.fromDto(dto.asset),
|
|
1039
1052
|
fundingAssets: dto.funding_assets.map(Asset.fromDto),
|
|
1040
|
-
tokens: dto.tokens
|
|
1053
|
+
tokens: OfferToken.listFromDto(dto.tokens),
|
|
1041
1054
|
swapContracts: swapContracts.map(OfferSwapContract.fromDto),
|
|
1042
1055
|
about: notBlankStringOrNull(dto.about),
|
|
1043
1056
|
tagline: dto.tagline,
|
|
@@ -2305,6 +2318,7 @@ export {
|
|
|
2305
2318
|
EthereumChain,
|
|
2306
2319
|
SOLANA_CHAINS,
|
|
2307
2320
|
SolanaChain,
|
|
2321
|
+
isChain,
|
|
2308
2322
|
Chain,
|
|
2309
2323
|
EvmWalletAddress,
|
|
2310
2324
|
EvmContractAddress,
|
|
@@ -2410,4 +2424,4 @@ export {
|
|
|
2410
2424
|
OAuthRefreshToken,
|
|
2411
2425
|
OAuthSession
|
|
2412
2426
|
};
|
|
2413
|
-
//# sourceMappingURL=chunk-
|
|
2427
|
+
//# sourceMappingURL=chunk-GFLU5OMP.js.map
|