From f7ec3180786899cabaa97ebc40f89fd171a10651 Mon Sep 17 00:00:00 2001 From: XiaoBei Date: Fri, 14 Mar 2025 20:44:41 +0800 Subject: [PATCH 01/17] update copyright year (#1340) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0bdbdc449..d1f7f8487 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,6 @@ This library would not be possible without these rockstars. ## 📜 License -Copyright (c) 2024 StarkWare +Copyright (c) 2025 StarkWare Licensed under the [MIT license](https://github.com/starknet-io/starknet.js/blob/main/LICENSE). From ac7227dcde54620da7e1ad54a3414ade818e84d1 Mon Sep 17 00:00:00 2001 From: crStiv Date: Fri, 14 Mar 2025 13:47:37 +0100 Subject: [PATCH 02/17] Update uint256.ts (#1330) --- src/utils/cairoDataTypes/uint256.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/cairoDataTypes/uint256.ts b/src/utils/cairoDataTypes/uint256.ts index 1c51c4c63..57fd76478 100644 --- a/src/utils/cairoDataTypes/uint256.ts +++ b/src/utils/cairoDataTypes/uint256.ts @@ -55,7 +55,7 @@ export class CairoUint256 { } /** - * Validate if BigNumberish can be represented as Unit256 + * Validate if BigNumberish can be represented as Uint256 */ static validate(bigNumberish: BigNumberish) { const bigInt = BigInt(bigNumberish); @@ -65,7 +65,7 @@ export class CairoUint256 { } /** - * Validate if low and high can be represented as Unit256 + * Validate if low and high can be represented as Uint256 */ static validateProps(low: BigNumberish, high: BigNumberish) { const bigIntLow = BigInt(low); @@ -80,7 +80,7 @@ export class CairoUint256 { } /** - * Check if BigNumberish can be represented as Unit256 + * Check if BigNumberish can be represented as Uint256 */ static is(bigNumberish: BigNumberish) { try { From 11818dea009b491ea668c17e8536035d41eae751 Mon Sep 17 00:00:00 2001 From: Lubov66 Date: Fri, 14 Mar 2025 14:53:40 +0200 Subject: [PATCH 03/17] chore: replaced broken discord link (#1326) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Petar Penović --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6803fa0bf..c037ac322 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -111,4 +111,4 @@ For major changes that markedly transform the existing API or significantly alte If you want to contribute but have any questions, concerns or doubts, feel free to ping maintainers. Ideally create a pull request with `WIP` (Work in progress) in its title and ask questions in the pull request description. -You can also ask your query on our dedicated channel for [Starknet.js](https://discord.com/channels/793094838509764618/1270119831559078061) on the [Starknet Discord](https://discord.com/invite/Ft6Xtzdg) +You can also ask your query on our dedicated channel for [Starknet.js](https://discord.com/channels/793094838509764618/1270119831559078061) on the [Starknet Discord](https://discord.com/invite/starknet-community) From 9f9010c1a140284172ccf63ad90dc41e289cf646 Mon Sep 17 00:00:00 2001 From: Danil <37103154+Danyylka@users.noreply.github.com> Date: Fri, 14 Mar 2025 13:56:11 +0100 Subject: [PATCH 04/17] Update L1message.md (#1322) --- www/versioned_docs/version-5.24.3/guides/L1message.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/versioned_docs/version-5.24.3/guides/L1message.md b/www/versioned_docs/version-5.24.3/guides/L1message.md index eec10460c..0c9e19835 100644 --- a/www/versioned_docs/version-5.24.3/guides/L1message.md +++ b/www/versioned_docs/version-5.24.3/guides/L1message.md @@ -10,7 +10,7 @@ You can exchange messages between L1 & L2 networks: - L2 Starknet testnet ↔️ L1 Goerli ETH testnet. - L2 local Starknet devnet ↔️ L1 local ETH testnet (Ganache, ...). -You can find an explanation of the global mechanism [here](https://docs.starknet.io/documentation/architecture_and_concepts/L1-L2_Communication/messaging-mechanism/). +You can find an explanation of the global mechanism [here](https://docs.starknet.io/architecture-and-concepts/network-architecture/messaging-mechanism/). Most of the code for this messaging process will be written in Cairo, but Starknet.js provides some functionalities for this subject. From 06b9dc41af701f09cea14b357ec89919fc3b8f8f Mon Sep 17 00:00:00 2001 From: Fallengirl <155266340+Fallengirl@users.noreply.github.com> Date: Fri, 14 Mar 2025 14:19:15 +0100 Subject: [PATCH 05/17] chore: fix errors in code (#1321) * Update requestParser.test.ts * Update validate.test.ts --- __tests__/utils/calldata/requestParser.test.ts | 2 +- __tests__/utils/calldata/validate.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/__tests__/utils/calldata/requestParser.test.ts b/__tests__/utils/calldata/requestParser.test.ts index 49ddbe3ef..ad805f8b7 100644 --- a/__tests__/utils/calldata/requestParser.test.ts +++ b/__tests__/utils/calldata/requestParser.test.ts @@ -196,7 +196,7 @@ describe('requestParser', () => { expect(parsedField).toEqual(['1', '27988542884245108']); }); - test('should throw an error for Custon Enum type when there is not active variant', () => { + test('should throw an error for Custom Enum type when there is not active variant', () => { const args = [new CairoCustomEnum({ test: 'content' })]; const argsIterator = args[Symbol.iterator](); expect(() => diff --git a/__tests__/utils/calldata/validate.test.ts b/__tests__/utils/calldata/validate.test.ts index 3110e4d3e..d09c2ba66 100644 --- a/__tests__/utils/calldata/validate.test.ts +++ b/__tests__/utils/calldata/validate.test.ts @@ -393,7 +393,7 @@ describe('validateFields', () => { expect(result).toBeUndefined(); }); - test('should throw an error if tupple validation fails', () => { + test('should throw an error if tuple validation fails', () => { const error = new Error(`Validate: arg test should be a tuple (defined as object)`); expect(() => @@ -635,7 +635,7 @@ describe('validateFields', () => { ).toThrow(error); }); - test('should throw an error if value 0 iz provided for any uint type', () => { + test('should throw an error if value 0 is provided for any uint type', () => { const error = new Error('Validate: value 0 is not authorized in NonZero uint type.'); expect(() => From 4c34c39b4644e0d46bd57ef2984d8ec4f61b226d Mon Sep 17 00:00:00 2001 From: Fallengirl <155266340+Fallengirl@users.noreply.github.com> Date: Sun, 16 Mar 2025 11:22:24 +0100 Subject: [PATCH 06/17] Update rpc.ts --- src/provider/rpc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/provider/rpc.ts b/src/provider/rpc.ts index 74e49bc6a..d0e0e627f 100644 --- a/src/provider/rpc.ts +++ b/src/provider/rpc.ts @@ -120,7 +120,7 @@ export class RpcProvider implements ProviderInterface { /** * Pause the execution of the script until a specified block is created. - * @param {BlockIdentifier} blockIdentifier bloc number (BigNumberish) or 'pending' or 'latest'. + * @param {BlockIdentifier} blockIdentifier block number (BigNumberish) or 'pending' or 'latest'. * Use of 'latest" or of a block already created will generate no pause. * @param {number} [retryInterval] number of milliseconds between 2 requests to the node * @example From 1e8ff22bfbd9de4eb6e258eea38882c687b4b1b8 Mon Sep 17 00:00:00 2001 From: XxAlex74xX <30472093+XxAlex74xX@users.noreply.github.com> Date: Mon, 17 Mar 2025 21:00:08 +0100 Subject: [PATCH 07/17] Update intro.md --- www/versioned_docs/version-5.24.3/guides/intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/versioned_docs/version-5.24.3/guides/intro.md b/www/versioned_docs/version-5.24.3/guides/intro.md index 0f1890b42..880ddc47d 100644 --- a/www/versioned_docs/version-5.24.3/guides/intro.md +++ b/www/versioned_docs/version-5.24.3/guides/intro.md @@ -72,4 +72,4 @@ For some more extensive examples visit PhilippeR26's [workshop](https://git ## Contracts used in the guides -You can find the compiled contracts used in these guides in the [compiled_contracts](https://github.com/starknet-io/starknet.js/tree/develop/www/docs/guides/compiled_contracts) directory. +You can find the compiled contracts used in these guides in the [compiled_contracts](https://github.com/starknet-io/starknet.js/tree/develop/www/versioned_docs/version-5.24.3/guides/compiled_contracts) directory. From 04cac91a2c3560fea60d5fb9f05783393a7c28bc Mon Sep 17 00:00:00 2001 From: futreall <86553580+futreall@users.noreply.github.com> Date: Thu, 20 Mar 2025 22:07:11 +0200 Subject: [PATCH 08/17] Update interface.ts --- src/provider/interface.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/provider/interface.ts b/src/provider/interface.ts index 21708b629..3eb2d2184 100644 --- a/src/provider/interface.ts +++ b/src/provider/interface.ts @@ -147,7 +147,7 @@ export abstract class ProviderInterface { * Gets the transaction information from a tx id. * * @param transactionHash - * @returns the transaction object \{ transaction_id, status, transaction, block_number?, block_number?, transaction_index?, transaction_failure_reason? \} + * @returns the transaction object \{ transaction_id, status, transaction, block_number?, block_hash?, transaction_index?, transaction_failure_reason? \} */ public abstract getTransaction(transactionHash: BigNumberish): Promise; From e1b5151428372973fc5b800dab9eea1bc02644c8 Mon Sep 17 00:00:00 2001 From: leopardracer <136604165+leopardracer@users.noreply.github.com> Date: Sat, 29 Mar 2025 18:25:43 +0200 Subject: [PATCH 09/17] Update rpc_0_7.ts --- src/channel/rpc_0_7.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/channel/rpc_0_7.ts b/src/channel/rpc_0_7.ts index 6e72afc23..dd93d46f1 100644 --- a/src/channel/rpc_0_7.ts +++ b/src/channel/rpc_0_7.ts @@ -188,8 +188,8 @@ export class RpcChannel { if (!this.specVersion) { const extendedVersion = await this.getSpecificationVersion(); const [major, minor] = extendedVersion.split('.'); - const specVerson = `${major}.${minor}` as SupportedRpcVersion; - this.specVersion ??= specVerson; + const specVersion = `${major}.${minor}` as SupportedRpcVersion; + this.specVersion ??= specVersion; } return this.specVersion; } From e30b090b3841873b2d4e22621cb88526fbec852f Mon Sep 17 00:00:00 2001 From: leopardracer <136604165+leopardracer@users.noreply.github.com> Date: Sat, 29 Mar 2025 18:26:09 +0200 Subject: [PATCH 10/17] Update rpc_0_8.ts --- src/channel/rpc_0_8.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/channel/rpc_0_8.ts b/src/channel/rpc_0_8.ts index e529cb343..e1670984b 100644 --- a/src/channel/rpc_0_8.ts +++ b/src/channel/rpc_0_8.ts @@ -234,8 +234,8 @@ export class RpcChannel { if (!this.specVersion) { const extendedVersion = await this.getSpecificationVersion(); const [major, minor] = extendedVersion.split('.'); - const specVerson = `${major}.${minor}` as SupportedRpcVersion; - this.specVersion ??= specVerson; + const specVersion = `${major}.${minor}` as SupportedRpcVersion; + this.specVersion ??= specVersion; } return this.specVersion; } From 0b5db30c1cc4a186b64b27a2ec270a94e9b1598d Mon Sep 17 00:00:00 2001 From: leopardracer <136604165+leopardracer@users.noreply.github.com> Date: Sat, 29 Mar 2025 18:26:43 +0200 Subject: [PATCH 11/17] Update validate.ts --- src/utils/calldata/validate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/calldata/validate.ts b/src/utils/calldata/validate.ts index b79613119..f99247ed5 100644 --- a/src/utils/calldata/validate.ts +++ b/src/utils/calldata/validate.ts @@ -405,7 +405,7 @@ const validateNonZero = (parameter: any, input: AbiEntry) => { * }; * * validateFields(functionAbi, [1n], abiStructs, abiEnums); // Returns void since validation passes - * validateFields(functionAbi, [{}], abiStructs, abiEnums); // Throw an error because paramters are not valid + * validateFields(functionAbi, [{}], abiStructs, abiEnums); // Throw an error because parameters are not valid */ export default function validateFields( abiMethod: FunctionAbi, From c154eac537c21c5bcc7445a35e4ca5447559b6eb Mon Sep 17 00:00:00 2001 From: leopardracer <136604165+leopardracer@users.noreply.github.com> Date: Sat, 29 Mar 2025 18:27:34 +0200 Subject: [PATCH 12/17] Update typedData.test.ts --- __tests__/utils/typedData.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/utils/typedData.test.ts b/__tests__/utils/typedData.test.ts index 51c435bac..cde780b9e 100644 --- a/__tests__/utils/typedData.test.ts +++ b/__tests__/utils/typedData.test.ts @@ -318,7 +318,7 @@ describe('typedData', () => { }); test('should hash messages with revision 1 types', () => { - // necessary to spy dependecy since function spies (hash.computePedersenHash; hash.computePoseidonHash) won't work + // necessary to spy dependency since function spies (hash.computePedersenHash; hash.computePoseidonHash) won't work const spyPedersen = jest.spyOn(starkCurve, 'pedersen'); const spyPoseidon = jest.spyOn(starkCurve, 'poseidonHashMany'); From 10a3d667025f01c099b81cd5a23c10c41a6f8612 Mon Sep 17 00:00:00 2001 From: leopardracer <136604165+leopardracer@users.noreply.github.com> Date: Tue, 6 May 2025 13:35:52 +0300 Subject: [PATCH 13/17] Update rpc_0_7.ts --- src/channel/rpc_0_7.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/channel/rpc_0_7.ts b/src/channel/rpc_0_7.ts index dd93d46f1..6e72afc23 100644 --- a/src/channel/rpc_0_7.ts +++ b/src/channel/rpc_0_7.ts @@ -188,8 +188,8 @@ export class RpcChannel { if (!this.specVersion) { const extendedVersion = await this.getSpecificationVersion(); const [major, minor] = extendedVersion.split('.'); - const specVersion = `${major}.${minor}` as SupportedRpcVersion; - this.specVersion ??= specVersion; + const specVerson = `${major}.${minor}` as SupportedRpcVersion; + this.specVersion ??= specVerson; } return this.specVersion; } From 06d3389d1004fdcb1441ff9cbb373219b921f6b4 Mon Sep 17 00:00:00 2001 From: leopardracer <136604165+leopardracer@users.noreply.github.com> Date: Tue, 6 May 2025 13:36:23 +0300 Subject: [PATCH 14/17] Update rpc_0_8.ts --- src/channel/rpc_0_8.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/channel/rpc_0_8.ts b/src/channel/rpc_0_8.ts index e1670984b..e529cb343 100644 --- a/src/channel/rpc_0_8.ts +++ b/src/channel/rpc_0_8.ts @@ -234,8 +234,8 @@ export class RpcChannel { if (!this.specVersion) { const extendedVersion = await this.getSpecificationVersion(); const [major, minor] = extendedVersion.split('.'); - const specVersion = `${major}.${minor}` as SupportedRpcVersion; - this.specVersion ??= specVersion; + const specVerson = `${major}.${minor}` as SupportedRpcVersion; + this.specVersion ??= specVerson; } return this.specVersion; } From 213bd875f80c8cccaca8e80cc4a2332964ee1aa1 Mon Sep 17 00:00:00 2001 From: "fuder.eth" <139509124+vtjl10@users.noreply.github.com> Date: Sat, 5 Apr 2025 19:30:25 +0200 Subject: [PATCH 15/17] Update CairoUint256.md --- .../version-6.11.0/API/classes/CairoUint256.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/versioned_docs/version-6.11.0/API/classes/CairoUint256.md b/www/versioned_docs/version-6.11.0/API/classes/CairoUint256.md index d8da3a8da..872fd35db 100644 --- a/www/versioned_docs/version-6.11.0/API/classes/CairoUint256.md +++ b/www/versioned_docs/version-6.11.0/API/classes/CairoUint256.md @@ -101,7 +101,7 @@ Initialization from Uint256 object ▸ **validate**(`bigNumberish`): `bigint` -Validate if BigNumberish can be represented as Unit256 +Validate if BigNumberish can be represented as Uint256 #### Parameters @@ -123,7 +123,7 @@ Validate if BigNumberish can be represented as Unit256 ▸ **validateProps**(`low`, `high`): `Object` -Validate if low and high can be represented as Unit256 +Validate if low and high can be represented as Uint256 #### Parameters @@ -151,7 +151,7 @@ Validate if low and high can be represented as Unit256 ▸ **is**(`bigNumberish`): `boolean` -Check if BigNumberish can be represented as Unit256 +Check if BigNumberish can be represented as Uint256 #### Parameters From 03107b03b5fd1cff9b52790ad3cae9fa2f65ae72 Mon Sep 17 00:00:00 2001 From: "fuder.eth" <139509124+vtjl10@users.noreply.github.com> Date: Sat, 5 Apr 2025 19:51:48 +0200 Subject: [PATCH 16/17] Update CairoUint256.md --- .../version-6.23.1/API/classes/CairoUint256.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/versioned_docs/version-6.23.1/API/classes/CairoUint256.md b/www/versioned_docs/version-6.23.1/API/classes/CairoUint256.md index 4cae6e7ce..ef8eddd08 100644 --- a/www/versioned_docs/version-6.23.1/API/classes/CairoUint256.md +++ b/www/versioned_docs/version-6.23.1/API/classes/CairoUint256.md @@ -101,7 +101,7 @@ Initialization from Uint256 object ▸ **validate**(`bigNumberish`): `bigint` -Validate if BigNumberish can be represented as Unit256 +Validate if BigNumberish can be represented as Uint256 #### Parameters @@ -123,7 +123,7 @@ Validate if BigNumberish can be represented as Unit256 ▸ **validateProps**(`low`, `high`): `Object` -Validate if low and high can be represented as Unit256 +Validate if low and high can be represented as Uint256 #### Parameters @@ -151,7 +151,7 @@ Validate if low and high can be represented as Unit256 ▸ **is**(`bigNumberish`): `boolean` -Check if BigNumberish can be represented as Unit256 +Check if BigNumberish can be represented as Uint256 #### Parameters From e5e76945b723d65a1c86cf00116051a5b7624fe9 Mon Sep 17 00:00:00 2001 From: "fuder.eth" <139509124+vtjl10@users.noreply.github.com> Date: Sat, 5 Apr 2025 20:10:39 +0200 Subject: [PATCH 17/17] Update CairoUint256.md --- .../version-6.24.1/API/classes/CairoUint256.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/versioned_docs/version-6.24.1/API/classes/CairoUint256.md b/www/versioned_docs/version-6.24.1/API/classes/CairoUint256.md index 0ab0007a8..d11c78685 100644 --- a/www/versioned_docs/version-6.24.1/API/classes/CairoUint256.md +++ b/www/versioned_docs/version-6.24.1/API/classes/CairoUint256.md @@ -101,7 +101,7 @@ Initialization from Uint256 object ▸ **validate**(`bigNumberish`): `bigint` -Validate if BigNumberish can be represented as Unit256 +Validate if BigNumberish can be represented as Uint256 #### Parameters @@ -123,7 +123,7 @@ Validate if BigNumberish can be represented as Unit256 ▸ **validateProps**(`low`, `high`): `Object` -Validate if low and high can be represented as Unit256 +Validate if low and high can be represented as Uint256 #### Parameters @@ -151,7 +151,7 @@ Validate if low and high can be represented as Unit256 ▸ **is**(`bigNumberish`): `boolean` -Check if BigNumberish can be represented as Unit256 +Check if BigNumberish can be represented as Uint256 #### Parameters