@triadxyz/triad-protocol 0.7.3-beta.devnet → 0.7.5-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.
- package/dist/local-test.js +7 -13
- package/dist/trade.d.ts +0 -1
- package/dist/types/idl_triad_protocol.json +249 -2
- package/dist/types/triad_protocol.d.ts +278 -2
- package/package.json +1 -1
package/dist/local-test.js
CHANGED
|
@@ -17,7 +17,7 @@ const index_1 = __importDefault(require("./index"));
|
|
|
17
17
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
18
18
|
const axios_1 = __importDefault(require("axios"));
|
|
19
19
|
const web3_js_1 = require("@solana/web3.js");
|
|
20
|
-
const file = fs_1.default.readFileSync('/Users/dannpl/.config/solana/
|
|
20
|
+
const file = fs_1.default.readFileSync('/Users/dannpl/.config/solana/triad.json');
|
|
21
21
|
const rpc_file = fs_1.default.readFileSync('/Users/dannpl/.config/solana/rpc-devnet.txt');
|
|
22
22
|
const keypair = web3_js_1.Keypair.fromSecretKey(new Uint8Array(JSON.parse(file.toString())));
|
|
23
23
|
const connection = new web3_js_1.Connection(rpc_file.toString(), 'confirmed');
|
|
@@ -42,8 +42,7 @@ const ordersHypeAndFloopBot = [
|
|
|
42
42
|
},
|
|
43
43
|
orderType: {
|
|
44
44
|
market: {}
|
|
45
|
-
}
|
|
46
|
-
limitPrice: 0
|
|
45
|
+
}
|
|
47
46
|
},
|
|
48
47
|
{
|
|
49
48
|
marketId: 0,
|
|
@@ -53,8 +52,7 @@ const ordersHypeAndFloopBot = [
|
|
|
53
52
|
},
|
|
54
53
|
orderType: {
|
|
55
54
|
market: {}
|
|
56
|
-
}
|
|
57
|
-
limitPrice: 0
|
|
55
|
+
}
|
|
58
56
|
},
|
|
59
57
|
{
|
|
60
58
|
marketId: 0,
|
|
@@ -64,8 +62,7 @@ const ordersHypeAndFloopBot = [
|
|
|
64
62
|
},
|
|
65
63
|
orderType: {
|
|
66
64
|
limit: {}
|
|
67
|
-
}
|
|
68
|
-
limitPrice: 0.8
|
|
65
|
+
}
|
|
69
66
|
},
|
|
70
67
|
{
|
|
71
68
|
marketId: 0,
|
|
@@ -75,8 +72,7 @@ const ordersHypeAndFloopBot = [
|
|
|
75
72
|
},
|
|
76
73
|
orderType: {
|
|
77
74
|
limit: {}
|
|
78
|
-
}
|
|
79
|
-
limitPrice: 0.2
|
|
75
|
+
}
|
|
80
76
|
},
|
|
81
77
|
{
|
|
82
78
|
marketId: 0,
|
|
@@ -168,7 +164,6 @@ const getMarkets = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
168
164
|
const markets = yield triadProtocol.trade.getMarkets();
|
|
169
165
|
console.log(markets);
|
|
170
166
|
});
|
|
171
|
-
getMarkets();
|
|
172
167
|
const initializeAllMarkets = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
173
168
|
for (const market of markets) {
|
|
174
169
|
try {
|
|
@@ -192,8 +187,7 @@ const openOrder = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
192
187
|
amount: order.amount,
|
|
193
188
|
direction: order.direction,
|
|
194
189
|
orderType: order.orderType,
|
|
195
|
-
comment: `hype/flop bot ${order.amount} - ${order.direction}
|
|
196
|
-
limitPrice: order.limitPrice
|
|
190
|
+
comment: `hype/flop bot ${order.amount} - ${order.direction}`
|
|
197
191
|
}, {
|
|
198
192
|
skipPreflight: true
|
|
199
193
|
});
|
|
@@ -222,6 +216,6 @@ const runBot = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
222
216
|
}
|
|
223
217
|
yield openOrder();
|
|
224
218
|
yield new Promise((resolve) => setTimeout(resolve, 40000));
|
|
225
|
-
yield closeOrder();
|
|
226
219
|
}
|
|
227
220
|
});
|
|
221
|
+
runBot();
|
package/dist/trade.d.ts
CHANGED
|
@@ -405,6 +405,75 @@
|
|
|
405
405
|
}
|
|
406
406
|
]
|
|
407
407
|
},
|
|
408
|
+
{
|
|
409
|
+
"name": "initialize_question",
|
|
410
|
+
"discriminator": [245, 151, 106, 188, 88, 44, 65, 212],
|
|
411
|
+
"accounts": [
|
|
412
|
+
{
|
|
413
|
+
"name": "signer",
|
|
414
|
+
"writable": true,
|
|
415
|
+
"signer": true
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"name": "market",
|
|
419
|
+
"writable": true
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"name": "mint",
|
|
423
|
+
"writable": true
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"name": "market_vault",
|
|
427
|
+
"writable": true,
|
|
428
|
+
"pda": {
|
|
429
|
+
"seeds": [
|
|
430
|
+
{
|
|
431
|
+
"kind": "account",
|
|
432
|
+
"path": "market"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"kind": "account",
|
|
436
|
+
"path": "token_program"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"kind": "account",
|
|
440
|
+
"path": "mint"
|
|
441
|
+
}
|
|
442
|
+
],
|
|
443
|
+
"program": {
|
|
444
|
+
"kind": "const",
|
|
445
|
+
"value": [
|
|
446
|
+
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
447
|
+
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
448
|
+
219, 233, 248, 89
|
|
449
|
+
]
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"name": "token_program",
|
|
455
|
+
"address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"name": "associated_token_program",
|
|
459
|
+
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"name": "system_program",
|
|
463
|
+
"address": "11111111111111111111111111111111"
|
|
464
|
+
}
|
|
465
|
+
],
|
|
466
|
+
"args": [
|
|
467
|
+
{
|
|
468
|
+
"name": "args",
|
|
469
|
+
"type": {
|
|
470
|
+
"defined": {
|
|
471
|
+
"name": "InitializeQuestionArgs"
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
]
|
|
476
|
+
},
|
|
408
477
|
{
|
|
409
478
|
"name": "open_order",
|
|
410
479
|
"discriminator": [206, 88, 88, 143, 38, 136, 50, 224],
|
|
@@ -550,6 +619,26 @@
|
|
|
550
619
|
],
|
|
551
620
|
"args": []
|
|
552
621
|
},
|
|
622
|
+
{
|
|
623
|
+
"name": "resolve_question",
|
|
624
|
+
"discriminator": [52, 32, 224, 179, 180, 8, 0, 246],
|
|
625
|
+
"accounts": [
|
|
626
|
+
{
|
|
627
|
+
"name": "signer",
|
|
628
|
+
"writable": true,
|
|
629
|
+
"signer": true
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"name": "market",
|
|
633
|
+
"writable": true
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"name": "system_program",
|
|
637
|
+
"address": "11111111111111111111111111111111"
|
|
638
|
+
}
|
|
639
|
+
],
|
|
640
|
+
"args": []
|
|
641
|
+
},
|
|
553
642
|
{
|
|
554
643
|
"name": "stake_nft",
|
|
555
644
|
"discriminator": [38, 27, 66, 46, 69, 65, 151, 219],
|
|
@@ -1076,6 +1165,10 @@
|
|
|
1076
1165
|
{
|
|
1077
1166
|
"name": "PriceUpdate",
|
|
1078
1167
|
"discriminator": [222, 51, 180, 226, 165, 188, 203, 54]
|
|
1168
|
+
},
|
|
1169
|
+
{
|
|
1170
|
+
"name": "QuestionUpdate",
|
|
1171
|
+
"discriminator": [110, 108, 240, 86, 176, 226, 54, 113]
|
|
1079
1172
|
}
|
|
1080
1173
|
],
|
|
1081
1174
|
"errors": [
|
|
@@ -1253,6 +1346,31 @@
|
|
|
1253
1346
|
"code": 6034,
|
|
1254
1347
|
"name": "OrderSizeTooLarge",
|
|
1255
1348
|
"msg": "Order size too large"
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
"code": 6035,
|
|
1352
|
+
"name": "QuestionPeriodNotEnded",
|
|
1353
|
+
"msg": "Question period not ended"
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
"code": 6036,
|
|
1357
|
+
"name": "InvalidStartTime",
|
|
1358
|
+
"msg": "Invalid start time"
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
"code": 6037,
|
|
1362
|
+
"name": "InvalidEndTime",
|
|
1363
|
+
"msg": "Invalid end time"
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
"code": 6038,
|
|
1367
|
+
"name": "QuestionPeriodNotStarted",
|
|
1368
|
+
"msg": "Question period not started"
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
"code": 6039,
|
|
1372
|
+
"name": "QuestionPeriodEnded",
|
|
1373
|
+
"msg": "Question period ended"
|
|
1256
1374
|
}
|
|
1257
1375
|
],
|
|
1258
1376
|
"types": [
|
|
@@ -1362,6 +1480,28 @@
|
|
|
1362
1480
|
]
|
|
1363
1481
|
}
|
|
1364
1482
|
},
|
|
1483
|
+
{
|
|
1484
|
+
"name": "InitializeQuestionArgs",
|
|
1485
|
+
"type": {
|
|
1486
|
+
"kind": "struct",
|
|
1487
|
+
"fields": [
|
|
1488
|
+
{
|
|
1489
|
+
"name": "question",
|
|
1490
|
+
"type": {
|
|
1491
|
+
"array": ["u8", 80]
|
|
1492
|
+
}
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
"name": "start_time",
|
|
1496
|
+
"type": "i64"
|
|
1497
|
+
},
|
|
1498
|
+
{
|
|
1499
|
+
"name": "end_time",
|
|
1500
|
+
"type": "i64"
|
|
1501
|
+
}
|
|
1502
|
+
]
|
|
1503
|
+
}
|
|
1504
|
+
},
|
|
1365
1505
|
{
|
|
1366
1506
|
"name": "Market",
|
|
1367
1507
|
"type": {
|
|
@@ -1796,11 +1936,105 @@
|
|
|
1796
1936
|
]
|
|
1797
1937
|
}
|
|
1798
1938
|
},
|
|
1939
|
+
{
|
|
1940
|
+
"name": "QuestionStatus",
|
|
1941
|
+
"type": {
|
|
1942
|
+
"kind": "enum",
|
|
1943
|
+
"variants": [
|
|
1944
|
+
{
|
|
1945
|
+
"name": "Resolved"
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
"name": "Unresolved"
|
|
1949
|
+
}
|
|
1950
|
+
]
|
|
1951
|
+
}
|
|
1952
|
+
},
|
|
1953
|
+
{
|
|
1954
|
+
"name": "QuestionUpdate",
|
|
1955
|
+
"type": {
|
|
1956
|
+
"kind": "struct",
|
|
1957
|
+
"fields": [
|
|
1958
|
+
{
|
|
1959
|
+
"name": "market_id",
|
|
1960
|
+
"type": "u64"
|
|
1961
|
+
},
|
|
1962
|
+
{
|
|
1963
|
+
"name": "question_id",
|
|
1964
|
+
"type": "u64"
|
|
1965
|
+
},
|
|
1966
|
+
{
|
|
1967
|
+
"name": "question",
|
|
1968
|
+
"type": "string"
|
|
1969
|
+
},
|
|
1970
|
+
{
|
|
1971
|
+
"name": "start_time",
|
|
1972
|
+
"type": "i64"
|
|
1973
|
+
},
|
|
1974
|
+
{
|
|
1975
|
+
"name": "end_time",
|
|
1976
|
+
"type": "i64"
|
|
1977
|
+
},
|
|
1978
|
+
{
|
|
1979
|
+
"name": "hype_liquidity",
|
|
1980
|
+
"type": "u64"
|
|
1981
|
+
},
|
|
1982
|
+
{
|
|
1983
|
+
"name": "flop_liquidity",
|
|
1984
|
+
"type": "u64"
|
|
1985
|
+
},
|
|
1986
|
+
{
|
|
1987
|
+
"name": "winning_direction",
|
|
1988
|
+
"type": {
|
|
1989
|
+
"defined": {
|
|
1990
|
+
"name": "WinningDirection"
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
"name": "market_price",
|
|
1996
|
+
"type": "u64"
|
|
1997
|
+
},
|
|
1998
|
+
{
|
|
1999
|
+
"name": "final_hype_price",
|
|
2000
|
+
"type": "u64"
|
|
2001
|
+
},
|
|
2002
|
+
{
|
|
2003
|
+
"name": "final_flop_price",
|
|
2004
|
+
"type": "u64"
|
|
2005
|
+
},
|
|
2006
|
+
{
|
|
2007
|
+
"name": "timestamp",
|
|
2008
|
+
"type": "i64"
|
|
2009
|
+
},
|
|
2010
|
+
{
|
|
2011
|
+
"name": "total_hype_shares",
|
|
2012
|
+
"type": "u64"
|
|
2013
|
+
},
|
|
2014
|
+
{
|
|
2015
|
+
"name": "total_flop_shares",
|
|
2016
|
+
"type": "u64"
|
|
2017
|
+
},
|
|
2018
|
+
{
|
|
2019
|
+
"name": "status",
|
|
2020
|
+
"type": {
|
|
2021
|
+
"defined": {
|
|
2022
|
+
"name": "QuestionStatus"
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
]
|
|
2027
|
+
}
|
|
2028
|
+
},
|
|
1799
2029
|
{
|
|
1800
2030
|
"name": "ResolvedQuestion",
|
|
1801
2031
|
"type": {
|
|
1802
2032
|
"kind": "struct",
|
|
1803
2033
|
"fields": [
|
|
2034
|
+
{
|
|
2035
|
+
"name": "question_id",
|
|
2036
|
+
"type": "u64"
|
|
2037
|
+
},
|
|
1804
2038
|
{
|
|
1805
2039
|
"name": "question",
|
|
1806
2040
|
"docs": ["The question or prediction topic for this week"],
|
|
@@ -1851,10 +2085,20 @@
|
|
|
1851
2085
|
"docs": ["Final price for Flop outcome at the end of the week"],
|
|
1852
2086
|
"type": "u64"
|
|
1853
2087
|
},
|
|
2088
|
+
{
|
|
2089
|
+
"name": "total_hype_shares",
|
|
2090
|
+
"docs": ["Total number of Hype shares issued"],
|
|
2091
|
+
"type": "u64"
|
|
2092
|
+
},
|
|
2093
|
+
{
|
|
2094
|
+
"name": "total_flop_shares",
|
|
2095
|
+
"docs": ["Total number of Flop shares issued"],
|
|
2096
|
+
"type": "u64"
|
|
2097
|
+
},
|
|
1854
2098
|
{
|
|
1855
2099
|
"name": "padding",
|
|
1856
2100
|
"type": {
|
|
1857
|
-
"array": ["u8",
|
|
2101
|
+
"array": ["u8", 40]
|
|
1858
2102
|
}
|
|
1859
2103
|
}
|
|
1860
2104
|
]
|
|
@@ -2167,6 +2411,9 @@
|
|
|
2167
2411
|
"type": {
|
|
2168
2412
|
"kind": "enum",
|
|
2169
2413
|
"variants": [
|
|
2414
|
+
{
|
|
2415
|
+
"name": "None"
|
|
2416
|
+
},
|
|
2170
2417
|
{
|
|
2171
2418
|
"name": "Hype"
|
|
2172
2419
|
},
|
|
@@ -2174,7 +2421,7 @@
|
|
|
2174
2421
|
"name": "Flop"
|
|
2175
2422
|
},
|
|
2176
2423
|
{
|
|
2177
|
-
"name": "
|
|
2424
|
+
"name": "Draw"
|
|
2178
2425
|
}
|
|
2179
2426
|
]
|
|
2180
2427
|
}
|
|
@@ -556,6 +556,104 @@ export type TriadProtocol = {
|
|
|
556
556
|
}
|
|
557
557
|
];
|
|
558
558
|
},
|
|
559
|
+
{
|
|
560
|
+
name: 'initializeQuestion';
|
|
561
|
+
discriminator: [245, 151, 106, 188, 88, 44, 65, 212];
|
|
562
|
+
accounts: [
|
|
563
|
+
{
|
|
564
|
+
name: 'signer';
|
|
565
|
+
writable: true;
|
|
566
|
+
signer: true;
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
name: 'market';
|
|
570
|
+
writable: true;
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
name: 'mint';
|
|
574
|
+
writable: true;
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
name: 'marketVault';
|
|
578
|
+
writable: true;
|
|
579
|
+
pda: {
|
|
580
|
+
seeds: [
|
|
581
|
+
{
|
|
582
|
+
kind: 'account';
|
|
583
|
+
path: 'market';
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
kind: 'account';
|
|
587
|
+
path: 'tokenProgram';
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
kind: 'account';
|
|
591
|
+
path: 'mint';
|
|
592
|
+
}
|
|
593
|
+
];
|
|
594
|
+
program: {
|
|
595
|
+
kind: 'const';
|
|
596
|
+
value: [
|
|
597
|
+
140,
|
|
598
|
+
151,
|
|
599
|
+
37,
|
|
600
|
+
143,
|
|
601
|
+
78,
|
|
602
|
+
36,
|
|
603
|
+
137,
|
|
604
|
+
241,
|
|
605
|
+
187,
|
|
606
|
+
61,
|
|
607
|
+
16,
|
|
608
|
+
41,
|
|
609
|
+
20,
|
|
610
|
+
142,
|
|
611
|
+
13,
|
|
612
|
+
131,
|
|
613
|
+
11,
|
|
614
|
+
90,
|
|
615
|
+
19,
|
|
616
|
+
153,
|
|
617
|
+
218,
|
|
618
|
+
255,
|
|
619
|
+
16,
|
|
620
|
+
132,
|
|
621
|
+
4,
|
|
622
|
+
142,
|
|
623
|
+
123,
|
|
624
|
+
216,
|
|
625
|
+
219,
|
|
626
|
+
233,
|
|
627
|
+
248,
|
|
628
|
+
89
|
|
629
|
+
];
|
|
630
|
+
};
|
|
631
|
+
};
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
name: 'tokenProgram';
|
|
635
|
+
address: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
name: 'associatedTokenProgram';
|
|
639
|
+
address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
name: 'systemProgram';
|
|
643
|
+
address: '11111111111111111111111111111111';
|
|
644
|
+
}
|
|
645
|
+
];
|
|
646
|
+
args: [
|
|
647
|
+
{
|
|
648
|
+
name: 'args';
|
|
649
|
+
type: {
|
|
650
|
+
defined: {
|
|
651
|
+
name: 'initializeQuestionArgs';
|
|
652
|
+
};
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
];
|
|
656
|
+
},
|
|
559
657
|
{
|
|
560
658
|
name: 'openOrder';
|
|
561
659
|
discriminator: [206, 88, 88, 143, 38, 136, 50, 224];
|
|
@@ -759,6 +857,26 @@ export type TriadProtocol = {
|
|
|
759
857
|
];
|
|
760
858
|
args: [];
|
|
761
859
|
},
|
|
860
|
+
{
|
|
861
|
+
name: 'resolveQuestion';
|
|
862
|
+
discriminator: [52, 32, 224, 179, 180, 8, 0, 246];
|
|
863
|
+
accounts: [
|
|
864
|
+
{
|
|
865
|
+
name: 'signer';
|
|
866
|
+
writable: true;
|
|
867
|
+
signer: true;
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
name: 'market';
|
|
871
|
+
writable: true;
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
name: 'systemProgram';
|
|
875
|
+
address: '11111111111111111111111111111111';
|
|
876
|
+
}
|
|
877
|
+
];
|
|
878
|
+
args: [];
|
|
879
|
+
},
|
|
762
880
|
{
|
|
763
881
|
name: 'stakeNft';
|
|
764
882
|
discriminator: [38, 27, 66, 46, 69, 65, 151, 219];
|
|
@@ -1517,6 +1635,10 @@ export type TriadProtocol = {
|
|
|
1517
1635
|
{
|
|
1518
1636
|
name: 'priceUpdate';
|
|
1519
1637
|
discriminator: [222, 51, 180, 226, 165, 188, 203, 54];
|
|
1638
|
+
},
|
|
1639
|
+
{
|
|
1640
|
+
name: 'questionUpdate';
|
|
1641
|
+
discriminator: [110, 108, 240, 86, 176, 226, 54, 113];
|
|
1520
1642
|
}
|
|
1521
1643
|
];
|
|
1522
1644
|
errors: [
|
|
@@ -1694,6 +1816,31 @@ export type TriadProtocol = {
|
|
|
1694
1816
|
code: 6034;
|
|
1695
1817
|
name: 'orderSizeTooLarge';
|
|
1696
1818
|
msg: 'Order size too large';
|
|
1819
|
+
},
|
|
1820
|
+
{
|
|
1821
|
+
code: 6035;
|
|
1822
|
+
name: 'questionPeriodNotEnded';
|
|
1823
|
+
msg: 'Question period not ended';
|
|
1824
|
+
},
|
|
1825
|
+
{
|
|
1826
|
+
code: 6036;
|
|
1827
|
+
name: 'invalidStartTime';
|
|
1828
|
+
msg: 'Invalid start time';
|
|
1829
|
+
},
|
|
1830
|
+
{
|
|
1831
|
+
code: 6037;
|
|
1832
|
+
name: 'invalidEndTime';
|
|
1833
|
+
msg: 'Invalid end time';
|
|
1834
|
+
},
|
|
1835
|
+
{
|
|
1836
|
+
code: 6038;
|
|
1837
|
+
name: 'questionPeriodNotStarted';
|
|
1838
|
+
msg: 'Question period not started';
|
|
1839
|
+
},
|
|
1840
|
+
{
|
|
1841
|
+
code: 6039;
|
|
1842
|
+
name: 'questionPeriodEnded';
|
|
1843
|
+
msg: 'Question period ended';
|
|
1697
1844
|
}
|
|
1698
1845
|
];
|
|
1699
1846
|
types: [
|
|
@@ -1803,6 +1950,28 @@ export type TriadProtocol = {
|
|
|
1803
1950
|
];
|
|
1804
1951
|
};
|
|
1805
1952
|
},
|
|
1953
|
+
{
|
|
1954
|
+
name: 'initializeQuestionArgs';
|
|
1955
|
+
type: {
|
|
1956
|
+
kind: 'struct';
|
|
1957
|
+
fields: [
|
|
1958
|
+
{
|
|
1959
|
+
name: 'question';
|
|
1960
|
+
type: {
|
|
1961
|
+
array: ['u8', 80];
|
|
1962
|
+
};
|
|
1963
|
+
},
|
|
1964
|
+
{
|
|
1965
|
+
name: 'startTime';
|
|
1966
|
+
type: 'i64';
|
|
1967
|
+
},
|
|
1968
|
+
{
|
|
1969
|
+
name: 'endTime';
|
|
1970
|
+
type: 'i64';
|
|
1971
|
+
}
|
|
1972
|
+
];
|
|
1973
|
+
};
|
|
1974
|
+
},
|
|
1806
1975
|
{
|
|
1807
1976
|
name: 'market';
|
|
1808
1977
|
type: {
|
|
@@ -2235,11 +2404,105 @@ export type TriadProtocol = {
|
|
|
2235
2404
|
];
|
|
2236
2405
|
};
|
|
2237
2406
|
},
|
|
2407
|
+
{
|
|
2408
|
+
name: 'questionStatus';
|
|
2409
|
+
type: {
|
|
2410
|
+
kind: 'enum';
|
|
2411
|
+
variants: [
|
|
2412
|
+
{
|
|
2413
|
+
name: 'resolved';
|
|
2414
|
+
},
|
|
2415
|
+
{
|
|
2416
|
+
name: 'unresolved';
|
|
2417
|
+
}
|
|
2418
|
+
];
|
|
2419
|
+
};
|
|
2420
|
+
},
|
|
2421
|
+
{
|
|
2422
|
+
name: 'questionUpdate';
|
|
2423
|
+
type: {
|
|
2424
|
+
kind: 'struct';
|
|
2425
|
+
fields: [
|
|
2426
|
+
{
|
|
2427
|
+
name: 'marketId';
|
|
2428
|
+
type: 'u64';
|
|
2429
|
+
},
|
|
2430
|
+
{
|
|
2431
|
+
name: 'questionId';
|
|
2432
|
+
type: 'u64';
|
|
2433
|
+
},
|
|
2434
|
+
{
|
|
2435
|
+
name: 'question';
|
|
2436
|
+
type: 'string';
|
|
2437
|
+
},
|
|
2438
|
+
{
|
|
2439
|
+
name: 'startTime';
|
|
2440
|
+
type: 'i64';
|
|
2441
|
+
},
|
|
2442
|
+
{
|
|
2443
|
+
name: 'endTime';
|
|
2444
|
+
type: 'i64';
|
|
2445
|
+
},
|
|
2446
|
+
{
|
|
2447
|
+
name: 'hypeLiquidity';
|
|
2448
|
+
type: 'u64';
|
|
2449
|
+
},
|
|
2450
|
+
{
|
|
2451
|
+
name: 'flopLiquidity';
|
|
2452
|
+
type: 'u64';
|
|
2453
|
+
},
|
|
2454
|
+
{
|
|
2455
|
+
name: 'winningDirection';
|
|
2456
|
+
type: {
|
|
2457
|
+
defined: {
|
|
2458
|
+
name: 'winningDirection';
|
|
2459
|
+
};
|
|
2460
|
+
};
|
|
2461
|
+
},
|
|
2462
|
+
{
|
|
2463
|
+
name: 'marketPrice';
|
|
2464
|
+
type: 'u64';
|
|
2465
|
+
},
|
|
2466
|
+
{
|
|
2467
|
+
name: 'finalHypePrice';
|
|
2468
|
+
type: 'u64';
|
|
2469
|
+
},
|
|
2470
|
+
{
|
|
2471
|
+
name: 'finalFlopPrice';
|
|
2472
|
+
type: 'u64';
|
|
2473
|
+
},
|
|
2474
|
+
{
|
|
2475
|
+
name: 'timestamp';
|
|
2476
|
+
type: 'i64';
|
|
2477
|
+
},
|
|
2478
|
+
{
|
|
2479
|
+
name: 'totalHypeShares';
|
|
2480
|
+
type: 'u64';
|
|
2481
|
+
},
|
|
2482
|
+
{
|
|
2483
|
+
name: 'totalFlopShares';
|
|
2484
|
+
type: 'u64';
|
|
2485
|
+
},
|
|
2486
|
+
{
|
|
2487
|
+
name: 'status';
|
|
2488
|
+
type: {
|
|
2489
|
+
defined: {
|
|
2490
|
+
name: 'questionStatus';
|
|
2491
|
+
};
|
|
2492
|
+
};
|
|
2493
|
+
}
|
|
2494
|
+
];
|
|
2495
|
+
};
|
|
2496
|
+
},
|
|
2238
2497
|
{
|
|
2239
2498
|
name: 'resolvedQuestion';
|
|
2240
2499
|
type: {
|
|
2241
2500
|
kind: 'struct';
|
|
2242
2501
|
fields: [
|
|
2502
|
+
{
|
|
2503
|
+
name: 'questionId';
|
|
2504
|
+
type: 'u64';
|
|
2505
|
+
},
|
|
2243
2506
|
{
|
|
2244
2507
|
name: 'question';
|
|
2245
2508
|
docs: ['The question or prediction topic for this week'];
|
|
@@ -2290,10 +2553,20 @@ export type TriadProtocol = {
|
|
|
2290
2553
|
docs: ['Final price for Flop outcome at the end of the week'];
|
|
2291
2554
|
type: 'u64';
|
|
2292
2555
|
},
|
|
2556
|
+
{
|
|
2557
|
+
name: 'totalHypeShares';
|
|
2558
|
+
docs: ['Total number of Hype shares issued'];
|
|
2559
|
+
type: 'u64';
|
|
2560
|
+
},
|
|
2561
|
+
{
|
|
2562
|
+
name: 'totalFlopShares';
|
|
2563
|
+
docs: ['Total number of Flop shares issued'];
|
|
2564
|
+
type: 'u64';
|
|
2565
|
+
},
|
|
2293
2566
|
{
|
|
2294
2567
|
name: 'padding';
|
|
2295
2568
|
type: {
|
|
2296
|
-
array: ['u8',
|
|
2569
|
+
array: ['u8', 40];
|
|
2297
2570
|
};
|
|
2298
2571
|
}
|
|
2299
2572
|
];
|
|
@@ -2606,6 +2879,9 @@ export type TriadProtocol = {
|
|
|
2606
2879
|
type: {
|
|
2607
2880
|
kind: 'enum';
|
|
2608
2881
|
variants: [
|
|
2882
|
+
{
|
|
2883
|
+
name: 'none';
|
|
2884
|
+
},
|
|
2609
2885
|
{
|
|
2610
2886
|
name: 'hype';
|
|
2611
2887
|
},
|
|
@@ -2613,7 +2889,7 @@ export type TriadProtocol = {
|
|
|
2613
2889
|
name: 'flop';
|
|
2614
2890
|
},
|
|
2615
2891
|
{
|
|
2616
|
-
name: '
|
|
2892
|
+
name: 'draw';
|
|
2617
2893
|
}
|
|
2618
2894
|
];
|
|
2619
2895
|
};
|