This is a cargo utility that allows developers to generate visualizations depicting data flows within their NEAR Rust smart contracts.
Provides the ability to generate representations of methods to allow for anyone to quickly understand how the contract works.
Smart contract developers use it to generate the images, but the images can help anyone trying to understand what’s going on.
Feature | Description |
---|---|
View Functions | Near smart contract view only functions |
Mutation | Near smart contract mutable functions |
Process | Helper or utility functions, also functions out of smart contract scope |
Events | Functions that falls into near event standard |
View Trait Impl | View only functions but trait implamentation |
Mutation Trait Impl | Mutable functions but trait implamentation |
Payable | Functions that except Near |
Initializers | Smart contract initializer functions |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Install cli with brew
brew install mermaid-cli
cargo install web3d
Install node
brew install node
git clone git@github.com:near-examples/rust-ft-raffle.git
cd rust-ft-raffle
web3d -O --input raffle.md
Key/Command | Description |
---|---|
-b, --backgroundColor | Background color. Example: transparent, red, '#F0F0F0'. Optional. Default: white |
-h, --help | Print help information |
-H, --height | Height of the page. Optional. Default: 600 |
-i, --input | Markdown file name |
-o, --output | Output file name. It should be either md, svg, png or pdf. Optional. Default:'./res/input_file_name.svg' |
-O, --openb | Should open output file in browser |
-q, --quiet | Suppress log output |
-w, --width | Width of the page. Optional. Default: 800 |