UNPKG

@collabland/staking-contracts

Version:
41 lines 1.55 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 { StartNft__factory } from '../types/factories/StartNft__factory.js'; let StartStakingContractAdapter = class StartStakingContractAdapter extends BaseStakingContractAdapter { constructor() { super(...arguments); /** * The contract address */ this.contractAddress = '0xB4A3C079ACBD57668bF5292C13878F9225678381'; /** * Assets that can be staked to this contract */ this.supportedAssets = [ { asset: 'ERC721:0x31b4C124E8e021402A2b89F8EC1AF54F68Fd256D', }, ]; } /** * Get staked token ids for the given owner * @param owner - Owner address * @returns */ getStakedTokenIds(owner) { const contract = StartNft__factory.connect(this.contractAddress, this.provider); return contract.getAllStakedERC721(owner); } }; StartStakingContractAdapter = __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)) ], StartStakingContractAdapter); export { StartStakingContractAdapter }; //# sourceMappingURL=start.adapter.js.map