@triadxyz/triad-protocol 0.7.2-beta.devnet → 0.7.4-beta.devnet

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.
@@ -168,6 +168,7 @@ const getMarkets = () => __awaiter(void 0, void 0, void 0, function* () {
168
168
  const markets = yield triadProtocol.trade.getMarkets();
169
169
  console.log(markets);
170
170
  });
171
+ getMarkets();
171
172
  const initializeAllMarkets = () => __awaiter(void 0, void 0, void 0, function* () {
172
173
  for (const market of markets) {
173
174
  try {
@@ -199,7 +200,6 @@ const openOrder = () => __awaiter(void 0, void 0, void 0, function* () {
199
200
  console.log(response);
200
201
  }
201
202
  });
202
- openOrder();
203
203
  const closeOrder = () => __awaiter(void 0, void 0, void 0, function* () {
204
204
  for (const order of yield getOrders()) {
205
205
  try {
@@ -1076,6 +1076,10 @@
1076
1076
  {
1077
1077
  "name": "PriceUpdate",
1078
1078
  "discriminator": [222, 51, 180, 226, 165, 188, 203, 54]
1079
+ },
1080
+ {
1081
+ "name": "QuestionUpdate",
1082
+ "discriminator": [110, 108, 240, 86, 176, 226, 54, 113]
1079
1083
  }
1080
1084
  ],
1081
1085
  "errors": [
@@ -1796,11 +1800,83 @@
1796
1800
  ]
1797
1801
  }
1798
1802
  },
1803
+ {
1804
+ "name": "QuestionUpdate",
1805
+ "type": {
1806
+ "kind": "struct",
1807
+ "fields": [
1808
+ {
1809
+ "name": "market_id",
1810
+ "type": "u64"
1811
+ },
1812
+ {
1813
+ "name": "question_id",
1814
+ "type": "u64"
1815
+ },
1816
+ {
1817
+ "name": "question",
1818
+ "type": "string"
1819
+ },
1820
+ {
1821
+ "name": "start_time",
1822
+ "type": "i64"
1823
+ },
1824
+ {
1825
+ "name": "end_time",
1826
+ "type": "i64"
1827
+ },
1828
+ {
1829
+ "name": "hype_liquidity",
1830
+ "type": "u64"
1831
+ },
1832
+ {
1833
+ "name": "flop_liquidity",
1834
+ "type": "u64"
1835
+ },
1836
+ {
1837
+ "name": "winning_direction",
1838
+ "type": {
1839
+ "defined": {
1840
+ "name": "WinningDirection"
1841
+ }
1842
+ }
1843
+ },
1844
+ {
1845
+ "name": "market_price",
1846
+ "type": "u64"
1847
+ },
1848
+ {
1849
+ "name": "final_hype_price",
1850
+ "type": "u64"
1851
+ },
1852
+ {
1853
+ "name": "final_flop_price",
1854
+ "type": "u64"
1855
+ },
1856
+ {
1857
+ "name": "direction",
1858
+ "type": {
1859
+ "defined": {
1860
+ "name": "OrderDirection"
1861
+ }
1862
+ }
1863
+ },
1864
+ {
1865
+ "name": "timestamp",
1866
+ "type": "i64"
1867
+ }
1868
+ ]
1869
+ }
1870
+ },
1799
1871
  {
1800
1872
  "name": "ResolvedQuestion",
1801
1873
  "type": {
1802
1874
  "kind": "struct",
1803
1875
  "fields": [
1876
+ {
1877
+ "name": "question_id",
1878
+ "type": "u64"
1879
+ },
1804
1880
  {
1805
1881
  "name": "question",
1806
1882
  "docs": ["The question or prediction topic for this week"],
@@ -1854,7 +1930,7 @@
1854
1930
  {
1855
1931
  "name": "padding",
1856
1932
  "type": {
1857
- "array": ["u8", 64]
1933
+ "array": ["u8", 56]
1858
1934
  }
1859
1935
  }
1860
1936
  ]
@@ -21,7 +21,7 @@ export type Market = {
21
21
  isActive: boolean;
22
22
  marketPrice: string;
23
23
  isOfficial: boolean;
24
- resolvedQuestions: ResolvedQuestion[];
24
+ previousResolvedQuestion: ResolvedQuestion;
25
25
  currentQuestionId: string;
26
26
  currentQuestionStart: string;
27
27
  currentQuestionEnd: string;
@@ -1517,6 +1517,10 @@ export type TriadProtocol = {
1517
1517
  {
1518
1518
  name: 'priceUpdate';
1519
1519
  discriminator: [222, 51, 180, 226, 165, 188, 203, 54];
1520
+ },
1521
+ {
1522
+ name: 'questionUpdate';
1523
+ discriminator: [110, 108, 240, 86, 176, 226, 54, 113];
1520
1524
  }
1521
1525
  ];
1522
1526
  errors: [
@@ -2235,11 +2239,83 @@ export type TriadProtocol = {
2235
2239
  ];
2236
2240
  };
2237
2241
  },
2242
+ {
2243
+ name: 'questionUpdate';
2244
+ type: {
2245
+ kind: 'struct';
2246
+ fields: [
2247
+ {
2248
+ name: 'marketId';
2249
+ type: 'u64';
2250
+ },
2251
+ {
2252
+ name: 'questionId';
2253
+ type: 'u64';
2254
+ },
2255
+ {
2256
+ name: 'question';
2257
+ type: 'string';
2258
+ },
2259
+ {
2260
+ name: 'startTime';
2261
+ type: 'i64';
2262
+ },
2263
+ {
2264
+ name: 'endTime';
2265
+ type: 'i64';
2266
+ },
2267
+ {
2268
+ name: 'hypeLiquidity';
2269
+ type: 'u64';
2270
+ },
2271
+ {
2272
+ name: 'flopLiquidity';
2273
+ type: 'u64';
2274
+ },
2275
+ {
2276
+ name: 'winningDirection';
2277
+ type: {
2278
+ defined: {
2279
+ name: 'winningDirection';
2280
+ };
2281
+ };
2282
+ },
2283
+ {
2284
+ name: 'marketPrice';
2285
+ type: 'u64';
2286
+ },
2287
+ {
2288
+ name: 'finalHypePrice';
2289
+ type: 'u64';
2290
+ },
2291
+ {
2292
+ name: 'finalFlopPrice';
2293
+ type: 'u64';
2294
+ },
2295
+ {
2296
+ name: 'direction';
2297
+ type: {
2298
+ defined: {
2299
+ name: 'orderDirection';
2300
+ };
2301
+ };
2302
+ },
2303
+ {
2304
+ name: 'timestamp';
2305
+ type: 'i64';
2306
+ }
2307
+ ];
2308
+ };
2309
+ },
2238
2310
  {
2239
2311
  name: 'resolvedQuestion';
2240
2312
  type: {
2241
2313
  kind: 'struct';
2242
2314
  fields: [
2315
+ {
2316
+ name: 'questionId';
2317
+ type: 'u64';
2318
+ },
2243
2319
  {
2244
2320
  name: 'question';
2245
2321
  docs: ['The question or prediction topic for this week'];
@@ -2293,7 +2369,7 @@ export type TriadProtocol = {
2293
2369
  {
2294
2370
  name: 'padding';
2295
2371
  type: {
2296
- array: ['u8', 64];
2372
+ array: ['u8', 56];
2297
2373
  };
2298
2374
  }
2299
2375
  ];
@@ -87,7 +87,7 @@ const accountToMarket = (account, address) => {
87
87
  isActive: account.isActive,
88
88
  marketPrice: account.marketPrice.toString(),
89
89
  isOfficial: account.isOfficial,
90
- resolvedQuestions: account.resolvedQuestions.map(accountToResolvedQuestion),
90
+ previousResolvedQuestion: accountToResolvedQuestion(account.previousResolvedQuestion),
91
91
  currentQuestionId: account.currentQuestionId.toString(),
92
92
  currentQuestionStart: account.currentQuestionStart.toString(),
93
93
  currentQuestionEnd: account.currentQuestionEnd.toString(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "0.7.2-beta.devnet",
3
+ "version": "0.7.4-beta.devnet",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",