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