Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ethernity Satoshi staking #209

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

mrmacp
Copy link

@mrmacp mrmacp commented Mar 22, 2024

Requesting addition of Ethernity Satoshi staking contract - thanks!

* @returns
*/
getStakedTokenIds(owner: string): Promise<BigNumber[]> {
const contract = Coco__factory.connect(this.contractAddress, this.provider);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be SatoshiStaking__factory?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raymondfeng Ooops thanks for spotting that. Question: the getStakedTokenIds() must return staked NFT token IDs from owner?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @raymondfeng questions:

  1. Does this adapter run on the EVM? I can't do an http call inside getStakedTokenIds() right?
  2. 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!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the adapter runs with our backend and you can call REST apis

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the issue as I commented.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @raymondfeng
I changed the function so it calls the endpoint instead of a contract function. Questions:

  1. 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?

  1. Is /src/types/SatoshiStaking.ts still needed? (since I am not calling the contract anymore from the adapter)

Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use getFetch() from @collabland/common.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See an example at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants