UNPKG

@collabland/staking-contracts

Version:
43 lines 1.63 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 { MeltdownChildren__factory } from '../types/factories/MeltdownChildren__factory.js'; let MeltdownContractAdapter = class MeltdownContractAdapter extends BaseStakingContractAdapter { constructor() { super(...arguments); /** * The contract address */ this.contractAddress = '0x78Edb971CdcAa7C262C58D526fc81Ee96809cF4f'; this.chainId = 137; /** * Assets that can be staked to this contract */ this.supportedAssets = [ { asset: 'ERC721:0xc47d3EF164FB3f3C3D6cfAF259f09f6AA9aa7C03', }, ]; } /** * Get staked token ids for the given owner * @param owner - Owner address * @returns */ async getStakedTokenIds(owner) { const contract = MeltdownChildren__factory.connect(this.contractAddress, this.provider); const data = await contract.getStakeInfo(owner); return data._tokensStaked; } }; MeltdownContractAdapter = __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)) ], MeltdownContractAdapter); export { MeltdownContractAdapter }; //# sourceMappingURL=meltdown-1.adapter.js.map