You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
eth-sdk is a tool that given a set of addresses (for example in json file) will download ABIs (from etherscan or sourcify) and generate a ready to use ethers.js contract instances with types generated with TypeChain.
It could serve as a replacement to the whole /contracts directory that is generated by CEA.
then simply run eth-sdk. This will get ABIs if they are not already acquired and will generate an SDK right into node_modules.
Then you can use it as:
import{getMainnetSdk}from'@dethcrypto/eth-sdk-client'// yay, our SDK! It's tailored especially for our needsimport{ethers}from'ethers'constmainnetProvider=ethers.getDefaultProvider('mainnet')constdefaultSigner=ethers.Wallet.createRandom().connect(mainnetProvider)constsdk=getMainnetSdk(defaultSigner)// default signer will be wired with all contract instances// sdk is an object like { dai: DaiContract }// sdk.dai is fully typed, you get type completion inside your IDEconstbalance=awaitsdk.dai.balanceOf(defaultSigner.address)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
eth-sdk is a tool that given a set of addresses (for example in json file) will download ABIs (from etherscan or sourcify) and generate a ready to use ethers.js contract instances with types generated with TypeChain.
It could serve as a replacement to the whole
/contracts
directory that is generated by CEA.Example
then simply run
eth-sdk
. This will get ABIs if they are not already acquired and will generate an SDK right intonode_modules
.Then you can use it as:
Beta Was this translation helpful? Give feedback.
All reactions