Crates.io | w3kit |
lib.rs | w3kit |
version | 0.1.5 |
source | src |
created_at | 2023-02-05 20:09:01.885033 |
updated_at | 2023-02-07 01:02:17.68369 |
description | A toolkit for several blockchains. |
homepage | |
repository | |
max_upload_size | |
id | 777365 |
size | 123,264 |
cargo install w3kit
to build the library from this GitHub repository you can run:
make build
note that all cargo commands relevant to this work are encoded in the Makefile
.
create an .env
file:
cp .env.example .env
vim .env
then add the config for the desired chain:
PROVIDER_URL_WS=
PROVIDER_URL_HTTP=
> w3kit http -b ethereum
✅ connecting to "ethereum"
✅ current block: 16572583
> w3kit ws -b ethereum
✅ connecting to "ethereum"
✅ current block: 16572598
> w3kit account -b ethereum -a 0xbA4C081942E6a25cAF87c5489B91b449c67f3078
✅ connecting to "ethereum"
✅ fetching account info: "0xbA4C081942E6a25cAF87c5489B91b449c67f3078"
✅ retrieving balances...
💰 account 0xba4c081942e6a25caf87c5489b91b449c67f3078 👉 0.0672775267238201 ETH
> w3kit coin ethereum
✅ fetching coin info: "ethereum"
✅ fetching price for ethereum in usd
✅ GET https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd
💰 ethereum price 👉 {"ethereum":{"usd":1623.04}}
> w3kit http -b arbitrum
> w3kit ws -b arbitrum
> w3kit account -b arbitrum -a <account>
> w3kit http -b avalanche
> w3kit ws -b avalanche
> w3kit account -b avalanche -a <account>
> w3kit http -b near
> w3kit ws -b near
> w3kit account -b near -a <account>
> w3kit http -b optimism
> w3kit ws -b optimism
> w3kit account -b optimism -a <account>
> w3kit http -b polygon
> w3kit ws -b polygon
> w3kit account -b polygon -a <account>
> w3kit http -b solana -a
> w3kit ws -b solana -a
> w3kit account -b solana -a <account>