@triadxyz/triad-protocol 1.5.4-beta → 1.5.6-beta
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/index.js +2 -1
- package/dist/trade.d.ts +46 -39
- package/dist/trade.js +127 -32
- package/dist/types/idl_triad_protocol.json +86 -409
- package/dist/types/trade.d.ts +22 -4
- package/dist/types/triad_protocol.d.ts +86 -494
- package/dist/utils/helpers.d.ts +3 -2
- package/dist/utils/helpers.js +26 -31
- package/dist/utils/pda/trade.d.ts +1 -0
- package/dist/utils/pda/trade.js +9 -1
- package/dist/utils/swap.js +1 -12
- package/package.json +1 -1
- package/dist/local-test.d.ts +0 -1
- package/dist/local-test.js +0 -619
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
]
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
|
-
"name": "
|
|
109
|
-
"discriminator": [
|
|
108
|
+
"name": "allow_market_to_payout",
|
|
109
|
+
"discriminator": [193, 227, 109, 171, 110, 177, 47, 251],
|
|
110
110
|
"accounts": [
|
|
111
111
|
{
|
|
112
112
|
"name": "signer",
|
|
@@ -451,6 +451,59 @@
|
|
|
451
451
|
],
|
|
452
452
|
"args": []
|
|
453
453
|
},
|
|
454
|
+
{
|
|
455
|
+
"name": "create_sub_user_trade",
|
|
456
|
+
"discriminator": [77, 201, 111, 73, 47, 229, 244, 161],
|
|
457
|
+
"accounts": [
|
|
458
|
+
{
|
|
459
|
+
"name": "signer",
|
|
460
|
+
"writable": true,
|
|
461
|
+
"signer": true
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"name": "user_trade",
|
|
465
|
+
"writable": true,
|
|
466
|
+
"pda": {
|
|
467
|
+
"seeds": [
|
|
468
|
+
{
|
|
469
|
+
"kind": "const",
|
|
470
|
+
"value": [117, 115, 101, 114, 95, 116, 114, 97, 100, 101]
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"kind": "account",
|
|
474
|
+
"path": "signer"
|
|
475
|
+
}
|
|
476
|
+
]
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"name": "sub_user_trade",
|
|
481
|
+
"writable": true,
|
|
482
|
+
"pda": {
|
|
483
|
+
"seeds": [
|
|
484
|
+
{
|
|
485
|
+
"kind": "const",
|
|
486
|
+
"value": [117, 115, 101, 114, 95, 116, 114, 97, 100, 101]
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"kind": "arg",
|
|
490
|
+
"path": "sub_user_key"
|
|
491
|
+
}
|
|
492
|
+
]
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"name": "system_program",
|
|
497
|
+
"address": "11111111111111111111111111111111"
|
|
498
|
+
}
|
|
499
|
+
],
|
|
500
|
+
"args": [
|
|
501
|
+
{
|
|
502
|
+
"name": "sub_user_key",
|
|
503
|
+
"type": "pubkey"
|
|
504
|
+
}
|
|
505
|
+
]
|
|
506
|
+
},
|
|
454
507
|
{
|
|
455
508
|
"name": "create_user_trade",
|
|
456
509
|
"discriminator": [232, 235, 58, 194, 135, 248, 153, 1],
|
|
@@ -849,140 +902,6 @@
|
|
|
849
902
|
}
|
|
850
903
|
]
|
|
851
904
|
},
|
|
852
|
-
{
|
|
853
|
-
"name": "settle_order",
|
|
854
|
-
"discriminator": [80, 74, 204, 34, 12, 183, 66, 66],
|
|
855
|
-
"accounts": [
|
|
856
|
-
{
|
|
857
|
-
"name": "signer",
|
|
858
|
-
"writable": true,
|
|
859
|
-
"signer": true
|
|
860
|
-
},
|
|
861
|
-
{
|
|
862
|
-
"name": "squads",
|
|
863
|
-
"writable": true,
|
|
864
|
-
"address": "6fcSf6qfwPNR9AUUNC1UWYZDy5cQ4TzTb2aaipN2zFdq"
|
|
865
|
-
},
|
|
866
|
-
{
|
|
867
|
-
"name": "user",
|
|
868
|
-
"writable": true
|
|
869
|
-
},
|
|
870
|
-
{
|
|
871
|
-
"name": "user_trade",
|
|
872
|
-
"writable": true
|
|
873
|
-
},
|
|
874
|
-
{
|
|
875
|
-
"name": "market",
|
|
876
|
-
"writable": true
|
|
877
|
-
},
|
|
878
|
-
{
|
|
879
|
-
"name": "mint",
|
|
880
|
-
"writable": true
|
|
881
|
-
},
|
|
882
|
-
{
|
|
883
|
-
"name": "user_ata",
|
|
884
|
-
"writable": true,
|
|
885
|
-
"pda": {
|
|
886
|
-
"seeds": [
|
|
887
|
-
{
|
|
888
|
-
"kind": "account",
|
|
889
|
-
"path": "user"
|
|
890
|
-
},
|
|
891
|
-
{
|
|
892
|
-
"kind": "account",
|
|
893
|
-
"path": "token_program"
|
|
894
|
-
},
|
|
895
|
-
{
|
|
896
|
-
"kind": "account",
|
|
897
|
-
"path": "mint"
|
|
898
|
-
}
|
|
899
|
-
],
|
|
900
|
-
"program": {
|
|
901
|
-
"kind": "const",
|
|
902
|
-
"value": [
|
|
903
|
-
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
904
|
-
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
905
|
-
219, 233, 248, 89
|
|
906
|
-
]
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
},
|
|
910
|
-
{
|
|
911
|
-
"name": "market_ata",
|
|
912
|
-
"writable": true,
|
|
913
|
-
"pda": {
|
|
914
|
-
"seeds": [
|
|
915
|
-
{
|
|
916
|
-
"kind": "account",
|
|
917
|
-
"path": "market"
|
|
918
|
-
},
|
|
919
|
-
{
|
|
920
|
-
"kind": "account",
|
|
921
|
-
"path": "token_program"
|
|
922
|
-
},
|
|
923
|
-
{
|
|
924
|
-
"kind": "account",
|
|
925
|
-
"path": "mint"
|
|
926
|
-
}
|
|
927
|
-
],
|
|
928
|
-
"program": {
|
|
929
|
-
"kind": "const",
|
|
930
|
-
"value": [
|
|
931
|
-
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
932
|
-
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
933
|
-
219, 233, 248, 89
|
|
934
|
-
]
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
},
|
|
938
|
-
{
|
|
939
|
-
"name": "squads_ata",
|
|
940
|
-
"writable": true,
|
|
941
|
-
"pda": {
|
|
942
|
-
"seeds": [
|
|
943
|
-
{
|
|
944
|
-
"kind": "account",
|
|
945
|
-
"path": "squads"
|
|
946
|
-
},
|
|
947
|
-
{
|
|
948
|
-
"kind": "account",
|
|
949
|
-
"path": "token_program"
|
|
950
|
-
},
|
|
951
|
-
{
|
|
952
|
-
"kind": "account",
|
|
953
|
-
"path": "mint"
|
|
954
|
-
}
|
|
955
|
-
],
|
|
956
|
-
"program": {
|
|
957
|
-
"kind": "const",
|
|
958
|
-
"value": [
|
|
959
|
-
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
960
|
-
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
961
|
-
219, 233, 248, 89
|
|
962
|
-
]
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
},
|
|
966
|
-
{
|
|
967
|
-
"name": "token_program",
|
|
968
|
-
"address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
|
|
969
|
-
},
|
|
970
|
-
{
|
|
971
|
-
"name": "associated_token_program",
|
|
972
|
-
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
973
|
-
},
|
|
974
|
-
{
|
|
975
|
-
"name": "system_program",
|
|
976
|
-
"address": "11111111111111111111111111111111"
|
|
977
|
-
}
|
|
978
|
-
],
|
|
979
|
-
"args": [
|
|
980
|
-
{
|
|
981
|
-
"name": "order_id",
|
|
982
|
-
"type": "u64"
|
|
983
|
-
}
|
|
984
|
-
]
|
|
985
|
-
},
|
|
986
905
|
{
|
|
987
906
|
"name": "stake_token",
|
|
988
907
|
"discriminator": [191, 127, 193, 101, 37, 96, 87, 211],
|
|
@@ -1425,10 +1344,6 @@
|
|
|
1425
1344
|
"name": "Collection",
|
|
1426
1345
|
"discriminator": [48, 160, 232, 205, 191, 207, 26, 141]
|
|
1427
1346
|
},
|
|
1428
|
-
{
|
|
1429
|
-
"name": "Market",
|
|
1430
|
-
"discriminator": [219, 190, 213, 55, 0, 227, 198, 154]
|
|
1431
|
-
},
|
|
1432
1347
|
{
|
|
1433
1348
|
"name": "MarketV2",
|
|
1434
1349
|
"discriminator": [27, 60, 50, 75, 191, 193, 86, 227]
|
|
@@ -1455,10 +1370,6 @@
|
|
|
1455
1370
|
}
|
|
1456
1371
|
],
|
|
1457
1372
|
"events": [
|
|
1458
|
-
{
|
|
1459
|
-
"name": "MarketAllowedToPayoutEvent",
|
|
1460
|
-
"discriminator": [72, 148, 96, 232, 248, 132, 92, 26]
|
|
1461
|
-
},
|
|
1462
1373
|
{
|
|
1463
1374
|
"name": "MarketEvent",
|
|
1464
1375
|
"discriminator": [212, 67, 145, 23, 58, 104, 52, 83]
|
|
@@ -1556,6 +1467,11 @@
|
|
|
1556
1467
|
"code": 6015,
|
|
1557
1468
|
"name": "MarketNotAllowedToPayout",
|
|
1558
1469
|
"msg": "Market Not allowed to payout"
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
"code": 6016,
|
|
1473
|
+
"name": "UserTradeIsSubUser",
|
|
1474
|
+
"msg": "User trade is sub user"
|
|
1559
1475
|
}
|
|
1560
1476
|
],
|
|
1561
1477
|
"types": [
|
|
@@ -1759,185 +1675,6 @@
|
|
|
1759
1675
|
]
|
|
1760
1676
|
}
|
|
1761
1677
|
},
|
|
1762
|
-
{
|
|
1763
|
-
"name": "Market",
|
|
1764
|
-
"type": {
|
|
1765
|
-
"kind": "struct",
|
|
1766
|
-
"fields": [
|
|
1767
|
-
{
|
|
1768
|
-
"name": "bump",
|
|
1769
|
-
"type": "u8"
|
|
1770
|
-
},
|
|
1771
|
-
{
|
|
1772
|
-
"name": "authority",
|
|
1773
|
-
"type": "pubkey"
|
|
1774
|
-
},
|
|
1775
|
-
{
|
|
1776
|
-
"name": "market_id",
|
|
1777
|
-
"docs": ["Unique identifier for the market"],
|
|
1778
|
-
"type": "u64"
|
|
1779
|
-
},
|
|
1780
|
-
{
|
|
1781
|
-
"name": "name",
|
|
1782
|
-
"docs": ["The event being predicted (e.g., \"tJUP/TRD\")"],
|
|
1783
|
-
"type": "string"
|
|
1784
|
-
},
|
|
1785
|
-
{
|
|
1786
|
-
"name": "hype_price",
|
|
1787
|
-
"docs": [
|
|
1788
|
-
"Current price for Hype outcome (0-1000000, representing 0 to 1 TRD)",
|
|
1789
|
-
"1000000 = 1 TRD, 500000 = 0.5 TRD, etc."
|
|
1790
|
-
],
|
|
1791
|
-
"type": "u64"
|
|
1792
|
-
},
|
|
1793
|
-
{
|
|
1794
|
-
"name": "flop_price",
|
|
1795
|
-
"docs": [
|
|
1796
|
-
"Current price for Flop outcome (0-1000000, representing 0 to 1 TRD)"
|
|
1797
|
-
],
|
|
1798
|
-
"type": "u64"
|
|
1799
|
-
},
|
|
1800
|
-
{
|
|
1801
|
-
"name": "hype_liquidity",
|
|
1802
|
-
"docs": ["Total liquidity for Hype (in TRD)"],
|
|
1803
|
-
"type": "u64"
|
|
1804
|
-
},
|
|
1805
|
-
{
|
|
1806
|
-
"name": "flop_liquidity",
|
|
1807
|
-
"docs": ["Total liquidity for Flop (in TRD)"],
|
|
1808
|
-
"type": "u64"
|
|
1809
|
-
},
|
|
1810
|
-
{
|
|
1811
|
-
"name": "total_hype_shares",
|
|
1812
|
-
"docs": ["Total number of Hype shares issued"],
|
|
1813
|
-
"type": "u64"
|
|
1814
|
-
},
|
|
1815
|
-
{
|
|
1816
|
-
"name": "total_flop_shares",
|
|
1817
|
-
"docs": ["Total number of Flop shares issued"],
|
|
1818
|
-
"type": "u64"
|
|
1819
|
-
},
|
|
1820
|
-
{
|
|
1821
|
-
"name": "total_volume",
|
|
1822
|
-
"docs": ["Total trading volume (in TRD) for all resolutions"],
|
|
1823
|
-
"type": "u64"
|
|
1824
|
-
},
|
|
1825
|
-
{
|
|
1826
|
-
"name": "mint",
|
|
1827
|
-
"docs": ["Mint $TRD token"],
|
|
1828
|
-
"type": "pubkey"
|
|
1829
|
-
},
|
|
1830
|
-
{
|
|
1831
|
-
"name": "ts",
|
|
1832
|
-
"docs": ["Timestamp of the init"],
|
|
1833
|
-
"type": "i64"
|
|
1834
|
-
},
|
|
1835
|
-
{
|
|
1836
|
-
"name": "update_ts",
|
|
1837
|
-
"type": "i64"
|
|
1838
|
-
},
|
|
1839
|
-
{
|
|
1840
|
-
"name": "open_orders_count",
|
|
1841
|
-
"docs": ["Total number of open orders in this market"],
|
|
1842
|
-
"type": "u64"
|
|
1843
|
-
},
|
|
1844
|
-
{
|
|
1845
|
-
"name": "next_order_id",
|
|
1846
|
-
"docs": ["Next available order ID"],
|
|
1847
|
-
"type": "u64"
|
|
1848
|
-
},
|
|
1849
|
-
{
|
|
1850
|
-
"name": "fee_bps",
|
|
1851
|
-
"docs": [
|
|
1852
|
-
"Fees applied to trades (in basis points, e.g., 2.131% fee)"
|
|
1853
|
-
],
|
|
1854
|
-
"type": "u16"
|
|
1855
|
-
},
|
|
1856
|
-
{
|
|
1857
|
-
"name": "fee_vault",
|
|
1858
|
-
"docs": ["Vault to Receive fees"],
|
|
1859
|
-
"type": "pubkey"
|
|
1860
|
-
},
|
|
1861
|
-
{
|
|
1862
|
-
"name": "is_active",
|
|
1863
|
-
"docs": ["Whether the market is currently active for trading"],
|
|
1864
|
-
"type": "bool"
|
|
1865
|
-
},
|
|
1866
|
-
{
|
|
1867
|
-
"name": "market_price",
|
|
1868
|
-
"type": "u64"
|
|
1869
|
-
},
|
|
1870
|
-
{
|
|
1871
|
-
"name": "previous_resolved_question",
|
|
1872
|
-
"type": {
|
|
1873
|
-
"defined": {
|
|
1874
|
-
"name": "ResolvedQuestion"
|
|
1875
|
-
}
|
|
1876
|
-
}
|
|
1877
|
-
},
|
|
1878
|
-
{
|
|
1879
|
-
"name": "current_question_id",
|
|
1880
|
-
"docs": [
|
|
1881
|
-
"Index of the current week in the weekly_results array initialized with default values"
|
|
1882
|
-
],
|
|
1883
|
-
"type": "u64"
|
|
1884
|
-
},
|
|
1885
|
-
{
|
|
1886
|
-
"name": "current_question_start",
|
|
1887
|
-
"type": "i64"
|
|
1888
|
-
},
|
|
1889
|
-
{
|
|
1890
|
-
"name": "current_question_end",
|
|
1891
|
-
"type": "i64"
|
|
1892
|
-
},
|
|
1893
|
-
{
|
|
1894
|
-
"name": "current_question",
|
|
1895
|
-
"docs": ["The question or prediction topic for the current week"],
|
|
1896
|
-
"type": {
|
|
1897
|
-
"array": ["u8", 80]
|
|
1898
|
-
}
|
|
1899
|
-
},
|
|
1900
|
-
{
|
|
1901
|
-
"name": "liquidity",
|
|
1902
|
-
"type": "u64"
|
|
1903
|
-
},
|
|
1904
|
-
{
|
|
1905
|
-
"name": "padding",
|
|
1906
|
-
"type": {
|
|
1907
|
-
"array": ["u8", 200]
|
|
1908
|
-
}
|
|
1909
|
-
}
|
|
1910
|
-
]
|
|
1911
|
-
}
|
|
1912
|
-
},
|
|
1913
|
-
{
|
|
1914
|
-
"name": "MarketAllowedToPayoutEvent",
|
|
1915
|
-
"type": {
|
|
1916
|
-
"kind": "struct",
|
|
1917
|
-
"fields": [
|
|
1918
|
-
{
|
|
1919
|
-
"name": "market_id",
|
|
1920
|
-
"type": "u64"
|
|
1921
|
-
},
|
|
1922
|
-
{
|
|
1923
|
-
"name": "winning_direction",
|
|
1924
|
-
"type": {
|
|
1925
|
-
"defined": {
|
|
1926
|
-
"name": "WinningDirection"
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
},
|
|
1930
|
-
{
|
|
1931
|
-
"name": "timestamp",
|
|
1932
|
-
"type": "i64"
|
|
1933
|
-
},
|
|
1934
|
-
{
|
|
1935
|
-
"name": "is_allowed_to_payout",
|
|
1936
|
-
"type": "bool"
|
|
1937
|
-
}
|
|
1938
|
-
]
|
|
1939
|
-
}
|
|
1940
|
-
},
|
|
1941
1678
|
{
|
|
1942
1679
|
"name": "MarketEvent",
|
|
1943
1680
|
"type": {
|
|
@@ -2002,6 +1739,14 @@
|
|
|
2002
1739
|
{
|
|
2003
1740
|
"name": "market_end",
|
|
2004
1741
|
"type": "i64"
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
"name": "is_allowed_to_payout",
|
|
1745
|
+
"type": "bool"
|
|
1746
|
+
},
|
|
1747
|
+
{
|
|
1748
|
+
"name": "market_liquidity_at_start",
|
|
1749
|
+
"type": "u64"
|
|
2005
1750
|
}
|
|
2006
1751
|
]
|
|
2007
1752
|
}
|
|
@@ -2213,10 +1958,14 @@
|
|
|
2213
1958
|
}
|
|
2214
1959
|
}
|
|
2215
1960
|
},
|
|
1961
|
+
{
|
|
1962
|
+
"name": "user_nonce",
|
|
1963
|
+
"type": "u32"
|
|
1964
|
+
},
|
|
2216
1965
|
{
|
|
2217
1966
|
"name": "padding",
|
|
2218
1967
|
"type": {
|
|
2219
|
-
"array": ["u8",
|
|
1968
|
+
"array": ["u8", 28]
|
|
2220
1969
|
}
|
|
2221
1970
|
}
|
|
2222
1971
|
]
|
|
@@ -2312,6 +2061,10 @@
|
|
|
2312
2061
|
"type": {
|
|
2313
2062
|
"option": "bool"
|
|
2314
2063
|
}
|
|
2064
|
+
},
|
|
2065
|
+
{
|
|
2066
|
+
"name": "user_nonce",
|
|
2067
|
+
"type": "u32"
|
|
2315
2068
|
}
|
|
2316
2069
|
]
|
|
2317
2070
|
}
|
|
@@ -2329,12 +2082,6 @@
|
|
|
2329
2082
|
},
|
|
2330
2083
|
{
|
|
2331
2084
|
"name": "Closed"
|
|
2332
|
-
},
|
|
2333
|
-
{
|
|
2334
|
-
"name": "Claimed"
|
|
2335
|
-
},
|
|
2336
|
-
{
|
|
2337
|
-
"name": "Liquidated"
|
|
2338
2085
|
}
|
|
2339
2086
|
]
|
|
2340
2087
|
}
|
|
@@ -2385,84 +2132,6 @@
|
|
|
2385
2132
|
]
|
|
2386
2133
|
}
|
|
2387
2134
|
},
|
|
2388
|
-
{
|
|
2389
|
-
"name": "ResolvedQuestion",
|
|
2390
|
-
"type": {
|
|
2391
|
-
"kind": "struct",
|
|
2392
|
-
"fields": [
|
|
2393
|
-
{
|
|
2394
|
-
"name": "question_id",
|
|
2395
|
-
"type": "u64"
|
|
2396
|
-
},
|
|
2397
|
-
{
|
|
2398
|
-
"name": "question",
|
|
2399
|
-
"docs": ["The question or prediction topic for this week"],
|
|
2400
|
-
"type": {
|
|
2401
|
-
"array": ["u8", 80]
|
|
2402
|
-
}
|
|
2403
|
-
},
|
|
2404
|
-
{
|
|
2405
|
-
"name": "start_time",
|
|
2406
|
-
"docs": ["Start timestamp of the week"],
|
|
2407
|
-
"type": "i64"
|
|
2408
|
-
},
|
|
2409
|
-
{
|
|
2410
|
-
"name": "end_time",
|
|
2411
|
-
"docs": ["End timestamp of the week"],
|
|
2412
|
-
"type": "i64"
|
|
2413
|
-
},
|
|
2414
|
-
{
|
|
2415
|
-
"name": "hype_liquidity",
|
|
2416
|
-
"docs": ["Total liquidity for Hype (in TRD)"],
|
|
2417
|
-
"type": "u64"
|
|
2418
|
-
},
|
|
2419
|
-
{
|
|
2420
|
-
"name": "flop_liquidity",
|
|
2421
|
-
"docs": ["Total liquidity for Flop (in TRD)"],
|
|
2422
|
-
"type": "u64"
|
|
2423
|
-
},
|
|
2424
|
-
{
|
|
2425
|
-
"name": "winning_direction",
|
|
2426
|
-
"docs": ["The winning direction (Hype, Flop or None)"],
|
|
2427
|
-
"type": {
|
|
2428
|
-
"defined": {
|
|
2429
|
-
"name": "WinningDirection"
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
},
|
|
2433
|
-
{
|
|
2434
|
-
"name": "market_price",
|
|
2435
|
-
"type": "u64"
|
|
2436
|
-
},
|
|
2437
|
-
{
|
|
2438
|
-
"name": "final_hype_price",
|
|
2439
|
-
"docs": ["Final price for Hype outcome at the end of the week"],
|
|
2440
|
-
"type": "u64"
|
|
2441
|
-
},
|
|
2442
|
-
{
|
|
2443
|
-
"name": "final_flop_price",
|
|
2444
|
-
"docs": ["Final price for Flop outcome at the end of the week"],
|
|
2445
|
-
"type": "u64"
|
|
2446
|
-
},
|
|
2447
|
-
{
|
|
2448
|
-
"name": "total_hype_shares",
|
|
2449
|
-
"docs": ["Total number of Hype shares issued"],
|
|
2450
|
-
"type": "u64"
|
|
2451
|
-
},
|
|
2452
|
-
{
|
|
2453
|
-
"name": "total_flop_shares",
|
|
2454
|
-
"docs": ["Total number of Flop shares issued"],
|
|
2455
|
-
"type": "u64"
|
|
2456
|
-
},
|
|
2457
|
-
{
|
|
2458
|
-
"name": "padding",
|
|
2459
|
-
"type": {
|
|
2460
|
-
"array": ["u8", 40]
|
|
2461
|
-
}
|
|
2462
|
-
}
|
|
2463
|
-
]
|
|
2464
|
-
}
|
|
2465
|
-
},
|
|
2466
2135
|
{
|
|
2467
2136
|
"name": "StakeRewardsEvent",
|
|
2468
2137
|
"type": {
|
|
@@ -2773,10 +2442,18 @@
|
|
|
2773
2442
|
]
|
|
2774
2443
|
}
|
|
2775
2444
|
},
|
|
2445
|
+
{
|
|
2446
|
+
"name": "nonce",
|
|
2447
|
+
"type": "u32"
|
|
2448
|
+
},
|
|
2449
|
+
{
|
|
2450
|
+
"name": "is_sub_user",
|
|
2451
|
+
"type": "bool"
|
|
2452
|
+
},
|
|
2776
2453
|
{
|
|
2777
2454
|
"name": "padding",
|
|
2778
2455
|
"type": {
|
|
2779
|
-
"array": ["u8",
|
|
2456
|
+
"array": ["u8", 27]
|
|
2780
2457
|
}
|
|
2781
2458
|
}
|
|
2782
2459
|
]
|
package/dist/types/trade.d.ts
CHANGED
|
@@ -26,6 +26,28 @@ export type Market = {
|
|
|
26
26
|
winningDirection: WinningDirection;
|
|
27
27
|
marketLiquidityAtStart: string;
|
|
28
28
|
};
|
|
29
|
+
export type UserTrade = {
|
|
30
|
+
user: string;
|
|
31
|
+
totalDeposits: string;
|
|
32
|
+
totalWithdraws: string;
|
|
33
|
+
openedOrders: string;
|
|
34
|
+
orders: Order[];
|
|
35
|
+
nonce: string;
|
|
36
|
+
isSubUser: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type Order = {
|
|
39
|
+
ts: string;
|
|
40
|
+
orderId: string;
|
|
41
|
+
questionId: string;
|
|
42
|
+
marketId: string;
|
|
43
|
+
status: OrderStatus;
|
|
44
|
+
price: string;
|
|
45
|
+
totalAmount: string;
|
|
46
|
+
totalShares: string;
|
|
47
|
+
orderType: OrderType;
|
|
48
|
+
direction: OrderDirection;
|
|
49
|
+
userNonce: string;
|
|
50
|
+
};
|
|
29
51
|
export declare enum WinningDirection {
|
|
30
52
|
HYPE = "Hype",
|
|
31
53
|
FLOP = "Flop",
|
|
@@ -42,10 +64,6 @@ export type OrderStatus = {
|
|
|
42
64
|
open: {};
|
|
43
65
|
} | {
|
|
44
66
|
closed: {};
|
|
45
|
-
} | {
|
|
46
|
-
claimed: {};
|
|
47
|
-
} | {
|
|
48
|
-
liquidated: {};
|
|
49
67
|
};
|
|
50
68
|
export type OrderType = {
|
|
51
69
|
limit: {};
|