Skip to main content

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:​

Source code:​

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

This GCScript/URL is too large! make it shorter uploading parts to GCFS. Unable to generate QR code

Resources​

License​

MIT