Skip to content

Commit 42edaed

Browse files
authored
feat: order router revshare params (#465)
1 parent 074c16e commit 42edaed

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

v4-client-js/package-lock.json

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

v4-client-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"@cosmjs/stargate": "^0.32.1",
5353
"@cosmjs/tendermint-rpc": "^0.32.1",
5454
"@cosmjs/utils": "^0.32.1",
55-
"@dydxprotocol/v4-proto": "9.4.0-rc.0",
55+
"@dydxprotocol/v4-proto": "9.5.0",
5656
"@osmonauts/lcd": "^0.6.0",
5757
"@scure/bip32": "^1.1.5",
5858
"@scure/bip39": "^1.1.1",

v4-client-js/src/clients/composite-client.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import { UserError } from './lib/errors';
4545
import { generateRegistry } from './lib/registry';
4646
import LocalWallet from './modules/local-wallet';
4747
import { SubaccountInfo } from './subaccount';
48-
import { BroadcastMode, OrderBatch } from './types';
48+
import { BroadcastMode, IBuilderCodeParameters, ITwapParameters, OrderBatch } from './types';
4949
import { ValidatorClient } from './validator-client';
5050

5151
// Required for encoding and decoding queries that are of type Long.
@@ -86,6 +86,9 @@ export type PlaceOrderPayload = {
8686
marketInfo?: MarketInfo;
8787
currentHeight?: number;
8888
goodTilBlock?: number;
89+
twapParameters?: ITwapParameters;
90+
builderCodeParameters?: IBuilderCodeParameters;
91+
orderRouterAddress?: string;
8992
};
9093

9194
export type CancelRawOrderPayload = {
@@ -422,6 +425,9 @@ export class CompositeClient {
422425
goodTilBlock?: number,
423426
memo?: string,
424427
broadcastMode?: BroadcastMode,
428+
twapParameters?: ITwapParameters,
429+
builderCodeParameters?: IBuilderCodeParameters,
430+
orderRouterAddress?: string,
425431
): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
426432
const msgs: Promise<EncodeObject[]> = new Promise((resolve) => {
427433
const msg = this.placeOrderMessage(
@@ -441,6 +447,9 @@ export class CompositeClient {
441447
marketInfo,
442448
currentHeight,
443449
goodTilBlock,
450+
twapParameters,
451+
builderCodeParameters,
452+
orderRouterAddress,
444453
);
445454
msg
446455
.then((it) => resolve([it]))
@@ -506,6 +515,9 @@ export class CompositeClient {
506515
marketInfo?: MarketInfo,
507516
currentHeight?: number,
508517
goodTilBlock?: number,
518+
twapParameters?: ITwapParameters,
519+
builderCodeParameters?: IBuilderCodeParameters,
520+
orderRouterAddress?: string,
509521
): Promise<EncodeObject> {
510522
const orderFlags = calculateOrderFlags(type, timeInForce);
511523

@@ -561,6 +573,9 @@ export class CompositeClient {
561573
clientMetadata,
562574
conditionalType,
563575
conditionalOrderTriggerSubticks,
576+
twapParameters,
577+
builderCodeParameters,
578+
orderRouterAddress,
564579
);
565580
}
566581

0 commit comments

Comments
 (0)