Cyber Bindings for CosmWasm
This crate provides Cyber-specific bindings to enable your CosmWasm smart contracts to interact with the Cyber blockchain by exposing messages and queriers that can be emitted and used from within your contract.
Bindings
Currently, the Cyber bindings include:
- Query support for:
- Graph
- ParticlesAmount
- CyberlinksAmount
- Bandwidth
- BandwidthPrice
- BandwidthLoad
- BandwidthTotal
- NeuronBandwidth
- Rank
- ParticleRank
- Energy
- SourceRoutes
- SourceRoutedEnergy
- DestinationRoutedEnergy
- Route
- DMN
- Thought
- ThoughtStats
- ThoughtLowestFee
- Liquidity
- PoolParams
- PoolLiquidity
- PoolSupply
- PoolPrice
- PoolAddress
- Graph
- Messages
- Graph
- MsgCyberlink
- Resources
- MsgInvestmint
- Energy
- MsgCreateRoute
- MsgEditRoute
- MsgEditRouteName
- MsgDeleteRoute
- DMN
- MsgCreateThought
- MsgForgetThought
- MsgChangeThoughtInput
- MsgChangeThoughtPeriod
- MsgChangeThoughtBlock
- MsgChangeThoughtGasPrice
- MsgChangeThoughtParticle
- MsgChangeThoughtName
- Liquidity
- MsgCreatePool
- MsgDepositWithinBath
- MsgWithdrawWithinBath
- MsgSwapWithinBath
- Graph
Usage
Querying
In order to use the query functions enabled by the bindings, create a CyberQuerier
instance within your contract logic. You can access all the enabled queries through this object.
// src/contract.rs
use Coin;
use ;
...
// handler
Creating Messages
You may want your contract to perform messages such as MsgCyberlink
operations at the end of its execution. To do this, create a message using the predefined functions:
create_cyberlink_msg
use CosmosMsg;
use ;
...