Dry run AA
Calculates the predicted outcome of an Autonomous Agent with a sample transaction.

Example

1
const params = {
2
trigger: {
3
address: 'K237YYRMBYWCJBLSZGLJTXLZVVEXLI2Y', // sent from address
4
outputs: {
5
'base': 10000 // default AA bounce fee in bytes
6
},
7
data: {
8
'vest': true
9
}
10
},
11
address: 'TSDLQPZTSVDNC63G7YROC26CYCCZC4GO' // sent to AA address
12
};
13
14
client.api.dryRunAa(params, function(err, result) {
15
if (err) return console.error(err);
16
console.log(result);
17
});
Copied!

Returns

1
[
2
{
3
mci: 1023895,
4
trigger_address: 'K237YYRMBYWCJBLSZGLJTXLZVVEXLI2Y',
5
trigger_initial_address: 'K237YYRMBYWCJBLSZGLJTXLZVVEXLI2Y',
6
trigger_unit: 'RpENIf8NoLY/OFpJ1n2i8E38lZDH7ZsqF6Xa2Pkca5w=',
7
aa_address: 'TSDLQPZTSVDNC63G7YROC26CYCCZC4GO',
8
bounced: false,
9
response_unit: null,
10
objResponseUnit: null,
11
response: {
12
responseVars: {
13
message: 'Vested 10000 bytes',
14
amount: 10000
15
},
16
error: 'no messages after filtering'
17
},
18
updatedStateVars: {
19
TSDLQPZTSVDNC63G7YROC26CYCCZC4GO: {
20
vested_total: {
21
value: 60000,
22
old_value: 50000,
23
delta: 10000
24
},
25
vested_K237YYRMBYWCJBLSZGLJTXLZVVEXLI2Y: {
26
value: 50000,
27
old_value: 40000,
28
delta: 10000
29
}
30
}
31
}
32
}
33
]
Copied!

Learn more

Last modified 6mo ago
Copy link