Conversation
Signed-off-by: mrmacp <mac@ethernity.io>
| * @returns | ||
| */ | ||
| getStakedTokenIds(owner: string): Promise<BigNumber[]> { | ||
| const contract = Coco__factory.connect(this.contractAddress, this.provider); |
There was a problem hiding this comment.
Should it be SatoshiStaking__factory?
There was a problem hiding this comment.
@raymondfeng Ooops thanks for spotting that. Question: the getStakedTokenIds() must return staked NFT token IDs from owner?
There was a problem hiding this comment.
oh ok thanks @raymondfeng I'm checking if the contract has such function, at a glance it doesn't (it was written a while ago)
There was a problem hiding this comment.
hey @raymondfeng questions:
- Does this adapter run on the EVM? I can't do an http call inside getStakedTokenIds() right?
- We also have an ERN fixed staking contract, that one will work - should I do a new pull request or just include it in the current one?
Thanks!
There was a problem hiding this comment.
No, the adapter runs with our backend and you can call REST apis
There was a problem hiding this comment.
Please fix the issue as I commented.
There was a problem hiding this comment.
hey @raymondfeng
I changed the function so it calls the endpoint instead of a contract function. Questions:
- The tests are failing for me
32) gets staked token balances for FlooringProtocol:
Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (transaction={"to":"0x49AD262C49C7aA708Cc2DF262eD53B64A17Dd5EE","data":"0xe89a7aed","accessList":null}, code=CALL_EXCEPTION, version=providers/5.7.1)
is this something sporadic or failing from my machine?
- Is /src/types/SatoshiStaking.ts still needed? (since I am not calling the contract anymore from the adapter)
Thanks!
There was a problem hiding this comment.
You can remove the abi json.
| async getStakedTokenIds(owner: string): Promise<BigNumber[]> { | ||
| const url = `https://api.ethernity.io/api/v2/satoshi-staking/${owner}/staked`; | ||
| try { | ||
| const response = await fetch(url); |
There was a problem hiding this comment.
Please use getFetch() from @collabland/common.
There was a problem hiding this comment.
See an example at
Requesting addition of Ethernity Satoshi staking contract - thanks!