Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use web3-utils instead of bignumber.js #304

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading