CRYPTO NEWS

get a contract from a chain knowing the chain id with ethers.js

I need some help with calling the retrieve function of a contract without making the user change the chain. scenario: the user is on chain with id= 111 , I want to call the retrieve function of a contract on the chain with id=123 , how do I do that? (without making the user’s metamask switch to the other chain)

here is how it usually works(call a function of a contract on the same chain):

const providerx = new ethers.providers.Web3Provider(window.ethereum); let signer = providerx.getSigner(); var contractx = new ethers.Contract(contract_address, abi, signer); let val = await contractx.retrieve(defaultAccount); 

and here is what I want :

var contractx = new ethers.Contract(contract_address, abi, chain_id); let val = await contractx.retrieve(defaultAccount); 

Getting historical buySellRatio values

Is there a possibility to get historical buySellRatio values older than 30 days? The buySellRatio can be found in /futures/data/takerlongshortRatio endpoint in future api. Since it records values only from last 30 days, I was wondering if it would be possible to calculate earlier data, for ex. through historical trades lookout or something like that.::Listen

Is there a possibility to get historical buySellRatio values older than 30 days? The buySellRatio can be found in /futures/data/takerlongshortRatio endpoint in future api.

Since it records values only from last 30 days, I was wondering if it would be possible to calculate earlier data, for ex. through historical trades lookout or something like that.

Thanks

get a contract from a chain knowing the chain id with ethers.js

Shopping cart
There are no products in the cart!
Continue shopping
0