yearn-sdk
yearn-sdk copied to clipboard
feat: Change Context configuration dynamically
Description
Add a config setter to be able to change configurations (chainId, context and assetServiceState) dynamically after initialisation. Usage:
// Initialise a Yearn instance
const sdkInstance = new Yearn(1, {
provider,
zapper: ZAPPER_API_KEY,
// ...
});
// then we can dynamically change the config by
sdkInstance.config = {
chainId: 250,
context: {
anotherProvider,
zapper: 'anotherZapperKey',
// ...
},
};
Related Issue
N/A
Motivation and Context
Currently after initialisation it is not possible to change the configs in the context
How Has This Been Tested?
Ran locally with yalc
size-limit report 📦
Path | Size |
---|---|
dist/sdk.cjs.production.min.js | 47.67 KB (+0.38% 🔺) |
dist/sdk.esm.js | 48 KB (+0.37% 🔺) |
@xgambitox shall we close this?
Closing for now as it's stalled, reopen if to be continued