Questions tagged [rust-web3]

rust-web3 is a Rust library for web3 transactions. Use this tag for questions about using the rust-web3 crate.

5 questions
1
vote
1 answer

Unsatisfied `Default` trait bound on type required by standard library

I'm using a type from the web3 crate, web3::contract::Contract. The compiler is complaining with E0277: $ cargo run Compiling proj v0.1.0 (/home/user/proj) error[E0277]: the trait bound…
sporejack
  • 71
  • 1
  • 6
0
votes
0 answers

How do I correctly implement Tokenize for, for example, a slot0 query to the UniswapV3 Pool contract?

I am trying to retrieve the slot0 data from a UniswapV3 liquidity pool. This is pretty straightforward on Golang, but giving me major problems in Rust. Like Swapping tokens is problematic for me in Golang but easy in Rust. I am hoping somebody can…
0
votes
1 answer

How do I pass in a number to web3.eth().block()?

I'm using the rust-web3 crate to connect to an ethereum node and get information about a block by it's block number (or block height). Based on this example here is how I was able to implement it: use web3; use web3::types::{BlockId, BlockNumber,…
jmezo
  • 13
  • 2
-1
votes
1 answer

How to store API keys in dApp NEAR

For example, my application uses IPFS, access to which I get through web3.storage. But for the web3.storage to work, you need an API token, for which I paid. Where to store this token if everything is open source? On the frontend, anyone can see my…
Jor
  • 11
  • 3
-1
votes
1 answer

How to correctly import web3::api::eth::Eth pub fn transaction_count in Rust?

I'm new to Rust. I'm trying to import the function web3::api::eth::Eth pub fn transaction_count but unable to do so. I have web3 crate installed in my Carg.toml file: web3 = "0.18.0" Since hovering over the transaction_count function showed: pub fn…
NewToCode
  • 174
  • 8