const transaction = await aptos.transaction.build.simple({
sender: account.accountAddress,
data: {
function: `${PACKAGE}::dex_accounts_entry::place_order_to_subaccount`,
typeArguments: [],
functionArguments: [
"0x123...abc", // subaccountAddr
"0x456...def", // marketAddr (PerpMarket object address)
5670000000, // price (5.67 with 9 decimals)
1000000000, // size (1.0 with 9 decimals)
true, // isBuy (true for buy, false for sell)
0, // timeInForce (0 = GoodTillCanceled, 1 = PostOnly, 2 = ImmediateOrCancel)
false, // isReduceOnly
"my-order-123", // clientOrderId (optional)
null, // stopPrice (optional)
null, // tpTriggerPrice (optional)
null, // tpLimitPrice (optional)
null, // slTriggerPrice (optional)
null, // slLimitPrice (optional)
null, // builderAddress (optional)
null, // builderFees (optional)
],
},
});