Open metaproph3t opened 8 months ago
Today, it's a bit cumbersome to specify all of the fields in PlaceOrderArgs and the other fields that placeOrder takes
PlaceOrderArgs
placeOrder
It would be nice to have a placeOrder interface that looks something like:
public async placeOrder( market: PublicKey, side: Side, priceLots: BN, maxBaseLots: BN, maxQuoteLots: BN, orderType: OrderType, expiryTimestamp: BN = new BN(0), selfTradeBehavior: SelfTradeBehavior = SelfTradeBehavior.DecrementTake, limit: number = 255, userTokenAccount?: PublicKey, clientOrderId?: BN, ): Promise<BN>
openOrdersAccount
.setOpenOrdersAccount()
MarketAccount
userTokenAccount
that way, you would only need to specify 5 params instead of 15
Solved this issue in openbook, you only need 3 params:
openbook
Have a look at the ob_client module for more info about the refactor i did to the client code.
ob_client
Today, it's a bit cumbersome to specify all of the fields in
PlaceOrderArgs
and the other fields thatplaceOrder
takesIt would be nice to have a
placeOrder
interface that looks something like:openOrdersAccount
could be set by a call.setOpenOrdersAccount()
on the clientMarketAccount
could be pulled either from on-chain or from a cacheuserTokenAccount
isn't provided, default could be associated token account for the user's public keythat way, you would only need to specify 5 params instead of 15