// Cancel the entire ladder
const cancelAll = await aptos.transaction.build.simple({
sender: account.accountAddress,
data: {
function: `${PACKAGE}::dex_accounts_spot_entry::cancel_spot_bulk_order_to_subaccount`,
typeArguments: [],
functionArguments: [
"0x123...abc", // subaccountAddr
"0x456...def", // marketAddr (SpotMarket object address)
],
},
});
// Cancel only the ask resting at one price level
const cancelLevel = await aptos.transaction.build.simple({
sender: account.accountAddress,
data: {
function: `${PACKAGE}::dex_accounts_spot_entry::cancel_spot_bulk_order_at_price_level_to_subaccount`,
typeArguments: [],
functionArguments: [
"0x123...abc", // subaccountAddr
"0x456...def", // marketAddr (SpotMarket object address)
45100000, // price (raw quote units)
false, // isBid (false cancels the ask at that price)
],
},
});