cpchain-dapps-language-support
v0.0.1
Published
CPChain DApps Language Support
Downloads
1
Readme
CPChain DApps Language Support
This is supported for the CPChain DApps Language.
Features
- Hightlight support for
cdl
files
Example
/**
* MetaToken Example
*/
// TODO xxx
// Test DApp
dapp MetaToken {
chain {
chain_id = 337
// Endpoint of the civilian
endpoint = "https://civilian.cpchain.io"
}
contract MetaToken {
address = "0x111"
// Transfer event
event Transfer {
from address
to address
value u256
a varchar(255)
}
when Transfer {
// ...
execute {
self.block.number
self.tx.from
self.event.to
}
}
}
// Account model,真实存储中,表名和字段名在前面加统一的下划线已
model Account {
account address pk
value u256
name varchar(255)
}
model Transaction {
from address
to address
value u256
}
when block {
}
// graphql query/mutation
api {
balance () {
}
}
cards {
card {
html = <div>
Hello world
</div>,
}
}
}
Requirements
Extension Settings
Known Issues
For more information
Enjoy!