Ownables are CosmWasm smart contracts that define ownership. In addition to running on a Cosmos blockchain, Ownables can run directly in a wallet using the LTO Network private layer.
The SDK contains examples and tools for developing Ownables.
npm i
npm run rustup
npm run ownables:build-all
npm start
Once that is done, navigate to http://localhost:3000/ and you should see an empty wallet that is ready to import Ownable packages.
In the wallet, click the + icon at the bottom right. This will open an action menu in which we can choose to import a
new Ownable from a file and select a zipped package. The packages are located in the ownables
folder.
Please read the documentation to learn more about Ownables.
The wallet is a React application that can be used to test Ownables.
In the project directory, you can run:
Runs the app in the development mode. Open http://localhost:3000 to view it in the browser. The page will reload if you make edits. You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode. See the section about running tests for more information.
Builds the app for production to the build
folder. It correctly bundles React in production mode and optimizes the
build for the best performance.
The build is minified and the filenames include the hashes. Your app is ready to be deployed!
See the section about deployment for more information.
Rustup, so that you can set up the wasm32 target:
curl https://sh.rustup.rs -sSf | sh
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
rustup default stable
cargo version
rustup update stable
rustup target list --installed
rustup target add wasm32-unknown-unknown
Alternatively run npm run rustup
.
npm run ownables:build --package=car
A static Ownable, with a widget that shows an MP4 loop of a car.
An basic stateful Ownable. The potion gets a random color when instantiated. You can drink a portion of the potion, until it's empty.
An Ownable to showcase Consumables. The robot will change as it consumes an upgrade.
Consumables are Ownables with a consume
method. The following Consumables are available for the robot:
A Consumable with a random color. Consume it to change the color of the robot.
Adds an antenna to the robot. Only one antenna can be added.
Adds speakers to the robot. Only one set of speakers can be added.
Adds armor to the robot. Only one shield can be added.