Official ProximaX Supercontracts SDK Library in Rust lang.
All Supercontracts stuff include in dependency:
[dependencies]
xpx_supercontracts_sdk = "0.1"
To start new development new Supercontract follow this steps:
-
cargo new sc-app
-
Add to
Cargo.toml
:
[dependencies]
xpx_supercontracts_sdk = "0.1"
- Add to
src/main.rs
:
extern xpx_supercontracts_sdk;
use xpx_supercontracts_sdk::utils::ping;
#[no_mangle]
pub extern "C" fn app_main() -> i64 {
ping(100).unwrap()
}
- Build:
cargo build --target wasm32-unknown-unknown --release
- If build success result contains in:
target
- Convert to Wat/Wast format:
wasm2wat sc-app
See Docs
directory.
- See
eamples
directory - Build specific exmaple:
cargo build --target wasm32-unknown-unknown --example ping --release
Copyright (c) 2019 ProximaX Limited