Skip to content

xport_reserve

  • Declares how many cross-chain exports this hook execution will perform.
  • Must be called before any xport() calls, similar to how etxn_reserve() must precede emit().
  • The valid count is 1 or 2.
  • Also reserves emitted-transaction capacity for the wrapper Export transactions.
  • If the hook also uses emit(), call etxn_reserve() before xport_reserve().
  • After xport_reserve() sets the combined emitted-transaction reservation, a later etxn_reserve() call fails with ALREADY_SET.
int64_t xport_reserve (
uint32_t count
);
if (xport_reserve(1) < 0)
rollback(SBUF("Export reserve failed"), 1);
NameTypeDescription
countuint32_tThe number of exports this hook execution will perform. Must be 1 or 2.
TypeDescription
int64_tThe reserved count on success. If negative, an error: ALREADY_SET — the Hook already called this function. TOO_SMALLcount is 0. TOO_BIGcount is greater than 2, or the combined existing emitted-transaction reservation and Export reservation would exceed 255.