@collabland/staking-contracts
Version:
Staking contracts supported by Collab.Land
46 lines • 1.78 kB
JavaScript
// 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 { __decorate, __metadata } 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 { Coco__factory } from '../types/factories/Coco__factory.js';
let CocoStakingContractAdapter = class CocoStakingContractAdapter extends BaseStakingContractAdapter {
constructor() {
super();
/**
* The contract address
*/
this.contractAddress = '0x0Df016Fb18ef4195b2CF9d8623E236272ec52e14';
/**
* Assets that can be staked to this contract
*/
this.supportedAssets = [
{
asset: 'ERC721:0x1A331c89898C37300CccE1298c62aefD3dFC016c',
},
];
this.contract = Coco__factory.connect(this.contractAddress, this.provider);
}
/**
* Get staked token ids for the given owner
* @param owner - Owner address
* @returns
*/
getStakedTokenIds(owner) {
return this.contract.getStakes(owner);
}
};
CocoStakingContractAdapter = __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)),
__metadata("design:paramtypes", [])
], CocoStakingContractAdapter);
export { CocoStakingContractAdapter };
//# sourceMappingURL=coco.adapter.js.map