@ajna-finance/sdk
Version:
A typescript SDK that can be used to create Dapps in Ajna ecosystem.
36 lines • 1.89 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Config = void 0;
/**
* Manages static protocol configuration, particularly contract addresses for a single chain.
*/
class Config {
/**
* Allows consumer to configure with their own addresses.
* @param erc20PoolFactory address of the factory contract which creates fungible pools
* @param erc721PoolFactory address of the factory contract which creates NFT pools
* @param poolUtils address of the readonly utility contract
* @param ajnaToken address of the AJNA token contract
* @param grantFund address of the ecosystem coordination contract
* @param burnWrapper address of the contract used to wrap AJNA for transferring across an L2 bridge
* @param lenderHelper address of the contract used as a helper to add and move liquidity across buckets
*/
constructor(erc20PoolFactory, erc721PoolFactory, poolUtils, positionManager, ajnaToken, grantFund, burnWrapper, lenderHelper) {
Config.erc20PoolFactory = erc20PoolFactory;
Config.erc721PoolFactory = erc721PoolFactory;
Config.poolUtils = poolUtils;
Config.positionManager = positionManager;
Config.ajnaToken = ajnaToken;
Config.grantFund = grantFund;
Config.burnWrapper = burnWrapper;
Config.lenderHelper = lenderHelper;
}
/**
* Configures addresses from known environment variables.
*/
static fromEnvironment() {
return new Config(process.env.AJNA_ERC20_POOL_FACTORY || '', process.env.AJNA_ERC721_POOL_FACTORY || '', process.env.AJNA_POOL_UTILS || '', process.env.AJNA_POSITION_MANAGER || '', process.env.AJNA_TOKEN_ADDRESS || '', process.env.AJNA_GRANT_FUND || '', process.env.AJNA_BURN_WRAPPER || '', process.env.AJNA_LENDER_HELPER || '');
}
}
exports.Config = Config;
//# sourceMappingURL=Config.js.map