From 3db46dea8d70b430635c977390c86a78f3017a7d Mon Sep 17 00:00:00 2001 From: CI Date: Tue, 3 Oct 2023 18:02:44 +0000 Subject: [PATCH 1/5] chore: correct typos [skip ci] --- __mocks__/cairo/helloCairo2/hellocairo | 2 +- __tests__/cairo1v2.test.ts | 2 +- __tests__/contract.test.ts | 2 +- src/account/interface.ts | 6 +++--- src/contract/contractFactory.ts | 2 +- src/provider/interface.ts | 2 +- src/provider/sequencer.ts | 2 +- src/types/calldata.ts | 2 +- src/utils/calldata/cairo.ts | 4 ++-- src/utils/calldata/propertyOrder.ts | 2 +- src/utils/calldata/validate.ts | 12 ++++++------ www/docs/guides/connect_contract.md | 2 +- .../version-5.14.1/API/classes/Account.md | 8 ++++---- .../version-5.14.1/API/classes/AccountInterface.md | 8 ++++---- .../version-5.14.1/API/classes/Provider.md | 2 +- .../version-5.14.1/API/classes/ProviderInterface.md | 2 +- .../version-5.14.1/API/classes/RpcProvider.md | 2 +- .../version-5.14.1/API/classes/SequencerProvider.md | 2 +- .../version-5.14.1/API/classes/Signer.md | 2 +- .../version-5.14.1/API/classes/SignerInterface.md | 2 +- .../version-5.14.1/guides/Old_API_doc/account.md | 4 ++-- .../version-5.19.5/API/classes/Account.md | 8 ++++---- .../version-5.19.5/API/classes/AccountInterface.md | 8 ++++---- .../version-5.19.5/API/classes/Provider.md | 2 +- .../version-5.19.5/API/classes/ProviderInterface.md | 2 +- .../version-5.19.5/API/classes/RpcProvider.md | 2 +- .../version-5.19.5/API/classes/SequencerProvider.md | 2 +- .../version-5.19.5/API/classes/Signer.md | 2 +- .../version-5.19.5/API/classes/SignerInterface.md | 2 +- .../version-5.19.5/guides/Old_API_doc/account.md | 4 ++-- .../version-5.24.3/API/classes/Account.md | 8 ++++---- .../version-5.24.3/API/classes/AccountInterface.md | 8 ++++---- .../version-5.24.3/API/classes/Provider.md | 2 +- .../version-5.24.3/API/classes/ProviderInterface.md | 2 +- .../version-5.24.3/API/classes/RpcProvider.md | 2 +- .../version-5.24.3/API/classes/SequencerProvider.md | 2 +- .../version-5.24.3/API/classes/Signer.md | 2 +- .../version-5.24.3/API/classes/SignerInterface.md | 2 +- 38 files changed, 66 insertions(+), 66 deletions(-) diff --git a/__mocks__/cairo/helloCairo2/hellocairo b/__mocks__/cairo/helloCairo2/hellocairo index 87af4940b..7c566b53d 100644 --- a/__mocks__/cairo/helloCairo2/hellocairo +++ b/__mocks__/cairo/helloCairo2/hellocairo @@ -478,7 +478,7 @@ mod HelloStarknet { } } - // return Option + // return Option fn option_u8_output(self: @ContractState, val1: u8) -> Option { if val1 < 100 { return Option::None(()); diff --git a/__tests__/cairo1v2.test.ts b/__tests__/cairo1v2.test.ts index c1692c679..70c64c3e3 100644 --- a/__tests__/cairo1v2.test.ts +++ b/__tests__/cairo1v2.test.ts @@ -141,7 +141,7 @@ describe('Cairo 1', () => { expect(balance).toBe(200n); }); - test('Cairo 1 Contract Interaction - uint 8, 16, 32, 64, 128, litterals', async () => { + test('Cairo 1 Contract Interaction - uint 8, 16, 32, 64, 128, literals', async () => { const tx = await cairo1Contract.increase_balance_u8(255n); await account.waitForTransaction(tx.transaction_hash); const balance = await cairo1Contract.get_balance_u8(); diff --git a/__tests__/contract.test.ts b/__tests__/contract.test.ts index d2a7ddedd..0a5f6f5e9 100644 --- a/__tests__/contract.test.ts +++ b/__tests__/contract.test.ts @@ -443,7 +443,7 @@ describe('Complex interaction', () => { expect(json.stringify(compiled)).toBe(reference); expect(json.stringify(doubleCompiled)).toBe(reference); - // mix of complex and litteral + // mix of complex and literal const mySetArgs = { validators: [234, 235], powers: { a1: 562, a2: 567 }, diff --git a/src/account/interface.ts b/src/account/interface.ts index ab5c043d7..f650f344e 100644 --- a/src/account/interface.ts +++ b/src/account/interface.ts @@ -262,7 +262,7 @@ export abstract class AccountInterface extends ProviderInterface { /** * Sign an JSON object for off-chain usage with the starknet private key and return the signature - * This adds a message prefix so it cant be interchanged with transactions + * This adds a message prefix so it can't be interchanged with transactions * * @param json - JSON object to be signed * @returns the signature of the JSON object @@ -271,8 +271,8 @@ export abstract class AccountInterface extends ProviderInterface { public abstract signMessage(typedData: TypedData): Promise; /** - * Hash a JSON object with pederson hash and return the hash - * This adds a message prefix so it cant be interchanged with transactions + * Hash a JSON object with Pedersen hash and return the hash + * This adds a message prefix so it can't be interchanged with transactions * * @param json - JSON object to be hashed * @returns the hash of the JSON object diff --git a/src/contract/contractFactory.ts b/src/contract/contractFactory.ts index b9d94dc01..f2c918192 100644 --- a/src/contract/contractFactory.ts +++ b/src/contract/contractFactory.ts @@ -110,5 +110,5 @@ export class ContractFactory { return new Contract(this.abi, address, this.account); } - // ethers.js' getDeployTransaction cant be supported as it requires the account or signer to return a signed transaction which is not possible with the current implementation + // ethers.js' getDeployTransaction can't be supported as it requires the account or signer to return a signed transaction which is not possible with the current implementation } diff --git a/src/provider/interface.ts b/src/provider/interface.ts index b692274c5..bcf6a1e17 100644 --- a/src/provider/interface.ts +++ b/src/provider/interface.ts @@ -158,7 +158,7 @@ export abstract class ProviderInterface { /** * Invokes a function on starknet - * @deprecated This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class + * @deprecated This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class * * @param invocation the invocation object containing: * - contractAddress - the address of the contract diff --git a/src/provider/sequencer.ts b/src/provider/sequencer.ts index a32349bb8..7ddfa87b8 100644 --- a/src/provider/sequencer.ts +++ b/src/provider/sequencer.ts @@ -196,7 +196,7 @@ export class SequencerProvider implements ProviderInterface { : [undefined, Sequencer.Endpoints[T]['REQUEST']] : Sequencer.Endpoints[T]['REQUEST'] extends never ? [Sequencer.Endpoints[T]['QUERY']] // when no request is needed, we can omit the request parameter - : [Sequencer.Endpoints[T]['QUERY'], Sequencer.Endpoints[T]['REQUEST']] // when both query and request are needed, we cant omit anything + : [Sequencer.Endpoints[T]['QUERY'], Sequencer.Endpoints[T]['REQUEST']] // when both query and request are needed, we can't omit anything ): Promise { const baseUrl = this.getFetchUrl(endpoint); const method = this.getFetchMethod(endpoint); diff --git a/src/types/calldata.ts b/src/types/calldata.ts index 0fbe35635..ae5558726 100644 --- a/src/types/calldata.ts +++ b/src/types/calldata.ts @@ -13,7 +13,7 @@ export enum Uint { u256 = 'core::integer::u256', // This one is struct } -export enum Litteral { +export enum Literal { ClassHash = 'core::starknet::class_hash::ClassHash', ContractAddress = 'core::starknet::contract_address::ContractAddress', } diff --git a/src/utils/calldata/cairo.ts b/src/utils/calldata/cairo.ts index 712c54e03..a51213281 100644 --- a/src/utils/calldata/cairo.ts +++ b/src/utils/calldata/cairo.ts @@ -4,7 +4,7 @@ import { AbiStructs, BigNumberish, ContractVersion, - Litteral, + Literal, Uint, Uint256, } from '../../types'; @@ -26,7 +26,7 @@ export const isTypeEnum = (type: string, enums: AbiEnums) => type in enums; export const isTypeOption = (type: string) => type.startsWith('core::option::Option::'); export const isTypeResult = (type: string) => type.startsWith('core::result::Result::'); export const isTypeUint = (type: string) => Object.values(Uint).includes(type as Uint); -export const isTypeLitteral = (type: string) => Object.values(Litteral).includes(type as Litteral); +export const isTypeLiteral = (type: string) => Object.values(Literal).includes(type as Literal); export const isTypeUint256 = (type: string) => type === 'core::integer::u256'; export const isTypeBool = (type: string) => type === 'core::bool'; export const isTypeContractAddress = (type: string) => diff --git a/src/utils/calldata/propertyOrder.ts b/src/utils/calldata/propertyOrder.ts index 401b7b0ce..2c96e0fa6 100644 --- a/src/utils/calldata/propertyOrder.ts +++ b/src/utils/calldata/propertyOrder.ts @@ -63,7 +63,7 @@ export default function orderPropsByAbi( // eslint-disable-next-line @typescript-eslint/no-use-before-define return orderStruct(unorderedItem, abiOfStruct); } - // litterals + // literals return unorderedItem; }; diff --git a/src/utils/calldata/validate.ts b/src/utils/calldata/validate.ts index 9dd9071e8..2c28909da 100644 --- a/src/utils/calldata/validate.ts +++ b/src/utils/calldata/validate.ts @@ -8,7 +8,7 @@ import { AbiStructs, BigNumberish, FunctionAbi, - Litteral, + Literal, Uint, } from '../../types'; import assert from '../assert'; @@ -22,7 +22,7 @@ import { isTypeBool, isTypeEnum, isTypeFelt, - isTypeLitteral, + isTypeLiteral, isTypeOption, isTypeResult, isTypeStruct, @@ -105,7 +105,7 @@ const validateUint = (parameter: any, input: AbiEntry) => { ); break; - case Litteral.ClassHash: + case Literal.ClassHash: assert( // from : https://github.com/starkware-libs/starknet-specs/blob/29bab650be6b1847c92d4461d4c33008b5e50b1a/api/starknet_api_openrpc.json#L1670 param >= 0n && param <= 2n ** 252n - 1n, @@ -113,7 +113,7 @@ const validateUint = (parameter: any, input: AbiEntry) => { ); break; - case Litteral.ContractAddress: + case Literal.ContractAddress: assert( // from : https://github.com/starkware-libs/starknet-specs/blob/29bab650be6b1847c92d4461d4c33008b5e50b1a/api/starknet_api_openrpc.json#L1245 param >= 0n && param <= 2n ** 252n - 1n, @@ -235,7 +235,7 @@ const validateArray = (parameter: any, input: AbiEntry, structs: AbiStructs, enu case isTypeEnum(baseType, enums): parameter.forEach((it: any) => validateEnum(it, { name: input.name, type: baseType })); break; - case isTypeUint(baseType) || isTypeLitteral(baseType): + case isTypeUint(baseType) || isTypeLiteral(baseType): parameter.forEach((param: BigNumberish) => validateUint(param, input)); break; case isTypeBool(baseType): @@ -263,7 +263,7 @@ export default function validateFields( case isTypeFelt(input.type): validateFelt(parameter, input); break; - case isTypeUint(input.type) || isTypeLitteral(input.type): + case isTypeUint(input.type) || isTypeLiteral(input.type): validateUint(parameter, input); break; case isTypeBool(input.type): diff --git a/www/docs/guides/connect_contract.md b/www/docs/guides/connect_contract.md index d4ef7dff8..401b14655 100644 --- a/www/docs/guides/connect_contract.md +++ b/www/docs/guides/connect_contract.md @@ -53,6 +53,6 @@ const myTestContract = new Contract(compiledTest.abi, testAddress, provider); ## Typechecking and autocompletion -If you want to have typechecking and autocompletion for your contracts functions calls and catch typing errors early, you can use Abiwan! +If you want to have typechecking and autocompletion for your contracts functions calls and catch typing errors early, you can use Abiwan! See [this guide](./automatic_cairo_ABI_parsing.md) for more details. diff --git a/www/versioned_docs/version-5.14.1/API/classes/Account.md b/www/versioned_docs/version-5.14.1/API/classes/Account.md index 4c5445fb8..770fa0bd8 100644 --- a/www/versioned_docs/version-5.14.1/API/classes/Account.md +++ b/www/versioned_docs/version-5.14.1/API/classes/Account.md @@ -574,7 +574,7 @@ a confirmation of sending a transaction on the starknet contract ▸ **signMessage**(`typedData`): `Promise`<[`Signature`](../namespaces/types.md#signature)\> Sign an JSON object for off-chain usage with the starknet private key and return the signature -This adds a message prefix so it cant be interchanged with transactions +This adds a message prefix so it can't be interchanged with transactions **`Throws`** @@ -606,8 +606,8 @@ the signature of the JSON object ▸ **hashMessage**(`typedData`): `Promise`<`string`\> -Hash a JSON object with pederson hash and return the hash -This adds a message prefix so it cant be interchanged with transactions +Hash a JSON object with Pedersen hash and return the hash +This adds a message prefix so it can't be interchanged with transactions **`Throws`** @@ -1307,7 +1307,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.14.1/API/classes/AccountInterface.md b/www/versioned_docs/version-5.14.1/API/classes/AccountInterface.md index 6ed0c840c..a4ceb3280 100644 --- a/www/versioned_docs/version-5.14.1/API/classes/AccountInterface.md +++ b/www/versioned_docs/version-5.14.1/API/classes/AccountInterface.md @@ -363,7 +363,7 @@ a confirmation of sending a transaction on the starknet contract ▸ `Abstract` **signMessage**(`typedData`): `Promise`<[`Signature`](../namespaces/types.md#signature)\> Sign an JSON object for off-chain usage with the starknet private key and return the signature -This adds a message prefix so it cant be interchanged with transactions +This adds a message prefix so it can't be interchanged with transactions **`Throws`** @@ -391,8 +391,8 @@ the signature of the JSON object ▸ `Abstract` **hashMessage**(`typedData`): `Promise`<`string`\> -Hash a JSON object with pederson hash and return the hash -This adds a message prefix so it cant be interchanged with transactions +Hash a JSON object with Pedersen hash and return the hash +This adds a message prefix so it can't be interchanged with transactions **`Throws`** @@ -898,7 +898,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.14.1/API/classes/Provider.md b/www/versioned_docs/version-5.14.1/API/classes/Provider.md index ffcc3c988..855fed589 100644 --- a/www/versioned_docs/version-5.14.1/API/classes/Provider.md +++ b/www/versioned_docs/version-5.14.1/API/classes/Provider.md @@ -426,7 +426,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.14.1/API/classes/ProviderInterface.md b/www/versioned_docs/version-5.14.1/API/classes/ProviderInterface.md index 983eb5d62..d09331877 100644 --- a/www/versioned_docs/version-5.14.1/API/classes/ProviderInterface.md +++ b/www/versioned_docs/version-5.14.1/API/classes/ProviderInterface.md @@ -324,7 +324,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.14.1/API/classes/RpcProvider.md b/www/versioned_docs/version-5.14.1/API/classes/RpcProvider.md index dd1843454..55b966c14 100644 --- a/www/versioned_docs/version-5.14.1/API/classes/RpcProvider.md +++ b/www/versioned_docs/version-5.14.1/API/classes/RpcProvider.md @@ -827,7 +827,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.14.1/API/classes/SequencerProvider.md b/www/versioned_docs/version-5.14.1/API/classes/SequencerProvider.md index c4292e5df..b27d16604 100644 --- a/www/versioned_docs/version-5.14.1/API/classes/SequencerProvider.md +++ b/www/versioned_docs/version-5.14.1/API/classes/SequencerProvider.md @@ -579,7 +579,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.14.1/API/classes/Signer.md b/www/versioned_docs/version-5.14.1/API/classes/Signer.md index fdcf379ea..3d6592304 100644 --- a/www/versioned_docs/version-5.14.1/API/classes/Signer.md +++ b/www/versioned_docs/version-5.14.1/API/classes/Signer.md @@ -65,7 +65,7 @@ public key of signer as hex string with 0x prefix ▸ **signMessage**(`typedData`, `accountAddress`): `Promise`<[`Signature`](../namespaces/types.md#signature)\> Sign an JSON object for off-chain usage with the starknet private key and return the signature -This adds a message prefix so it cant be interchanged with transactions +This adds a message prefix so it can't be interchanged with transactions **`Throws`** diff --git a/www/versioned_docs/version-5.14.1/API/classes/SignerInterface.md b/www/versioned_docs/version-5.14.1/API/classes/SignerInterface.md index b9642d906..1eac2744b 100644 --- a/www/versioned_docs/version-5.14.1/API/classes/SignerInterface.md +++ b/www/versioned_docs/version-5.14.1/API/classes/SignerInterface.md @@ -41,7 +41,7 @@ public key of signer as hex string with 0x prefix ▸ `Abstract` **signMessage**(`typedData`, `accountAddress`): `Promise`<[`Signature`](../namespaces/types.md#signature)\> Sign an JSON object for off-chain usage with the starknet private key and return the signature -This adds a message prefix so it cant be interchanged with transactions +This adds a message prefix so it can't be interchanged with transactions **`Throws`** diff --git a/www/versioned_docs/version-5.14.1/guides/Old_API_doc/account.md b/www/versioned_docs/version-5.14.1/guides/Old_API_doc/account.md index f82ec0dcc..25d72d96c 100644 --- a/www/versioned_docs/version-5.14.1/guides/Old_API_doc/account.md +++ b/www/versioned_docs/version-5.14.1/guides/Old_API_doc/account.md @@ -460,7 +460,7 @@ The _transactionsDetail_ object may include any of: account.**signMessage**(typedData) => _Promise < Signature >_ -Sign an JSON object for off-chain usage with the starknet private key and return the signature. This adds a message prefix so it cant be interchanged with transactions. +Sign an JSON object for off-chain usage with the starknet private key and return the signature. This adds a message prefix so it can't be interchanged with transactions. _typedData_ - JSON object to be signed @@ -476,7 +476,7 @@ string[]; account.**hashMessage**(typedData) => _Promise < string >_ -Hash a JSON object with pederson hash and return the hash. This adds a message prefix so it cant be interchanged with transactions. +Hash a JSON object with Pedersen hash and return the hash. This adds a message prefix so it can't be interchanged with transactions. _typedData_ - JSON object to be signed diff --git a/www/versioned_docs/version-5.19.5/API/classes/Account.md b/www/versioned_docs/version-5.19.5/API/classes/Account.md index 9cab35aa1..c9f16bdbb 100644 --- a/www/versioned_docs/version-5.19.5/API/classes/Account.md +++ b/www/versioned_docs/version-5.19.5/API/classes/Account.md @@ -574,7 +574,7 @@ a confirmation of sending a transaction on the starknet contract ▸ **signMessage**(`typedData`): `Promise`<[`Signature`](../namespaces/types.md#signature)\> Sign an JSON object for off-chain usage with the starknet private key and return the signature -This adds a message prefix so it cant be interchanged with transactions +This adds a message prefix so it can't be interchanged with transactions **`Throws`** @@ -606,8 +606,8 @@ the signature of the JSON object ▸ **hashMessage**(`typedData`): `Promise`<`string`\> -Hash a JSON object with pederson hash and return the hash -This adds a message prefix so it cant be interchanged with transactions +Hash a JSON object with Pedersen hash and return the hash +This adds a message prefix so it can't be interchanged with transactions **`Throws`** @@ -1307,7 +1307,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.19.5/API/classes/AccountInterface.md b/www/versioned_docs/version-5.19.5/API/classes/AccountInterface.md index 6ad6be5ce..c6d068f19 100644 --- a/www/versioned_docs/version-5.19.5/API/classes/AccountInterface.md +++ b/www/versioned_docs/version-5.19.5/API/classes/AccountInterface.md @@ -363,7 +363,7 @@ a confirmation of sending a transaction on the starknet contract ▸ `Abstract` **signMessage**(`typedData`): `Promise`<[`Signature`](../namespaces/types.md#signature)\> Sign an JSON object for off-chain usage with the starknet private key and return the signature -This adds a message prefix so it cant be interchanged with transactions +This adds a message prefix so it can't be interchanged with transactions **`Throws`** @@ -391,8 +391,8 @@ the signature of the JSON object ▸ `Abstract` **hashMessage**(`typedData`): `Promise`<`string`\> -Hash a JSON object with pederson hash and return the hash -This adds a message prefix so it cant be interchanged with transactions +Hash a JSON object with Pedersen hash and return the hash +This adds a message prefix so it can't be interchanged with transactions **`Throws`** @@ -898,7 +898,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.19.5/API/classes/Provider.md b/www/versioned_docs/version-5.19.5/API/classes/Provider.md index 650627573..73d7785de 100644 --- a/www/versioned_docs/version-5.19.5/API/classes/Provider.md +++ b/www/versioned_docs/version-5.19.5/API/classes/Provider.md @@ -426,7 +426,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.19.5/API/classes/ProviderInterface.md b/www/versioned_docs/version-5.19.5/API/classes/ProviderInterface.md index d35f44b86..f854b9caf 100644 --- a/www/versioned_docs/version-5.19.5/API/classes/ProviderInterface.md +++ b/www/versioned_docs/version-5.19.5/API/classes/ProviderInterface.md @@ -324,7 +324,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.19.5/API/classes/RpcProvider.md b/www/versioned_docs/version-5.19.5/API/classes/RpcProvider.md index ed1aa7860..f31d341d7 100644 --- a/www/versioned_docs/version-5.19.5/API/classes/RpcProvider.md +++ b/www/versioned_docs/version-5.19.5/API/classes/RpcProvider.md @@ -827,7 +827,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.19.5/API/classes/SequencerProvider.md b/www/versioned_docs/version-5.19.5/API/classes/SequencerProvider.md index 23c10f657..9584d21ef 100644 --- a/www/versioned_docs/version-5.19.5/API/classes/SequencerProvider.md +++ b/www/versioned_docs/version-5.19.5/API/classes/SequencerProvider.md @@ -579,7 +579,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.19.5/API/classes/Signer.md b/www/versioned_docs/version-5.19.5/API/classes/Signer.md index 21f19586b..8dbdb50bf 100644 --- a/www/versioned_docs/version-5.19.5/API/classes/Signer.md +++ b/www/versioned_docs/version-5.19.5/API/classes/Signer.md @@ -65,7 +65,7 @@ public key of signer as hex string with 0x prefix ▸ **signMessage**(`typedData`, `accountAddress`): `Promise`<[`Signature`](../namespaces/types.md#signature)\> Sign an JSON object for off-chain usage with the starknet private key and return the signature -This adds a message prefix so it cant be interchanged with transactions +This adds a message prefix so it can't be interchanged with transactions **`Throws`** diff --git a/www/versioned_docs/version-5.19.5/API/classes/SignerInterface.md b/www/versioned_docs/version-5.19.5/API/classes/SignerInterface.md index 52ad25500..20ed54841 100644 --- a/www/versioned_docs/version-5.19.5/API/classes/SignerInterface.md +++ b/www/versioned_docs/version-5.19.5/API/classes/SignerInterface.md @@ -41,7 +41,7 @@ public key of signer as hex string with 0x prefix ▸ `Abstract` **signMessage**(`typedData`, `accountAddress`): `Promise`<[`Signature`](../namespaces/types.md#signature)\> Sign an JSON object for off-chain usage with the starknet private key and return the signature -This adds a message prefix so it cant be interchanged with transactions +This adds a message prefix so it can't be interchanged with transactions **`Throws`** diff --git a/www/versioned_docs/version-5.19.5/guides/Old_API_doc/account.md b/www/versioned_docs/version-5.19.5/guides/Old_API_doc/account.md index f82ec0dcc..25d72d96c 100644 --- a/www/versioned_docs/version-5.19.5/guides/Old_API_doc/account.md +++ b/www/versioned_docs/version-5.19.5/guides/Old_API_doc/account.md @@ -460,7 +460,7 @@ The _transactionsDetail_ object may include any of: account.**signMessage**(typedData) => _Promise < Signature >_ -Sign an JSON object for off-chain usage with the starknet private key and return the signature. This adds a message prefix so it cant be interchanged with transactions. +Sign an JSON object for off-chain usage with the starknet private key and return the signature. This adds a message prefix so it can't be interchanged with transactions. _typedData_ - JSON object to be signed @@ -476,7 +476,7 @@ string[]; account.**hashMessage**(typedData) => _Promise < string >_ -Hash a JSON object with pederson hash and return the hash. This adds a message prefix so it cant be interchanged with transactions. +Hash a JSON object with Pedersen hash and return the hash. This adds a message prefix so it can't be interchanged with transactions. _typedData_ - JSON object to be signed diff --git a/www/versioned_docs/version-5.24.3/API/classes/Account.md b/www/versioned_docs/version-5.24.3/API/classes/Account.md index aa4668435..2f54b53fc 100644 --- a/www/versioned_docs/version-5.24.3/API/classes/Account.md +++ b/www/versioned_docs/version-5.24.3/API/classes/Account.md @@ -598,7 +598,7 @@ a confirmation of sending a transaction on the starknet contract ▸ **signMessage**(`typedData`): `Promise`<[`Signature`](../namespaces/types.md#signature)\> Sign an JSON object for off-chain usage with the starknet private key and return the signature -This adds a message prefix so it cant be interchanged with transactions +This adds a message prefix so it can't be interchanged with transactions **`Throws`** @@ -630,8 +630,8 @@ the signature of the JSON object ▸ **hashMessage**(`typedData`): `Promise`<`string`\> -Hash a JSON object with pederson hash and return the hash -This adds a message prefix so it cant be interchanged with transactions +Hash a JSON object with Pedersen hash and return the hash +This adds a message prefix so it can't be interchanged with transactions **`Throws`** @@ -1331,7 +1331,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.24.3/API/classes/AccountInterface.md b/www/versioned_docs/version-5.24.3/API/classes/AccountInterface.md index 09ff8deb5..557bdf14d 100644 --- a/www/versioned_docs/version-5.24.3/API/classes/AccountInterface.md +++ b/www/versioned_docs/version-5.24.3/API/classes/AccountInterface.md @@ -363,7 +363,7 @@ a confirmation of sending a transaction on the starknet contract ▸ `Abstract` **signMessage**(`typedData`): `Promise`<[`Signature`](../namespaces/types.md#signature)\> Sign an JSON object for off-chain usage with the starknet private key and return the signature -This adds a message prefix so it cant be interchanged with transactions +This adds a message prefix so it can't be interchanged with transactions **`Throws`** @@ -391,8 +391,8 @@ the signature of the JSON object ▸ `Abstract` **hashMessage**(`typedData`): `Promise`<`string`\> -Hash a JSON object with pederson hash and return the hash -This adds a message prefix so it cant be interchanged with transactions +Hash a JSON object with Pedersen hash and return the hash +This adds a message prefix so it can't be interchanged with transactions **`Throws`** @@ -898,7 +898,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.24.3/API/classes/Provider.md b/www/versioned_docs/version-5.24.3/API/classes/Provider.md index bebd1c6d3..0b22946df 100644 --- a/www/versioned_docs/version-5.24.3/API/classes/Provider.md +++ b/www/versioned_docs/version-5.24.3/API/classes/Provider.md @@ -430,7 +430,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.24.3/API/classes/ProviderInterface.md b/www/versioned_docs/version-5.24.3/API/classes/ProviderInterface.md index ea9e4cbde..574381a91 100644 --- a/www/versioned_docs/version-5.24.3/API/classes/ProviderInterface.md +++ b/www/versioned_docs/version-5.24.3/API/classes/ProviderInterface.md @@ -324,7 +324,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.24.3/API/classes/RpcProvider.md b/www/versioned_docs/version-5.24.3/API/classes/RpcProvider.md index 3704a0f54..a6a7c1681 100644 --- a/www/versioned_docs/version-5.24.3/API/classes/RpcProvider.md +++ b/www/versioned_docs/version-5.24.3/API/classes/RpcProvider.md @@ -1154,7 +1154,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.24.3/API/classes/SequencerProvider.md b/www/versioned_docs/version-5.24.3/API/classes/SequencerProvider.md index 963d3f6ed..3ba6847d0 100644 --- a/www/versioned_docs/version-5.24.3/API/classes/SequencerProvider.md +++ b/www/versioned_docs/version-5.24.3/API/classes/SequencerProvider.md @@ -636,7 +636,7 @@ Invokes a function on starknet **`Deprecated`** -This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class +This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class #### Parameters diff --git a/www/versioned_docs/version-5.24.3/API/classes/Signer.md b/www/versioned_docs/version-5.24.3/API/classes/Signer.md index bb7f958c9..bc395bbd6 100644 --- a/www/versioned_docs/version-5.24.3/API/classes/Signer.md +++ b/www/versioned_docs/version-5.24.3/API/classes/Signer.md @@ -65,7 +65,7 @@ public key of signer as hex string with 0x prefix ▸ **signMessage**(`typedData`, `accountAddress`): `Promise`<[`Signature`](../namespaces/types.md#signature)\> Sign an JSON object for off-chain usage with the starknet private key and return the signature -This adds a message prefix so it cant be interchanged with transactions +This adds a message prefix so it can't be interchanged with transactions **`Throws`** diff --git a/www/versioned_docs/version-5.24.3/API/classes/SignerInterface.md b/www/versioned_docs/version-5.24.3/API/classes/SignerInterface.md index 77d38cd82..0d0199e04 100644 --- a/www/versioned_docs/version-5.24.3/API/classes/SignerInterface.md +++ b/www/versioned_docs/version-5.24.3/API/classes/SignerInterface.md @@ -41,7 +41,7 @@ public key of signer as hex string with 0x prefix ▸ `Abstract` **signMessage**(`typedData`, `accountAddress`): `Promise`<[`Signature`](../namespaces/types.md#signature)\> Sign an JSON object for off-chain usage with the starknet private key and return the signature -This adds a message prefix so it cant be interchanged with transactions +This adds a message prefix so it can't be interchanged with transactions **`Throws`** From 3b6f56ec3d070a5e1eca474494c18ed70b0edc9a Mon Sep 17 00:00:00 2001 From: BorkBorked <107079055+BorkBorked@users.noreply.github.com> Date: Sat, 2 Dec 2023 12:43:35 +0100 Subject: [PATCH 2/5] chore: correct typos --- src/account/interface.ts | 4 ++-- src/provider/sequencer.ts | 2 +- src/types/lib/contract/legacy.ts | 2 +- src/utils/calldata/enum/CairoCustomEnum.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/account/interface.ts b/src/account/interface.ts index f650f344e..c75b14f6e 100644 --- a/src/account/interface.ts +++ b/src/account/interface.ts @@ -261,7 +261,7 @@ export abstract class AccountInterface extends ProviderInterface { ): Promise; /** - * Sign an JSON object for off-chain usage with the starknet private key and return the signature + * Signs a JSON object for off-chain usage with the Starknet private key and returns the signature * This adds a message prefix so it can't be interchanged with transactions * * @param json - JSON object to be signed @@ -322,7 +322,7 @@ export abstract class AccountInterface extends ProviderInterface { ): Promise; /** - * Simulates an array of transaction and returns an array of transaction trace and estimated fee. + * Simulates an array of transactions and returns an array of transaction trace and estimated fee. * * @param invocations Invocations containing: * - type - transaction type: DECLARE, (multi)DEPLOY, DEPLOY_ACCOUNT, (multi)INVOKE_FUNCTION diff --git a/src/provider/sequencer.ts b/src/provider/sequencer.ts index 7ddfa87b8..82b6edaa7 100644 --- a/src/provider/sequencer.ts +++ b/src/provider/sequencer.ts @@ -370,7 +370,7 @@ export class SequencerProvider implements ProviderInterface { } else if (classHash) { contractClass = await this.getClassByHash(classHash, blockIdentifier); } else { - throw Error('getContractVersion require contractAddress or classHash'); + throw Error('getContractVersion requires contractAddress or classHash'); } if (isSierra(contractClass)) { diff --git a/src/types/lib/contract/legacy.ts b/src/types/lib/contract/legacy.ts index ad12a9376..9a8da23bc 100644 --- a/src/types/lib/contract/legacy.ts +++ b/src/types/lib/contract/legacy.ts @@ -11,7 +11,7 @@ export type LegacyContractClass = { }; /** - * format produced after compile .cairo to .json + * format produced after compiling .cairo to .json */ export type LegacyCompiledContract = Omit & { program: Program; diff --git a/src/utils/calldata/enum/CairoCustomEnum.ts b/src/utils/calldata/enum/CairoCustomEnum.ts index 547e676b3..c1c8fd7a7 100644 --- a/src/utils/calldata/enum/CairoCustomEnum.ts +++ b/src/utils/calldata/enum/CairoCustomEnum.ts @@ -29,7 +29,7 @@ export class CairoCustomEnum { constructor(enumContent: CairoEnumRaw) { const variantsList = Object.values(enumContent); if (variantsList.length === 0) { - throw new Error('This Enum must have a least 1 variant'); + throw new Error('This Enum must have at least 1 variant'); } const nbActiveVariants = variantsList.filter( (content) => typeof content !== 'undefined' From e4a82a8604c411afae009add702851c95f42145f Mon Sep 17 00:00:00 2001 From: script-money <74860630+script-money@users.noreply.github.com> Date: Wed, 6 Dec 2023 17:38:41 +0800 Subject: [PATCH 3/5] docs: fix typo (#871) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: fix typo * Update www/docs/guides/estimate_fees.md --------- Co-authored-by: Ivan Pavičić --- www/docs/guides/estimate_fees.md | 2 +- www/versioned_docs/version-5.14.1/guides/estimate_fees.md | 2 +- www/versioned_docs/version-5.19.5/guides/estimate_fees.md | 2 +- www/versioned_docs/version-5.24.3/guides/estimate_fees.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/www/docs/guides/estimate_fees.md b/www/docs/guides/estimate_fees.md index f279c8847..a739031e6 100644 --- a/www/docs/guides/estimate_fees.md +++ b/www/docs/guides/estimate_fees.md @@ -43,7 +43,7 @@ To estimate the cost to deploy an account in the network: ```typescript const { suggestedMaxFee: estimatedFee1 } = await account0.estimateAccountDeployFee({ - classHash: OZaccountClashHass, + classHash: OZaccountClassHash, constructorCalldata: OZaccountConstructorCallData, contractAddress: OZcontractAddress }); diff --git a/www/versioned_docs/version-5.14.1/guides/estimate_fees.md b/www/versioned_docs/version-5.14.1/guides/estimate_fees.md index 6ef9fb492..b9bea9747 100644 --- a/www/versioned_docs/version-5.14.1/guides/estimate_fees.md +++ b/www/versioned_docs/version-5.14.1/guides/estimate_fees.md @@ -39,7 +39,7 @@ To estimate the cost to deploy an account in the network: ```typescript const { suggestedMaxFee: estimatedFee1 } = await account0.estimateAccountDeployFee({ - classHash: OZaccountClashHass, + classHash: OZaccountClassHash, constructorCalldata: OZaccountConstructorCallData, contractAddress: OZcontractAddress }); diff --git a/www/versioned_docs/version-5.19.5/guides/estimate_fees.md b/www/versioned_docs/version-5.19.5/guides/estimate_fees.md index 3fe6e7069..259298b85 100644 --- a/www/versioned_docs/version-5.19.5/guides/estimate_fees.md +++ b/www/versioned_docs/version-5.19.5/guides/estimate_fees.md @@ -39,7 +39,7 @@ To estimate the cost to deploy an account in the network: ```typescript const { suggestedMaxFee: estimatedFee1 } = await account0.estimateAccountDeployFee({ - classHash: OZaccountClashHass, + classHash: OZaccountClassHash, constructorCalldata: OZaccountConstructorCallData, contractAddress: OZcontractAddress }); diff --git a/www/versioned_docs/version-5.24.3/guides/estimate_fees.md b/www/versioned_docs/version-5.24.3/guides/estimate_fees.md index f279c8847..a739031e6 100644 --- a/www/versioned_docs/version-5.24.3/guides/estimate_fees.md +++ b/www/versioned_docs/version-5.24.3/guides/estimate_fees.md @@ -43,7 +43,7 @@ To estimate the cost to deploy an account in the network: ```typescript const { suggestedMaxFee: estimatedFee1 } = await account0.estimateAccountDeployFee({ - classHash: OZaccountClashHass, + classHash: OZaccountClassHash, constructorCalldata: OZaccountConstructorCallData, contractAddress: OZcontractAddress }); From c03842a8f5784c6558ea98162864ba96da8ef684 Mon Sep 17 00:00:00 2001 From: kongtaoxing Date: Sat, 6 Jan 2024 14:11:57 +0800 Subject: [PATCH 4/5] docs: correct example variable --- www/docs/guides/create_account.md | 2 +- www/versioned_docs/version-5.14.1/guides/create_account.md | 2 +- www/versioned_docs/version-5.19.5/guides/create_account.md | 2 +- www/versioned_docs/version-5.24.3/guides/create_account.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/www/docs/guides/create_account.md b/www/docs/guides/create_account.md index 9b0095d4a..3bbed22d9 100644 --- a/www/docs/guides/create_account.md +++ b/www/docs/guides/create_account.md @@ -110,7 +110,7 @@ const argentXaccountClassHash = "0x033434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d // Generate public and private key pair. const privateKeyAX = stark.randomAddress(); console.log('AX_ACCOUNT_PRIVATE_KEY=', privateKeyAX); -const starkKeyPubAX = ec.starkCurve.getStarkKey(privateKey); +const starkKeyPubAX = ec.starkCurve.getStarkKey(privateKeyAX); console.log('AX_ACCOUNT_PUBLIC_KEY=', starkKeyPubAX); // Calculate future address of the ArgentX account diff --git a/www/versioned_docs/version-5.14.1/guides/create_account.md b/www/versioned_docs/version-5.14.1/guides/create_account.md index 85f424fe5..bad254672 100644 --- a/www/versioned_docs/version-5.14.1/guides/create_account.md +++ b/www/versioned_docs/version-5.14.1/guides/create_account.md @@ -110,7 +110,7 @@ const argentXaccountClassHash = "0x033434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d // Generate public and private key pair. const privateKeyAX = stark.randomAddress(); console.log('AX_ACCOUNT_PRIVATE_KEY=', privateKeyAX); -const starkKeyPubAX = ec.starkCurve.getStarkKey(privateKey); +const starkKeyPubAX = ec.starkCurve.getStarkKey(privateKeyAX); console.log('AX_ACCOUNT_PUBLIC_KEY=', starkKeyPubAX); // Calculate future address of the ArgentX account diff --git a/www/versioned_docs/version-5.19.5/guides/create_account.md b/www/versioned_docs/version-5.19.5/guides/create_account.md index 80ceb6f87..b2bf98afe 100644 --- a/www/versioned_docs/version-5.19.5/guides/create_account.md +++ b/www/versioned_docs/version-5.19.5/guides/create_account.md @@ -118,7 +118,7 @@ const argentXaccountClassHash = "0x033434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d // Generate public and private key pair. const privateKeyAX = stark.randomAddress(); console.log('AX_ACCOUNT_PRIVATE_KEY=', privateKeyAX); -const starkKeyPubAX = ec.starkCurve.getStarkKey(privateKey); +const starkKeyPubAX = ec.starkCurve.getStarkKey(privateKeyAX); console.log('AX_ACCOUNT_PUBLIC_KEY=', starkKeyPubAX); // Calculate future address of the ArgentX account diff --git a/www/versioned_docs/version-5.24.3/guides/create_account.md b/www/versioned_docs/version-5.24.3/guides/create_account.md index 80ceb6f87..b2bf98afe 100644 --- a/www/versioned_docs/version-5.24.3/guides/create_account.md +++ b/www/versioned_docs/version-5.24.3/guides/create_account.md @@ -118,7 +118,7 @@ const argentXaccountClassHash = "0x033434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d // Generate public and private key pair. const privateKeyAX = stark.randomAddress(); console.log('AX_ACCOUNT_PRIVATE_KEY=', privateKeyAX); -const starkKeyPubAX = ec.starkCurve.getStarkKey(privateKey); +const starkKeyPubAX = ec.starkCurve.getStarkKey(privateKeyAX); console.log('AX_ACCOUNT_PUBLIC_KEY=', starkKeyPubAX); // Calculate future address of the ArgentX account From 89e060e2659bad11b4e1a388ef34976bc0ac0a1a Mon Sep 17 00:00:00 2001 From: Dhruv Kelawala Date: Thu, 11 Jan 2024 10:36:59 +0000 Subject: [PATCH 5/5] chore: fix readme typo [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 129cb83d6..689a66985 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ If you consider to contribute to this project please read [CONTRIBUTING.md](http Special thanks to all the [contributors](https://github.com/starknet-io/starknet.js/graphs/contributors), especially to: -- Sean ([@0xs34n](https://github.com/0xs34n)), the original creator of Straknet.js! +- Sean ([@0xs34n](https://github.com/0xs34n)), the original creator of Starknet.js! - Janek ([@janek26](https://github.com/janek26)) and Dhruv ([@dhruvkelawala](https://github.com/dhruvkelawala)) from [Argent](https://github.com/argentlabs)