UNPKG

@collabland/staking-contracts

Version:
48 lines (43 loc) 1.44 kB
// Copyright Abridged, Inc. 2022. All Rights Reserved. // Node module: @collabland/staking-contracts // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT import {BindingScope, extensionFor, injectable} from '@loopback/core'; import {BigNumber} from 'ethers'; import {STAKING_ADAPTERS_EXTENSION_POINT} from '../keys.js'; import {BaseStakingContractAdapter, StakingAsset} from '../staking.js'; // Use the full path to import instead of `../types` @injectable( { scope: BindingScope.SINGLETON, // Mark the adapter as a singleton }, // Mark it as an extension to staking contracts service extensionFor(STAKING_ADAPTERS_EXTENSION_POINT), ) export class DigitzStakingContractAdapter extends BaseStakingContractAdapter { /** * The contract address */ contractAddress = '0x60f6DC07A2E18f44Afe497fbe8B0B4C6103D94d1'; /** * Assets that can be staked to this contract */ supportedAssets: StakingAsset[] = [ { asset: 'ERC721:0x92b3282DD1BfE571323CC1324177d0Def2D4c218', }, ]; /** * Get staked token ids for the given owner * @param provider - Ethers provider * @param owner - Owner address * @returns */ async getStakedTokenIds(owner: string): Promise<BigNumber[]> { return []; /* const contract = Coco__factory.connect(this.contractAddress, this.provider); return contract.getStakes(owner); */ } }