Dry run AA

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

Example

const params = {
  trigger: {
    address: 'K237YYRMBYWCJBLSZGLJTXLZVVEXLI2Y', // sent from address
    outputs: {
      'base': 10000 // default AA bounce fee in bytes
    },
    data: {
      'vest': true
    }
  },
  address: 'TSDLQPZTSVDNC63G7YROC26CYCCZC4GO' // sent to AA address
};

client.api.dryRunAa(params, function(err, result) {
  if (err) return console.error(err);
  console.log(result);
});

Returns

[
  {
    mci: 1023895,
    trigger_address: 'K237YYRMBYWCJBLSZGLJTXLZVVEXLI2Y',
    trigger_initial_address: 'K237YYRMBYWCJBLSZGLJTXLZVVEXLI2Y',
    trigger_unit: 'RpENIf8NoLY/OFpJ1n2i8E38lZDH7ZsqF6Xa2Pkca5w=',
    aa_address: 'TSDLQPZTSVDNC63G7YROC26CYCCZC4GO',
    bounced: false,
    response_unit: null,
    objResponseUnit: null,
    response: {
      responseVars: {
        message: 'Vested 10000 bytes',
        amount: 10000
      },
      error: 'no messages after filtering'
    },
    updatedStateVars: {
      TSDLQPZTSVDNC63G7YROC26CYCCZC4GO: {
        vested_total: {
          value: 60000,
          old_value: 50000,
          delta: 10000
        },
        vested_K237YYRMBYWCJBLSZGLJTXLZVVEXLI2Y: {
          value: 50000,
          old_value: 40000,
          delta: 10000
        }
      }
    }
  }
]

Learn more

Last updated