@collabland/staking-contracts
Version:
Staking contracts supported by Collab.Land
41 lines • 1.59 kB
JavaScript
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 { PlutoallianceStaking__factory } from '../types/factories/PlutoallianceStaking__factory.js';
let PlutoallianceStakingAdapter = class PlutoallianceStakingAdapter extends BaseStakingContractAdapter {
constructor() {
super(...arguments);
/**
* The contract address
*/
this.contractAddress = '0x882eA36F2031F3EDD6Cc243472f6Bea7195ECaf3';
/**
* Assets that can be staked to this contract
*/
this.supportedAssets = [
{
asset: 'ERC721:0xDfe3AC769b2d8E382cB86143E0b0B497E1ED5447',
},
];
}
/**
* Get staked token ids for the given owner
* @param owner - Owner address
* @returns
*/
getStakedTokenIds(owner) {
const contract = PlutoallianceStaking__factory.connect(this.contractAddress, this.provider);
return contract.getStakedTokens(owner);
}
};
PlutoallianceStakingAdapter = __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))
], PlutoallianceStakingAdapter);
export { PlutoallianceStakingAdapter };
//# sourceMappingURL=plutoalliance.adapter.js.map