Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1573 from bancorprotocol/web3Update
Browse files Browse the repository at this point in the history
update web3 to v1.5.0
  • Loading branch information
RanCohenn authored Aug 4, 2021
2 parents 374177b + 1d17897 commit d3faffa
Show file tree
Hide file tree
Showing 3 changed files with 251 additions and 93 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"eos-transit-tokenpocket-provider": "^4.0.1",
"eos-transit-whalevault-provider": "^4.0.1",
"eosjs": "21.0.4",
"eth-multicall": "^1.3.13",
"eth-multicall": "^1.4.0",
"fast-sort": "^3.0.2",
"ipfs-http-client": "49.0.4",
"json-bigint": "^1.0.0",
Expand All @@ -79,7 +79,7 @@
"vuex-module-decorators": "^1.0.1",
"vuex-router-sync": "^5.0.0",
"waait": "^1.0.5",
"web3": "1.3.6"
"web3": "1.5.0"
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.14.0",
Expand Down
15 changes: 11 additions & 4 deletions src/api/eth/contractTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,22 @@ import { Proposal } from "@/store/modules/governance/ethGovernance";
import Web3 from "web3";
import { web3 } from "@/api/web3";
import { StringRfq } from "@/api/observables/keeperDao";
import { Contract } from "web3-eth-contract";

const buildContract = (
interface ContractTyped<T> extends Contract {
methods: T;
}

const buildContract = <T>(
abi: AbiItem[],
contractAddress?: string,
injectedWeb3?: Web3
) =>
contractAddress
): ContractTyped<T> =>
(contractAddress
? new (injectedWeb3 || web3).eth.Contract(abi, contractAddress)
: new (injectedWeb3 || web3).eth.Contract(abi);
: new (injectedWeb3 || web3).eth.Contract(
abi
)) as unknown as ContractTyped<T>;

interface TokenContractType {
symbol: () => CallReturn<string>;
Expand Down
Loading

0 comments on commit d3faffa

Please sign in to comment.