Comments (3)
Hmm I think one of the benefits of using this pattern is that we can hide away the complicated details (nonce & fees) from users. So I'd vote for not having to explicitly set use_next_nonce()
.
from starknet-rs.
What I have in mind is the following.
We should change the execute()
method in Account
trait to:
- not accept a
nonce
parameter; and - return some new type
AccountCall
(as always, naming not final), which contains somesend()
method that will actually make the requests.
The proposed new type AccountCall
will have these methods, apart from send()
:
nonce()
max_fee()
When send()
is called, it'll use whatever nonce
and max_fee
supplied. If none is given, it will call get_nonce()
and estimate_fees
to figure out automatically.
@milancermak WDYT?
from starknet-rs.
Yes, this sounds great!
What do you think about having to use explicit and mutually exclusive setters for nonce / fee? So you'd either have to nonce(20)
to set it as you wish or use_next_nonce()
to get it from the get_nonce()
call. I guess the only advantage is that the values are set explicitly instead of using a default. I have no strong feelings about this, just curious what your opinion is.
from starknet-rs.
Related Issues (20)
- Legacy contract class corrupted when deserialized through `ContractArtifact` HOT 1
- `starknet-core` dependency `serde_json` arbitrary precision feature flag HOT 4
- starknet contract 2.0 support HOT 3
- estimateFee version support HOT 6
- `no_std` support for `starknet-core` HOT 3
- Support declare transactions with version 0x0 HOT 2
- Support `starknet_simulateTransactions` in Provider trait for JsonRpcClient HOT 2
- [feat] Add contract types like in other SDKs HOT 1
- Improve codebase, fix potential issues HOT 8
- ContractFactory::deploy should return deployment address HOT 1
- Add provider function to get L1 message hash (where applicable) HOT 3
- ECDSA signature validation doesn't comply common rules HOT 3
- Elliptic curve point multiplication is not constant time. HOT 1
- Pedersen hash is not constant time HOT 1
- Poseidon hash instances are hardcoded HOT 1
- Incorrect error handling HOT 3
- Make hardcoded RPC address configurable HOT 1
- False Negative: jsonrpc_estimate_fee test HOT 3
- How to fix private_key OutOfRange HOT 4
- Entry point offset could be deserialized from numeric value HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starknet-rs.