OHHB42K54TO567T23Y43LV4WPYES4ZKK
[
"autonomous agent",
{
"messages": {
"cases": [
{
"if": "{
$checkaddress = trigger.data.address;
if ( !$checkaddress ) bounce( 'input: { address : address , [ data : passthur_data ] , [ newaddress : newaddress ] , [ checkonly : false ] }'
); // USAGE
// doesn't matter if checkaddress is valid or not because it will bounce when routing to the invalid address
$logicaladdress = var[ $checkaddress ];
if ( $logicaladdress ){ // FOUND LOGICAL ADDRESS
$currentaddress = var[ $logicaladdress ]; // GET LATEST ADDRESS
$newaddress = trigger.data.newaddress;
if( $newaddress ){ // again doesn't matter if newaddress is valid or not , RECEIVED NEW ADDRESS
if( var[ $currentaddress ][ 'author' ] == trigger.address ){ // CHECK OWNERSHIP OF LATEST ADDRESS
// transfer of arbitrary address types will be possible in the future when AA can explore DAG
$route = $newaddress; // ROUTE TO NEW ADDRESS
// actual author transfer done in app state
} else {
bounce( 'Trigger address does not match with var[ author ] in ' || $currentaddress || ' which is require to make newa
ddress transfer' );
}
} else {
$route = $currentaddress; // ROUTE TO LATEST ADDRESS
}
}else{
$route = $checkaddress; // registration will be done at app state , ROUTE TO CHECK ADRESS FIRST TIME
}
if( trigger.data.checkonly ){ // CHECKONLY
if( $checkaddress != $route ) bounce( 'Please use latest address at ' || $route );
else bounce( 'This address ' || $checkaddress || ' is the latest');
}
// ROUTE with pass thur data
$route
}",
"messages": [
{
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "{$route}"
}
]
}
},
{
"app": "data",
"payload": "{trigger.data}"
},
{
"app": "state",
"state": "{
if( !$logicaladdress ){
var[ 'L' || $checkaddress ] = $checkaddress; // create logical address
var[ $checkaddress ] = 'L' || $checkaddress; // set checkaddress to logical address
$msg = $checkaddress || ' is a new address registration';
}
if( $logicaladdress AND $newaddress AND var[ $newaddress ][ 'author' ] AND $currentaddress AND var[ $currentaddress ][ 'autho
r' ] == trigger.address ){
var[ $logicaladdress ] = $newaddress;
var[ $newaddress ] = $logicaladdress;
$msg = $currentaddress || ' owned by ' || var[ $currentaddress ][ 'author' ] || ' transferred to ' || $newaddress ||
' owned by ' || var[ $newaddress ][ 'author' ];
}
response[ 'message' ] = 'Routing to ' || $route || '. ' || $msg;
if( !var[ 'author' ] ) var[ 'author' ] = '7MDNSRYFRLJ4PQMPD5TZPIO5JHCTYNQI';
}"
}
]
}
]
}
}
]
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount