Unit ID
xvhO9eOcM8hwalpYd9cMB4UmE2UaqMYkqPvGwEAWr5o=
Received
07.10.2020 17:04:26
Confirmation delay (full node)
12 minutes 4 seconds
Confirmation delay (light node)
15 minutes 47 seconds
Messages
Definition
Definition: [ "autonomous agent", { "doc_url": "https://raw.githubusercontent.com/jldevelops/handy-wandy/main/description.json", "init": "{ $OSTABLE_DEP_ADDR = params.ostable_dep OTHERWISE 'IPZULHNHOIZHTQYGUPXBJLLRAOCH5BBL'; $OSTABLE_CURVE_ADDR = params.curve OTHERWISE '26XAPPPTTYRIOSYNCUV3NS2H57X5LZLJ'; $OSWAP_POOL_ADDR = params.oswap_pool OTHERWISE 'AR3SHS7SFH3PF6ZM6UIF7HWIV44TZ46H'; $STABLE_ASSET = var[$OSTABLE_DEP_ADDR]['asset']; $OWNER_ADDR = params.owner; if(!$OWNER_ADDR) bounce('no owner'); $addDeposit = =>{ $deposits = var['deposits'] otherwise []; $deposits[] = trigger.data.id; var['deposits'] = $deposits; }; $removeDeposit = $ind =>{ $deposits = var['deposits'] otherwise []; delete($deposits, $ind); var['deposits'] = $deposits; }; }", "messages": { "cases": [ { "if": "{(trigger.data.interest AND trigger.address == $OWNER_ADDR) OR var['index']}", "init": "{ $ind = var['index'] otherwise 0; $deposits = var['deposits']; $id = $deposits[$ind]; }", "messages": [ { "if": "{$id}", "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{$OSTABLE_DEP_ADDR}", "amount": 1 } ] } }, { "if": "{$id}", "app": "data", "payload": { "id": "{$id}" } }, { "if": "{!$id AND var['swap']}", "app": "payment", "payload": { "asset": "{$STABLE_ASSET}", "outputs": [ { "address": "{$OSWAP_POOL_ADDR}" } ] } }, { "if": "{!$id AND var['swap']}", "app": "data", "payload": { "to_aa": "{$OSTABLE_CURVE_ADDR}", "to": "{$OWNER_ADDR}" } }, { "app": "state", "state": "{ if($id) var['index'] = $ind + 1; else var['index'] = false; }" } ] }, { "if": "{trigger.address != $OWNER_ADDR}", "messages": [ { "app": "state", "state": "{ response['message'] = 'received'; }" } ] }, { "if": "{ if(trigger.address != $OWNER_ADDR) bounce('you are not the owner'); trigger.data.add_dep and trigger.data.id}", "messages": [ { "app": "state", "state": "{ $addDeposit(); }" } ] }, { "if": "{trigger.data.swap}", "messages": [ { "app": "state", "state": "{ if(trigger.data.swap == 1) var['swap'] = 1; else var['swap'] = false; }" } ] }, { "if": "{trigger.data.rm_dep and trigger.data.index}", "messages": [ { "app": "state", "state": "{ $removeDeposit(); }" } ] }, { "if": "{trigger.data.withdraw}", "messages": [ { "app": "payment", "payload": { "asset": "{trigger.data.asset otherwise 'base'}", "outputs": [ { "address": "{trigger.address}" } ] } } ] } ] } } ]
Technical information
Fees:
3,444 bytes
(451 headers, 2993 payload)
Level:6038223
Witnessed level:6038209
Main chain index:5892548
Latest included mc index:5892547
Status:stable/confirmed/final