diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index d1fafa3d05..665a611553 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -6382,7 +6382,8 @@ export class DriftClient { orderParamsMessage: | SignedMsgOrderParamsMessage | SignedMsgOrderParamsDelegateMessage, - delegateSigner?: boolean + delegateSigner?: boolean, + signMessageFunction?: (message: Uint8Array) => Buffer ): SignedMsgOrderParams { const borshBuf = this.encodeSignedMsgOrderParamsMessage( orderParamsMessage, @@ -6391,7 +6392,9 @@ export class DriftClient { const orderParams = Buffer.from(borshBuf.toString('hex')); return { orderParams, - signature: this.signMessage(Buffer.from(borshBuf.toString('hex'))), + signature: signMessageFunction + ? signMessageFunction(Buffer.from(borshBuf.toString('hex'))) + : this.signMessage(Buffer.from(borshBuf.toString('hex'))), }; }