Cardano Example Dapp
Await conditions
This demo will wait for a timer to reach its timeout and then for the current wallet to receive at least 5.25 coins
Try it online:
- Visit HTML+JS Dapp
- Visit HTML+React Dapp
- Visit Native HTML dapp
- Run Run in Wallet…Open in IDE…
Source code:
- dapp connection code: GCScript DSL
- frontend (using @gamechanger-finance/gc): HTML+JS dapp
- frontend (using @gamechanger-finance/gc): HTML+React dapp
- frontend (without official library): Native HTML dapp
Dapp code was autogenerated by Playground IDE in GameChanger Wallet
GCScript code (dapp connection):
{
"title": "Await conditions",
"description": "This demo will wait for a timer to reach its timeout and then for the current wallet to receive at least 5.25 coins",
"type": "script",
"returnURLPattern": "http://localhost:3000/demo/api/dapp",
"run": {
"address": {
"type": "getCurrentAddress"
},
"wait": {
"type": "await",
"until": {
"A": {
"kind": "timer",
"value": 15
},
"B": {
"kind": "balance",
"asset": {
"policyId": "ada",
"assetName": "ada",
"quantity": "5250000"
}
},
"C": {
"kind": "balance",
"address": "addr1q98f06pcrsn8x03uw0vlejw684fcu02waffvfscdsz0djgqd6j6v0fc04n5ehg292yxvs292vesrqqmxqfnp7yuwn7yq2vsyn7",
"is": "equal",
"asset": {
"policyId": "d491234d8b40b63aceab0d7329c6db111c3634d9e0d3c6166c66c13b",
"assetName": "FakeUSD",
"quantity": "5"
}
},
"D": {
"kind": "timer",
"unit": "days",
"value": 365
}
}
}
}
}
Run standalone QR dapp connection:
You can use Playground IDE in GameChanger Wallet in QR URL Transport mode to capture results
Resources
- How to connect?
- Docs and examples on Github
- GCScript documentation
- Playground IDE in GameChanger Wallet
- Tutorials on Youtube
- Support on Discord
- News on Twitter
- Website
License
MIT
