UNPKG

@collabland/staking-contracts

Version:
49 lines 2.24 kB
import { __decorate } from "tslib"; import { BindingScope, extensionFor, injectable } from '@loopback/core'; import { STAKING_ADAPTERS_EXTENSION_POINT } from '../keys.js'; import { BaseStakingContractAdapter } from '../staking.js'; // Use the full path to import instead of `../types` import { FloorGetter__factory } from '../index.js'; import { FlooringProtocolStaking__factory } from '../types/factories/FlooringProtocolStaking__factory.js'; let FlooringProtocolStakingContractAdapter = class FlooringProtocolStakingContractAdapter extends BaseStakingContractAdapter { constructor() { super(...arguments); this.contractName = 'FlooringProtocol'; /** * The contract address */ this.contractAddress = '0x3eb879cc9a0Ef4C6f1d870A40ae187768c278Da2'; /** * The periphery contract address of the Flooring Protocol used to read Flooring Protocol States */ this.peripheryContractAddress = '0x49AD262C49C7aA708Cc2DF262eD53B64A17Dd5EE'; /** * The Flooring Lab Credit contract address */ this.flcAddress = '0x102c776DDB30C754dEd4fDcC77A19230A60D4e4f'; /** * Assets that can be staked to this contract */ this.supportedAssets = [ { name: 'FlooringLabCredit', asset: 'ERC20:0x102c776DDB30C754dEd4fDcC77A19230A60D4e4f', }, ]; } async getStakedTokenBalance(owner) { const contract = FlooringProtocolStaking__factory.connect(this.peripheryContractAddress, this.provider); const floorGetter = await contract.floorGetter(); const floorContract = FloorGetter__factory.connect(floorGetter, this.provider); return floorContract.tokenBalance(owner, this.flcAddress); } }; FlooringProtocolStakingContractAdapter = __decorate([ injectable({ scope: BindingScope.SINGLETON, // Mark the adapter as a singleton }, // Mark it as an extension to staking contracts service extensionFor(STAKING_ADAPTERS_EXTENSION_POINT)) ], FlooringProtocolStakingContractAdapter); export { FlooringProtocolStakingContractAdapter }; //# sourceMappingURL=flooring-protocol-staking.adapter.js.map