Cardano Example Dapp
Multi Stake Withdrawal
Script that requests 3 child wallet's reward addresses from an specific workspace, to later withdraw some staking rewards from each of them on a single transaction. You need to have staking rewards on each child wallet and run 'Multi Stake Delegation' demo first or load its wallet configuration on this device
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):
{
"type": "script",
"title": "Multi Stake Withdrawal",
"description": "Script that requests 3 child wallet's reward addresses from an specific workspace, to later withdraw some staking rewards from each of them on a single transaction. You need to have staking rewards on each child wallet and run 'Multi Stake Delegation' demo first or load its wallet configuration on this device",
"require": {
"not": {
"walletTypeIn": [
"extension"
]
}
},
"exportAs": "MultiWithdrawlDemo",
"returnURLPattern": "http://localhost:3000/demo/api/dapp",
"run": {
"setWorkspace": {
"type": "setCurrentWorkspace",
"workspaceId": "demos"
},
"dependencies": {
"type": "script",
"run": {
"rewardValue": {
"type": "data",
"value": "1000000"
},
"addresses": {
"type": "getAddresses",
"keyPattern": "{artifactName}"
}
}
},
"txs": {
"type": "script",
"run": {
"buildWithdraw": {
"type": "buildTx",
"name": "WithdrawTx",
"tx": {
"withdrawals": {
"A": {
"address": "{get('cache.dependencies.addresses.RewardAddress-A.address')}",
"quantity": "{get('cache.dependencies.rewardValue')}"
},
"B": {
"address": "{get('cache.dependencies.addresses.RewardAddress-B.address')}",
"quantity": "{get('cache.dependencies.rewardValue')}"
},
"C": {
"address": "{get('cache.dependencies.addresses.RewardAddress-C.address')}",
"quantity": "{get('cache.dependencies.rewardValue')}"
}
}
}
},
"signWithdraw": {
"type": "signTxs",
"namePattern": "signed-{key}",
"detailedPermissions": false,
"txs": {
"withdraw": "{get('cache.txs.buildWithdraw.txHex')}"
}
},
"submitWithdraw": {
"type": "submitTxs",
"namePattern": "submitted-{key}",
"txs": "{get('cache.txs.signWithdraw')}"
}
}
},
"finally": {
"type": "script",
"exportAs": "MultiWithdraw",
"run": {
"signWithdraw": {
"type": "macro",
"run": "{get('cache.txs.buildWithdraw.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
