Skip to content

Commit

Permalink
chore: use web3-utils instead of bignumber.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugoo committed Aug 3, 2023
1 parent 239bbf0 commit 0349a7b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"web3": "^1.10.0"
},
"dependencies": {
"bignumber.js": "^9.1.1",
"ethereumjs-util": "^7.1.5",
"web3-eth-abi": "^1.10.0",
"web3-providers-http": "^1.10.0",
Expand Down
9 changes: 4 additions & 5 deletions src/lib/encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @author Hugo Masclet <@Hugoo>
* @author Callum Grindle <@CallumGrindle>
* @author Jean Cavallera <@CJ42>
* @date 2020
* @date 2023
*/

/*
Expand All @@ -41,10 +41,9 @@ import {
hexToBytes,
bytesToHex,
toHex,
toBN,
} from 'web3-utils';

import BigNumber from 'bignumber.js';

import { JSONURLDataToEncode, URLDataWithHash } from '../types';
import { AssetURLEncode } from '../types/encodeData';

Expand Down Expand Up @@ -403,7 +402,7 @@ const valueTypeEncodingMap = {
);
}

return BigNumber(value).toNumber();
return toBN(value).toNumber();
},
},
uint256: {
Expand All @@ -423,7 +422,7 @@ const valueTypeEncodingMap = {
);
}

return BigNumber(value).toNumber();
return toBN(value).toNumber();
},
},
bytes32: {
Expand Down

0 comments on commit 0349a7b

Please sign in to comment.