@triadxyz/triad-protocol 1.7.3-beta → 1.7.5-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.
@@ -26,6 +26,7 @@ export type Market = {
26
26
  question: string;
27
27
  winningDirection: WinningDirection;
28
28
  marketLiquidityAtStart: string;
29
+ payoutFee: number;
29
30
  customer: string;
30
31
  };
31
32
  export type UserTrade = {
@@ -35,20 +36,25 @@ export type UserTrade = {
35
36
  openedOrders: string;
36
37
  orders: Order[];
37
38
  nonce: string;
39
+ poseidon: string;
38
40
  isSubUser: boolean;
39
41
  };
40
42
  export type Order = {
41
43
  ts: string;
42
44
  orderId: string;
43
- questionId: string;
45
+ filledShares: string;
44
46
  marketId: string;
45
- status: OrderStatus;
47
+ orderStatus: OrderStatus;
46
48
  price: string;
47
49
  totalAmount: string;
48
50
  totalShares: string;
49
51
  orderType: OrderType;
50
- direction: OrderDirection;
52
+ orderDirection: OrderDirection;
53
+ orderSide: OrderSide;
51
54
  userNonce: string;
55
+ linkedOrderId: string;
56
+ account: string;
57
+ createdAt: string;
52
58
  };
53
59
  export declare enum WinningDirection {
54
60
  HYPE = "Hype",
@@ -56,28 +62,79 @@ export declare enum WinningDirection {
56
62
  FLOP = "Flop",
57
63
  NONE = "None"
58
64
  }
59
- export type OrderDirection = {
60
- hype: {};
61
- } | {
62
- flop: {};
65
+ export declare enum OrderDirection {
66
+ HYPE = "hype",
67
+ FLOP = "flop"
68
+ }
69
+ export declare enum OrderStatus {
70
+ INIT = "init",
71
+ OPEN = "open",
72
+ CLOSED = "closed",
73
+ CLAIMED = "claimed",
74
+ LIQUIDATED = "liquidated",
75
+ WAITING = "waiting"
76
+ }
77
+ export declare enum OrderType {
78
+ LIMIT = "limit",
79
+ MARKET = "market"
80
+ }
81
+ export declare enum OrderSide {
82
+ BID = "bid",
83
+ ASK = "ask"
84
+ }
85
+ export type PlaceOrderArgs = {
86
+ marketId: number;
87
+ amount: number;
88
+ price: number;
89
+ direction: {
90
+ hype: {};
91
+ } | {
92
+ flop: {};
93
+ };
94
+ orderSide: {
95
+ bid: {};
96
+ } | {
97
+ ask: {};
98
+ };
99
+ mint: PublicKey;
100
+ bidOrderId: number | null;
63
101
  };
64
- export type OrderStatus = {
65
- init: {};
66
- } | {
67
- open: {};
68
- } | {
69
- closed: {};
102
+ export type InitializeMarketArgs = {
103
+ marketId: number;
104
+ startTime: number;
105
+ endTime: number;
106
+ question: string;
107
+ feeBps: number;
108
+ customer: PublicKey | null;
70
109
  };
71
- export type OrderType = {
72
- limit: {};
73
- } | {
74
- market: {};
110
+ export type UpdateMarketArgs = {
111
+ marketId: number;
112
+ marketEnd?: number;
113
+ winningDirection?: {
114
+ hype: {};
115
+ } | {
116
+ flop: {};
117
+ } | {
118
+ none: {};
119
+ } | {
120
+ draw: {};
121
+ };
122
+ };
123
+ export type CreateCustomerArgs = {
124
+ id: number;
125
+ name: string;
126
+ authority: PublicKey;
127
+ feeRecipient: PublicKey;
75
128
  };
76
129
  export type OpenOrderArgs = {
77
130
  marketId: number;
78
131
  amount: number;
79
- direction: OrderDirection;
80
- token: string;
132
+ direction: {
133
+ hype: {};
134
+ } | {
135
+ flop: {};
136
+ };
137
+ mint: PublicKey;
81
138
  };
82
139
  export type CreateMarketArgs = {
83
140
  marketId: number;
@@ -86,10 +143,24 @@ export type CreateMarketArgs = {
86
143
  question: string;
87
144
  feeBps: number;
88
145
  customer: PublicKey;
146
+ payoutFee: number;
89
147
  mint: PublicKey;
90
148
  };
91
- export type CreateCustomerArgs = {
92
- id: number;
93
- name: string;
94
- authority: PublicKey;
149
+ export type CancelOrderArgs = {
150
+ marketId: number;
151
+ orderId: number;
152
+ userNonce: number;
153
+ orderSide: OrderSide;
154
+ mint: PublicKey;
155
+ userNonceBidOrder: number | null;
156
+ };
157
+ export type MarketBidOrderArgs = {
158
+ marketId: number;
159
+ amount: number;
160
+ direction: {
161
+ hype: {};
162
+ } | {
163
+ flop: {};
164
+ };
165
+ mint: PublicKey;
95
166
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WinningDirection = void 0;
3
+ exports.OrderSide = exports.OrderType = exports.OrderStatus = exports.OrderDirection = exports.WinningDirection = void 0;
4
4
  var WinningDirection;
5
5
  (function (WinningDirection) {
6
6
  WinningDirection["HYPE"] = "Hype";
@@ -8,3 +8,27 @@ var WinningDirection;
8
8
  WinningDirection["FLOP"] = "Flop";
9
9
  WinningDirection["NONE"] = "None";
10
10
  })(WinningDirection || (exports.WinningDirection = WinningDirection = {}));
11
+ var OrderDirection;
12
+ (function (OrderDirection) {
13
+ OrderDirection["HYPE"] = "hype";
14
+ OrderDirection["FLOP"] = "flop";
15
+ })(OrderDirection || (exports.OrderDirection = OrderDirection = {}));
16
+ var OrderStatus;
17
+ (function (OrderStatus) {
18
+ OrderStatus["INIT"] = "init";
19
+ OrderStatus["OPEN"] = "open";
20
+ OrderStatus["CLOSED"] = "closed";
21
+ OrderStatus["CLAIMED"] = "claimed";
22
+ OrderStatus["LIQUIDATED"] = "liquidated";
23
+ OrderStatus["WAITING"] = "waiting";
24
+ })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
25
+ var OrderType;
26
+ (function (OrderType) {
27
+ OrderType["LIMIT"] = "limit";
28
+ OrderType["MARKET"] = "market";
29
+ })(OrderType || (exports.OrderType = OrderType = {}));
30
+ var OrderSide;
31
+ (function (OrderSide) {
32
+ OrderSide["BID"] = "bid";
33
+ OrderSide["ASK"] = "ask";
34
+ })(OrderSide || (exports.OrderSide = OrderSide = {}));