Skip to main content

Cardano Example Dapp

Using console​

Let's use dapp connector internal console to log or debug some events. Run and go to Advanced - Console to read them.

Try it online:​

Source code:​

Dapp code was autogenerated by Playground IDE in GameChanger Wallet

GCScript code (dapp connection):​

{
"type": "script",
"title": "Using console",
"description": "Let's use dapp connector internal console to log or debug some events. Run and go to Advanced - Console to read them.",
"returnURLPattern": "http://localhost:3000/demo/api/dapp",
"run": {
"typesOfMessages": {
"type": "macro",
"run": [
"{console('log','Log message')}",
"{console('info','Info message')}",
"{console('warn','Warning message!')}",
"{console('error','Error message!!!')}"
]
},
"setGlobalAndLog": {
"type": "macro",
"run": "{\n set('temp1','hello');\n set('temp2',123);\n console('log',get('global'));\n console('info',get('global.temp1'));\n console('warn',get('global.temp2'));\n console('error',get('global.thisDoesNotExist')); \n return('goodbye!'); \n }"
},
"address": {
"type": "getCurrentAddress"
},
"logCache": {
"type": "macro",
"run": "{console('log',get('cache'))}"
},
"logMultipleThings": {
"type": "macro",
"run": {
"address": "{console('log','my address is',get('cache.address'))}",
"uuid": "{console('log',uuid(),uuid(),uuid())}",
"hash": "{console('log',sha256(get('cache.address')))}"
}
}
}
}

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