Skip to main content

Cardano Example Dapp

Advanced DAPP connection​

Connection that requires some wallet data and then signs it with private keys

Try it online:​

Source code:​

Dapp code was autogenerated by Playground IDE in GameChanger Wallet

GCScript code (dapp connection):​

{
"title": "🚀 Connect with dapp?",
"description": "About to share your public wallet information and a CIP-8 signature to verify this data",
"type": "script",
"exportAs": "connect",
"returnURLPattern": "http://localhost:3000/demo/api/dapp",
"run": {
"data": {
"type": "script",
"run": {
"name": {
"type": "getName"
},
"address": {
"type": "getCurrentAddress"
},
"spendPubKey": {
"type": "getSpendingPublicKey"
},
"stakePubKey": {
"type": "getStakingPublicKey"
},
"addressInfo": {
"type": "macro",
"run": "{getAddressInfo(get('cache.data.address'))}"
},
"agreement": {
"type": "macro",
"run": "{replaceAll('Myself, the user of wallet ADDRESS accepts to share all this information in order to connect with the dapp','ADDRESS',get('cache.data.address'))}"
},
"salt": {
"type": "macro",
"run": "{uuid()}"
}
}
},
"hash": {
"type": "macro",
"run": "{sha512(objToJson(get('cache.data')))}"
},
"sign": {
"type": "signDataWithAddress",
"address": "{get('cache.data.address')}",
"dataHex": "{get('cache.hash')}"
}
}
}

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