@dydxprotocol/v4-client-js 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/__native__/__ios__/v4-native-client.js +550 -18
- package/build/src/clients/composite-client.d.ts +1 -0
- package/build/src/clients/composite-client.js +4 -1
- package/build/src/clients/constants.d.ts +1 -0
- package/build/src/clients/constants.js +5 -3
- package/build/src/clients/modules/composer.d.ts +1 -0
- package/build/src/clients/modules/composer.js +16 -1
- package/build/src/clients/modules/post.d.ts +2 -0
- package/build/src/clients/modules/post.js +8 -1
- package/build/src/clients/modules/proto-includes.d.ts +2 -0
- package/build/src/clients/modules/proto-includes.js +4 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/clients/composite-client.ts +10 -0
- package/src/clients/constants.ts +3 -0
- package/src/clients/modules/composer.ts +24 -0
- package/src/clients/modules/post.ts +19 -0
- package/src/clients/modules/proto-includes.ts +2 -0
package/package.json
CHANGED
|
@@ -1207,4 +1207,14 @@ export class CompositeClient {
|
|
|
1207
1207
|
|
|
1208
1208
|
return this.send(wallet, () => msg, false, undefined, memo);
|
|
1209
1209
|
}
|
|
1210
|
+
|
|
1211
|
+
async createMarketPermissionless(
|
|
1212
|
+
subaccount: SubaccountInfo,
|
|
1213
|
+
ticker: string,
|
|
1214
|
+
broadcastMode?: BroadcastMode,
|
|
1215
|
+
gasAdjustment?: number,
|
|
1216
|
+
memo?: string,
|
|
1217
|
+
): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
|
|
1218
|
+
return this.validatorClient.post.createMarketPermissionless(ticker, subaccount, broadcastMode, gasAdjustment, memo);
|
|
1219
|
+
}
|
|
1210
1220
|
}
|
package/src/clients/constants.ts
CHANGED
|
@@ -85,6 +85,9 @@ export const TYPE_URL_MSG_UPDATE_CLOB_PAIR = '/dydxprotocol.clob.MsgUpdateClobPa
|
|
|
85
85
|
// x/delaymsg
|
|
86
86
|
export const TYPE_URL_MSG_DELAY_MESSAGE = '/dydxprotocol.delaymsg.MsgDelayMessage';
|
|
87
87
|
|
|
88
|
+
// x/listing
|
|
89
|
+
export const TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS = '/dydxprotocol.listing.MsgCreateMarketPermissionless';
|
|
90
|
+
|
|
88
91
|
// x/perpetuals
|
|
89
92
|
export const TYPE_URL_MSG_CREATE_PERPETUAL = '/dydxprotocol.perpetuals.MsgCreatePerpetual';
|
|
90
93
|
|
|
@@ -51,6 +51,7 @@ import {
|
|
|
51
51
|
TYPE_URL_MSG_REGISTER_AFFILIATE,
|
|
52
52
|
TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT,
|
|
53
53
|
TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT,
|
|
54
|
+
TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS,
|
|
54
55
|
} from '../constants';
|
|
55
56
|
import { DenomConfig } from '../types';
|
|
56
57
|
import {
|
|
@@ -62,6 +63,7 @@ import {
|
|
|
62
63
|
MsgPlaceOrder,
|
|
63
64
|
MsgCancelOrder,
|
|
64
65
|
SubaccountId,
|
|
66
|
+
MsgCreateMarketPermissionless,
|
|
65
67
|
MsgCreateTransfer,
|
|
66
68
|
Transfer,
|
|
67
69
|
MsgDepositToSubaccount,
|
|
@@ -551,6 +553,28 @@ export class Composer {
|
|
|
551
553
|
};
|
|
552
554
|
}
|
|
553
555
|
|
|
556
|
+
// ------------ x/listing ------------
|
|
557
|
+
public composeMsgCreateMarketPermissionless(
|
|
558
|
+
address: string,
|
|
559
|
+
ticker: string,
|
|
560
|
+
subaccountNumber: number,
|
|
561
|
+
): EncodeObject {
|
|
562
|
+
const subaccountId: SubaccountId = {
|
|
563
|
+
owner: address,
|
|
564
|
+
number: subaccountNumber,
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
const msg: MsgCreateMarketPermissionless = {
|
|
568
|
+
ticker,
|
|
569
|
+
subaccountId
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
return {
|
|
573
|
+
typeUrl: TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS,
|
|
574
|
+
value: msg,
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
554
578
|
// ------------ util ------------
|
|
555
579
|
public validateGoodTilBlockAndTime(
|
|
556
580
|
orderFlags: number,
|
|
@@ -917,4 +917,23 @@ export class Post {
|
|
|
917
917
|
registerAffiliateMsg(...args: Parameters<Composer['composeMsgRegisterAffiliate']>): EncodeObject {
|
|
918
918
|
return this.composer.composeMsgRegisterAffiliate(...args);
|
|
919
919
|
}
|
|
920
|
+
|
|
921
|
+
launchMarketMsg(...args: Parameters<Composer['composeMsgCreateMarketPermissionless']>): EncodeObject {
|
|
922
|
+
return this.composer.composeMsgCreateMarketPermissionless(...args);
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
async createMarketPermissionless(ticker: string, subaccount: SubaccountInfo, broadcastMode?: BroadcastMode, gasAdjustment?: number, memo?: string): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
|
|
926
|
+
const msg = this.launchMarketMsg(subaccount.address, ticker, subaccount.subaccountNumber);
|
|
927
|
+
|
|
928
|
+
return this.send(
|
|
929
|
+
subaccount.wallet,
|
|
930
|
+
() => Promise.resolve([msg]),
|
|
931
|
+
false,
|
|
932
|
+
undefined,
|
|
933
|
+
memo,
|
|
934
|
+
broadcastMode,
|
|
935
|
+
undefined,
|
|
936
|
+
gasAdjustment,
|
|
937
|
+
);
|
|
938
|
+
}
|
|
920
939
|
}
|
|
@@ -13,6 +13,7 @@ export * as BridgeModule from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/b
|
|
|
13
13
|
export * as DistributionModule from '@dydxprotocol/v4-proto/src/codegen/cosmos/distribution/v1beta1/query';
|
|
14
14
|
export * as AffiliateModule from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/query';
|
|
15
15
|
export * as VaultModule from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/query';
|
|
16
|
+
export * as ListingModule from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/query';
|
|
16
17
|
|
|
17
18
|
export * from '@dydxprotocol/v4-proto/src/codegen/cosmos/base/abci/v1beta1/abci';
|
|
18
19
|
export * from '@dydxprotocol/v4-proto/src/codegen/cosmos/gov/v1/gov';
|
|
@@ -27,3 +28,4 @@ export * from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/tx';
|
|
|
27
28
|
export * from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer';
|
|
28
29
|
export * from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/genesis';
|
|
29
30
|
export * from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/asset';
|
|
31
|
+
export * from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/tx';
|