Skip to content

Commit 84ba24c

Browse files
committed
docs: update dependencies
1 parent 8449968 commit 84ba24c

File tree

177 files changed

+16763
-11411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+16763
-11411
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@ This library would not be possible without these rockstars.
8282

8383
## 📜 License
8484

85-
Copyright (c) 2024 StarkWare
85+
Copyright (c) 2025 StarkWare
8686

8787
Licensed under the [MIT license](https://github.com/starknet-io/starknet.js/blob/main/LICENSE).

__tests__/account.outsideExecution.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ describe('Account and OutsideExecution', () => {
334334
calldata: [getDecimalString(recipientAccount.address), '300', '0'],
335335
},
336336
]);
337-
// get outside transaction of a multiCall :
337+
// get outside transaction of a multiCall:
338338
const outsideTransaction2: OutsideTransaction = await signerAccount.getOutsideTransaction(
339339
callOptions,
340340
[call1, call2]

__tests__/utils/hash.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ describe('getSelector', () => {
5151

5252
describe('L1->L2 messaging', () => {
5353
// L1 tx for a message L1->L2
54-
// data extracted from :
54+
// data extracted from:
5555
// https://sepolia.etherscan.io/tx/0xd82ce7dd9f3964d89d2eb9d555e1460fb7792be274950abe578d610f95cc40f5
56-
// data extracted from etherscan :
56+
// data extracted from etherscan:
5757
const l1FromAddress = '0x0000000000000000000000008453fc6cd1bcfe8d4dfc069c400b433054d47bdc';
5858
const l2ToAddress = 2158142789748719025684046545159279785659305214176670733242887773692203401023n;
5959
const l2Selector = 774397379524139446221206168840917193112228400237242521560346153613428128537n;

src/account/interface.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export abstract class AccountInterface extends ProviderInterface {
146146
* Estimate Fee for executing a list of transactions on starknet
147147
* Contract must be deployed for fee estimation to be possible
148148
*
149-
* @param invocations array of transaction object containing :
149+
* @param invocations array of transaction object containing:
150150
* - type - the type of transaction : 'DECLARE' | (multi)'DEPLOY' | (multi)'INVOKE_FUNCTION' | 'DEPLOY_ACCOUNT'
151151
* - payload - the payload of the transaction
152152
*

src/provider/interface.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export abstract class ProviderInterface {
9090
* @param {BigNumberish} l2TxHash L2 transaction hash
9191
* @returns {string} Hex string of L1 message hash
9292
* @example
93-
* In Sepolia Testnet :
93+
* In Sepolia Testnet:
9494
* ```typescript
9595
* const result = provider.getL1MessageHash('0x28dfc05eb4f261b37ddad451ff22f1d08d4e3c24dc646af0ec69fa20e096819');
9696
* // result = '0x55b3f8b6e607fffd9b4d843dfe8f9b5c05822cd94fcad8797deb01d77805532a'
@@ -133,7 +133,7 @@ export abstract class ProviderInterface {
133133
* Get the value of the storage (contract's variable) at the given address and key
134134
*
135135
* @param contractAddress
136-
* @param key - from getStorageVarAddress('<STORAGE_VARIABLE_NAME>') (WIP)
136+
* @param key - from starknetKeccak()
137137
* @param blockIdentifier - block identifier
138138
* @returns the value of the storage variable
139139
*/
@@ -147,7 +147,7 @@ export abstract class ProviderInterface {
147147
* Gets the transaction information from a tx id.
148148
*
149149
* @param transactionHash
150-
* @returns the transaction object \{ transaction_id, status, transaction, block_number?, block_number?, transaction_index?, transaction_failure_reason? \}
150+
* @returns the transaction object `{ transaction_id, status, transaction, block_number?, transaction_index?, transaction_failure_reason? }`
151151
*/
152152
public abstract getTransaction(transactionHash: BigNumberish): Promise<GetTransactionResponse>;
153153

src/provider/rpc.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class RpcProvider implements ProviderInterface {
171171

172172
/**
173173
* Pause the execution of the script until a specified block is created.
174-
* @param {BlockIdentifier} blockIdentifier bloc number (BigNumberish) or 'pending' or 'latest'.
174+
* @param {BlockIdentifier} blockIdentifier block number (BigNumberish) or 'pending' or 'latest'.
175175
* Use of 'latest" or of a block already created will generate no pause.
176176
* @param {number} [retryInterval] number of milliseconds between 2 requests to the node
177177
* @example

src/signer/ledgerSigner221.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class LedgerSigner221<Transport extends Record<any, any> = any>
6262
* @param {LedgerPathCalculation} [pathFunction=getLedgerPathBuffer221]
6363
* defines the function that will calculate the path. By default `getLedgerPathBuffer221` is selected.
6464
*
65-
* If you are using APP v2.2.1 with an account created with the v1.1.1, you need to use :
65+
* If you are using APP v2.2.1 with an account created with the v1.1.1, you need to use:
6666
* ```typescript
6767
* const myLedgerSigner = new LedgerSigner211(myNodeTransport, 0, undefined, getLedgerPathBuffer111);
6868
* ```

src/types/lib/contract/abi.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export type AbiEnum = {
4444
type: 'enum';
4545
};
4646

47-
// AbiEvents type is an arborescence :
47+
// AbiEvents type is an arborescence:
4848
// - Nodes are hashes of either Cairo 1 components names, or of Cairo 0 or 1 event names,
4949
// - With Cairo 1 abi, the nodes are linked in accordance with the components arborescence ; the tree can have several levels of nodes.
5050
// - With Cairo 0 abi : the tree has only one level of nodes (no component concept)

src/utils/cairoDataTypes/uint256.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class CairoUint256 {
5555
}
5656

5757
/**
58-
* Validate if BigNumberish can be represented as Unit256
58+
* Validate if BigNumberish can be represented as Uint256
5959
*/
6060
static validate(bigNumberish: BigNumberish) {
6161
const bigInt = BigInt(bigNumberish);
@@ -65,7 +65,7 @@ export class CairoUint256 {
6565
}
6666

6767
/**
68-
* Validate if low and high can be represented as Unit256
68+
* Validate if low and high can be represented as Uint256
6969
*/
7070
static validateProps(low: BigNumberish, high: BigNumberish) {
7171
const bigIntLow = BigInt(low);
@@ -80,7 +80,7 @@ export class CairoUint256 {
8080
}
8181

8282
/**
83-
* Check if BigNumberish can be represented as Unit256
83+
* Check if BigNumberish can be represented as Uint256
8484
*/
8585
static is(bigNumberish: BigNumberish) {
8686
try {
@@ -107,7 +107,7 @@ export class CairoUint256 {
107107

108108
/**
109109
* Return Uint256 structure with HexString props
110-
* {low: HexString, high: HexString}
110+
* `{low: HexString, high: HexString}`
111111
*/
112112
toUint256HexString() {
113113
return {
@@ -118,7 +118,7 @@ export class CairoUint256 {
118118

119119
/**
120120
* Return Uint256 structure with DecimalString props
121-
* {low: DecString, high: DecString}
121+
* `{low: DecString, high: DecString}`
122122
*/
123123
toUint256DecimalString() {
124124
return {

src/utils/calldata/byteArray.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@ export function stringFromByteArray(myByteArray: ByteArray): string {
3737
* @example
3838
* ```typescript
3939
* const myByteArray: ByteArray = byteArrayFromString("ABCDEFGHI");
40+
* // result is: {
41+
* // data: [],
42+
* // pending_word: '0x414243444546474849',
43+
* // pending_word_len: 9
44+
* // }
4045
* ```
41-
* Result is :
42-
* {
43-
* data: [],
44-
* pending_word: '0x414243444546474849',
45-
* pending_word_len: 9
46-
* }
4746
*/
4847
export function byteArrayFromString(targetString: string): ByteArray {
4948
const shortStrings: string[] = splitLongString(targetString);

src/utils/calldata/enum/CairoCustomEnum.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ export type CairoEnumRaw = Record<string, any>;
44

55
/**
66
* Class to handle Cairo custom Enum
7-
* @param enumContent object containing the variants and its content. Example :
8-
* {Success: 234, Warning: undefined, Error: undefined}.
7+
* @param enumContent object containing the variants and its content. Example:
8+
* `{Success: 234, Warning: undefined, Error: undefined}`.
99
* Only one variant with a value, object, array.
1010
* @returns an instance representing a Cairo custom Enum.
1111
* @example

src/utils/hash/transactionHash/v3.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ export function encodeResourceBoundsL1(bounds: ResourceBounds): bigint {
4545

4646
/**
4747
* Encode the L2 bound of a V3 transaction
48-
* @param {ResourceBounds} bounds
49-
* {l1_gas: {max_amount: u64, max_price_per_unit: u128},
50-
* l2_gas: {max_amount: u64, max_price_per_unit: u128}}
51-
}
48+
* @param {ResourceBounds} bounds
49+
* `{l1_gas: {max_amount: u64, max_price_per_unit: u128},
50+
* l2_gas: {max_amount: u64, max_price_per_unit: u128}}`
5251
* @returns {bigint} encoded data
5352
*/
5453
export function encodeResourceBoundsL2(bounds: RPCSPEC07.ResourceBounds): bigint {

src/utils/provider.ts

+5-9
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,11 @@ export function getDefaultNodes(rpcVersion: SupportedRpcVersion) {
157157
export const validBlockTags = Object.values(BlockTag);
158158

159159
/**
160-
* This class is formatting the identifier of a block.
161-
*
162-
* hex string and BigInt are detected as block hashes. identifier return { block_hash: hash }
163-
*
164-
* decimal string and number are detected as block numbers. identifier return { block_number: number }
165-
*
166-
* text string are detected as block tag. identifier return tag
167-
*
168-
* null is detected as 'pending' block tag. identifier return 'pending'
160+
* This class formats the identifier of a block.
161+
* - hex strings and BigInts are detected as block hashes. identifier return `{ block_hash: hash }`
162+
* - decimal strings and numbers are detected as block numbers. identifier return `{ block_number: number }`
163+
* - text strings are detected as block tag. identifier return tag
164+
* - null is detected as 'pending' block tag. identifier return 'pending'
169165
* @example
170166
* ```typescript
171167
* const result = new provider.Block(null).identifier;

www/ApiTitle.md

+4-22
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
# Starknet.js API
2+
13
This API is based on the <ins>[Starknet.js V3](https://github.com/starknet-io/starknet.js/discussions/102)</ins> Interface write up by <ins>[Janek](https://twitter.com/0xjanek)</ins> of <ins>[Argent](https://www.argent.xyz/)</ins>
24

35
## Provider
46

5-
The Provider [**API**](./classes/Provider.md) allows you to interact with the Starknet network, without signing transactions or messages.
7+
The Provider [**API**](./classes/RpcProvider.md) allows you to interact with the Starknet network, without signing transactions or messages.
68

79
Typically, these are _read_ calls on the blockchain.
810

911
Guide is [**here**](../guides/connect_network.md).
1012

1113
## Account
1214

13-
An Account extends <ins>[`Provider`](./classes/Provider)</ins> and inherits all of its methods.
15+
An `Account` extends `Provider` and inherits all of its methods.
1416

1517
It also introduces new methods that allow Accounts to create and verify signatures with a custom <ins>[`Signer`](./classes/Signer)</ins>, declare and deploy Contract and deploy new Account
1618

@@ -29,23 +31,3 @@ Guide is [**here**](../guides/create_contract.md).
2931
## Signer
3032

3133
The Signer [**API**](./classes/Signer.md) allows you to sign transactions and messages, and also allows you to get the public key.
32-
33-
## Utils
34-
35-
Util functions are provided so you can use various low level functions in your application:
36-
37-
### [elliptic curve](./namespaces/ec.md)
38-
39-
### [hash](./namespaces/hash.md)
40-
41-
### [num](./namespaces/num.md)
42-
43-
### [encode](./namespaces/encode.md)
44-
45-
### [merkle](./namespaces/merkle.md)
46-
47-
### [shortString](./namespaces/shortString.md)
48-
49-
### [stark](./namespaces/stark.md)
50-
51-
### [uint256](./namespaces/uint256.md)

www/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Website
22

3-
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
44

55
## Installation
66

www/docs/guides/L1message.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can exchange messages between L1 & L2 networks:
1010
- L2 Starknet testnet ↔️ L1 Sepolia ETH testnet.
1111
- L2 local Starknet devnet ↔️ L1 local ETH testnet (anvil, ...).
1212

13-
You can find an explanation of the global mechanism [here](https://docs.starknet.io/documentation/architecture_and_concepts/L1-L2_Communication/messaging-mechanism/).
13+
You can find an explanation of the global mechanism [here](https://docs.starknet.io/architecture-and-concepts/network-architecture/messaging-mechanism/).
1414

1515
Most of the code for this messaging process will be written in Cairo, but Starknet.js provides some functionalities for this subject.
1616

@@ -50,10 +50,10 @@ If the fee is paid in L1, the Cairo contract at `to_Address` is automatically ex
5050

5151
### L1 ➡️ L2 hashes
5252

53-
Starknet.js proposes 2 functions to calculate hashes related to a L1 ➡️ L2 message :
53+
Starknet.js proposes 2 functions to calculate hashes related to a L1 ➡️ L2 message:
5454

5555
- The L2 message hash:
56-
For a L1 tx requesting a message L1->L2, some data extracted from etherscan : https://sepolia.etherscan.io/tx/0xd82ce7dd9f3964d89d2eb9d555e1460fb7792be274950abe578d610f95cc40f5
56+
For a L1 tx requesting a message L1->L2, some data extracted from etherscan: https://sepolia.etherscan.io/tx/0xd82ce7dd9f3964d89d2eb9d555e1460fb7792be274950abe578d610f95cc40f5
5757

5858
```typescript
5959
const l1FromAddress = '0x0000000000000000000000008453fc6cd1bcfe8d4dfc069c400b433054d47bdc';
@@ -77,7 +77,7 @@ Starknet.js proposes 2 functions to calculate hashes related to a L1 ➡️ L2 m
7777
// l1ToL2MessageHash = '0x2e350fa9d830482605cb68be4fdb9f0cb3e1f95a0c51623ac1a5d1bd997c2090'
7878
```
7979

80-
Can be verified here : https://sepolia.starkscan.co/message/0x2e350fa9d830482605cb68be4fdb9f0cb3e1f95a0c51623ac1a5d1bd997c2090#messagelogs
80+
Can be verified here: https://sepolia.starkscan.co/message/0x2e350fa9d830482605cb68be4fdb9f0cb3e1f95a0c51623ac1a5d1bd997c2090#messagelogs
8181

8282
- The L2 transaction hash:
8383
For the same message:
@@ -92,7 +92,7 @@ Starknet.js proposes 2 functions to calculate hashes related to a L1 ➡️ L2 m
9292
);
9393
// l1ToL2TransactionHash = '0x67d959200d65d4ad293aa4b0da21bb050a1f669bce37d215c6edbf041269c07'
9494
```
95-
Can be verified here : https://sepolia.starkscan.co/tx/0x067d959200d65d4ad293aa4b0da21bb050a1f669bce37d215c6edbf041269c07
95+
Can be verified here: https://sepolia.starkscan.co/tx/0x067d959200d65d4ad293aa4b0da21bb050a1f669bce37d215c6edbf041269c07
9696

9797
## L2 ➡️ L1 messages
9898

@@ -112,12 +112,12 @@ The result is in `estimatedFee1`, of type BN.
112112

113113
### L2 ➡️ L1 hash
114114

115-
Starknet.js proposes a function to calculate the L1 ➡️ L2 message hash :
115+
Starknet.js proposes a function to calculate the L1 ➡️ L2 message hash:
116116

117117
```typescript
118118
const l2TransactionHash = '0x28dfc05eb4f261b37ddad451ff22f1d08d4e3c24dc646af0ec69fa20e096819';
119119
const l1MessageHash = await provider.getL1MessageHash(l2TransactionHash);
120120
// l1MessageHash = '0x55b3f8b6e607fffd9b4d843dfe8f9b5c05822cd94fcad8797deb01d77805532a'
121121
```
122122

123-
Can be verified here : https://sepolia.voyager.online/tx/0x28dfc05eb4f261b37ddad451ff22f1d08d4e3c24dc646af0ec69fa20e096819#messages
123+
Can be verified here: https://sepolia.voyager.online/tx/0x28dfc05eb4f261b37ddad451ff22f1d08d4e3c24dc646af0ec69fa20e096819#messages

www/docs/guides/connect_network.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ Then you need to select a node. A node is a safe way to connect with the Starkne
1616
> Main development devnets are Starknet-devnet-rs, Madara, ...
1717
1818
Each node is communicating with Starknet.js using a rpc specification. Most of the nodes are able to use 2 rpc spec versions.
19-
For example, this node is compatible with v0.6.0 & v0.7.0, using the following entry points :
19+
For example, this node is compatible with v0.6.0 & v0.7.0, using the following entry points:
2020

2121
- "https://free-rpc.nethermind.io/sepolia-juno/v0_6"
2222
- "https://free-rpc.nethermind.io/sepolia-juno/v0_7"
2323

24-
From rpc spec v0.5.0, you can request the rpc spec version that uses a node address :
24+
From rpc spec v0.5.0, you can request the rpc spec version that uses a node address:
2525

2626
```typescript
2727
const resp = await myProvider.getSpecVersion();
2828
console.log('rpc version =', resp);
29-
// result : rpc version = 0.7.0
29+
// result: rpc version = 0.7.0
3030
```
3131

32-
On Starknet.js side, you have to select the proper version, to be in accordance with the node you want to use :
32+
On Starknet.js side, you have to select the proper version, to be in accordance with the node you want to use:
3333

3434
| Rpc spec version of your node | Starknet.js version to use |
3535
| :---------------------------: | ---------------------------- |
@@ -91,7 +91,7 @@ const providerAlchemyMainnet = new RpcProvider({
9191
const providerMainnetNethermindPublic = new RpcProvider({
9292
nodeUrl: 'https://free-rpc.nethermind.io/mainnet-juno/v0_7',
9393
});
94-
// Public Blast node rpc 0.7.0 for Mainnet (0.4, 0.5 & 0_6 also available) :
94+
// Public Blast node rpc 0.7.0 for Mainnet (0.4, 0.5 & 0_6 also available):
9595
const providerBlastMainnet = new RpcProvider({
9696
nodeUrl: 'https://starknet-mainnet.public.blastapi.io/rpc/v0_7',
9797
});
@@ -112,15 +112,15 @@ The Goerli testnet is no more in service.
112112
### Sepolia Testnet
113113

114114
```typescript
115-
// Infura node rpc 0.5.1 for Sepolia Testnet :
115+
// Infura node rpc 0.5.1 for Sepolia Testnet:
116116
const providerInfuraSepoliaTestnet = new RpcProvider({
117117
nodeUrl: 'https://starknet-sepolia.infura.io/v3/' + infuraKey,
118118
});
119-
// Public Nethermind node rpc 0.7.0 for Sepolia Testnet (0_6 also available) :
119+
// Public Nethermind node rpc 0.7.0 for Sepolia Testnet (0_6 also available):
120120
const providerSepoliaTestnetNethermindPublic = new RpcProvider({
121121
nodeUrl: 'https://free-rpc.nethermind.io/sepolia-juno/v0_7',
122122
});
123-
// Public Blast node rpc 0.7.0 for Sepolia Testnet (0_6 also available) :
123+
// Public Blast node rpc 0.7.0 for Sepolia Testnet (0_6 also available):
124124
const providerSepoliaTestnetBlastPublic = new RpcProvider({
125125
nodeUrl: 'https://starknet-sepolia.public.blastapi.io/rpc/v0_7',
126126
});

0 commit comments

Comments
 (0)