Cardano Example Dapp
Delegate Current Address to PEACE (MAINNET)
About to delegate your ADA to 'PEACEpool Cardano ecosystem developers' stake pool. The stake key is registered and delegated in a single transaction, and an already registered stake key is handled, so the same script also works when re-delegating.
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": "Delegate to [PEACE]",
"description": "About to delegate your ADA to 'PEACEpool Cardano ecosystem developers' stake pool. The stake key is registered and delegated in a single transaction, and an already registered stake key is handled, so the same script also works when re-delegating.",
"exportAs": "data",
"require": {
"not": {
"walletTypeIn": [
"burner",
"gift"
]
},
"networkTag": "mainnet"
},
"type": "script",
"return": {
"mode": "last"
},
"run": {
"dependencies": {
"type": "script",
"run": {
"currentAddress": {
"type": "getCurrentAddress"
},
"addressInfo": {
"type": "macro",
"run": "{getAddressInfo(get('cache.dependencies.currentAddress'))}"
},
"poolKeyHash": {
"type": "data",
"value": "bd24b3372791f401cc029455c44ea77f3c8750ce3b804a354af0ff16"
}
}
},
"registrationCert": {
"type": "certificate",
"cert": {
"kind": "StakeRegistration",
"pubKeyHashHex": "{get('cache.dependencies.addressInfo.stakingKeyHash')}"
}
},
"delegationCert": {
"type": "certificate",
"cert": {
"kind": "StakeDelegation",
"pubKeyHashHex": "{get('cache.dependencies.addressInfo.stakingKeyHash')}",
"poolKeyHashHex": "{get('cache.dependencies.poolKeyHash')}"
}
},
"txs": {
"type": "script",
"run": {
"buildDelegate": {
"type": "buildTx",
"title": "Delegate to [PEACE]",
"tx": {
"certificates": [
{
"certHex": "{get('cache.registrationCert')}"
},
{
"certHex": "{get('cache.delegationCert')}"
}
],
"options": {
"autoProvision": {
"workspaceNativeScript": true
},
"autoOptionalSigners": {
"nativeScript": true
},
"autoClean": {
"certReRegistrations": true
}
}
}
},
"signDelegate": {
"type": "signTxs",
"detailedPermissions": false,
"txs": [
"{get('cache.txs.buildDelegate.txHex')}"
]
},
"submitDelegate": {
"type": "submitTxs",
"txs": "{get('cache.txs.signDelegate')}"
}
}
},
"finally": {
"type": "macro",
"run": {
"address": "{get('cache.dependencies.currentAddress')}",
"rewardAddress": "{get('cache.dependencies.addressInfo.rewardAddress')}",
"stakePoolKeyHash": "{get('cache.dependencies.poolKeyHash')}",
"txHash": "{get('cache.txs.buildDelegate.txHash')}"
}
}
}
}
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
.png)