Repository: 0xs34n/starknet.js (ts)

Issue:
'number' export conflicts with typescript default type 'number'
**Describe the bug**
The 'number' export in starknet has the same name as the typescript built-in 'number' type, which is confusing both for me and my code editor.

**Expected behavior**
Starknet.js should probably not use such a common namespace for an export.

---

Version: Present in `develop` branch as of Feb 16 2023.

---

NB: the same applies to 'json', though that doesn't conflict the JS object which is capitalised, and probably some other ones.
NB2: I realise this is fairly debatable but I've had to alias the import or just use a top-level `starknet` import, and it seems slightly inconvenient.

Pull request description:
fix: rename number namespace to num
## Motivation and Resolution
Closes #521 
The 'number' export has the same name as the typescript built-in 'number' type which creates confusion for code editors and users. 

## Usage related changes

- Renamed the namespace `number` to `num`

## Development related changes

<!-- How these changes affect the developers of this project - e.g. changes in testing or CI/CD. -->


## Checklist:

- [x] Performed a self-review of the code
- [x] Rebased to the last commit of the target branch (or merged it into my branch)
- [x] Linked the issues which this PR resolves
- [x] Documented the changes
- [x] Updated the docs (www)
- [x] Updated the tests
- [x] All tests are passing


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b0e391b5..9a457147 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,16 @@
+## [5.0.2](https://github.com/0xs34n/starknet.js/compare/v5.0.1...v5.0.2) (2023-03-02)
+
+### Bug Fixes
+
+- add max_fee to simulate_transaction ([95ae885](https://github.com/0xs34n/starknet.js/commit/95ae8857eb05daaeb75b4b853a0ee9377d9ac7df))
+
+## [5.0.1](https://github.com/0xs34n/starknet.js/compare/v5.0.0...v5.0.1) (2023-03-02)
+
+### Bug Fixes
+
+- add new starknet id contracts (testnet) ([343cf78](https://github.com/0xs34n/starknet.js/commit/343cf78a678b088ab4915407fe86f28fa91db6ea))
+- devnet tests ([8a5866e](https://github.com/0xs34n/starknet.js/commit/8a5866ee24b1a88ae3914fd7700d8a6e785979f1))
+
 # [5.0.0](https://github.com/0xs34n/starknet.js/compare/v4.22.0...v5.0.0) (2023-02-22)
 
 ### Bug Fixes
diff --git a/package-lock.json b/package-lock.json
index b3a93c76..19ff85e3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "starknet",
-  "version": "5.0.0",
+  "version": "5.0.2",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "starknet",
-      "version": "5.0.0",
+      "version": "5.0.2",
       "license": "MIT",
       "dependencies": {
         "@ethersproject/bytes": "^5.6.1",
diff --git a/package.json b/package.json
index 4e68e6bd..87516f09 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "starknet",
-  "version": "5.0.0",
+  "version": "5.0.2",
   "description": "JavaScript library for Starknet",
   "main": "dist/index.js",
   "module": "dist/index.mjs",
diff --git a/src/account/default.ts b/src/account/default.ts
index 486cec36..957aacbe 100644
--- a/src/account/default.ts
+++ b/src/account/default.ts
@@ -39,7 +39,7 @@ import {
   feeTransactionVersion,
   transactionVersion,
 } from '../utils/hash';
-import { BigNumberish, toBigInt, toCairoBool, toHex } from '../utils/number';
+import { BigNumberish, toBigInt, toCairoBool, toHex } from '../utils/num';
 import { parseContract } from '../utils/provider';
 import { compileCalldata, estimatedFeeToMaxFee, randomAddress } from '../utils/stark';
 import { fromCallsToExecuteCalldata } from '../utils/transaction';
diff --git a/src/account/interface.ts b/src/account/interface.ts
index 2fd8ea0f..1517aec4 100644
--- a/src/account/interface.ts
+++ b/src/account/interface.ts
@@ -24,7 +24,7 @@ import {
   TransactionSimulation,
   UniversalDeployerContractPayload,
 } from '../types';
-import { BigNumberish } from '../utils/number';
+import { BigNumberish } from '../utils/num';
 import { TypedData } from '../utils/typedData/types';
 
 export abstract class AccountInterface extends ProviderInterface {
diff --git a/src/index.ts b/src/index.ts
index c8a244dd..99b15e96 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -14,7 +14,7 @@ export * as constants from './constants';
 export * as encode from './utils/encode';
 export * as hash from './utils/hash';
 export * as json from './utils/json';
-export * as number from './utils/number';
+export * as num from './utils/num';
 export * as transaction from './utils/transaction';
 export * as stark from './utils/stark';
 export * as merkle from './utils/merkle';
@@ -24,3 +24,12 @@ export * as typedData from './utils/typedData';
 export * as ec from './utils/ec';
 export * from './utils/address';
 export * from './utils/url';
+
+/**
+ * Deprecated
+ */
+/* eslint-disable import/first */
+import * as num from './utils/num';
+
+/** @deprecated prefer the 'num' naming */
+export const number = num;
diff --git a/src/provider/default.ts b/src/provider/default.ts
index 755d2896..15b21d32 100644
--- a/src/provider/default.ts
+++ b/src/provider/default.ts
@@ -21,7 +21,7 @@ import {
   TransactionSimulationResponse,
   waitForTransactionOptions,
 } from '../types';
-import { BigNumberish } from '../utils/number';
+import { BigNumberish } from '../utils/num';
 import { ProviderInterface } from './interface';
 import { RpcProvider, RpcProviderOptions } from './rpc';
 import { SequencerProvider, SequencerProviderOptions } from './sequencer';
diff --git a/src/provider/interface.ts b/src/provider/interface.ts
index 9474f946..cd29f061 100644
--- a/src/provider/interface.ts
+++ b/src/provider/interface.ts
@@ -22,7 +22,7 @@ import type {
   TransactionSimulationResponse,
   waitForTransactionOptions,
 } from '../types';
-import type { BigNumberish } from '../utils/number';
+import type { BigNumberish } from '../utils/num';
 import { BlockIdentifier } from './utils';
 
 export abstract class ProviderInterface {
diff --git a/src/provider/rpc.ts b/src/provider/rpc.ts
index 7a309a07..0c20feea 100644
--- a/src/provider/rpc.ts
+++ b/src/provider/rpc.ts
@@ -23,7 +23,7 @@ import {
 import fetch from '../utils/fetchPonyfill';
 import { getSelectorFromName } from '../utils/hash';
 import { stringify } from '../utils/json';
-import { BigNumberish, bigNumberishArrayToHexadecimalStringArray, toHex } from '../utils/number';
+import { BigNumberish, bigNumberishArrayToHexadecimalStringArray, toHex } from '../utils/num';
 import { parseCalldata, wait } from '../utils/provider';
 import { RPCResponseParser } from '../utils/responseParser/rpc';
 import { signatureToHexArray } from '../utils/stark';
diff --git a/src/provider/sequencer.ts b/src/provider/sequencer.ts
index 34eb1e67..e45ae240 100644
--- a/src/provider/sequencer.ts
+++ b/src/provider/sequencer.ts
@@ -40,7 +40,7 @@ import {
   getHexStringArray,
   toBigInt,
   toHex,
-} from '../utils/number';
+} from '../utils/num';
 import { parseContract, wait } from '../utils/provider';
 import { SequencerAPIResponseParser } from '../utils/responseParser/sequencer';
 import { formatSignature, randomAddress, signatureToDecimalArray } from '../utils/stark';
@@ -595,6 +595,7 @@ export class SequencerProvider implements ProviderInterface {
         signature: signatureToDecimalArray(invocation.signature),
         version: toHex(invocationDetails?.version || 1),
         nonce: toHex(invocationDetails.nonce),
+        max_fee: toHex(invocationDetails?.maxFee || 0),
       }
     ).then(this.responseParser.parseFeeSimulateTransactionResponse);
   }
diff --git a/src/provider/starknetId.ts b/src/provider/starknetId.ts
index b4b34239..e78be607 100644
--- a/src/provider/starknetId.ts
+++ b/src/provider/starknetId.ts
@@ -1,4 +1,4 @@
-import { BigNumberish } from '../utils/number';
+import { BigNumberish } from '../utils/num';
 import { compileCalldata } from '../utils/stark';
 import { getStarknetIdContract, useDecoded, useEncoded } from '../utils/starknetId';
 import { ProviderInterface } from './interface';
diff --git a/src/provider/utils.ts b/src/provider/utils.ts
index 5968d33b..720a73b1 100644
--- a/src/provider/utils.ts
+++ b/src/provider/utils.ts
@@ -1,6 +1,6 @@
 /* eslint-disable max-classes-per-file */
 import type { BlockNumber, SequencerIdentifier } from '../types';
-import { BigNumberish, isHex, toHex } from '../utils/number';
+import { BigNumberish, isHex, toHex } from '../utils/num';
 
 /**
  *
diff --git a/src/signer/default.ts b/src/signer/default.ts
index 1c8e56fc..c6f7a524 100644
--- a/src/signer/default.ts
+++ b/src/signer/default.ts
@@ -7,7 +7,7 @@ import {
   calculateDeployAccountTransactionHash,
   calculateTransactionHash,
 } from '../utils/hash';
-import { toHex } from '../utils/number';
+import { toHex } from '../utils/num';
 import { fromCallsToExecuteCalldata } from '../utils/transaction';
 import { TypedData, getMessageHash } from '../utils/typedData';
 import { SignerInterface } from './interface';
diff --git a/src/types/account.ts b/src/types/account.ts
index 09556515..60c0b261 100644
--- a/src/types/account.ts
+++ b/src/types/account.ts
@@ -1,5 +1,5 @@
 import { BlockIdentifier } from '../provider/utils';
-import { BigNumberish } from '../utils/number';
+import { BigNumberish } from '../utils/num';
 import {
   DeclareTransactionReceiptResponse,
   EstimateFeeResponse,
diff --git a/src/types/api/index.ts b/src/types/api/index.ts
index e7d055e6..9ee48fe9 100644
--- a/src/types/api/index.ts
+++ b/src/types/api/index.ts
@@ -1,4 +1,4 @@
-import { BigNumberish } from '../../utils/number';
+import { BigNumberish } from '../../utils/num';
 import { Signature } from '../lib';
 
 export type Calldata = string[];
diff --git a/src/types/api/sequencer.ts b/src/types/api/sequencer.ts
index d1f0222a..7dbb9630 100644
--- a/src/types/api/sequencer.ts
+++ b/src/types/api/sequencer.ts
@@ -1,5 +1,5 @@
 import { BlockIdentifier } from '../../provider/utils';
-import { BigNumberish } from '../../utils/number';
+import { BigNumberish } from '../../utils/num';
 import {
   Abi,
   AllowArray,
@@ -258,7 +258,7 @@ export namespace Sequencer {
     fee_estimation: Sequencer.EstimateFeeResponse;
   };
 
-  export type SimulateTransaction = Omit<InvokeFunctionTransaction, 'max_fee' | 'entry_point_type'>;
+  export type SimulateTransaction = Omit<InvokeFunctionTransaction, 'entry_point_type'>;
 
   export type EstimateFeeRequestBulk = AllowArray<
     InvokeEstimateFee | DeclareEstimateFee | DeployEstimateFee | DeployAccountEstimateFee
diff --git a/src/types/lib.ts b/src/types/lib.ts
index 69b53400..35e9750a 100644
--- a/src/types/lib.ts
+++ b/src/types/lib.ts
@@ -1,5 +1,5 @@
 import { weierstrass } from '../utils/ec';
-import type { BigNumberish } from '../utils/number';
+import type { BigNumberish } from '../utils/num';
 import { RPC } from './api/rpc';
 
 // Common Signature Type which needs to be imported from weierstrass
diff --git a/src/types/signer.ts b/src/types/signer.ts
index 00c1b24a..53506ec9 100644
--- a/src/types/signer.ts
+++ b/src/types/signer.ts
@@ -1,5 +1,5 @@
 import { StarknetChainId } from '../constants';
-import { BigNumberish } from '../utils/number';
+import { BigNumberish } from '../utils/num';
 import { DeployAccountContractPayload, InvocationsDetails } from './lib';
 
 export interface InvocationsSignerDetails extends Required<InvocationsDetails> {
diff --git a/src/utils/address.ts b/src/utils/address.ts
index 607c02e8..1188ded0 100644
--- a/src/utils/address.ts
+++ b/src/utils/address.ts
@@ -4,7 +4,7 @@ import { arrayify } from '@ethersproject/bytes';
 import { MASK_251, ZERO } from '../constants';
 import { addHexPrefix, removeHexPrefix } from './encode';
 import { keccakBn } from './hash';
-import { BigNumberish, assertInRange, toHex } from './number';
+import { BigNumberish, assertInRange, toHex } from './num';
 
 export function addAddressPadding(address: BigNumberish): string {
   return addHexPrefix(removeHexPrefix(toHex(address)).padStart(64, '0'));
diff --git a/src/utils/calldata/cairo.ts b/src/utils/calldata/cairo.ts
index 2b7302a5..77d4a5c1 100644
--- a/src/utils/calldata/cairo.ts
+++ b/src/utils/calldata/cairo.ts
@@ -1,5 +1,5 @@
 import { abiStructs } from '../../types';
-import { BigNumberish, isBigInt, isHex, isStringWholeNumber } from '../number';
+import { BigNumberish, isBigInt, isHex, isStringWholeNumber } from '../num';
 import { encodeShortString, isShortString, isText } from '../shortString';
 import { UINT_128_MAX, Uint256, isUint256 } from '../uint256';
 
diff --git a/src/utils/calldata/formatter.ts b/src/utils/calldata/formatter.ts
index c1b9a736..19d15253 100644
--- a/src/utils/calldata/formatter.ts
+++ b/src/utils/calldata/formatter.ts
@@ -1,4 +1,4 @@
-import { isBigInt } from '../number';
+import { isBigInt } from '../num';
 import { decodeShortString } from '../shortString';
 
 const guard = {
diff --git a/src/utils/calldata/index.ts b/src/utils/calldata/index.ts
index 9b751142..78d81c1b 100644
--- a/src/utils/calldata/index.ts
+++ b/src/utils/calldata/index.ts
@@ -1,6 +1,6 @@
 import { Abi, AbiEntry, Args, Calldata, FunctionAbi, abiStructs } from '../../types';
 import assert from '../assert';
-import { isBigInt } from '../number';
+import { isBigInt } from '../num';
 import { isLongText, splitLongString } from '../shortString';
 import { felt, isLen } from './cairo';
 import formatter from './formatter';
diff --git a/src/utils/calldata/requestParser.ts b/src/utils/calldata/requestParser.ts
index e8c02a87..4c10d427 100644
--- a/src/utils/calldata/requestParser.ts
+++ b/src/utils/calldata/requestParser.ts
@@ -1,5 +1,5 @@
 import { AbiEntry, ParsedStruct, Tupled, abiStructs } from '../../types';
-import { BigNumberish } from '../number';
+import { BigNumberish } from '../num';
 import { isText, splitLongString } from '../shortString';
 import { felt, isTypeArray, isTypeFeltArray, isTypeStruct, isTypeTuple } from './cairo';
 import extractTupleMemberTypes from './tuple';
diff --git a/src/utils/calldata/responseParser.ts b/src/utils/calldata/responseParser.ts
index e07cad05..97e09eac 100644
--- a/src/utils/calldata/responseParser.ts
+++ b/src/utils/calldata/responseParser.ts
@@ -1,5 +1,5 @@
 import { AbiEntry, Args, ParsedStruct, abiStructs } from '../../types';
-import { BigNumberish } from '../number';
+import { BigNumberish } from '../num';
 import { isLen, isTypeArray, isTypeTuple } from './cairo';
 import extractTupleMemberTypes from './tuple';
 
diff --git a/src/utils/calldata/validate.ts b/src/utils/calldata/validate.ts
index 65b04dc7..b01266d9 100644
--- a/src/utils/calldata/validate.ts
+++ b/src/utils/calldata/validate.ts
@@ -4,7 +4,7 @@ import { AbiEntry, FunctionAbi, abiStructs } from '../../types';
  * Flow: Determine type from abi and than validate against parameter
  */
 import assert from '../assert';
-import { BigNumberish } from '../number';
+import { BigNumberish } from '../num';
 import { isLongText } from '../shortString';
 import { isLen, isTypeArray, isTypeFelt, isTypeStruct, isTypeTuple } from './cairo';
 
diff --git a/src/utils/events.ts b/src/utils/events.ts
index 0f618ca1..0f78604e 100644
--- a/src/utils/events.ts
+++ b/src/utils/events.ts
@@ -1,6 +1,6 @@
 import { UDC } from '../constants';
 import { InvokeTransactionReceiptResponse } from '../types/provider';
-import { cleanHex } from './number';
+import { cleanHex } from './num';
 
 /**
  * Parse Transaction Receipt Event from UDC invoke transaction and
diff --git a/src/utils/hash.ts b/src/utils/hash.ts
index 98011663..fbfdecfa 100644
--- a/src/utils/hash.ts
+++ b/src/utils/hash.ts
@@ -9,7 +9,7 @@ import { felt } from './calldata/cairo';
 import { starkCurve } from './ec';
 import { addHexPrefix, buf2hex, removeHexPrefix, utf8ToArray } from './encode';
 import { parse, stringify } from './json';
-import { BigNumberish, isHex, isStringWholeNumber, toBigInt, toHex, toHexString } from './number';
+import { BigNumberish, isHex, isStringWholeNumber, toBigInt, toHex, toHexString } from './num';
 import { encodeShortString } from './shortString';
 
 export const transactionVersion = 1n;
diff --git a/src/utils/merkle.ts b/src/utils/merkle.ts
index fe5f0a7c..7f254b9e 100644
--- a/src/utils/merkle.ts
+++ b/src/utils/merkle.ts
@@ -1,5 +1,5 @@
 import { starkCurve } from './ec';
-import { toBigInt } from './number';
+import { toBigInt } from './num';
 
 export class MerkleTree {
   public leaves: string[];
diff --git a/src/utils/number.ts b/src/utils/num.ts
similarity index 100%
rename from src/utils/number.ts
rename to src/utils/num.ts
diff --git a/src/utils/provider.ts b/src/utils/provider.ts
index 26849764..329687cf 100644
--- a/src/utils/provider.ts
+++ b/src/utils/provider.ts
@@ -1,6 +1,6 @@
 import { CompiledContract, ContractClass, RawCalldata } from '../types';
 import { parse } from './json';
-import { isHex, toHex } from './number';
+import { isHex, toHex } from './num';
 import { compressProgram } from './stark';
 
 export function wait(delay: number) {
diff --git a/src/utils/responseParser/rpc.ts b/src/utils/responseParser/rpc.ts
index f9e314e0..bb8e6390 100644
--- a/src/utils/responseParser/rpc.ts
+++ b/src/utils/responseParser/rpc.ts
@@ -9,7 +9,7 @@ import {
   GetTransactionResponse,
   RPC,
 } from '../../types';
-import { toBigInt } from '../number';
+import { toBigInt } from '../num';
 import { ResponseParser } from '.';
 
 type RpcGetBlockResponse = RPC.GetBlockWithTxHashesResponse & {
diff --git a/src/utils/responseParser/sequencer.ts b/src/utils/responseParser/sequencer.ts
index 16826dd1..a81b602d 100644
--- a/src/utils/responseParser/sequencer.ts
+++ b/src/utils/responseParser/sequencer.ts
@@ -16,7 +16,7 @@ import {
   StateUpdateResponse,
   TransactionSimulationResponse,
 } from '../../types';
-import { toBigInt } from '../number';
+import { toBigInt } from '../num';
 import { parseSignature } from '../stark';
 import { ResponseParser } from '.';
 
diff --git a/src/utils/shortString.ts b/src/utils/shortString.ts
index e3e75de7..07cc9fe2 100644
--- a/src/utils/shortString.ts
+++ b/src/utils/shortString.ts
@@ -1,5 +1,5 @@
 import { addHexPrefix, removeHexPrefix } from './encode';
-import { isHex, isStringWholeNumber } from './number';
+import { isHex, isStringWholeNumber } from './num';
 
 const TEXT_TO_FELT_MAX_LEN = 31;
 
diff --git a/src/utils/stark.ts b/src/utils/stark.ts
index a77c8b30..08e076ea 100644
--- a/src/utils/stark.ts
+++ b/src/utils/stark.ts
@@ -16,7 +16,7 @@ import {
   bigNumberishArrayToHexadecimalStringArray,
   toBigInt,
   toHex,
-} from './number';
+} from './num';
 
 /**
  * Function to compress compiled cairo program
diff --git a/src/utils/starknetId.ts b/src/utils/starknetId.ts
index 0799704d..54d0f45c 100644
--- a/src/utils/starknetId.ts
+++ b/src/utils/starknetId.ts
@@ -104,7 +104,7 @@ export function getStarknetIdContract(chainId: StarknetChainId): string {
   const starknetIdMainnetContract =
     '0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678';
   const starknetIdTestnetContract =
-    '0x05cf267a0af6101667013fc6bd3f6c11116a14cda9b8c4b1198520d59f900b17';
+    '0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce';
 
   switch (chainId) {
     case StarknetChainId.SN_MAIN:
diff --git a/src/utils/transaction.ts b/src/utils/transaction.ts
index 4374891e..90c0793c 100644
--- a/src/utils/transaction.ts
+++ b/src/utils/transaction.ts
@@ -1,6 +1,6 @@
 import { Call, ParsedStruct } from '../types';
 import { getSelectorFromName } from './hash';
-import { BigNumberish, bigNumberishArrayToDecimalStringArray, toBigInt } from './number';
+import { BigNumberish, bigNumberishArrayToDecimalStringArray, toBigInt } from './num';
 
 /**
  * Transforms a list of Calls, each with their own calldata, into
diff --git a/src/utils/typedData/index.ts b/src/utils/typedData/index.ts
index 7622b9a7..b6cedf00 100644
--- a/src/utils/typedData/index.ts
+++ b/src/utils/typedData/index.ts
@@ -1,6 +1,6 @@
 import { computeHashOnElements, getSelectorFromName } from '../hash';
 import { MerkleTree } from '../merkle';
-import { BigNumberish, isHex, toHex } from '../number';
+import { BigNumberish, isHex, toHex } from '../num';
 import { encodeShortString } from '../shortString';
 import { StarkNetMerkleType, StarkNetType, TypedData } from './types';
 import { validateTypedData } from './utils';
diff --git a/src/utils/uint256.ts b/src/utils/uint256.ts
index b6f11477..78bdfd1e 100644
--- a/src/utils/uint256.ts
+++ b/src/utils/uint256.ts
@@ -1,6 +1,6 @@
 /* eslint-disable no-bitwise */
 import { addHexPrefix } from './encode';
-import { BigNumberish, toBigInt } from './number';
+import { BigNumberish, toBigInt } from './num';
 
 // Represents an integer in the range [0, 2^256).
 export interface Uint256 {
diff --git a/www/code-examples/account.js b/www/code-examples/account.js
index 2e62332d..0a3567ee 100644
--- a/www/code-examples/account.js
+++ b/www/code-examples/account.js
@@ -5,7 +5,7 @@ import * as starknet from 'starknet';
 
 const keyPair = starknet.ec.genKeyPair();
 const starkKey = starknet.ec.getStarkKey(keyPair);
-const starkKeyInt = starknet.number.toBigInt(starknet.encode.removeHexPrefix(starkKey), 16);
+const starkKeyInt = starknet.num.toBigInt(starknet.encode.removeHexPrefix(starkKey), 16);
 
 const { address: walletAddressLocal } = await provider.deployContract({
   contract: COMPILED_WALLET_CONTRACT_JSON,
diff --git a/www/code-examples/erc20.js b/www/code-examples/erc20.js
index 0e883ae2..451d883d 100644
--- a/www/code-examples/erc20.js
+++ b/www/code-examples/erc20.js
@@ -2,7 +2,7 @@ import * as starknet from 'starknet';
 
 const keyPair = starknet.ec.genKeyPair();
 const starkKey = starknet.ec.getStarkKey(keyPair);
-const starkKeyInt = starknet.number.toBigInt(starknet.encode.removeHexPrefix(starkKey), 16);
+const starkKeyInt = starknet.num.toBigInt(starknet.encode.removeHexPrefix(starkKey), 16);
 
 const deployWalletTx = await provider.deployContract({
   contract: COMPILED_WALLET_CONTRACT_JSON,
diff --git a/www/docs/API/utils.md b/www/docs/API/utils.md
index 9a2bb548..a8eda1f3 100644
--- a/www/docs/API/utils.md
+++ b/www/docs/API/utils.md
@@ -104,7 +104,7 @@ Returns a BigInt.
 
 ---
 
-## **number**
+## **num**
 
 Various number formatting functions.
 
diff --git a/www/docs/guides/define_call_message.md b/www/docs/guides/define_call_message.md
index 48c9aad6..e9f2347b 100644
--- a/www/docs/guides/define_call_message.md
+++ b/www/docs/guides/define_call_message.md
@@ -83,7 +83,7 @@ const myCallData = [
     "0x2345",
     bn1.toString(), // BigInt converted to string
     bi1.toString(), // BigInt converted to string
-    number.toBN(num1).toString(), // Number 53 bits converted to string
+    num.toBN(num1).toString(), // Number 53 bits converted to string
     initialUint256.low.toString(), initialUint256.high.toString(),
     coord.x0.toString(), coord.y0.toString(), coord.z0.toString(),
     shortString.encodeShortString('A'),
diff --git a/www/docs/guides/events.md b/www/docs/guides/events.md
index 7f44964d..f6654bf7 100644
--- a/www/docs/guides/events.md
+++ b/www/docs/guides/events.md
@@ -61,7 +61,7 @@ const txReceiptDeployTest = await provider.waitForTransaction(resu.transaction_h
 In Typescript, you have to change a little the code :
 
 ```typescript
-import { number, InvokeTransactionReceiptResponse } from "starknet";
+import { num, InvokeTransactionReceiptResponse } from "starknet";
 
 const resu = await myTestContract.invoke("my_func");
 const txReceiptDeployTest: InvokeTransactionReceiptResponse = await provider.waitForTransaction(resu.transaction_hash);
@@ -100,7 +100,7 @@ Use the contract deployment address, to filter the events and read the data from
 
 ```typescript
 const event = txReceiptDeployTest.events.find(
-  (it) => number.cleanHex(it.from_address) === number.cleanHex(testContractAddress)
+  (it) => num.cleanHex(it.from_address) === num.cleanHex(testContractAddress)
 ) || {data: []};
 
 const eventD1 = event.data[0];
diff --git a/www/docs/guides/signature.md b/www/docs/guides/signature.md
index 4609272a..36299314 100644
--- a/www/docs/guides/signature.md
+++ b/www/docs/guides/signature.md
@@ -13,7 +13,7 @@ Your message has to be an array of `BigNumberish`. First calculate the hash of t
 > If the message does not respect some safety rules of composition, this method could be a way of attack of your smart contract. If you have any doubts, prefer the [EIP712 like method](#sign-and-verify-following-eip712), which is safe, but is also more complicated.
 
 ```typescript
-import {ec, hash, number, json, Contract } from "starknet";
+import {ec, hash, num, json, Contract } from "starknet";
 
 const privateKey = "0x1234567890987654321";
 const starkKeyPair = ec.getKeyPair(privateKey);


Test patch:
diff --git a/__tests__/account.test.ts b/__tests__/account.test.ts
index dd1b45a2..9dccaf16 100644
--- a/__tests__/account.test.ts
+++ b/__tests__/account.test.ts
@@ -3,7 +3,7 @@ import { Account, Contract, Provider, TransactionStatus, ec, stark } from '../sr
 import { uint256 } from '../src/utils/calldata/cairo';
 import { parseUDCEvent } from '../src/utils/events';
 import { calculateContractAddressFromHash, feeTransactionVersion } from '../src/utils/hash';
-import { cleanHex, hexToDecimalString, toBigInt, toHex } from '../src/utils/number';
+import { cleanHex, hexToDecimalString, toBigInt, toHex } from '../src/utils/num';
 import { encodeShortString } from '../src/utils/shortString';
 import { randomAddress } from '../src/utils/stark';
 import {
diff --git a/__tests__/contract.test.ts b/__tests__/contract.test.ts
index b1300d2c..4f185573 100644
--- a/__tests__/contract.test.ts
+++ b/__tests__/contract.test.ts
@@ -2,7 +2,7 @@ import { Contract, ContractFactory, json, stark } from '../src';
 import { CallData } from '../src/utils/calldata';
 import { felt, tuple, uint256 } from '../src/utils/calldata/cairo';
 import { getSelectorFromName } from '../src/utils/hash';
-import { BigNumberish, hexToDecimalString, toBigInt } from '../src/utils/number';
+import { BigNumberish, hexToDecimalString, toBigInt } from '../src/utils/num';
 import { encodeShortString } from '../src/utils/shortString';
 import { compileCalldata } from '../src/utils/stark';
 import { uint256ToBN } from '../src/utils/uint256';
diff --git a/__tests__/defaultProvider.test.ts b/__tests__/defaultProvider.test.ts
index 9f462147..f0944a1b 100644
--- a/__tests__/defaultProvider.test.ts
+++ b/__tests__/defaultProvider.test.ts
@@ -1,5 +1,5 @@
 import { BlockNumber, GetBlockResponse, LibraryError, Provider, stark } from '../src';
-import { toBigInt } from '../src/utils/number';
+import { toBigInt } from '../src/utils/num';
 import { encodeShortString } from '../src/utils/shortString';
 import {
   compiledErc20,
diff --git a/__tests__/fixtures.ts b/__tests__/fixtures.ts
index e281ca9e..94b5a952 100644
--- a/__tests__/fixtures.ts
+++ b/__tests__/fixtures.ts
@@ -3,7 +3,7 @@ import path from 'path';
 
 import { Account, ProviderInterface, RpcProvider, SequencerProvider, json } from '../src';
 import { CompiledContract, waitForTransactionOptions } from '../src/types';
-import { toHex } from '../src/utils/number';
+import { toHex } from '../src/utils/num';
 
 const readContract = (name: string): CompiledContract =>
   json.parse(
diff --git a/__tests__/utils/stark.test.ts b/__tests__/utils/stark.test.ts
index e5f98415..4c6d10b0 100644
--- a/__tests__/utils/stark.test.ts
+++ b/__tests__/utils/stark.test.ts
@@ -1,7 +1,7 @@
 import fs from 'fs';
 
 import { RawArgs, json, stark } from '../../src';
-import { toBigInt, toHex } from '../../src/utils/number';
+import { toBigInt, toHex } from '../../src/utils/num';
 
 const compiledAccount = json.parse(fs.readFileSync('./__mocks__/Account.json').toString('ascii'));
 
diff --git a/__tests__/utils/starknetId.test.ts b/__tests__/utils/starknetId.test.ts
index 04588a52..fa21f5d8 100644
--- a/__tests__/utils/starknetId.test.ts
+++ b/__tests__/utils/starknetId.test.ts
@@ -41,7 +41,7 @@ describe('Should tets StarknetId utils', () => {
 
   test('Should test getStarknetIdContract', () => {
     expect(getStarknetIdContract(StarknetChainId.SN_GOERLI)).toBe(
-      '0x05cf267a0af6101667013fc6bd3f6c11116a14cda9b8c4b1198520d59f900b17'
+      '0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce'
     );
 
     expect(() => {
diff --git a/__tests__/utils/typedData.test.ts b/__tests__/utils/typedData.test.ts
index 09ca6be4..690408bc 100644
--- a/__tests__/utils/typedData.test.ts
+++ b/__tests__/utils/typedData.test.ts
@@ -1,10 +1,10 @@
 import typedDataExample from '../../__mocks__/typedDataExample.json';
 import typedDataSessionExample from '../../__mocks__/typedDataSessionExample.json';
 import typedDataStructArrayExample from '../../__mocks__/typedDataStructArrayExample.json';
-import { number } from '../../src';
+import { num } from '../../src';
 import { getSelectorFromName } from '../../src/utils/hash';
 import { MerkleTree } from '../../src/utils/merkle';
-import { BigNumberish } from '../../src/utils/number';
+import { BigNumberish } from '../../src/utils/num';
 import {
   StarkNetDomain,
   encodeType,
@@ -155,7 +155,7 @@ describe('typedData', () => {
   }
   function stringToStringStruct(str: string): StringStruct {
     const len = str.length;
-    const data = str.split('').map((char) => number.toHex(char.charCodeAt(0)));
+    const data = str.split('').map((char) => num.toHex(char.charCodeAt(0)));
     return { len, data };
   }
 
diff --git a/__tests__/utils/utils.test.ts b/__tests__/utils/utils.test.ts
index 600736d4..e41e8375 100644
--- a/__tests__/utils/utils.test.ts
+++ b/__tests__/utils/utils.test.ts
@@ -1,4 +1,4 @@
-import { constants, ec, hash, number, stark } from '../../src';
+import { constants, ec, hash, num, stark } from '../../src';
 import { Block } from '../../src/provider/utils';
 
 const { IS_BROWSER } = constants;
@@ -9,15 +9,15 @@ test('isNode', () => {
 
 describe('hexToDecimalString()', () => {
   test('parse 0xa23', () => {
-    expect(number.hexToDecimalString('0xa23')).toBe('2595');
+    expect(num.hexToDecimalString('0xa23')).toBe('2595');
   });
 });
 
 describe('cleanHex()', () => {
   test('parse 0xa23', () => {
-    expect(number.cleanHex('0x023Ab')).toBe('0x23ab');
-    expect(number.cleanHex('0x000023Ab')).toBe('0x23ab');
-    expect(number.cleanHex('0x23Ab')).toBe('0x23ab');
+    expect(num.cleanHex('0x023Ab')).toBe('0x23ab');
+    expect(num.cleanHex('0x000023Ab')).toBe('0x23ab');
+    expect(num.cleanHex('0x23Ab')).toBe('0x23ab');
   });
 });
 
@@ -57,9 +57,9 @@ describe('computeHashOnElements()', () => {
   });
   test('should return valid hash for valid array', () => {
     const res = hash.computeHashOnElements([
-      number.toBigInt(123782376),
-      number.toBigInt(213984),
-      number.toBigInt(128763521321),
+      num.toBigInt(123782376),
+      num.toBigInt(213984),
+      num.toBigInt(128763521321),
     ]);
     expect(res).toMatchInlineSnapshot(
       `"0x7b422405da6571242dfc245a43de3b0fe695e7021c148b918cd9cdb462cac59"`