Skip to main content

Cardano Example Dapp

Transaction Time to Live Demo​

Script that will try the different time validity interval parameters of transaction builder

Try it online:​

Source code:​

Dapp code was autogenerated by Playground IDE in GameChanger Wallet

GCScript code (dapp connection):​

{
"title": "Transaction Time to Live Demo",
"description": "Script that will try the different time validity interval parameters of transaction builder",
"type": "script",
"returnURLPattern": "http://localhost:3000/demo/api/dapp",
"run": {
"currentSlotNumber": {
"type": "getCurrentSlot"
},
"build": {
"type": "script",
"run": [
{
"type": "buildTx",
"title": "TTL: no setup",
"tx": {}
},
{
"type": "buildTx",
"title": "TTL: from",
"tx": {
"ttl": {
"from": "{get('cache.currentSlotNumber')}"
}
}
},
{
"type": "buildTx",
"title": "TTL: until",
"tx": {
"ttl": {
"until": "23432401234"
}
}
},
{
"type": "buildTx",
"title": "TTL: from until",
"tx": {
"ttl": {
"from": "{get('cache.currentSlotNumber')}",
"until": "23432401234"
}
}
},
{
"type": "buildTx",
"title": "TTL: from duration",
"tx": {
"ttl": {
"from": "{get('cache.currentSlotNumber')}",
"duration": "2592000000"
}
}
},
{
"type": "buildTx",
"title": "TTL: validFromNow duration",
"tx": {
"ttl": {
"duration": "2592000000"
},
"options": {
"validFromNow": true
}
}
},
{
"type": "buildTx",
"title": "TTL: ttl calc error",
"tx": {
"ttl": {
"from": "23432401234",
"until": "{get('cache.currentSlotNumber')}"
}
}
}
]
},
"sign": {
"type": "signTxs",
"namePattern": "signed-{key}",
"detailedPermissions": false,
"txs": [
"{get('cache.build.0.txHex')}",
"{get('cache.build.1.txHex')}",
"{get('cache.build.2.txHex')}",
"{get('cache.build.3.txHex')}",
"{get('cache.build.4.txHex')}",
"{get('cache.build.5.txHex')}",
"{get('cache.build.6.txHex')}"
]
},
"submit": {
"type": "submitTxs",
"namePattern": "submitted-{key}",
"txs": "{get('cache.sign')}"
},
"finally": {
"type": "script",
"exportAs": "LoremIpsumTest",
"run": [
{
"type": "macro",
"run": "{get('cache.build.0.txHash')}"
},
{
"type": "macro",
"run": "{get('cache.build.1.txHash')}"
},
{
"type": "macro",
"run": "{get('cache.build.2.txHash')}"
},
{
"type": "macro",
"run": "{get('cache.build.3.txHash')}"
},
{
"type": "macro",
"run": "{get('cache.build.4.txHash')}"
},
{
"type": "macro",
"run": "{get('cache.build.5.txHash')}"
},
{
"type": "macro",
"run": "{get('cache.build.6.txHash')}"
}
]
}
}
}

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