diff --git a/docs/docs/guides/web3_upgrade_guide/1.x/accounts_migration_guide.md b/docs/docs/guides/web3_upgrade_guide/1.x/accounts_migration_guide.md index 9446135ef4b..f6505e460f8 100644 --- a/docs/docs/guides/web3_upgrade_guide/1.x/accounts_migration_guide.md +++ b/docs/docs/guides/web3_upgrade_guide/1.x/accounts_migration_guide.md @@ -34,3 +34,14 @@ const wallet = web3.eth.accounts.wallet.create(1, 'optionalEntropy'); // entropy const account = web3.eth.accounts.wallet.create(1, 'optionalEntropy'); // will result in an error const account = web3.eth.accounts.wallet.create(); // correct way ``` + +## stripHexPrefix method + +In 1.x `stripHexPrefix` method is located in the `web3-utils` package, in 4.x this has been moved to `web3-eth-accounts` + +```typescript +import { stripHexPrefix } from 'web3-eth-accounts'; + +console.log(stripHexPrefix('0x123')); // "123" + +``` diff --git a/docs/docs/guides/web3_upgrade_guide/1.x/web3_utils_migration_guide.md b/docs/docs/guides/web3_upgrade_guide/1.x/web3_utils_migration_guide.md index 04886c52351..0b977890e6e 100644 --- a/docs/docs/guides/web3_upgrade_guide/1.x/web3_utils_migration_guide.md +++ b/docs/docs/guides/web3_upgrade_guide/1.x/web3_utils_migration_guide.md @@ -79,6 +79,16 @@ isHex('-0x'); // in 1.x used to return `true`. But changed in 4.x to return `fal isHexStrict('-0x'); // in 1.x used to return `true`. But changed in 4.x to return `false` // `false` +``` +## stripHexPrefix method + +In 1.x `stripHexPrefix` method is located in the `web3-utils` package, in 4.x this has been moved to `web3-eth-accounts` + +```typescript +import { stripHexPrefix } from 'web3-eth-accounts'; + +console.log(stripHexPrefix('0x123')); // "123" + ``` ## Other functions