From e76c24743ff76d169fd161a11b9c7d0bbb493549 Mon Sep 17 00:00:00 2001 From: wphan Date: Wed, 28 Aug 2024 13:15:35 -0700 Subject: [PATCH] sdk: fix spot place_and_take types --- sdk/src/driftClient.ts | 25 ++++++++++++++++++++----- sdk/src/types.ts | 4 +++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index dd3a9b1876..90d5219bc8 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -5267,7 +5267,10 @@ export class DriftClient { public async preparePlaceAndTakeSpotOrder( orderParams: OptionalOrderParams, - fulfillmentConfig?: SerumV3FulfillmentConfigAccount, + fulfillmentConfig?: + | SerumV3FulfillmentConfigAccount + | PhoenixV1FulfillmentConfigAccount + | OpenbookV2FulfillmentConfigAccount, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo, txParams?: TxParams, @@ -5291,7 +5294,10 @@ export class DriftClient { public async placeAndTakeSpotOrder( orderParams: OptionalOrderParams, - fulfillmentConfig?: SerumV3FulfillmentConfigAccount, + fulfillmentConfig?: + | SerumV3FulfillmentConfigAccount + | PhoenixV1FulfillmentConfigAccount + | OpenbookV2FulfillmentConfigAccount, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo, txParams?: TxParams, @@ -5319,7 +5325,10 @@ export class DriftClient { public async getPlaceAndTakeSpotOrderIx( orderParams: OptionalOrderParams, - fulfillmentConfig?: SerumV3FulfillmentConfigAccount, + fulfillmentConfig?: + | SerumV3FulfillmentConfigAccount + | PhoenixV1FulfillmentConfigAccount + | OpenbookV2FulfillmentConfigAccount, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo, subAccountId?: number @@ -5394,7 +5403,10 @@ export class DriftClient { public async placeAndMakeSpotOrder( orderParams: OptionalOrderParams, takerInfo: TakerInfo, - fulfillmentConfig?: SerumV3FulfillmentConfigAccount, + fulfillmentConfig?: + | SerumV3FulfillmentConfigAccount + | PhoenixV1FulfillmentConfigAccount + | OpenbookV2FulfillmentConfigAccount, referrerInfo?: ReferrerInfo, txParams?: TxParams, subAccountId?: number @@ -5421,7 +5433,10 @@ export class DriftClient { public async getPlaceAndMakeSpotOrderIx( orderParams: OptionalOrderParams, takerInfo: TakerInfo, - fulfillmentConfig?: SerumV3FulfillmentConfigAccount, + fulfillmentConfig?: + | SerumV3FulfillmentConfigAccount + | PhoenixV1FulfillmentConfigAccount + | OpenbookV2FulfillmentConfigAccount, referrerInfo?: ReferrerInfo, subAccountId?: number ): Promise { diff --git a/sdk/src/types.ts b/sdk/src/types.ts index eba5de8235..db6fc3291f 100644 --- a/sdk/src/types.ts +++ b/sdk/src/types.ts @@ -211,8 +211,10 @@ export class OrderTriggerCondition { } export class SpotFulfillmentType { - static readonly EXTERNAL = { external: {} }; + static readonly SERUM_V3 = { serumV3: {} }; static readonly MATCH = { match: {} }; + static readonly PHOENIX_V1 = { phoenixV1: {} }; + static readonly OPENBOOK_V2 = { openbookV2: {} }; } export class SpotFulfillmentStatus {