Cardano Example Dapp
Advanced DAPP connection
Connection that requires some wallet data and then signs it with private keys
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": "🚀 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
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
