starknet 11.10.5 → 11.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +48 -55
- package/dist/index.global.js +417 -433
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +434 -450
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +434 -450
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [11.10.7](https://github.com/starknet-io/starknet.js/compare/v11.10.6...v11.10.7) (2026-12-03)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **num:** normalize a hex input in getHexString ([#1776](https://github.com/starknet-io/starknet.js/issues/1776)) ([d643b7a](https://github.com/starknet-io/starknet.js/commit/d643b7a89594e58b81f23f7ce48a283c8512bead))
|
|
6
|
+
|
|
7
|
+
## [11.10.6](https://github.com/starknet-io/starknet.js/compare/v11.10.5...v11.10.6) (2026-12-02)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **provider:** make Block read-only and throw an Error for an identifier that names no block ([cbf39cb](https://github.com/starknet-io/starknet.js/commit/cbf39cb714775f05b96c833836567689fc8ee43a))
|
|
12
|
+
|
|
1
13
|
## [11.10.5](https://github.com/starknet-io/starknet.js/compare/v11.10.4...v11.10.5) (2026-12-02)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as RPCSPEC0105 from '@starknet-io/starknet-types-0105';
|
|
2
|
-
import { PAYMASTER_API, CONTRACT, ETransactionType, EDataAvailabilityMode as EDataAvailabilityMode$1, SUBSCRIPTION_BLOCK_ID, TypedData, CONTRACT_STORAGE_KEYS, StorageProof, CASM_COMPILED_CONTRACT_CLASS, OutsideExecutionTypedData, IsSucceeded, TransactionReceipt as TransactionReceipt$1, IsReverted, BLOCK_WITH_TX_HASHES, PRE_CONFIRMED_BLOCK_WITH_TX_HASHES, IsType, ETransactionVersion3 as ETransactionVersion3$1, SUBSCRIPTION_ID, NewHeadsEvent, TXN_FINALITY_STATUS, STATUS_ACCEPTED_ON_L1, StarknetEventsEvent, TransactionsStatusEvent, NewTransactionReceiptsEvent, TXN_STATUS_WITHOUT_L1, NewTransactionEvent, TransactionHash, BlockHash, FAILED_TO_RECEIVE_TXN, NO_TRACE_AVAILABLE, CONTRACT_NOT_FOUND, ENTRYPOINT_NOT_FOUND, BLOCK_NOT_FOUND, INVALID_TXN_INDEX, CLASS_HASH_NOT_FOUND, TXN_HASH_NOT_FOUND, PAGE_SIZE_TOO_BIG, NO_BLOCKS, INVALID_CONTINUATION_TOKEN, TOO_MANY_KEYS_IN_FILTER, CONTRACT_ERROR, TRANSACTION_EXECUTION_ERROR, STORAGE_PROOF_NOT_SUPPORTED, CLASS_ALREADY_DECLARED, INVALID_TRANSACTION_NONCE, INSUFFICIENT_RESOURCES_FOR_VALIDATE, INSUFFICIENT_ACCOUNT_BALANCE, VALIDATION_FAILURE, COMPILATION_FAILED, CONTRACT_CLASS_SIZE_IS_TOO_LARGE, NON_ACCOUNT, DUPLICATE_TX, COMPILED_CLASS_HASH_MISMATCH, UNSUPPORTED_TX_VERSION, UNSUPPORTED_CONTRACT_CLASS_VERSION, UNEXPECTED_ERROR, REPLACEMENT_TRANSACTION_UNDERPRICED, FEE_BELOW_MINIMUM, INVALID_SUBSCRIPTION_ID, TOO_MANY_ADDRESSES_IN_FILTER, TOO_MANY_BLOCKS_BACK, COMPILATION_ERROR, ETransactionVersion as ETransactionVersion$1, STORAGE_RESULT, INVOKE_TXN_V3, StarknetWindowObject, AccountChangeEventHandler, NetworkChangeEventHandler, WatchAssetParameters, AddStarknetChainParameters, Signature as Signature$1, STRK20_REGISTER_ACTION, STRK20_DEPOSIT_ACTION, STRK20_WITHDRAW_ACTION, STRK20_TRANSFER_ACTION, STRK20_INVOKE_ACTION, STRK20_SHADOW_ACCOUNT_INVOKE_ACTION as STRK20_SHADOW_ACCOUNT_INVOKE_ACTION$1, STRK20_CALL_AND_PROOF as STRK20_CALL_AND_PROOF$1, STRK20_PROOF, Address, STRK20_BALANCE_ENTRY, STRK20_DAPP_NAME, FELT as FELT$1, EDAMode as EDAMode$1, TypedDataRevision, StarknetType, StarknetMerkleType, OutsideCallV1, OutsideCallV2, Event as Event$2, EmittedEvent as EmittedEvent$1, AddDeclareTransactionParameters, AddDeclareTransactionResult, AddInvokeTransactionParameters, AddInvokeTransactionResult, AccountDeploymentData, Permission, ChainId, SpecVersion, API_VERSION as API_VERSION$1, STRK20_ACTION as STRK20_ACTION$1 } from '@starknet-io/starknet-types-0105';
|
|
2
|
+
import { PAYMASTER_API, CONTRACT, ETransactionType, EDataAvailabilityMode as EDataAvailabilityMode$1, SUBSCRIPTION_BLOCK_ID, TypedData, CONTRACT_STORAGE_KEYS, StorageProof, CASM_COMPILED_CONTRACT_CLASS, OutsideExecutionTypedData, IsSucceeded, TransactionReceipt as TransactionReceipt$1, IsReverted, BLOCK_WITH_TX_HASHES, PRE_CONFIRMED_BLOCK_WITH_TX_HASHES, IsType, ETransactionVersion3 as ETransactionVersion3$1, SUBSCRIPTION_ID, NewHeadsEvent, TXN_FINALITY_STATUS, STATUS_ACCEPTED_ON_L1, StarknetEventsEvent, TransactionsStatusEvent, NewTransactionReceiptsEvent, TXN_STATUS_WITHOUT_L1, NewTransactionEvent, TransactionHash, BlockHash, FAILED_TO_RECEIVE_TXN, NO_TRACE_AVAILABLE, CONTRACT_NOT_FOUND, ENTRYPOINT_NOT_FOUND, BLOCK_NOT_FOUND, INVALID_TXN_INDEX, CLASS_HASH_NOT_FOUND, TXN_HASH_NOT_FOUND, PAGE_SIZE_TOO_BIG, NO_BLOCKS, INVALID_CONTINUATION_TOKEN, TOO_MANY_KEYS_IN_FILTER, CONTRACT_ERROR, TRANSACTION_EXECUTION_ERROR, STORAGE_PROOF_NOT_SUPPORTED, CLASS_ALREADY_DECLARED, INVALID_TRANSACTION_NONCE, INSUFFICIENT_RESOURCES_FOR_VALIDATE, INSUFFICIENT_ACCOUNT_BALANCE, VALIDATION_FAILURE, COMPILATION_FAILED, CONTRACT_CLASS_SIZE_IS_TOO_LARGE, NON_ACCOUNT, DUPLICATE_TX, COMPILED_CLASS_HASH_MISMATCH, UNSUPPORTED_TX_VERSION, UNSUPPORTED_CONTRACT_CLASS_VERSION, UNEXPECTED_ERROR, REPLACEMENT_TRANSACTION_UNDERPRICED, FEE_BELOW_MINIMUM, INVALID_SUBSCRIPTION_ID, TOO_MANY_ADDRESSES_IN_FILTER, TOO_MANY_BLOCKS_BACK, COMPILATION_ERROR, ETransactionVersion as ETransactionVersion$1, STORAGE_RESULT, INVOKE_TXN_V3, StarknetWindowObject, AccountChangeEventHandler, NetworkChangeEventHandler, WatchAssetParameters, AddStarknetChainParameters, Signature as Signature$1, STRK20_REGISTER_ACTION, STRK20_DEPOSIT_ACTION, STRK20_WITHDRAW_ACTION, STRK20_TRANSFER_ACTION, STRK20_INVOKE_ACTION, STRK20_SHADOW_ACCOUNT_INVOKE_ACTION as STRK20_SHADOW_ACCOUNT_INVOKE_ACTION$1, STRK20_CALL_AND_PROOF as STRK20_CALL_AND_PROOF$1, STRK20_PROOF, Address, STRK20_BALANCE_ENTRY, STRK20_DAPP_NAME, FELT as FELT$1, EDAMode as EDAMode$1, TypedDataRevision, StarknetType, StarknetMerkleType, OutsideCallV1, OutsideCallV2, BLOCK_ID, Event as Event$2, EmittedEvent as EmittedEvent$1, AddDeclareTransactionParameters, AddDeclareTransactionResult, AddInvokeTransactionParameters, AddInvokeTransactionResult, AccountDeploymentData, Permission, ChainId, SpecVersion, API_VERSION as API_VERSION$1, STRK20_ACTION as STRK20_ACTION$1 } from '@starknet-io/starknet-types-0105';
|
|
3
3
|
export { STRK20_BALANCE_ENTRY, STRK20_CALLDATA_ITEM, STRK20_CALLDATA_PLACEHOLDER, STRK20_COLLECT_POLICY, STRK20_DAPP_NAME, STRK20_DEPOSIT_ACTION, STRK20_INVOKE_ACTION, STRK20_PROOF, STRK20_REGISTER_ACTION, STRK20_TRANSFER_ACTION, STRK20_WITHDRAW_ACTION, StarknetDomain, StarknetEnumType, StarknetMerkleType, StarknetType, TypedData, TypedDataRevision } from '@starknet-io/starknet-types-0105';
|
|
4
4
|
import * as RPC$1 from '@starknet-io/starknet-types-0101';
|
|
5
5
|
import { WatchAssetParameters as WatchAssetParameters$1, AddStarknetChainParameters as AddStarknetChainParameters$1, Signature as Signature$2, AddDeclareTransactionParameters as AddDeclareTransactionParameters$1, AddDeclareTransactionResult as AddDeclareTransactionResult$1, AddInvokeTransactionParameters as AddInvokeTransactionParameters$1, AddInvokeTransactionResult as AddInvokeTransactionResult$1, AccountDeploymentData as AccountDeploymentData$1, Permission as Permission$1, Address as Address$1, ChainId as ChainId$1, TypedData as TypedData$1, SpecVersion as SpecVersion$1, API_VERSION as API_VERSION$2 } from '@starknet-io/starknet-types-0101';
|
|
@@ -12427,18 +12427,28 @@ declare function isStringWholeNumber(str: string): boolean;
|
|
|
12427
12427
|
*/
|
|
12428
12428
|
declare function getDecimalString(str: string): string;
|
|
12429
12429
|
/**
|
|
12430
|
-
* Convert string to
|
|
12430
|
+
* Convert a hex-string, or a string of decimal digits, to a hex-string
|
|
12431
12431
|
*
|
|
12432
|
-
*
|
|
12433
|
-
*
|
|
12434
|
-
*
|
|
12432
|
+
* The result has the form that a node expects for a felt: it starts with `0x`,
|
|
12433
|
+
* its letters are lowercase, and it has no leading zero.
|
|
12434
|
+
* For example, `'0X1F'` and `'0x001f'` both give `'0x1f'`.
|
|
12435
|
+
* @param {string} str the string to convert, like `'123'` or `'0X7B'`
|
|
12436
|
+
* @returns {string} the hex-string
|
|
12437
|
+
* @throws {Error} when `str` is `'0x'`, which has no digit
|
|
12438
|
+
* @throws {Error} when `str` is not a hex-string and not a string of decimal digits
|
|
12435
12439
|
* @example
|
|
12436
12440
|
* ```typescript
|
|
12437
12441
|
* const result = getHexString("123");
|
|
12438
12442
|
* // result = "0x7b"
|
|
12439
12443
|
*
|
|
12440
|
-
* const result2 = getHexString("
|
|
12444
|
+
* const result2 = getHexString("0X001F");
|
|
12445
|
+
* // result2 = "0x1f"
|
|
12446
|
+
*
|
|
12447
|
+
* const result3 = getHexString("Hello");
|
|
12441
12448
|
* // throws Error: Hello needs to be a hex-string or whole-number-string
|
|
12449
|
+
*
|
|
12450
|
+
* const result4 = getHexString("0x");
|
|
12451
|
+
* // throws Error: Invalid input: '0x' holds no hexadecimal digit
|
|
12442
12452
|
* ```
|
|
12443
12453
|
*/
|
|
12444
12454
|
declare function getHexString(str: string): string;
|
|
@@ -14130,74 +14140,57 @@ declare function getDefaultNodes(rpcVersion: _SupportedRpcVersion): {
|
|
|
14130
14140
|
declare function getSupportedRpcVersions(): _SupportedRpcVersion[];
|
|
14131
14141
|
declare const validBlockTags: ("latest" | "pre_confirmed" | "l1_accepted")[];
|
|
14132
14142
|
/**
|
|
14133
|
-
*
|
|
14134
|
-
*
|
|
14135
|
-
* hex string and BigInt are detected as block hashes. identifier return { block_hash: hash }
|
|
14136
|
-
*
|
|
14137
|
-
* decimal string and number are detected as block numbers. identifier return { block_number: number }
|
|
14143
|
+
* A Block reads the identifier of a block, and gives it in the form that an RPC request expects.
|
|
14138
14144
|
*
|
|
14139
|
-
*
|
|
14145
|
+
* - A number, or a string of digits, is a block number. `identifier` returns `{ block_number: 631581 }`.
|
|
14146
|
+
* - A hex string or a bigint is a block hash. A block hash is a felt. `identifier` returns
|
|
14147
|
+
* `{ block_hash: '0x…' }`, with a lowercase `0x` and without leading zeros, as the RPC
|
|
14148
|
+
* specification asks.
|
|
14149
|
+
* - A block tag (`'latest'`, `'pre_confirmed'` or `'l1_accepted'`) stays a tag. `identifier` returns it.
|
|
14150
|
+
* - `null` and `undefined` mean `'latest'`.
|
|
14140
14151
|
*
|
|
14141
|
-
*
|
|
14152
|
+
* A Block cannot be changed after its creation. For another block, create a new Block.
|
|
14142
14153
|
* @example
|
|
14143
14154
|
* ```typescript
|
|
14144
|
-
* const result = new provider.Block(
|
|
14145
|
-
* // result =
|
|
14155
|
+
* const result = new provider.Block('631581').identifier;
|
|
14156
|
+
* // result = { block_number: 631581 }
|
|
14146
14157
|
* ```
|
|
14147
14158
|
*/
|
|
14148
14159
|
declare class Block {
|
|
14160
|
+
/** It holds the block hash when the block is given by its hash. Otherwise, it is null. */
|
|
14161
|
+
readonly hash: string | null;
|
|
14162
|
+
/** It holds the block number when the block is given by its number. Otherwise, it is null. */
|
|
14163
|
+
readonly number: number | null;
|
|
14164
|
+
/** It holds the block tag when the block is given by a tag. Otherwise, it is null. */
|
|
14165
|
+
readonly tag: BlockTag | null;
|
|
14149
14166
|
/**
|
|
14150
|
-
*
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
*
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
/**
|
|
14158
|
-
* @param {BlockIdentifier} tag if not null, contains "pre_confirmed" or "latest"
|
|
14159
|
-
*/
|
|
14160
|
-
tag: BlockIdentifier;
|
|
14161
|
-
private setIdentifier;
|
|
14162
|
-
/**
|
|
14163
|
-
* Create a Block instance
|
|
14164
|
-
* @param {BlockIdentifier} _identifier hex string and BigInt are detected as block hashes.
|
|
14165
|
-
* decimal string and number are detected as block numbers.
|
|
14166
|
-
* text string are detected as block tag.
|
|
14167
|
-
* null is considered as a 'latest' block tag.
|
|
14168
|
-
*/
|
|
14169
|
-
constructor(_identifier: BlockIdentifier);
|
|
14170
|
-
/**
|
|
14171
|
-
* @returns {any} the identifier as a string
|
|
14167
|
+
* Create a Block.
|
|
14168
|
+
* @param {BlockIdentifier} _identifier the block number, the block hash or the block tag.
|
|
14169
|
+
* `null` and `undefined` mean `'latest'`.
|
|
14170
|
+
* @throws {Error} The identifier names no block. It is an empty string, a text that is not a
|
|
14171
|
+
* block tag, a hash that is not a felt (`'0x'`, a negative bigint, or a value larger than the
|
|
14172
|
+
* largest felt), a number that is not an integer, a negative number, a number larger than
|
|
14173
|
+
* `Number.MAX_SAFE_INTEGER`, or a value that is not a string, a number or a bigint.
|
|
14172
14174
|
* @example
|
|
14173
14175
|
* ```typescript
|
|
14174
|
-
* const result = new provider.Block(
|
|
14175
|
-
* // result =
|
|
14176
|
+
* const result = new provider.Block('0X0abc').identifier;
|
|
14177
|
+
* // result = { block_hash: '0xabc' }
|
|
14178
|
+
*
|
|
14179
|
+
* new provider.Block(1.5);
|
|
14180
|
+
* // throws Error: Block number (1.5) must be an integer
|
|
14176
14181
|
* ```
|
|
14177
14182
|
*/
|
|
14178
|
-
|
|
14183
|
+
constructor(_identifier: BlockIdentifier);
|
|
14179
14184
|
/**
|
|
14180
|
-
* @returns {
|
|
14185
|
+
* @returns {RPC.BLOCK_ID} the block in the form of the `block_id` of an RPC request:
|
|
14186
|
+
* `{ block_number: number }`, `{ block_hash: string }` or a block tag.
|
|
14181
14187
|
* @example
|
|
14182
14188
|
* ```typescript
|
|
14183
14189
|
* const result = new provider.Block(56789).identifier;
|
|
14184
14190
|
* // result = { block_number: 56789 }
|
|
14185
14191
|
* ```
|
|
14186
14192
|
*/
|
|
14187
|
-
get identifier():
|
|
14188
|
-
/**
|
|
14189
|
-
* change the identifier of an existing Block instance
|
|
14190
|
-
* @example
|
|
14191
|
-
* ```typescript
|
|
14192
|
-
* const myBlock = new provider.Block("latest");
|
|
14193
|
-
* myBlock.identifier ="0x3456789abc";
|
|
14194
|
-
* const result = myBlock.identifier;
|
|
14195
|
-
* // result = { block_hash: '0x3456789abc' }
|
|
14196
|
-
* ```
|
|
14197
|
-
*/
|
|
14198
|
-
set identifier(_identifier: BlockIdentifier);
|
|
14199
|
-
valueOf: () => BlockIdentifier;
|
|
14200
|
-
toString: () => BlockIdentifier;
|
|
14193
|
+
get identifier(): BLOCK_ID;
|
|
14201
14194
|
}
|
|
14202
14195
|
|
|
14203
14196
|
type provider_Block = Block;
|