UNPKG

@collabland/staking-contracts

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