Releases: xJonathanLEI/starknet-rs
starknet/v0.17.0
New crate versions
starknet: v0.17.0starknet-macros: v0.2.5starknet-contract: v0.16.0starknet-accounts: v0.16.0starknet-providers: v0.16.0starknet-signers: v0.14.0starknet-core: v0.16.0starknet-crypto: v0.8.1starknet-curve: v0.6.0starknet-tokio-tungstenite: v0.3.0
Summary
This is a breaking release targeting JSON-RPC v0.9.0 and Starknet v0.14.0. The major breaking changes include the renaming of "pending" terminology to "pre-confirmed" throughout the API, restructuring of message status types, and support for transaction tips.
New features
Transaction tip support
Transaction tips are now supported across declaration, execution, and deployment transactions, allowing users to specify priority fees for faster transaction inclusion.
Built-in support for new UDC
The contract factory now includes built-in support for the new Universal Deployer Contract (UDC). The previous new() constructor has been deprecated in favor of the more specific new_with_udc() method.
Enhanced API visibility
Several previously internal APIs have been made public for better programmability:
ProviderImplErrortrait for custom provider implementations- Methods for getting broadcasted transaction requests
PoseidonHashernow derivesClone
Breaking changes
Change of target JSON-RPC version
See the full changes in the official specification repo. Main chagnes include:
- All references to "pending" blocks and states have been renamed to "pre-confirmed".
- A pending-related WebSocket stream has been removed:
starknet_subscribePendingTransactions
- Two new WebSocket streams have been added:
starknet_subscribeNewTransactionsstarknet_subscribeNewTransactionReceipts
starknet/v0.16.0
New crate versions
starknet: v0.16.0starknet-macros: v0.2.4starknet-contract: v0.15.0starknet-accounts: v0.15.0starknet-providers: v0.15.0starknet-signers: v0.13.0starknet-core: v0.15.0starknet-tokio-tungstenite: v0.2.0
Summary
This is a breaking release but the target JSON-RPC version remains at v0.8.1. The breakage comes from the fix for the TransactionStatus type in #750.
New features
SNIP-12 typed data encoding API
A wider set of SNIP-12 related encoding API is now exposed to allow better programmability.
WebSocket heartbeat support
The starknet-tokio-tungstenite crate has been enhanced with automatic heartbeat handling to maintain connection stability.
Bug fixes
Transaction failure reasons
Fixed an issue where transaction failure reasons were missing for transactions with REJECTED status. The failure reason is now properly included in the response.
starknet/v0.15.1
New crate versions
starknet: v0.15.1starknet-providers: v0.14.1
New features
Cloudflare Workers support
A new (feature-gated) transport WorkersTransport allows the JSON-RPC client to be used in the Cloudflare Workers environment.
starknet/v0.15.0
New crate versions
starknet: v0.15.0starknet-tokio-tungstenite: v0.1.0starknet-macros: v0.2.3starknet-contract: v0.14.0starknet-accounts: v0.14.0starknet-providers: v0.14.0starknet-signers: v0.12.0starknet-core: v0.14.0
Breaking changes
reqwest bumped to 0.12.x
This affects clients that construct HttpTransport manually.
Default account block is now Pending
The default block SingleOwnerAccount uses to query network state used to be Latest. This has caused issues especially for new users. The default has now been changed to Pending instead.
This should have minimal impact, as most users already always change the block to Pending anyway.
Changed field types on JSON-RPC types
Types of some fields of certain generared JSON-RPC types have been changed. This is mostly to account for changes in the specs itself, and the added support for optional request fields.
New features
Updated for JSON-RPC v0.8.1
The offcial target spec version is now v0.8.1, upgraded from v0.8.0.
WebSocket subscription support
WebSocket subscriptions are now supported via the new starknet-tokio-tungstenite crate. See the new websocket example for usage.
Only the tokio async runtime is supported for now.
StarknetError now prints inner errors
The Display impl of StarknetError now prints inner error data if any. Previously only the error variant name was displayed.
starknet/v0.14.0
New crate versions
starknet: v0.14.0starknet-macros: v0.2.2starknet-contract: v0.13.0starknet-accounts: v0.13.0starknet-providers: v0.13.0starknet-signers: v0.11.0starknet-core: v0.13.0
Breaking changes
Switch to JSON-RPC v0.8.0
starknet-rs does not support using multiple JSON-RPC spec versions side-by-side. The current active spec version has been changed from v0.7.1 to v0.8.0.
Removal of pre-v3 transactions
Pre-v3 transactions will soon be removed from the Starknet network. They have been excluded from JSON-RPC spec v0.8.0, and due to the switch to v0.8.0, starknet-rs no longer supports sending these older versions of transactions.
Nevertheless, as of this writing, the network itself still accepts pre-v3 transactions. Use a previous release of starknet-rs to continue sending these transactions. However, it's recommended that you upgrade soon.
New features
JSON-RPC v0.8.0 support
The library now uses spec v0.8.0.
Ledger app 2.0.0+ support
Due to breaking changes introduced in the Starknet Ledger app v2.0.0+, the library would sometimes fetch incorrect signatures from a device. An app version query has been added to be compatible with the latest version.
Bug fixes
SNIP-12 message hash parity with starknet.js
The library previously implemented SNIP-12 correctly. However, due to bugs found in starknet.js, the de facto standard, a few deviations have been made in order to yield the same message hashes as starknet.js.
starknet/v0.13.0
New crate versions
starknet: v0.13.0starknet-signers: v0.10.1starknet-providers: v0.12.1starknet-crypto: v0.7.4starknet-core: v0.12.1starknet-core-derive: v0.1.0starknet-contract: v0.12.0starknet-accounts: v0.12.0
Breaking changes
ArgentAccountFactory updated for Argent X contracts v0.4.0
The ArgentAccountFactory type for deploying Argent X accounts has been updated to use the new constructor signature from Argent X contracts v0.4.0. Using this updated type with older class hashes would not work.
Deprecations
All functions that involve using pre-v3 transactions are now deprecated. Downstream libraries and applications are advised to migrate to using v3 transactions.
New features
Basic Cairo encoding/decoding support
Basic Cairo (de)serialization support has been added via the derivable Encode and Decode traits.
A new example is available for demonstrating this feature.
Basic SNIP-12 support
Support for SNIP-12 message hashing has been implemented via the new TypedData type.
A new example is available for demonstrating this feature.
starknet/v0.12.0
New crate versions
starknet: v0.12.0starknet-signers: v0.10.0starknet-providers: v0.12.0starknet-macros: v0.2.1starknet-curve: v0.5.1starknet-crypto: v0.7.2starknet-core: v0.12.0starknet-contract: v0.11.0starknet-accounts: v0.11.0
Breaking changes
Signer trait changes
The Signer trait has been updated in #617 and #648 to account for the fact that some Signer implementations are most expensive to use than others, sometimes even depending on the calls being made. The new feature is known as "signer interactivity". When an implementation is behaving as interactive, higher-level types (e.g. Account) in the library would avoid signature requests unless absolutely necessary.
CompiledClass changes
In #651, the type for the bytecode_segment_lengths field in CompiledClass has been changed to fix a deserialization bug. This only affects downstream code that constructs CompiledClass directly.
New features
Ledger signer
Added in #605, a new Signer implementation backed by the Ledger hardware wallet is now available. The feature is off by default and must be turned on via the ledger feature of starknet-signers.
The new type LedgerStarknetApp can also be used outside of the context of Signer to use Ledger-specific functionalities (e.g. getting Ledger app version).
Support for JSON-RPC batch requests
Implemented in #653, it's now possible to send multiple JSON-RPC requests in parallel utilizing the same HTTP request.
starknet/v0.11.0
New crate versions
starknet: v0.11.0starknet-signers: v0.9.0starknet-providers: v0.11.0starknet-macros: v0.2.0starknet-curve: v0.5.0starknet-crypto: v0.7.0starknet-crypto-codegen: v0.4.0starknet-core: v0.11.0starknet-contract: v0.10.0starknet-accounts: v0.10.0
Breaking changes
The FieldElement type has been replaced by Felt from starknet-types-core
Note
As noted in #562, performance of EC and Poseidon operations has decreased with this type migration. More work is required to investigate the performance drop.
Following an ecosystem-wide initiative to unify field element types across different crates, starknet-rs has replaced the use of its own FieldElement type from the starknet-ff crate with the Felt type from starknet-types-core.
This has resulted in huge breaking changes for most, if not all, users of the starknet-rs library. To resolve the breakage, simply replace all uses of FieldElement with Felt. Note that the new Felt type is available as a re-export from starknet-core as starknet_core::types::Felt (or starknet::core::types::Felt), similar to how the old FieldElement type used to be available from starknet_core::types::FieldElement. You don't have to explicitly import the starknet-types-core crate, unless you have a reason to do so.
The public API of the new Felt type is quite similar to what FieldElement used to offer, with a few notable differences:
-
.from_hex_be()is now.from_hex(). -
.from_mont()is removed. A new method.from_raw()is available for constructingFeltinconstcontexts. However, note that.from_mont()and.from_raw()DO NOT take the same input. In fact, you must reverse the input you gave.from_mont()to.from_raw().You're always advised to use
felt!()for constructingconstfield element instances, which encapsulates this underlying complexity for you. -
Similarly,
.into_mont()has been removed and.to_raw()is available as an alternative. -
.from_bytes_be()now cannot fail, so it returnsFeltistead ofOption<Felt>.
Macros like felt!() and selector!() still work the same way they did, except the expression type is now Felt instead of FieldElement.
Removal of the starknet-ff crate
Due to the replacement of FieldElement by Felt, the starknet-ff crate is no longer useful. The crate has been removed from this repository. If you need direct access to the field element crate, change to depend on starknet-types-core instead.
Supported JSON-RPC spec version changed to 0.7.1
As usual, starknet-rs does not support multiple JSON-RPC versions side by side. Users who wish to stay on JSON-RPC v0.6.x should use a previous lib version.
Account and AccountFactory traits
New methods have been added to the Account and AccountFactory traits to support v3 transactions. Downstream crates that implement these traits must be updated.
Deprecation
Deprecating unversioned calls from Account and AccountFactory
Due to the new addition of v3 transaction support, unversioned methods like .execute() and .declare() from Account, along with .deploy() from AccountFactory, are now deprecated. Using these would result in sending pre-v3 transactions - like they did before this upgrade, and hence only a deprecation, users are advised to use verisioned variants like .execute_v1() to clearly indicate the transaction version to be used. These deprecated methods will be removed in the upcoming v0.12.0 release.
New features
Support for JSON-RPC spec v0.7.1
Types have been updated to reflect the spec changes. A new .get_block_with_receipts() method has also been added to the Provider trait to support the new starknet_getBlockWithReceipts method from the specs.
Support for v3 transactions
While low-level types have been available for constructing v3 transaction for a while, the library hasn't offered a way to send them idiomatically, until now. Users can now use the new versioned methods from Account and AccountFactory like .execute_v3() for sending v3 transactions and pay transaction fees in STRK.