Skip to main content

Cardano Example Dapp

Submit 3 transactions and report errors​

This example will build 3 transactions, sign and submit them without halting on errors, instead it will continue script execution to return any errors reported from the nodes

Try it online:​

Source code:​

Dapp code was autogenerated by Playground IDE in GameChanger Wallet

GCScript code (dapp connection):​

{
"type": "script",
"title": "Submit 3 transactions and report errors",
"description": "This example will build 3 transactions, sign and submit them without halting on errors, instead it will continue script execution to return any errors reported from the nodes",
"exportAs": "txErrors",
"return": {
"mode": "last"
},
"run": {
"buildA": {
"type": "buildTx",
"title": "Will succeed",
"tx": {}
},
"buildB": {
"type": "buildTx",
"title": "Will fail",
"tx": {
"ttl": {
"until": "0"
}
}
},
"buildC": {
"type": "buildTx",
"title": "Will also succeed",
"tx": {}
},
"sign": {
"detailedPermissions": false,
"type": "signTxs",
"txs": {
"A": "{get('cache.buildA.txHex')}",
"B": "{get('cache.buildB.txHex')}",
"C": "{get('cache.buildC.txHex')}"
}
},
"submit": {
"type": "submitTxs",
"mode": "noWait",
"noFail": true,
"extras": true,
"txs": "{get('cache.sign')}"
},
"finally": {
"type": "macro",
"run": {
"status": {
"A": "{get('cache.submit.txsExtended.A.status')}",
"B": "{get('cache.submit.txsExtended.B.status')}",
"C": "{get('cache.submit.txsExtended.C.status')}"
},
"txHashes": {
"A": "{get('cache.submit.txsExtended.A.txHash')}",
"B": "{get('cache.submit.txsExtended.B.txHash')}",
"C": "{get('cache.submit.txsExtended.C.txHash')}"
},
"errors": {
"A": "{get('cache.submit.txsExtended.A.error')}",
"B": "{get('cache.submit.txsExtended.B.error')}",
"C": "{get('cache.submit.txsExtended.C.error')}"
}
}
}
}
}

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