@dydxprotocol/v4-client-js 1.0.15 → 1.0.17

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/src/lib/utils.ts CHANGED
@@ -43,3 +43,27 @@ export function clientIdFromString(
43
43
  export async function sleep(ms: number): Promise<void> {
44
44
  return new Promise((resolve) => setTimeout(resolve, ms));
45
45
  }
46
+
47
+ /**
48
+ * Returns a title to use for a gov proposal that adds a new market.
49
+ *
50
+ * @param ticker ticker symbol for the new market.
51
+ * @returns title for the gov proposal.
52
+ */
53
+ export function getGovAddNewMarketTitle(ticker: string): string {
54
+ return `Add ${ticker} perpetual market`;
55
+ }
56
+
57
+ /**
58
+ * Returns a summary to use for a gov proposal that adds a new market.
59
+ *
60
+ * @param ticker ticker symbol for the new market.
61
+ * @param delayBlocks number of blocks to wait before activating the market.
62
+ * @returns summary for the gov proposal.
63
+ */
64
+ export function getGovAddNewMarketSummary(
65
+ ticker: string,
66
+ delayBlocks: number,
67
+ ): string {
68
+ return `Add the x/prices, x/perpetuals and x/clob parameters needed for a ${ticker} perpetual market. Create the market in INITIALIZING status and transition it to ACTIVE status after ${delayBlocks} blocks.`;
69
+ }