Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix todo for order type compatibility in client #26

Merged
merged 5 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions client/idl/generateIdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,7 @@ function modifyIdlCore(programName) {
name: 'PostOnly',
},
{
name: 'PostOnlySlide',
},
{
name: 'FillOrKill',
name: 'Global',
},
],
},
Expand Down
5 changes: 1 addition & 4 deletions client/idl/wrapper.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,7 @@
"name": "PostOnly"
},
{
"name": "PostOnlySlide"
},
{
"name": "FillOrKill"
"name": "Global"
}
]
}
Expand Down
7 changes: 3 additions & 4 deletions client/ts/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class ManifestClient {
*
* @returns TransactionInstruction
*/
public static createMarketIx(
private static createMarketIx(
payer: PublicKey,
baseMint: PublicKey,
quoteMint: PublicKey,
Expand Down Expand Up @@ -468,7 +468,7 @@ export type WrapperPlaceOrderParamsExternal = {
/** Type of order (Limit, PostOnly, ...). */
orderType: OrderType;
/** Used in fill or kill orders. Set to zero otherwise. */
minOutAtoms: bignum;
minOutAtoms?: bignum;
/** Client order id used for cancelling orders. Does not need to be unique. */
clientOrderId: bignum;
};
Expand All @@ -485,11 +485,10 @@ function toWrapperPlaceOrderParams(
}
priceMantissa = Math.floor(priceMantissa);

// TODO: Fix this
// @ts-ignore
return {
...wrapperPlaceOrderParamsExternal,
priceMantissa,
priceExponent,
minOutAtoms: wrapperPlaceOrderParamsExternal.minOutAtoms ?? 0,
};
}
3 changes: 1 addition & 2 deletions client/ts/src/wrapper/types/OrderType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ export enum OrderType {
Limit,
ImmediateOrCancel,
PostOnly,
PostOnlySlide,
FillOrKill,
Global,
}

/**
Expand Down
2 changes: 1 addition & 1 deletion client/ts/tests/createMarket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export async function createMarket(
programId: PROGRAM_ID,
});

const createMarketIx = ManifestClient.createMarketIx(
const createMarketIx = ManifestClient['createMarketIx'](
payerKeypair.publicKey,
baseMint,
quoteMint,
Expand Down
Loading