@collabland/staking-contracts
Version:
Staking contracts supported by Collab.Land
42 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 { Meltdown03__factory } from '../types/factories/Meltdown03__factory.js';
let Meltdown03ContractAdapter = class Meltdown03ContractAdapter extends BaseStakingContractAdapter {
constructor() {
super(...arguments);
/**
* The contract address
*/
this.contractAddress = '0x056afF8f6aE1F9f02EEbE270b7B14528EA143e2E';
/**
* Assets that can be staked to this contract
*/
this.supportedAssets = [
{
asset: 'ERC721:0x94355367a2d1896fed2Cd61CD7a11a7b50071451',
},
];
}
/**
* Get staked token ids for the given owner
* @param owner - Owner address
* @returns
*/
async getStakedTokenIds(owner) {
const contract = Meltdown03__factory.connect(this.contractAddress, this.provider);
const data = await contract.getStakeInfo(owner);
return data._tokensStaked;
}
};
Meltdown03ContractAdapter = __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))
], Meltdown03ContractAdapter);
export { Meltdown03ContractAdapter };
//# sourceMappingURL=meltdown.adapter.js.map