Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
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
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,10 @@ should use 4.0.1-alpha.0 for testing.

- Add optional `innerError` property to the abstract class `Web3Error`. This `innerError` could be `Error`, `Error[]` or `undefined`. (#5435) (#5434)
- The class `Web3ContractError` is moved to this package from `web3-eth-contract`. (#5434)
- Added the error code `ERR_TX_SIGNING` and used it inside `TransactionSigningError` (#5462)
- Added the error code `ERR_TX_GAS_MISMATCH` and used it inside `TransactionGasMismatchError` (#5462)
- Added `SignatureError` to `web3-errors/src/errors/signature_errors.ts` (moved from `web3-eth/src/errors.ts`) (#5462)
- Added the errors' classes to `web3-errors/src/errors/transaction_errors.ts` from `web3-eth/src/errors.ts` (#5462)

#### web3-eth-abi

Expand All @@ -755,12 +759,28 @@ should use 4.0.1-alpha.0 for testing.
- Decoding error data, using Error ABI if available, according to EIP-838. (#5434)
- The class `Web3ContractError` is moved from this package to `web3-error`. (#5434)

### Changed

#### web3-error

- Moved `SignerError` from `web3-errors/src/errors/signature_errors.ts` to `web3-errors/src/errors/transaction_errors.ts`, and renamed it to `TransactionSigningError` (#5462)

### Fixed

#### web3-error

- Corrected the error code for `JSONRPC_ERR_UNAUTHORIZED` to be `4100` (#5462)

#### web3-eth-contract

- According to the latest change in `web3-eth-abi`, the decoded values of the large numbers, returned from function calls or events, are now available as `BigInt`. (#5435)

#### web3-eth-abi

- Return `BigInt` instead of `string` when decoding function parameters for large numbers, such as `uint256`. (#5435)

### Removed

#### web3-eth

- Moved the errors' classes from `web3-eth/src/errors.ts` to `web3-errors/src/errors/transaction_errors.ts` (#5462)
12 changes: 12 additions & 0 deletions packages/web3-errors/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add optional `innerError` property to the abstract class `Web3Error`. This `innerError` could be `Error`, `Error[]` or `undefined`. (#5435) (#5434)
- The class `Web3ContractError` is moved to this package from `web3-eth-contract`. (#5434)
- Added the error code `ERR_TX_SIGNING` and used it inside `TransactionSigningError` (#5462)
- Added the error code `ERR_TX_GAS_MISMATCH` and used it inside `TransactionGasMismatchError` (#5462)
- Added `SignatureError` to `web3-errors/src/errors/signature_errors.ts` (moved from `web3-eth/src/errors.ts`) (#5462)
- Added the errors' classes to `web3-errors/src/errors/transaction_errors.ts` from `web3-eth/src/errors.ts` (#5462)

### Changed

- Corrected the error code for `JSONRPC_ERR_UNAUTHORIZED` to be `4100` (#5462)

### Fixed

- Moved `SignerError` from `web3-errors/src/errors/signature_errors.ts` to `web3-errors/src/errors/transaction_errors.ts`, and renamed it to `TransactionSigningError` (#5462)
5 changes: 4 additions & 1 deletion packages/web3-errors/src/error_codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export const ERR_TX_LOCAL_WALLET_NOT_AVAILABLE = 429;
export const ERR_TX_NOT_FOUND = 430;
export const ERR_TX_SEND_TIMEOUT = 431;

export const ERR_TX_SIGNING = 433;
export const ERR_TX_GAS_MISMATCH = 434;

// Connection error codes
export const ERR_CONN = 500;
export const ERR_CONN_INVALID = 501;
Expand Down Expand Up @@ -113,7 +116,7 @@ export const GENESIS_BLOCK_NUMBER = '0x0';

// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md#provider-errors
export const JSONRPC_ERR_REJECTED_REQUEST = 4001;
export const JSONRPC_ERR_UNAUTHORIZED = 4001;
export const JSONRPC_ERR_UNAUTHORIZED = 4100;
export const JSONRPC_ERR_UNSUPPORTED_METHOD = 4200;
export const JSONRPC_ERR_DISCONNECTED = 4900;
export const JSONRPC_ERR_CHAIN_DISCONNECTED = 4901;
Expand Down
7 changes: 2 additions & 5 deletions packages/web3-errors/src/errors/signature_errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/

import { ERR_SIGNATURE_FAILED } from '../error_codes';
import { Web3Error } from '../web3_error_base';
import { InvalidValueError } from '../web3_error_base';

export class SignerError extends Web3Error {
export class SignatureError extends InvalidValueError {
public code = ERR_SIGNATURE_FAILED;
public constructor(errorDetails: string) {
super(`Invalid signature. "${errorDetails}"`);
}
}
Loading