Use single exports object for sdk-core (and v2 packages). Achieves same goal as multiple if done correctly & cleans up package.json.
General
Moved module-specific utils to their respective module (like sdk-core/utils/getMinGasLimit to sdk-core/chains/utils/getMinGasLimit). The idea being that a util that is only meant to be used in a single module should live there since it won't be exported from the package anyway. src/utils are more general and could be exported from a package.
Remove env vars from core packages in favor of setters.
sdk-core
Exposes getToken(s)(), getNetwork(s)() and getChain(s)() as the main touchpoints. No package outside of sdk-core should read/manipulate the token/network/chain objects directly since they are static.
Index getChain(s)() by (chainId) or by (networkSlug and chainSlug). chainId is always unique. Indexing by (networkSlug and chainSlug) allows for easier consumption when chainIds are not present (many places in v1 packages).
Move s3Upload to stats-worker. I think it is more appropriate to live here than in the SDK, especially since this package already has the same publish logic.
I'm not 100% convinced this is the best place for this, but I do think it should not live in the SDK now since IMO the SDK shouldn't be the one responsible for writing to s3 & none of this logic should be exposed to consumers.
hop-node-core
Move some modules to v1. They may be useful in core, but as it stands any update to them may break v1. Also, v2 will likely include a more robust version of these modules with more features, so they can be pulled back down to core when appropriate.
Slack logic. Notification system for v2 will be more versatile for decentralized network. Slack likely fits into that new system, but will cherrypick what is needed when that time comes.
Structure updates for v1/v2 clean split.
Config
exports
object forsdk-core
(and v2 packages). Achieves same goal as multiple if done correctly & cleans uppackage.json
.General
sdk-core/utils/getMinGasLimit
tosdk-core/chains/utils/getMinGasLimit
). The idea being that a util that is only meant to be used in a single module should live there since it won't be exported from the package anyway.src/utils
are more general and could be exported from a package.core
packages in favor of setters.sdk-core
getToken(s)()
,getNetwork(s)()
andgetChain(s)()
as the main touchpoints. No package outside ofsdk-core
should read/manipulate the token/network/chain objects directly since they are static.getChain(s)()
by (chainId
) or by (networkSlug
andchainSlug
).chainId
is always unique. Indexing by (networkSlug
andchainSlug
) allows for easier consumption whenchainId
s are not present (many places in v1 packages).s3Upload
tostats-worker
. I think it is more appropriate to live here than in the SDK, especially since this package already has the same publish logic.hop-node-core
v1
. They may be useful incore
, but as it stands any update to them may breakv1
. Also,v2
will likely include a more robust version of these modules with more features, so they can be pulled back down tocore
when appropriate.metrics
moduleswap
module