0xweb
TypeScript icon, indicating that this package has built-in type declarations

0.10.45 • Public • Published

0xWeb - Contract package manager and CLI Web3 Toolkit


Website Link Documentation Link NPM version CircleCI

Contract Package Manager

Generate TypeScript classes for contracts fetched from Etherscan and Co.

We use 📦 dequanto library for the wrapped classes

Here the example of generated classes: 0xweb-org/0xweb-sample 🔗

Install

$ npm i 0xweb -g

# Boostrap dequanto library in cwd
$ 0xweb init

# Download sources/ABI and generate TS classes
$ 0xweb install 0x5f4ec3df9cbd43714fe2740f5e3616155c5b8419 --name chainlink/oracle-eth

API Usage

Use autogenerated TypeScript classes for much safer and faster backend implementation

import { ChainlinkOracleEth } from './0xweb/eth/chainlink/oracle-eth/oracle-eth';
import { Config } from '@dequanto/Config';
import { $bigint } from '@dequanto/utils/$bigint';

await Config.fetch();

let oracle = new ChainlinkOracleEth();
let decimals = await oracle.decimals();
let price = await oracle.latestAnswer();

console.log(`ETH Price`, $bigint.toEther(price, decimals));

CLI Usage

READ and WRITE to installed contracts directly from the command line

$ 0xweb contract chainlink/oracle-eth latestAnswer

Config

❗❣️❗ We include our default KEYs for etherscan/co and infura. They are rate-limited. Please, create and insert your keys. Thank you!

$ 0xweb config --edit

## optionally, you can provide the Nodes Endpoint with `--endpoint` flag
$ 0xweb COMMAND --endpoint https://my-node-url-here

Various Blockchain tools

Get the commands overview

$ 0xweb --help
$ 0xweb install --help

block

  1. Get current block info
$ web3 block get latest

token

  1. Get Token Price
$ 0xweb token price WETH

accounts

🔐 Wallet feature allows to store accounts in encrypted local storage. We use local machine KEY and provided PIN in arguments to create cryptographically strong secrets 🔑 for encryption.

When calling contracts WRITE methods, you should first add an account to the wallet, and then use PIN to unlock the storage

$ 0xweb account add --name foo --key the_private_key --pin foobar
$ 0xweb token transfer USDC --from foo --to 0x123456 --amount 20 --pin foobar

🏁


©️ MIT License.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.10.45
2latest

Version History

VersionDownloads (Last 7 Days)Published
0.10.45
2
0.10.44
0
0.10.43
0
0.10.42
0
0.10.41
0
0.10.40
0
0.10.39
0
0.10.38
0
0.10.37
0
0.10.35
0
0.10.34
0
0.10.33
0
0.10.32
0
0.10.31
0
0.10.29
0
0.10.28
0
0.10.27
0
0.10.23
0
0.10.22
0
0.10.21
0
0.10.190
0.10.180
0.10.170
0.10.160
0.10.150
0.10.140
0.10.131
0.10.120
0.10.110
0.10.100
0.10.90
0.10.80
0.10.70
0.10.60
0.10.50
0.10.40
0.10.30
0.10.21
0.10.10
0.9.978
0.9.963
0.9.953
0.9.942
0.9.932
0.9.922
0.9.912
0.9.902
0.9.893
0.9.882
0.9.872
0.9.863
0.9.852
0.9.842
0.9.832
0.9.822
0.9.803
0.9.792
0.9.782
0.9.772
0.9.762
0.9.752
0.9.743
0.9.732
0.9.722
0.9.712
0.9.702
0.9.692
0.9.683
0.9.672
0.9.662
0.9.652
0.9.642
0.9.632
0.9.623
0.9.612
0.9.602
0.9.585
0.9.572
0.9.563
0.9.552
0.9.542
0.9.532
0.9.523
0.9.512
0.9.502
0.9.492
0.9.482
0.9.472
0.9.462
0.9.453
0.9.442
0.9.432
0.9.422
0.9.412
0.9.402
0.9.392
0.9.382
0.9.373
0.9.362
0.9.352
0.9.342
0.9.332
0.9.329
0.9.315
0.9.303
0.9.292
0.9.283
0.9.274
0.9.263
0.9.253
0.9.243
0.9.233
0.9.223
0.9.213
0.9.203
0.9.193
0.9.183
0.9.173
0.9.163
0.9.153
0.9.143
0.9.123
0.9.103
0.9.93

Package Sidebar

Install

npm i 0xweb

Homepage

0xweb.org

Weekly Downloads

10

Version

0.10.45

License

MIT

Unpacked Size

23.9 MB

Total Files

308

Last publish

Collaborators

  • tenbits