Skip to content

Commit

Permalink
Merge pull request #296 from ethereum-ts/kk/rryter-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
krzkaczor committed Nov 4, 2020
2 parents e8b2e53 + fc62a64 commit 51923b3
Show file tree
Hide file tree
Showing 12 changed files with 407 additions and 405 deletions.
10 changes: 5 additions & 5 deletions examples/ethers-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@typechain/ethers-v5": "^0.0.1",
"@typechain/ethers-v5": "^3.0.0",
"@types/bn.js": "^4.11.6",
"ts-node": "^8.8.2",
"typechain": "^2.0.0",
"typescript": "^3.8.3"
"ts-node": "^9.0.0",
"typechain": "^4.0.0",
"typescript": "^4.0.5"
},
"dependencies": {
"ethers": "^5.0.3"
"ethers": "^5.0.19"
}
}
16 changes: 6 additions & 10 deletions examples/ethers-v5/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import * as ethers from 'ethers'
import { Dai } from '../types/ethers-contracts/Dai'

const abi = require('../abi/dai.json')
import { utils, ethers } from 'ethers'
import { DaiFactory } from '../types/ethers-contracts/DaiFactory'

const RPC_HOST = 'https://mainnet.infura.io/v3/6d6c70e65c77429482df5b64a4d0c943'
const DAI_ADDRESS = '0x6B175474E89094C44Da98b954EedeAC495271d0F'

async function main() {
const provider = new ethers.providers.JsonRpcProvider(RPC_HOST)
const formatEther = ethers.utils.formatEther

const dai = (new ethers.Contract(DAI_ADDRESS, abi, provider) as any) as Dai
const balance = await dai.functions.balanceOf('0x70b144972C5Ef6CB941A5379240B74239c418CD4')
const dai = DaiFactory.connect(DAI_ADDRESS, provider)
const balance = await dai.balanceOf('0x70b144972C5Ef6CB941A5379240B74239c418CD4')

console.log(`Our DAI balance is: ${formatEther(balance[0])}`)
console.log(`Our DAI balance is: ${utils.formatEther(balance)}`)
}

main().catch(e => {
main().catch((e) => {
console.error(e)
process.exit(1)
})
3 changes: 2 additions & 1 deletion examples/ethers-v5/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"strict": true,
"target": "ES2018",
"sourceMap": true,
"esModuleInterop": true
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
}
}
767 changes: 386 additions & 381 deletions examples/ethers-v5/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/target-ethers-v4-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"sinon-chai": "^3.3.0",
"test-utils": "1.0.0",
"ts-node": "^8.5.4",
"typechain": "^3.0.0",
"typechain": "^4.0.0",
"typescript": "3.9.0-beta"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/target-ethers-v4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"sinon-chai": "^3.3.0",
"ts-node": "^8.5.4",
"typescript": "3.9.0-beta",
"typechain": "^3.0.0",
"typechain": "^4.0.0",
"test-utils": "1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/target-ethers-v5-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"sinon-chai": "^3.3.0",
"test-utils": "1.0.0",
"ts-node": "^8.5.4",
"typechain": "^3.0.0",
"typechain": "^4.0.0",
"typescript": "3.9.0-beta"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/target-ethers-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"sinon-chai": "^3.3.0",
"test-utils": "1.0.0",
"ts-node": "^8.5.4",
"typechain": "^3.0.0",
"typechain": "^4.0.0",
"typescript": "3.9.0-beta"
}
}
2 changes: 1 addition & 1 deletion packages/target-truffle-v4-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"sinon-chai": "^3.3.0",
"truffle": "v4",
"ts-node": "^8.5.4",
"typechain": "^3.0.0",
"typechain": "^4.0.0",
"typescript": "3.9.0-beta",
"test-utils": "1.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/target-truffle-v5-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"test-utils": "1.0.0",
"truffle": "^5.1.21",
"ts-node": "^8.5.4",
"typechain": "^3.0.0",
"typechain": "^4.0.0",
"typescript": "3.9.0-beta"
}
}
2 changes: 1 addition & 1 deletion packages/target-web3-v1-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"sinon-chai": "^3.3.0",
"test-utils": "1.0.0",
"ts-node": "^8.5.4",
"typechain": "^3.0.0",
"typechain": "^4.0.0",
"typescript": "3.9.0-beta"
}
}
2 changes: 1 addition & 1 deletion packages/target-web3-v1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"ts-node": "^8.5.4",
"typescript": "3.9.0-beta",
"web3": "^1.2.6",
"typechain": "^3.0.0",
"typechain": "^4.0.0",
"test-utils": "1.0.0"
}
}

0 comments on commit 51923b3

Please sign in to comment.