@o2exchange/contracts 0.1.23 → 0.2.1-rc

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.
@@ -18,6 +18,28 @@ export var AccessErrorOutput;
18
18
  AccessErrorOutput["NotOwner"] = "NotOwner";
19
19
  })(AccessErrorOutput || (AccessErrorOutput = {}));
20
20
  ;
21
+ export var EjectionReasonInput;
22
+ (function (EjectionReasonInput) {
23
+ EjectionReasonInput["Activated"] = "Activated";
24
+ EjectionReasonInput["CanceledByTheUser"] = "CanceledByTheUser";
25
+ EjectionReasonInput["ForceCanceled"] = "ForceCanceled";
26
+ EjectionReasonInput["SiblingOrderActivated"] = "SiblingOrderActivated";
27
+ EjectionReasonInput["NotEnoughFunds"] = "NotEnoughFunds";
28
+ EjectionReasonInput["EjectedByAdmin"] = "EjectedByAdmin";
29
+ EjectionReasonInput["ParentOrderCanceled"] = "ParentOrderCanceled";
30
+ })(EjectionReasonInput || (EjectionReasonInput = {}));
31
+ ;
32
+ export var EjectionReasonOutput;
33
+ (function (EjectionReasonOutput) {
34
+ EjectionReasonOutput["Activated"] = "Activated";
35
+ EjectionReasonOutput["CanceledByTheUser"] = "CanceledByTheUser";
36
+ EjectionReasonOutput["ForceCanceled"] = "ForceCanceled";
37
+ EjectionReasonOutput["SiblingOrderActivated"] = "SiblingOrderActivated";
38
+ EjectionReasonOutput["NotEnoughFunds"] = "NotEnoughFunds";
39
+ EjectionReasonOutput["EjectedByAdmin"] = "EjectedByAdmin";
40
+ EjectionReasonOutput["ParentOrderCanceled"] = "ParentOrderCanceled";
41
+ })(EjectionReasonOutput || (EjectionReasonOutput = {}));
42
+ ;
21
43
  export var FeeErrorInput;
22
44
  (function (FeeErrorInput) {
23
45
  FeeErrorInput["NoFeesAvailable"] = "NoFeesAvailable";
@@ -46,6 +68,7 @@ export var OrderBookInitializationErrorInput;
46
68
  OrderBookInitializationErrorInput["InvalidPricePrecision"] = "InvalidPricePrecision";
47
69
  OrderBookInitializationErrorInput["OwnerNotSet"] = "OwnerNotSet";
48
70
  OrderBookInitializationErrorInput["InvalidMinOrder"] = "InvalidMinOrder";
71
+ OrderBookInitializationErrorInput["InvalidTriggerMaxSlippage"] = "InvalidTriggerMaxSlippage";
49
72
  })(OrderBookInitializationErrorInput || (OrderBookInitializationErrorInput = {}));
50
73
  ;
51
74
  export var OrderBookInitializationErrorOutput;
@@ -56,6 +79,7 @@ export var OrderBookInitializationErrorOutput;
56
79
  OrderBookInitializationErrorOutput["InvalidPricePrecision"] = "InvalidPricePrecision";
57
80
  OrderBookInitializationErrorOutput["OwnerNotSet"] = "OwnerNotSet";
58
81
  OrderBookInitializationErrorOutput["InvalidMinOrder"] = "InvalidMinOrder";
82
+ OrderBookInitializationErrorOutput["InvalidTriggerMaxSlippage"] = "InvalidTriggerMaxSlippage";
59
83
  })(OrderBookInitializationErrorOutput || (OrderBookInitializationErrorOutput = {}));
60
84
  ;
61
85
  export var OrderCancelErrorInput;
@@ -96,6 +120,76 @@ export var SideOutput;
96
120
  SideOutput["Sell"] = "Sell";
97
121
  })(SideOutput || (SideOutput = {}));
98
122
  ;
123
+ export var TriggerOrderCancelErrorInput;
124
+ (function (TriggerOrderCancelErrorInput) {
125
+ TriggerOrderCancelErrorInput["NotOrderOwner"] = "NotOrderOwner";
126
+ TriggerOrderCancelErrorInput["TraderNotBlacklisted"] = "TraderNotBlacklisted";
127
+ TriggerOrderCancelErrorInput["OrderDoesNotExist"] = "OrderDoesNotExist";
128
+ })(TriggerOrderCancelErrorInput || (TriggerOrderCancelErrorInput = {}));
129
+ ;
130
+ export var TriggerOrderCancelErrorOutput;
131
+ (function (TriggerOrderCancelErrorOutput) {
132
+ TriggerOrderCancelErrorOutput["NotOrderOwner"] = "NotOrderOwner";
133
+ TriggerOrderCancelErrorOutput["TraderNotBlacklisted"] = "TraderNotBlacklisted";
134
+ TriggerOrderCancelErrorOutput["OrderDoesNotExist"] = "OrderDoesNotExist";
135
+ })(TriggerOrderCancelErrorOutput || (TriggerOrderCancelErrorOutput = {}));
136
+ ;
137
+ export var TriggerOrderCreationErrorInput;
138
+ (function (TriggerOrderCreationErrorInput) {
139
+ TriggerOrderCreationErrorInput["InvalidArgs"] = "InvalidArgs";
140
+ TriggerOrderCreationErrorInput["PricePrecision"] = "PricePrecision";
141
+ TriggerOrderCreationErrorInput["InvalidOrderType"] = "InvalidOrderType";
142
+ TriggerOrderCreationErrorInput["InvalidMarketOrderArgs"] = "InvalidMarketOrderArgs";
143
+ TriggerOrderCreationErrorInput["FractionalPrice"] = "FractionalPrice";
144
+ TriggerOrderCreationErrorInput["InvalidAsset"] = "InvalidAsset";
145
+ TriggerOrderCreationErrorInput["InvalidInputAmount"] = "InvalidInputAmount";
146
+ TriggerOrderCreationErrorInput["ZeroTriggerPrice"] = "ZeroTriggerPrice";
147
+ TriggerOrderCreationErrorInput["ZeroLimitPrice"] = "ZeroLimitPrice";
148
+ TriggerOrderCreationErrorInput["QuantityMustBeParentOrder"] = "QuantityMustBeParentOrder";
149
+ TriggerOrderCreationErrorInput["ZeroResolvedQtyOrPrice"] = "ZeroResolvedQtyOrPrice";
150
+ TriggerOrderCreationErrorInput["InvalidParentOrderId"] = "InvalidParentOrderId";
151
+ TriggerOrderCreationErrorInput["ParentOrderIsNotSpot"] = "ParentOrderIsNotSpot";
152
+ TriggerOrderCreationErrorInput["ParentOrderFilled"] = "ParentOrderFilled";
153
+ TriggerOrderCreationErrorInput["ParentOrderNotFound"] = "ParentOrderNotFound";
154
+ TriggerOrderCreationErrorInput["ParentTriggerSlotsExhausted"] = "ParentTriggerSlotsExhausted";
155
+ TriggerOrderCreationErrorInput["ParentOrderOwnerMismatch"] = "ParentOrderOwnerMismatch";
156
+ TriggerOrderCreationErrorInput["TriggerPriceSameAsParent"] = "TriggerPriceSameAsParent";
157
+ TriggerOrderCreationErrorInput["TriggerSideSameAsParent"] = "TriggerSideSameAsParent";
158
+ TriggerOrderCreationErrorInput["SlippageExceedsMax"] = "SlippageExceedsMax";
159
+ TriggerOrderCreationErrorInput["OcoSameTriggerPrice"] = "OcoSameTriggerPrice";
160
+ TriggerOrderCreationErrorInput["OcoNotStopAndTakeProfit"] = "OcoNotStopAndTakeProfit";
161
+ TriggerOrderCreationErrorInput["LimitPriceCrossesParent"] = "LimitPriceCrossesParent";
162
+ TriggerOrderCreationErrorInput["ParentQuantityMismatch"] = "ParentQuantityMismatch";
163
+ })(TriggerOrderCreationErrorInput || (TriggerOrderCreationErrorInput = {}));
164
+ ;
165
+ export var TriggerOrderCreationErrorOutput;
166
+ (function (TriggerOrderCreationErrorOutput) {
167
+ TriggerOrderCreationErrorOutput["InvalidArgs"] = "InvalidArgs";
168
+ TriggerOrderCreationErrorOutput["PricePrecision"] = "PricePrecision";
169
+ TriggerOrderCreationErrorOutput["InvalidOrderType"] = "InvalidOrderType";
170
+ TriggerOrderCreationErrorOutput["InvalidMarketOrderArgs"] = "InvalidMarketOrderArgs";
171
+ TriggerOrderCreationErrorOutput["FractionalPrice"] = "FractionalPrice";
172
+ TriggerOrderCreationErrorOutput["InvalidAsset"] = "InvalidAsset";
173
+ TriggerOrderCreationErrorOutput["InvalidInputAmount"] = "InvalidInputAmount";
174
+ TriggerOrderCreationErrorOutput["ZeroTriggerPrice"] = "ZeroTriggerPrice";
175
+ TriggerOrderCreationErrorOutput["ZeroLimitPrice"] = "ZeroLimitPrice";
176
+ TriggerOrderCreationErrorOutput["QuantityMustBeParentOrder"] = "QuantityMustBeParentOrder";
177
+ TriggerOrderCreationErrorOutput["ZeroResolvedQtyOrPrice"] = "ZeroResolvedQtyOrPrice";
178
+ TriggerOrderCreationErrorOutput["InvalidParentOrderId"] = "InvalidParentOrderId";
179
+ TriggerOrderCreationErrorOutput["ParentOrderIsNotSpot"] = "ParentOrderIsNotSpot";
180
+ TriggerOrderCreationErrorOutput["ParentOrderFilled"] = "ParentOrderFilled";
181
+ TriggerOrderCreationErrorOutput["ParentOrderNotFound"] = "ParentOrderNotFound";
182
+ TriggerOrderCreationErrorOutput["ParentTriggerSlotsExhausted"] = "ParentTriggerSlotsExhausted";
183
+ TriggerOrderCreationErrorOutput["ParentOrderOwnerMismatch"] = "ParentOrderOwnerMismatch";
184
+ TriggerOrderCreationErrorOutput["TriggerPriceSameAsParent"] = "TriggerPriceSameAsParent";
185
+ TriggerOrderCreationErrorOutput["TriggerSideSameAsParent"] = "TriggerSideSameAsParent";
186
+ TriggerOrderCreationErrorOutput["SlippageExceedsMax"] = "SlippageExceedsMax";
187
+ TriggerOrderCreationErrorOutput["OcoSameTriggerPrice"] = "OcoSameTriggerPrice";
188
+ TriggerOrderCreationErrorOutput["OcoNotStopAndTakeProfit"] = "OcoNotStopAndTakeProfit";
189
+ TriggerOrderCreationErrorOutput["LimitPriceCrossesParent"] = "LimitPriceCrossesParent";
190
+ TriggerOrderCreationErrorOutput["ParentQuantityMismatch"] = "ParentQuantityMismatch";
191
+ })(TriggerOrderCreationErrorOutput || (TriggerOrderCreationErrorOutput = {}));
192
+ ;
99
193
  const abi = {
100
194
  "programType": "contract",
101
195
  "specVersion": "1.2",
@@ -105,6 +199,16 @@ const abi = {
105
199
  "type": "()",
106
200
  "concreteTypeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
107
201
  },
202
+ {
203
+ "type": "(b256, b256)",
204
+ "concreteTypeId": "bc42ec26f2a17c5b23fc007d96b96bf35f8949ee156afdd789064210d881f7e0",
205
+ "metadataTypeId": 2
206
+ },
207
+ {
208
+ "type": "(b256, b256, enum std::option::Option<b256>)",
209
+ "concreteTypeId": "cdeacf58742dab0aa73fcb9b540d076dab5973f18c48cdd27818f72784feb6f2",
210
+ "metadataTypeId": 3
211
+ },
108
212
  {
109
213
  "type": "(u64, struct std::time::Time)",
110
214
  "concreteTypeId": "3639c0c1fb291a3e7e7ab4d9fe1d6762d6ff0fde0777d0ef8f3799d2f3d70a95",
@@ -126,65 +230,99 @@ const abi = {
126
230
  {
127
231
  "type": "enum contract_schema::order_book::FeeError",
128
232
  "concreteTypeId": "41ffdde08d41a5769627d4e77a60cbf9ef0a0e9194114652b57247e64a9ce7f0",
129
- "metadataTypeId": 2
233
+ "metadataTypeId": 5
130
234
  },
131
235
  {
132
236
  "type": "enum contract_schema::order_book::OrderBookInitializationError",
133
237
  "concreteTypeId": "7beea8d3e75df4e367b45e1567e03c81f969faef517cea9a4ff938fed6ee9f6a",
134
- "metadataTypeId": 3
238
+ "metadataTypeId": 6
135
239
  },
136
240
  {
137
241
  "type": "enum contract_schema::order_book::OrderCancelError",
138
242
  "concreteTypeId": "0e7d0742559c4d2c273298fdc0b9b7e9b07f7f944855ca3020dba8617515e2f0",
139
- "metadataTypeId": 4
243
+ "metadataTypeId": 7
140
244
  },
141
245
  {
142
246
  "type": "enum contract_schema::order_book::OrderCreationError",
143
247
  "concreteTypeId": "a700a0d30e8d2803040dc79b7b7b259d0c308ca5187f6c742da1df21c27bf24a",
144
- "metadataTypeId": 5
248
+ "metadataTypeId": 8
145
249
  },
146
250
  {
147
251
  "type": "enum contract_schema::order_book::Side",
148
252
  "concreteTypeId": "9a10e2c94a13825d2af23f4a4743379feba2acfcec8e2d775e945c5452e84708",
149
- "metadataTypeId": 7
253
+ "metadataTypeId": 10
254
+ },
255
+ {
256
+ "type": "enum contract_schema::order_book::TriggerOrderCancelError",
257
+ "concreteTypeId": "a4c1f16008f794e4bb5f1e3dee0e961b2c480dad11ea5b89fc2eacfe38631db5",
258
+ "metadataTypeId": 11
259
+ },
260
+ {
261
+ "type": "enum contract_schema::order_book::TriggerOrderCreationError",
262
+ "concreteTypeId": "15a4dcc6afac3f5e9d69383292c88895475737c599b518309c34cf8c1104f8f5",
263
+ "metadataTypeId": 12
150
264
  },
151
265
  {
152
266
  "type": "enum ownership::errors::InitializationError",
153
267
  "concreteTypeId": "b1fddf488ccb9e63d11888b2750bbd1280a1ae1c49f2d6637fd4cf1e930d1468",
154
- "metadataTypeId": 8
268
+ "metadataTypeId": 15
155
269
  },
156
270
  {
157
271
  "type": "enum pausable::errors::PauseError",
158
272
  "concreteTypeId": "455b46a49016f5c03c18ce54b969ea3d0d33c9b00263b3dcc36aa8da27558b8a",
159
- "metadataTypeId": 9
273
+ "metadataTypeId": 16
160
274
  },
161
275
  {
162
276
  "type": "enum src5::AccessError",
163
277
  "concreteTypeId": "f1247475d0d1466599267010f088190f8664dd31663a40c5d5e525d8e64b995d",
164
- "metadataTypeId": 10
278
+ "metadataTypeId": 17
165
279
  },
166
280
  {
167
281
  "type": "enum src5::State",
168
282
  "concreteTypeId": "287a382c1e0b1f11d12a422e77a248d27761327cd17515cc6e6369d528cf31ca",
169
- "metadataTypeId": 11
283
+ "metadataTypeId": 18
170
284
  },
171
285
  {
172
286
  "type": "enum std::identity::Identity",
173
287
  "concreteTypeId": "ab7cd04e05be58e3fc15d424c2c4a57f824a2a2d97d67252440a3925ebdc1335",
174
- "metadataTypeId": 12
288
+ "metadataTypeId": 19
289
+ },
290
+ {
291
+ "type": "enum std::option::Option<b256>",
292
+ "concreteTypeId": "0c2beb9013490c4f753f2757dfe2d8340b22ce3827d596d81d249b7038033cb6",
293
+ "metadataTypeId": 20,
294
+ "typeArguments": [
295
+ "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
296
+ ]
175
297
  },
176
298
  {
177
299
  "type": "enum std::option::Option<struct contract_schema::order_book::Order>",
178
300
  "concreteTypeId": "6cbb9ddffc993ba68abb27bb88aae72e4d50123c3fc8f05d663246d7c9f70724",
179
- "metadataTypeId": 13,
301
+ "metadataTypeId": 20,
180
302
  "typeArguments": [
181
303
  "8269f147d8b1fed93590ca56380b11413a1bed10c13c00627a887a6a5e042cea"
182
304
  ]
183
305
  },
306
+ {
307
+ "type": "enum std::option::Option<struct contract_schema::order_book::TriggerOrder>",
308
+ "concreteTypeId": "aa46988b96e71d9a5994f2807f743c9a360e72be8e9865141192345e539187f5",
309
+ "metadataTypeId": 20,
310
+ "typeArguments": [
311
+ "4cf39a60821b204ac155fe0a818c69e2008c926cb1903b2215dc08bec937dd21"
312
+ ]
313
+ },
314
+ {
315
+ "type": "enum std::option::Option<struct contract_schema::order_book::TriggerOrderArgs>",
316
+ "concreteTypeId": "020bfa2968cbf7600b3752287637e71587b0f46760ffdf0a977421343746b5c8",
317
+ "metadataTypeId": 20,
318
+ "typeArguments": [
319
+ "e915e400fd7cca76151cd63ea4a84d70d906ea97663b011363db9271072cad74"
320
+ ]
321
+ },
184
322
  {
185
323
  "type": "enum std::option::Option<struct std::contract_id::ContractId>",
186
324
  "concreteTypeId": "0d79387ad3bacdc3b7aad9da3a96f4ce60d9a1b6002df254069ad95a3931d5c8",
187
- "metadataTypeId": 13,
325
+ "metadataTypeId": 20,
188
326
  "typeArguments": [
189
327
  "29c10735d33b5159f0c71ee1dbd17b36a3e69e41f00fab0d42e1bd9f428d8a54"
190
328
  ]
@@ -192,7 +330,7 @@ const abi = {
192
330
  {
193
331
  "type": "enum std::option::Option<u64>",
194
332
  "concreteTypeId": "d852149004cc9ec0bbe7dc4e37bffea1d41469b759512b6136f2e865a4c06e7d",
195
- "metadataTypeId": 13,
333
+ "metadataTypeId": 20,
196
334
  "typeArguments": [
197
335
  "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
198
336
  ]
@@ -204,117 +342,142 @@ const abi = {
204
342
  {
205
343
  "type": "struct contract_schema::order_book::ExpireMakerEvent",
206
344
  "concreteTypeId": "937c43727e43c6ad683c47ad69885cf2783ecf73d59460fe1d7033a78ad5963c",
207
- "metadataTypeId": 16
345
+ "metadataTypeId": 23
208
346
  },
209
347
  {
210
348
  "type": "struct contract_schema::order_book::FeesClaimedEvent",
211
349
  "concreteTypeId": "2e0368c222981c3e3cbba54d7dafbda77dd2c48809b2fd989773b4ae092d8b47",
212
- "metadataTypeId": 17
350
+ "metadataTypeId": 24
213
351
  },
214
352
  {
215
353
  "type": "struct contract_schema::order_book::FeesCollectedEvent",
216
354
  "concreteTypeId": "814befd15e7d0ec83c54b78f1248f65890b6e4db618d7f067940385064ae00fa",
217
- "metadataTypeId": 18
355
+ "metadataTypeId": 25
218
356
  },
219
357
  {
220
358
  "type": "struct contract_schema::order_book::Order",
221
359
  "concreteTypeId": "8269f147d8b1fed93590ca56380b11413a1bed10c13c00627a887a6a5e042cea",
222
- "metadataTypeId": 20
360
+ "metadataTypeId": 27
223
361
  },
224
362
  {
225
363
  "type": "struct contract_schema::order_book::OrderArgs",
226
364
  "concreteTypeId": "027cfee5b9839be8e12b3b56eaf1315f269a86a23ae0a392f084185f7b54a410",
227
- "metadataTypeId": 21
365
+ "metadataTypeId": 28
228
366
  },
229
367
  {
230
368
  "type": "struct contract_schema::order_book::OrderBookBlacklistEvent",
231
369
  "concreteTypeId": "15e58f365af5d32c8a830ec43e70fce6cfbad16f88ed89b35bb7878f15f5b75d",
232
- "metadataTypeId": 22
370
+ "metadataTypeId": 29
233
371
  },
234
372
  {
235
373
  "type": "struct contract_schema::order_book::OrderBookConfigEvent",
236
374
  "concreteTypeId": "0959a811c54f76a36f4b1ca7a14729eba6801a5c03356f2cfb12233f574d0ce2",
237
- "metadataTypeId": 23
375
+ "metadataTypeId": 30
238
376
  },
239
377
  {
240
378
  "type": "struct contract_schema::order_book::OrderBookSymbolsEvent",
241
379
  "concreteTypeId": "99b332e010c1fe173601492be1e50767afba39d95f5aebb83f07fdf4c2103104",
242
- "metadataTypeId": 24
380
+ "metadataTypeId": 31
243
381
  },
244
382
  {
245
383
  "type": "struct contract_schema::order_book::OrderBookWhitelistEvent",
246
384
  "concreteTypeId": "39cbf43d52ecef8290e4f6e639a22b50f2ea8ce7d673930c83622422c7653026",
247
- "metadataTypeId": 25
385
+ "metadataTypeId": 32
248
386
  },
249
387
  {
250
388
  "type": "struct contract_schema::order_book::OrderCancelledEvent",
251
389
  "concreteTypeId": "82fb068ba8a0739f1b0a907ff1fbcbc8b1e5a31d5a2f1b46742e4c5fca967c18",
252
- "metadataTypeId": 26
390
+ "metadataTypeId": 33
253
391
  },
254
392
  {
255
393
  "type": "struct contract_schema::order_book::OrderCancelledInternalEvent",
256
394
  "concreteTypeId": "6e6744800e6fc84d4680e9492774bc9e0cab52bb665d518bdfd2ba21b3a4866c",
257
- "metadataTypeId": 27
395
+ "metadataTypeId": 34
258
396
  },
259
397
  {
260
398
  "type": "struct contract_schema::order_book::OrderCreatedEvent",
261
399
  "concreteTypeId": "df21162bb6a03b08040f043d238f4b5275e591737c8b5f068f7422be87168258",
262
- "metadataTypeId": 28
400
+ "metadataTypeId": 35
401
+ },
402
+ {
403
+ "type": "struct contract_schema::order_book::OrderHaltedEvent",
404
+ "concreteTypeId": "704d11e3abffc019b7c89fea24cbc379742ed0dc7ddc01c5425a143c1f0bc2b8",
405
+ "metadataTypeId": 36
263
406
  },
264
407
  {
265
408
  "type": "struct contract_schema::order_book::OrderMatchedEvent",
266
409
  "concreteTypeId": "cd2ccf60c8a1d69c9f5a8c9d17ec658f09cd58dac7f0f991a3ce3161c494ea88",
267
- "metadataTypeId": 29
410
+ "metadataTypeId": 37
268
411
  },
269
412
  {
270
413
  "type": "struct contract_schema::order_book::OrderOutOfGasEvent",
271
414
  "concreteTypeId": "d7fc4e0e366f46285d7ebf08fe5d7a450b649532159d67ce60a329a2d468c5c1",
272
- "metadataTypeId": 30
415
+ "metadataTypeId": 38
273
416
  },
274
417
  {
275
418
  "type": "struct contract_schema::order_book::OrderTooSmallEvent",
276
419
  "concreteTypeId": "2fed5c339537969e7d6569d8f1607e8476b5829cc3ef3185c9c4ae8f3a4f5edd",
277
- "metadataTypeId": 31
420
+ "metadataTypeId": 39
421
+ },
422
+ {
423
+ "type": "struct contract_schema::order_book::TriggerOrder",
424
+ "concreteTypeId": "4cf39a60821b204ac155fe0a818c69e2008c926cb1903b2215dc08bec937dd21",
425
+ "metadataTypeId": 40
426
+ },
427
+ {
428
+ "type": "struct contract_schema::order_book::TriggerOrderArgs",
429
+ "concreteTypeId": "e915e400fd7cca76151cd63ea4a84d70d906ea97663b011363db9271072cad74",
430
+ "metadataTypeId": 41
431
+ },
432
+ {
433
+ "type": "struct contract_schema::order_book::TriggerOrderCreatedEvent",
434
+ "concreteTypeId": "e668619391f65f6ddbe3de3cfd8a1777035887bc8bbb31c7847131031159841a",
435
+ "metadataTypeId": 42
436
+ },
437
+ {
438
+ "type": "struct contract_schema::order_book::TriggerOrderEjectedEvent",
439
+ "concreteTypeId": "962f5e9ef1b8222269128afe35ff4d3241c140c267d673365de624d353b563c8",
440
+ "metadataTypeId": 43
278
441
  },
279
442
  {
280
443
  "type": "struct contract_schema::order_book::WithdrawSettledTradeEvent",
281
444
  "concreteTypeId": "b145f499e90557447a26156cda458d1c0284a487ef8b8a90646411a33ee5e241",
282
- "metadataTypeId": 32
445
+ "metadataTypeId": 44
283
446
  },
284
447
  {
285
448
  "type": "struct ownership::events::OwnershipSet",
286
449
  "concreteTypeId": "8c0d2488561c35a28ef795bb8bcc4c43999cdd1e3ecbd10c226e0a68660c54d4",
287
- "metadataTypeId": 33
450
+ "metadataTypeId": 45
288
451
  },
289
452
  {
290
453
  "type": "struct ownership::events::OwnershipTransferred",
291
454
  "concreteTypeId": "a2a2643e0252b510328c0323a0ea60724fb4cb3309a2322ab31b27566ff9a79d",
292
- "metadataTypeId": 34
455
+ "metadataTypeId": 46
293
456
  },
294
457
  {
295
458
  "type": "struct pausable::events::PauseEvent",
296
459
  "concreteTypeId": "692983a9aba767e36b5014d3eb842447c736e341cc3b30fcb051b1f5a3d5f80a",
297
- "metadataTypeId": 35
460
+ "metadataTypeId": 47
298
461
  },
299
462
  {
300
463
  "type": "struct pausable::events::UnpauseEvent",
301
464
  "concreteTypeId": "0026d386ad84e75b525bec3e7c8b6a63df3fcd108a8c4b26438c8a7a2e2c218b",
302
- "metadataTypeId": 36
465
+ "metadataTypeId": 48
303
466
  },
304
467
  {
305
468
  "type": "struct std::asset_id::AssetId",
306
469
  "concreteTypeId": "c0710b6731b1dd59799cf6bef33eee3b3b04a2e40e80a0724090215bbf2ca974",
307
- "metadataTypeId": 38
470
+ "metadataTypeId": 50
308
471
  },
309
472
  {
310
473
  "type": "struct std::contract_id::ContractId",
311
474
  "concreteTypeId": "29c10735d33b5159f0c71ee1dbd17b36a3e69e41f00fab0d42e1bd9f428d8a54",
312
- "metadataTypeId": 41
475
+ "metadataTypeId": 53
313
476
  },
314
477
  {
315
478
  "type": "struct std::vec::Vec<b256>",
316
479
  "concreteTypeId": "32559685d0c9845f059bf9d472a0a38cf77d36c23dfcffe5489e86a65cdd9198",
317
- "metadataTypeId": 45,
480
+ "metadataTypeId": 57,
318
481
  "typeArguments": [
319
482
  "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
320
483
  ]
@@ -322,7 +485,7 @@ const abi = {
322
485
  {
323
486
  "type": "struct std::vec::Vec<enum std::identity::Identity>",
324
487
  "concreteTypeId": "2f79033d0d3729398611309f48578b56cf5162ba85e50f4d8fb79c9d9d1abc7b",
325
- "metadataTypeId": 45,
488
+ "metadataTypeId": 57,
326
489
  "typeArguments": [
327
490
  "ab7cd04e05be58e3fc15d424c2c4a57f824a2a2d97d67252440a3925ebdc1335"
328
491
  ]
@@ -330,11 +493,19 @@ const abi = {
330
493
  {
331
494
  "type": "struct std::vec::Vec<struct contract_schema::order_book::Order>",
332
495
  "concreteTypeId": "d390c7062efc85cc0e3e0a9339016565cda69d055c218f82d362776998f4e505",
333
- "metadataTypeId": 45,
496
+ "metadataTypeId": 57,
334
497
  "typeArguments": [
335
498
  "8269f147d8b1fed93590ca56380b11413a1bed10c13c00627a887a6a5e042cea"
336
499
  ]
337
500
  },
501
+ {
502
+ "type": "struct std::vec::Vec<struct contract_schema::order_book::TriggerOrder>",
503
+ "concreteTypeId": "90bd4a53a7770f92afd12f9ceaea3e7f99a6c46d42d3ddedeef0874b7be6c92a",
504
+ "metadataTypeId": 57,
505
+ "typeArguments": [
506
+ "4cf39a60821b204ac155fe0a818c69e2008c926cb1903b2215dc08bec937dd21"
507
+ ]
508
+ },
338
509
  {
339
510
  "type": "u256",
340
511
  "concreteTypeId": "1b5759d94094368cfd443019e7ca5ec4074300e544e5ea993a979f5da627261e"
@@ -355,7 +526,7 @@ const abi = {
355
526
  },
356
527
  {
357
528
  "name": "__tuple_element",
358
- "typeId": 43
529
+ "typeId": 55
359
530
  }
360
531
  ]
361
532
  },
@@ -374,8 +545,80 @@ const abi = {
374
545
  ]
375
546
  },
376
547
  {
377
- "type": "enum contract_schema::order_book::FeeError",
548
+ "type": "(_, _)",
378
549
  "metadataTypeId": 2,
550
+ "components": [
551
+ {
552
+ "name": "__tuple_element",
553
+ "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
554
+ },
555
+ {
556
+ "name": "__tuple_element",
557
+ "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
558
+ }
559
+ ]
560
+ },
561
+ {
562
+ "type": "(_, _, _)",
563
+ "metadataTypeId": 3,
564
+ "components": [
565
+ {
566
+ "name": "__tuple_element",
567
+ "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
568
+ },
569
+ {
570
+ "name": "__tuple_element",
571
+ "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
572
+ },
573
+ {
574
+ "name": "__tuple_element",
575
+ "typeId": 20,
576
+ "typeArguments": [
577
+ {
578
+ "name": "",
579
+ "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
580
+ }
581
+ ]
582
+ }
583
+ ]
584
+ },
585
+ {
586
+ "type": "enum contract_schema::order_book::EjectionReason",
587
+ "metadataTypeId": 4,
588
+ "components": [
589
+ {
590
+ "name": "Activated",
591
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
592
+ },
593
+ {
594
+ "name": "CanceledByTheUser",
595
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
596
+ },
597
+ {
598
+ "name": "ForceCanceled",
599
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
600
+ },
601
+ {
602
+ "name": "SiblingOrderActivated",
603
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
604
+ },
605
+ {
606
+ "name": "NotEnoughFunds",
607
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
608
+ },
609
+ {
610
+ "name": "EjectedByAdmin",
611
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
612
+ },
613
+ {
614
+ "name": "ParentOrderCanceled",
615
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
616
+ }
617
+ ]
618
+ },
619
+ {
620
+ "type": "enum contract_schema::order_book::FeeError",
621
+ "metadataTypeId": 5,
379
622
  "components": [
380
623
  {
381
624
  "name": "NoFeesAvailable",
@@ -385,7 +628,7 @@ const abi = {
385
628
  },
386
629
  {
387
630
  "type": "enum contract_schema::order_book::OrderBookInitializationError",
388
- "metadataTypeId": 3,
631
+ "metadataTypeId": 6,
389
632
  "components": [
390
633
  {
391
634
  "name": "InvalidAsset",
@@ -410,12 +653,16 @@ const abi = {
410
653
  {
411
654
  "name": "InvalidMinOrder",
412
655
  "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
656
+ },
657
+ {
658
+ "name": "InvalidTriggerMaxSlippage",
659
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
413
660
  }
414
661
  ]
415
662
  },
416
663
  {
417
664
  "type": "enum contract_schema::order_book::OrderCancelError",
418
- "metadataTypeId": 4,
665
+ "metadataTypeId": 7,
419
666
  "components": [
420
667
  {
421
668
  "name": "NotOrderOwner",
@@ -433,7 +680,7 @@ const abi = {
433
680
  },
434
681
  {
435
682
  "type": "enum contract_schema::order_book::OrderCreationError",
436
- "metadataTypeId": 5,
683
+ "metadataTypeId": 8,
437
684
  "components": [
438
685
  {
439
686
  "name": "InvalidOrderArgs",
@@ -491,7 +738,7 @@ const abi = {
491
738
  },
492
739
  {
493
740
  "type": "enum contract_schema::order_book::OrderType",
494
- "metadataTypeId": 6,
741
+ "metadataTypeId": 9,
495
742
  "components": [
496
743
  {
497
744
  "name": "Limit",
@@ -521,21 +768,173 @@ const abi = {
521
768
  },
522
769
  {
523
770
  "type": "enum contract_schema::order_book::Side",
524
- "metadataTypeId": 7,
771
+ "metadataTypeId": 10,
525
772
  "components": [
526
773
  {
527
774
  "name": "Buy",
528
775
  "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
529
776
  },
530
777
  {
531
- "name": "Sell",
532
- "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
778
+ "name": "Sell",
779
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
780
+ }
781
+ ]
782
+ },
783
+ {
784
+ "type": "enum contract_schema::order_book::TriggerOrderCancelError",
785
+ "metadataTypeId": 11,
786
+ "components": [
787
+ {
788
+ "name": "NotOrderOwner",
789
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
790
+ },
791
+ {
792
+ "name": "TraderNotBlacklisted",
793
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
794
+ },
795
+ {
796
+ "name": "OrderDoesNotExist",
797
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
798
+ }
799
+ ]
800
+ },
801
+ {
802
+ "type": "enum contract_schema::order_book::TriggerOrderCreationError",
803
+ "metadataTypeId": 12,
804
+ "components": [
805
+ {
806
+ "name": "InvalidArgs",
807
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
808
+ },
809
+ {
810
+ "name": "PricePrecision",
811
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
812
+ },
813
+ {
814
+ "name": "InvalidOrderType",
815
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
816
+ },
817
+ {
818
+ "name": "InvalidMarketOrderArgs",
819
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
820
+ },
821
+ {
822
+ "name": "FractionalPrice",
823
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
824
+ },
825
+ {
826
+ "name": "InvalidAsset",
827
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
828
+ },
829
+ {
830
+ "name": "InvalidInputAmount",
831
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
832
+ },
833
+ {
834
+ "name": "ZeroTriggerPrice",
835
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
836
+ },
837
+ {
838
+ "name": "ZeroLimitPrice",
839
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
840
+ },
841
+ {
842
+ "name": "QuantityMustBeParentOrder",
843
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
844
+ },
845
+ {
846
+ "name": "ZeroResolvedQtyOrPrice",
847
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
848
+ },
849
+ {
850
+ "name": "InvalidParentOrderId",
851
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
852
+ },
853
+ {
854
+ "name": "ParentOrderIsNotSpot",
855
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
856
+ },
857
+ {
858
+ "name": "ParentOrderFilled",
859
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
860
+ },
861
+ {
862
+ "name": "ParentOrderNotFound",
863
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
864
+ },
865
+ {
866
+ "name": "ParentTriggerSlotsExhausted",
867
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
868
+ },
869
+ {
870
+ "name": "ParentOrderOwnerMismatch",
871
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
872
+ },
873
+ {
874
+ "name": "TriggerPriceSameAsParent",
875
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
876
+ },
877
+ {
878
+ "name": "TriggerSideSameAsParent",
879
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
880
+ },
881
+ {
882
+ "name": "SlippageExceedsMax",
883
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
884
+ },
885
+ {
886
+ "name": "OcoSameTriggerPrice",
887
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
888
+ },
889
+ {
890
+ "name": "OcoNotStopAndTakeProfit",
891
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
892
+ },
893
+ {
894
+ "name": "LimitPriceCrossesParent",
895
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
896
+ },
897
+ {
898
+ "name": "ParentQuantityMismatch",
899
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
900
+ }
901
+ ]
902
+ },
903
+ {
904
+ "type": "enum contract_schema::order_book::TriggerOrderType",
905
+ "metadataTypeId": 13,
906
+ "components": [
907
+ {
908
+ "name": "Market",
909
+ "typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
910
+ },
911
+ {
912
+ "name": "MarketBounded",
913
+ "typeId": 1
914
+ },
915
+ {
916
+ "name": "Spot",
917
+ "typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
918
+ }
919
+ ]
920
+ },
921
+ {
922
+ "type": "enum contract_schema::order_book::TriggerQuantity",
923
+ "metadataTypeId": 14,
924
+ "components": [
925
+ {
926
+ "name": "Quantity",
927
+ "typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
928
+ },
929
+ {
930
+ "name": "ParentOrder",
931
+ "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
533
932
  }
534
933
  ]
535
934
  },
536
935
  {
537
936
  "type": "enum ownership::errors::InitializationError",
538
- "metadataTypeId": 8,
937
+ "metadataTypeId": 15,
539
938
  "components": [
540
939
  {
541
940
  "name": "CannotReinitialized",
@@ -545,7 +944,7 @@ const abi = {
545
944
  },
546
945
  {
547
946
  "type": "enum pausable::errors::PauseError",
548
- "metadataTypeId": 9,
947
+ "metadataTypeId": 16,
549
948
  "components": [
550
949
  {
551
950
  "name": "Paused",
@@ -559,7 +958,7 @@ const abi = {
559
958
  },
560
959
  {
561
960
  "type": "enum src5::AccessError",
562
- "metadataTypeId": 10,
961
+ "metadataTypeId": 17,
563
962
  "components": [
564
963
  {
565
964
  "name": "NotOwner",
@@ -569,7 +968,7 @@ const abi = {
569
968
  },
570
969
  {
571
970
  "type": "enum src5::State",
572
- "metadataTypeId": 11,
971
+ "metadataTypeId": 18,
573
972
  "components": [
574
973
  {
575
974
  "name": "Uninitialized",
@@ -577,7 +976,7 @@ const abi = {
577
976
  },
578
977
  {
579
978
  "name": "Initialized",
580
- "typeId": 12
979
+ "typeId": 19
581
980
  },
582
981
  {
583
982
  "name": "Revoked",
@@ -587,21 +986,21 @@ const abi = {
587
986
  },
588
987
  {
589
988
  "type": "enum std::identity::Identity",
590
- "metadataTypeId": 12,
989
+ "metadataTypeId": 19,
591
990
  "components": [
592
991
  {
593
992
  "name": "Address",
594
- "typeId": 37
993
+ "typeId": 49
595
994
  },
596
995
  {
597
996
  "name": "ContractId",
598
- "typeId": 41
997
+ "typeId": 53
599
998
  }
600
999
  ]
601
1000
  },
602
1001
  {
603
1002
  "type": "enum std::option::Option",
604
- "metadataTypeId": 13,
1003
+ "metadataTypeId": 20,
605
1004
  "components": [
606
1005
  {
607
1006
  "name": "None",
@@ -609,24 +1008,24 @@ const abi = {
609
1008
  },
610
1009
  {
611
1010
  "name": "Some",
612
- "typeId": 14
1011
+ "typeId": 21
613
1012
  }
614
1013
  ],
615
1014
  "typeParameters": [
616
- 14
1015
+ 21
617
1016
  ]
618
1017
  },
619
1018
  {
620
1019
  "type": "generic T",
621
- "metadataTypeId": 14
1020
+ "metadataTypeId": 21
622
1021
  },
623
1022
  {
624
1023
  "type": "raw untyped ptr",
625
- "metadataTypeId": 15
1024
+ "metadataTypeId": 22
626
1025
  },
627
1026
  {
628
1027
  "type": "struct contract_schema::order_book::ExpireMakerEvent",
629
- "metadataTypeId": 16,
1028
+ "metadataTypeId": 23,
630
1029
  "components": [
631
1030
  {
632
1031
  "name": "order_id",
@@ -634,13 +1033,13 @@ const abi = {
634
1033
  },
635
1034
  {
636
1035
  "name": "timestamp",
637
- "typeId": 43
1036
+ "typeId": 55
638
1037
  }
639
1038
  ]
640
1039
  },
641
1040
  {
642
1041
  "type": "struct contract_schema::order_book::FeesClaimedEvent",
643
- "metadataTypeId": 17,
1042
+ "metadataTypeId": 24,
644
1043
  "components": [
645
1044
  {
646
1045
  "name": "base_fees",
@@ -654,7 +1053,7 @@ const abi = {
654
1053
  },
655
1054
  {
656
1055
  "type": "struct contract_schema::order_book::FeesCollectedEvent",
657
- "metadataTypeId": 18,
1056
+ "metadataTypeId": 25,
658
1057
  "components": [
659
1058
  {
660
1059
  "name": "base_fees",
@@ -668,7 +1067,7 @@ const abi = {
668
1067
  },
669
1068
  {
670
1069
  "type": "struct contract_schema::order_book::MatchId",
671
- "metadataTypeId": 19,
1070
+ "metadataTypeId": 26,
672
1071
  "components": [
673
1072
  {
674
1073
  "name": "maker_id",
@@ -682,7 +1081,7 @@ const abi = {
682
1081
  },
683
1082
  {
684
1083
  "type": "struct contract_schema::order_book::Order",
685
- "metadataTypeId": 20,
1084
+ "metadataTypeId": 27,
686
1085
  "components": [
687
1086
  {
688
1087
  "name": "order_id",
@@ -690,11 +1089,11 @@ const abi = {
690
1089
  },
691
1090
  {
692
1091
  "name": "trader_id",
693
- "typeId": 12
1092
+ "typeId": 19
694
1093
  },
695
1094
  {
696
1095
  "name": "side",
697
- "typeId": 7
1096
+ "typeId": 10
698
1097
  },
699
1098
  {
700
1099
  "name": "price",
@@ -706,13 +1105,13 @@ const abi = {
706
1105
  },
707
1106
  {
708
1107
  "name": "order_type",
709
- "typeId": 6
1108
+ "typeId": 9
710
1109
  }
711
1110
  ]
712
1111
  },
713
1112
  {
714
1113
  "type": "struct contract_schema::order_book::OrderArgs",
715
- "metadataTypeId": 21,
1114
+ "metadataTypeId": 28,
716
1115
  "components": [
717
1116
  {
718
1117
  "name": "price",
@@ -724,21 +1123,21 @@ const abi = {
724
1123
  },
725
1124
  {
726
1125
  "name": "order_type",
727
- "typeId": 6
1126
+ "typeId": 9
728
1127
  }
729
1128
  ]
730
1129
  },
731
1130
  {
732
1131
  "type": "struct contract_schema::order_book::OrderBookBlacklistEvent",
733
- "metadataTypeId": 22,
1132
+ "metadataTypeId": 29,
734
1133
  "components": [
735
1134
  {
736
1135
  "name": "blacklist",
737
- "typeId": 13,
1136
+ "typeId": 20,
738
1137
  "typeArguments": [
739
1138
  {
740
1139
  "name": "",
741
- "typeId": 41
1140
+ "typeId": 53
742
1141
  }
743
1142
  ]
744
1143
  }
@@ -746,15 +1145,15 @@ const abi = {
746
1145
  },
747
1146
  {
748
1147
  "type": "struct contract_schema::order_book::OrderBookConfigEvent",
749
- "metadataTypeId": 23,
1148
+ "metadataTypeId": 30,
750
1149
  "components": [
751
1150
  {
752
1151
  "name": "base_asset",
753
- "typeId": 38
1152
+ "typeId": 50
754
1153
  },
755
1154
  {
756
1155
  "name": "quote_asset",
757
- "typeId": 38
1156
+ "typeId": 50
758
1157
  },
759
1158
  {
760
1159
  "name": "base_decimals",
@@ -795,34 +1194,38 @@ const abi = {
795
1194
  {
796
1195
  "name": "allow_fractional_price",
797
1196
  "typeId": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903"
1197
+ },
1198
+ {
1199
+ "name": "trigger_max_slippage",
1200
+ "typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
798
1201
  }
799
1202
  ]
800
1203
  },
801
1204
  {
802
1205
  "type": "struct contract_schema::order_book::OrderBookSymbolsEvent",
803
- "metadataTypeId": 24,
1206
+ "metadataTypeId": 31,
804
1207
  "components": [
805
1208
  {
806
1209
  "name": "base_symbol",
807
- "typeId": 42
1210
+ "typeId": 54
808
1211
  },
809
1212
  {
810
1213
  "name": "quote_symbol",
811
- "typeId": 42
1214
+ "typeId": 54
812
1215
  }
813
1216
  ]
814
1217
  },
815
1218
  {
816
1219
  "type": "struct contract_schema::order_book::OrderBookWhitelistEvent",
817
- "metadataTypeId": 25,
1220
+ "metadataTypeId": 32,
818
1221
  "components": [
819
1222
  {
820
1223
  "name": "whitelist",
821
- "typeId": 13,
1224
+ "typeId": 20,
822
1225
  "typeArguments": [
823
1226
  {
824
1227
  "name": "",
825
- "typeId": 41
1228
+ "typeId": 53
826
1229
  }
827
1230
  ]
828
1231
  }
@@ -830,7 +1233,7 @@ const abi = {
830
1233
  },
831
1234
  {
832
1235
  "type": "struct contract_schema::order_book::OrderCancelledEvent",
833
- "metadataTypeId": 26,
1236
+ "metadataTypeId": 33,
834
1237
  "components": [
835
1238
  {
836
1239
  "name": "order_id",
@@ -838,13 +1241,13 @@ const abi = {
838
1241
  },
839
1242
  {
840
1243
  "name": "timestamp",
841
- "typeId": 43
1244
+ "typeId": 55
842
1245
  }
843
1246
  ]
844
1247
  },
845
1248
  {
846
1249
  "type": "struct contract_schema::order_book::OrderCancelledInternalEvent",
847
- "metadataTypeId": 27,
1250
+ "metadataTypeId": 34,
848
1251
  "components": [
849
1252
  {
850
1253
  "name": "order_id",
@@ -852,13 +1255,13 @@ const abi = {
852
1255
  },
853
1256
  {
854
1257
  "name": "timestamp",
855
- "typeId": 43
1258
+ "typeId": 55
856
1259
  }
857
1260
  ]
858
1261
  },
859
1262
  {
860
1263
  "type": "struct contract_schema::order_book::OrderCreatedEvent",
861
- "metadataTypeId": 28,
1264
+ "metadataTypeId": 35,
862
1265
  "components": [
863
1266
  {
864
1267
  "name": "order_id",
@@ -866,15 +1269,15 @@ const abi = {
866
1269
  },
867
1270
  {
868
1271
  "name": "trader_id",
869
- "typeId": 12
1272
+ "typeId": 19
870
1273
  },
871
1274
  {
872
1275
  "name": "order_side",
873
- "typeId": 7
1276
+ "typeId": 10
874
1277
  },
875
1278
  {
876
1279
  "name": "order_type",
877
- "typeId": 6
1280
+ "typeId": 9
878
1281
  },
879
1282
  {
880
1283
  "name": "quantity",
@@ -886,17 +1289,35 @@ const abi = {
886
1289
  },
887
1290
  {
888
1291
  "name": "timestamp",
889
- "typeId": 43
1292
+ "typeId": 55
1293
+ }
1294
+ ]
1295
+ },
1296
+ {
1297
+ "type": "struct contract_schema::order_book::OrderHaltedEvent",
1298
+ "metadataTypeId": 36,
1299
+ "components": [
1300
+ {
1301
+ "name": "order_id",
1302
+ "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
1303
+ },
1304
+ {
1305
+ "name": "remaining_quantity",
1306
+ "typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
1307
+ },
1308
+ {
1309
+ "name": "timestamp",
1310
+ "typeId": 55
890
1311
  }
891
1312
  ]
892
1313
  },
893
1314
  {
894
1315
  "type": "struct contract_schema::order_book::OrderMatchedEvent",
895
- "metadataTypeId": 29,
1316
+ "metadataTypeId": 37,
896
1317
  "components": [
897
1318
  {
898
1319
  "name": "match_id",
899
- "typeId": 19
1320
+ "typeId": 26
900
1321
  },
901
1322
  {
902
1323
  "name": "quantity",
@@ -908,13 +1329,13 @@ const abi = {
908
1329
  },
909
1330
  {
910
1331
  "name": "timestamp",
911
- "typeId": 43
1332
+ "typeId": 55
912
1333
  }
913
1334
  ]
914
1335
  },
915
1336
  {
916
1337
  "type": "struct contract_schema::order_book::OrderOutOfGasEvent",
917
- "metadataTypeId": 30,
1338
+ "metadataTypeId": 38,
918
1339
  "components": [
919
1340
  {
920
1341
  "name": "order_id",
@@ -922,31 +1343,141 @@ const abi = {
922
1343
  },
923
1344
  {
924
1345
  "name": "timestamp",
925
- "typeId": 43
1346
+ "typeId": 55
926
1347
  }
927
1348
  ]
928
1349
  },
929
1350
  {
930
1351
  "type": "struct contract_schema::order_book::OrderTooSmallEvent",
931
- "metadataTypeId": 31,
1352
+ "metadataTypeId": 39,
1353
+ "components": [
1354
+ {
1355
+ "name": "order_id",
1356
+ "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
1357
+ },
1358
+ {
1359
+ "name": "timestamp",
1360
+ "typeId": 55
1361
+ }
1362
+ ]
1363
+ },
1364
+ {
1365
+ "type": "struct contract_schema::order_book::TriggerOrder",
1366
+ "metadataTypeId": 40,
1367
+ "components": [
1368
+ {
1369
+ "name": "order_id",
1370
+ "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
1371
+ },
1372
+ {
1373
+ "name": "trader_id",
1374
+ "typeId": 19
1375
+ },
1376
+ {
1377
+ "name": "side",
1378
+ "typeId": 10
1379
+ },
1380
+ {
1381
+ "name": "price",
1382
+ "typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
1383
+ },
1384
+ {
1385
+ "name": "quantity",
1386
+ "typeId": 14
1387
+ },
1388
+ {
1389
+ "name": "order_type",
1390
+ "typeId": 13
1391
+ },
1392
+ {
1393
+ "name": "trigger_price",
1394
+ "typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
1395
+ }
1396
+ ]
1397
+ },
1398
+ {
1399
+ "type": "struct contract_schema::order_book::TriggerOrderArgs",
1400
+ "metadataTypeId": 41,
1401
+ "components": [
1402
+ {
1403
+ "name": "quantity",
1404
+ "typeId": 14
1405
+ },
1406
+ {
1407
+ "name": "order_type",
1408
+ "typeId": 13
1409
+ },
1410
+ {
1411
+ "name": "trigger_price",
1412
+ "typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
1413
+ }
1414
+ ]
1415
+ },
1416
+ {
1417
+ "type": "struct contract_schema::order_book::TriggerOrderCreatedEvent",
1418
+ "metadataTypeId": 42,
932
1419
  "components": [
933
1420
  {
934
1421
  "name": "order_id",
935
1422
  "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
936
1423
  },
1424
+ {
1425
+ "name": "trader_id",
1426
+ "typeId": 19
1427
+ },
1428
+ {
1429
+ "name": "order_side",
1430
+ "typeId": 10
1431
+ },
1432
+ {
1433
+ "name": "order_type",
1434
+ "typeId": 13
1435
+ },
1436
+ {
1437
+ "name": "quantity",
1438
+ "typeId": 14
1439
+ },
1440
+ {
1441
+ "name": "trigger_price",
1442
+ "typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
1443
+ },
937
1444
  {
938
1445
  "name": "timestamp",
939
- "typeId": 43
1446
+ "typeId": 55
1447
+ },
1448
+ {
1449
+ "name": "sibling_order",
1450
+ "typeId": 20,
1451
+ "typeArguments": [
1452
+ {
1453
+ "name": "",
1454
+ "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
1455
+ }
1456
+ ]
1457
+ }
1458
+ ]
1459
+ },
1460
+ {
1461
+ "type": "struct contract_schema::order_book::TriggerOrderEjectedEvent",
1462
+ "metadataTypeId": 43,
1463
+ "components": [
1464
+ {
1465
+ "name": "order_id",
1466
+ "typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
1467
+ },
1468
+ {
1469
+ "name": "reason",
1470
+ "typeId": 4
940
1471
  }
941
1472
  ]
942
1473
  },
943
1474
  {
944
1475
  "type": "struct contract_schema::order_book::WithdrawSettledTradeEvent",
945
- "metadataTypeId": 32,
1476
+ "metadataTypeId": 44,
946
1477
  "components": [
947
1478
  {
948
1479
  "name": "trader_id",
949
- "typeId": 12
1480
+ "typeId": 19
950
1481
  },
951
1482
  {
952
1483
  "name": "base_amount",
@@ -960,51 +1491,51 @@ const abi = {
960
1491
  },
961
1492
  {
962
1493
  "type": "struct ownership::events::OwnershipSet",
963
- "metadataTypeId": 33,
1494
+ "metadataTypeId": 45,
964
1495
  "components": [
965
1496
  {
966
1497
  "name": "new_owner",
967
- "typeId": 12
1498
+ "typeId": 19
968
1499
  }
969
1500
  ]
970
1501
  },
971
1502
  {
972
1503
  "type": "struct ownership::events::OwnershipTransferred",
973
- "metadataTypeId": 34,
1504
+ "metadataTypeId": 46,
974
1505
  "components": [
975
1506
  {
976
1507
  "name": "new_owner",
977
- "typeId": 12
1508
+ "typeId": 19
978
1509
  },
979
1510
  {
980
1511
  "name": "previous_owner",
981
- "typeId": 12
1512
+ "typeId": 19
982
1513
  }
983
1514
  ]
984
1515
  },
985
1516
  {
986
1517
  "type": "struct pausable::events::PauseEvent",
987
- "metadataTypeId": 35,
1518
+ "metadataTypeId": 47,
988
1519
  "components": [
989
1520
  {
990
1521
  "name": "caller",
991
- "typeId": 12
1522
+ "typeId": 19
992
1523
  }
993
1524
  ]
994
1525
  },
995
1526
  {
996
1527
  "type": "struct pausable::events::UnpauseEvent",
997
- "metadataTypeId": 36,
1528
+ "metadataTypeId": 48,
998
1529
  "components": [
999
1530
  {
1000
1531
  "name": "caller",
1001
- "typeId": 12
1532
+ "typeId": 19
1002
1533
  }
1003
1534
  ]
1004
1535
  },
1005
1536
  {
1006
1537
  "type": "struct std::address::Address",
1007
- "metadataTypeId": 37,
1538
+ "metadataTypeId": 49,
1008
1539
  "components": [
1009
1540
  {
1010
1541
  "name": "bits",
@@ -1014,7 +1545,7 @@ const abi = {
1014
1545
  },
1015
1546
  {
1016
1547
  "type": "struct std::asset_id::AssetId",
1017
- "metadataTypeId": 38,
1548
+ "metadataTypeId": 50,
1018
1549
  "components": [
1019
1550
  {
1020
1551
  "name": "bits",
@@ -1024,11 +1555,11 @@ const abi = {
1024
1555
  },
1025
1556
  {
1026
1557
  "type": "struct std::bytes::Bytes",
1027
- "metadataTypeId": 39,
1558
+ "metadataTypeId": 51,
1028
1559
  "components": [
1029
1560
  {
1030
1561
  "name": "buf",
1031
- "typeId": 40
1562
+ "typeId": 52
1032
1563
  },
1033
1564
  {
1034
1565
  "name": "len",
@@ -1038,11 +1569,11 @@ const abi = {
1038
1569
  },
1039
1570
  {
1040
1571
  "type": "struct std::bytes::RawBytes",
1041
- "metadataTypeId": 40,
1572
+ "metadataTypeId": 52,
1042
1573
  "components": [
1043
1574
  {
1044
1575
  "name": "ptr",
1045
- "typeId": 15
1576
+ "typeId": 22
1046
1577
  },
1047
1578
  {
1048
1579
  "name": "cap",
@@ -1052,7 +1583,7 @@ const abi = {
1052
1583
  },
1053
1584
  {
1054
1585
  "type": "struct std::contract_id::ContractId",
1055
- "metadataTypeId": 41,
1586
+ "metadataTypeId": 53,
1056
1587
  "components": [
1057
1588
  {
1058
1589
  "name": "bits",
@@ -1062,17 +1593,17 @@ const abi = {
1062
1593
  },
1063
1594
  {
1064
1595
  "type": "struct std::string::String",
1065
- "metadataTypeId": 42,
1596
+ "metadataTypeId": 54,
1066
1597
  "components": [
1067
1598
  {
1068
1599
  "name": "bytes",
1069
- "typeId": 39
1600
+ "typeId": 51
1070
1601
  }
1071
1602
  ]
1072
1603
  },
1073
1604
  {
1074
1605
  "type": "struct std::time::Time",
1075
- "metadataTypeId": 43,
1606
+ "metadataTypeId": 55,
1076
1607
  "components": [
1077
1608
  {
1078
1609
  "name": "unix",
@@ -1082,11 +1613,11 @@ const abi = {
1082
1613
  },
1083
1614
  {
1084
1615
  "type": "struct std::vec::RawVec",
1085
- "metadataTypeId": 44,
1616
+ "metadataTypeId": 56,
1086
1617
  "components": [
1087
1618
  {
1088
1619
  "name": "ptr",
1089
- "typeId": 15
1620
+ "typeId": 22
1090
1621
  },
1091
1622
  {
1092
1623
  "name": "cap",
@@ -1094,20 +1625,20 @@ const abi = {
1094
1625
  }
1095
1626
  ],
1096
1627
  "typeParameters": [
1097
- 14
1628
+ 21
1098
1629
  ]
1099
1630
  },
1100
1631
  {
1101
1632
  "type": "struct std::vec::Vec",
1102
- "metadataTypeId": 45,
1633
+ "metadataTypeId": 57,
1103
1634
  "components": [
1104
1635
  {
1105
1636
  "name": "buf",
1106
- "typeId": 44,
1637
+ "typeId": 56,
1107
1638
  "typeArguments": [
1108
1639
  {
1109
1640
  "name": "",
1110
- "typeId": 14
1641
+ "typeId": 21
1111
1642
  }
1112
1643
  ]
1113
1644
  },
@@ -1117,7 +1648,7 @@ const abi = {
1117
1648
  }
1118
1649
  ],
1119
1650
  "typeParameters": [
1120
- 14
1651
+ 21
1121
1652
  ]
1122
1653
  }
1123
1654
  ],
@@ -1502,109 +2033,258 @@ const abi = {
1502
2033
  {
1503
2034
  "name": "doc-comment",
1504
2035
  "arguments": [
1505
- " # Storage Access"
2036
+ " # Storage Access"
2037
+ ]
2038
+ },
2039
+ {
2040
+ "name": "doc-comment",
2041
+ "arguments": [
2042
+ ""
2043
+ ]
2044
+ },
2045
+ {
2046
+ "name": "doc-comment",
2047
+ "arguments": [
2048
+ " - Reads: Current order book state to check for matches"
2049
+ ]
2050
+ },
2051
+ {
2052
+ "name": "doc-comment",
2053
+ "arguments": [
2054
+ " - Writes: Updates order book with new order or executes trades"
2055
+ ]
2056
+ },
2057
+ {
2058
+ "name": "doc-comment",
2059
+ "arguments": [
2060
+ ""
2061
+ ]
2062
+ },
2063
+ {
2064
+ "name": "doc-comment",
2065
+ "arguments": [
2066
+ " # Events"
2067
+ ]
2068
+ },
2069
+ {
2070
+ "name": "doc-comment",
2071
+ "arguments": [
2072
+ ""
2073
+ ]
2074
+ },
2075
+ {
2076
+ "name": "doc-comment",
2077
+ "arguments": [
2078
+ " - Emits `OrderCreatedEvent` if order is added to book"
2079
+ ]
2080
+ },
2081
+ {
2082
+ "name": "doc-comment",
2083
+ "arguments": [
2084
+ " - Emits `OrderMatchedEvent` for each match executed"
2085
+ ]
2086
+ },
2087
+ {
2088
+ "name": "doc-comment",
2089
+ "arguments": [
2090
+ ""
2091
+ ]
2092
+ },
2093
+ {
2094
+ "name": "doc-comment",
2095
+ "arguments": [
2096
+ " # Reverts"
2097
+ ]
2098
+ },
2099
+ {
2100
+ "name": "doc-comment",
2101
+ "arguments": [
2102
+ ""
2103
+ ]
2104
+ },
2105
+ {
2106
+ "name": "doc-comment",
2107
+ "arguments": [
2108
+ " - If quantity is zero"
1506
2109
  ]
1507
2110
  },
1508
2111
  {
1509
2112
  "name": "doc-comment",
1510
2113
  "arguments": [
1511
- ""
2114
+ " - If price is zero"
1512
2115
  ]
1513
2116
  },
1514
2117
  {
1515
2118
  "name": "doc-comment",
1516
2119
  "arguments": [
1517
- " - Reads: Current order book state to check for matches"
2120
+ " - If msg_asset_id is neither BASE_ASSET nor QUOTE_ASSET"
1518
2121
  ]
1519
2122
  },
1520
2123
  {
1521
2124
  "name": "doc-comment",
1522
2125
  "arguments": [
1523
- " - Writes: Updates order book with new order or executes trades"
2126
+ " - If msg_amount doesn't match expected amount:"
1524
2127
  ]
1525
2128
  },
1526
2129
  {
1527
2130
  "name": "doc-comment",
1528
2131
  "arguments": [
1529
- ""
2132
+ " - Buy orders: msg_amount != quantity * price"
1530
2133
  ]
1531
2134
  },
1532
2135
  {
1533
2136
  "name": "doc-comment",
1534
2137
  "arguments": [
1535
- " # Events"
2138
+ " - Sell orders: msg_amount != quantity"
1536
2139
  ]
1537
2140
  },
1538
2141
  {
1539
- "name": "doc-comment",
2142
+ "name": "storage",
1540
2143
  "arguments": [
1541
- ""
2144
+ "read",
2145
+ "write"
1542
2146
  ]
1543
2147
  },
1544
2148
  {
1545
- "name": "doc-comment",
1546
- "arguments": [
1547
- " - Emits `OrderCreatedEvent` if order is added to book"
1548
- ]
2149
+ "name": "payable",
2150
+ "arguments": []
2151
+ }
2152
+ ]
2153
+ },
2154
+ {
2155
+ "name": "create_order_with_triggers",
2156
+ "inputs": [
2157
+ {
2158
+ "name": "order_args",
2159
+ "concreteTypeId": "027cfee5b9839be8e12b3b56eaf1315f269a86a23ae0a392f084185f7b54a410"
1549
2160
  },
1550
2161
  {
1551
- "name": "doc-comment",
2162
+ "name": "trigger_1",
2163
+ "concreteTypeId": "e915e400fd7cca76151cd63ea4a84d70d906ea97663b011363db9271072cad74"
2164
+ },
2165
+ {
2166
+ "name": "trigger_2",
2167
+ "concreteTypeId": "020bfa2968cbf7600b3752287637e71587b0f46760ffdf0a977421343746b5c8"
2168
+ }
2169
+ ],
2170
+ "output": "cdeacf58742dab0aa73fcb9b540d076dab5973f18c48cdd27818f72784feb6f2",
2171
+ "attributes": [
2172
+ {
2173
+ "name": "storage",
1552
2174
  "arguments": [
1553
- " - Emits `OrderMatchedEvent` for each match executed"
2175
+ "read",
2176
+ "write"
1554
2177
  ]
1555
2178
  },
1556
2179
  {
1557
- "name": "doc-comment",
2180
+ "name": "payable",
2181
+ "arguments": []
2182
+ }
2183
+ ]
2184
+ },
2185
+ {
2186
+ "name": "create_trigger_order",
2187
+ "inputs": [
2188
+ {
2189
+ "name": "trigger_order",
2190
+ "concreteTypeId": "e915e400fd7cca76151cd63ea4a84d70d906ea97663b011363db9271072cad74"
2191
+ },
2192
+ {
2193
+ "name": "expected_parent_quantity",
2194
+ "concreteTypeId": "d852149004cc9ec0bbe7dc4e37bffea1d41469b759512b6136f2e865a4c06e7d"
2195
+ }
2196
+ ],
2197
+ "output": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b",
2198
+ "attributes": [
2199
+ {
2200
+ "name": "storage",
1558
2201
  "arguments": [
1559
- ""
2202
+ "read",
2203
+ "write"
1560
2204
  ]
1561
2205
  },
1562
2206
  {
1563
- "name": "doc-comment",
2207
+ "name": "payable",
2208
+ "arguments": []
2209
+ }
2210
+ ]
2211
+ },
2212
+ {
2213
+ "name": "create_trigger_orders",
2214
+ "inputs": [
2215
+ {
2216
+ "name": "trigger_order_1",
2217
+ "concreteTypeId": "e915e400fd7cca76151cd63ea4a84d70d906ea97663b011363db9271072cad74"
2218
+ },
2219
+ {
2220
+ "name": "trigger_order_2",
2221
+ "concreteTypeId": "e915e400fd7cca76151cd63ea4a84d70d906ea97663b011363db9271072cad74"
2222
+ },
2223
+ {
2224
+ "name": "expected_parent_quantity",
2225
+ "concreteTypeId": "d852149004cc9ec0bbe7dc4e37bffea1d41469b759512b6136f2e865a4c06e7d"
2226
+ }
2227
+ ],
2228
+ "output": "bc42ec26f2a17c5b23fc007d96b96bf35f8949ee156afdd789064210d881f7e0",
2229
+ "attributes": [
2230
+ {
2231
+ "name": "storage",
1564
2232
  "arguments": [
1565
- " # Reverts"
2233
+ "read",
2234
+ "write"
1566
2235
  ]
1567
2236
  },
2237
+ {
2238
+ "name": "payable",
2239
+ "arguments": []
2240
+ }
2241
+ ]
2242
+ },
2243
+ {
2244
+ "name": "execute_trigger_order",
2245
+ "inputs": [],
2246
+ "output": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d",
2247
+ "attributes": [
1568
2248
  {
1569
2249
  "name": "doc-comment",
1570
2250
  "arguments": [
1571
- ""
2251
+ " Executes the next trigger order at the head of the global queue."
1572
2252
  ]
1573
2253
  },
1574
2254
  {
1575
2255
  "name": "doc-comment",
1576
2256
  "arguments": [
1577
- " - If quantity is zero"
2257
+ ""
1578
2258
  ]
1579
2259
  },
1580
2260
  {
1581
2261
  "name": "doc-comment",
1582
2262
  "arguments": [
1583
- " - If price is zero"
2263
+ " The trigger is funded by whatever has accumulated in its lock. If a parent spot"
1584
2264
  ]
1585
2265
  },
1586
2266
  {
1587
2267
  "name": "doc-comment",
1588
2268
  "arguments": [
1589
- " - If msg_asset_id is neither BASE_ASSET nor QUOTE_ASSET"
2269
+ " order is still resting, it is cancelled first (its escrow returned to the trader's"
1590
2270
  ]
1591
2271
  },
1592
2272
  {
1593
2273
  "name": "doc-comment",
1594
2274
  "arguments": [
1595
- " - If msg_amount doesn't match expected amount:"
2275
+ " settled balance) so the trigger fires at the snapshot of available funds rather"
1596
2276
  ]
1597
2277
  },
1598
2278
  {
1599
2279
  "name": "doc-comment",
1600
2280
  "arguments": [
1601
- " - Buy orders: msg_amount != quantity * price"
2281
+ " than racing future fills against it. The new spot's quantity is scaled down to"
1602
2282
  ]
1603
2283
  },
1604
2284
  {
1605
2285
  "name": "doc-comment",
1606
2286
  "arguments": [
1607
- " - Sell orders: msg_amount != quantity"
2287
+ " match the available lock — never up."
1608
2288
  ]
1609
2289
  },
1610
2290
  {
@@ -1613,10 +2293,6 @@ const abi = {
1613
2293
  "read",
1614
2294
  "write"
1615
2295
  ]
1616
- },
1617
- {
1618
- "name": "payable",
1619
- "arguments": []
1620
2296
  }
1621
2297
  ]
1622
2298
  },
@@ -1815,6 +2491,19 @@ const abi = {
1815
2491
  "output": "0d79387ad3bacdc3b7aad9da3a96f4ce60d9a1b6002df254069ad95a3931d5c8",
1816
2492
  "attributes": null
1817
2493
  },
2494
+ {
2495
+ "name": "get_head_trigger_order",
2496
+ "inputs": [],
2497
+ "output": "aa46988b96e71d9a5994f2807f743c9a360e72be8e9865141192345e539187f5",
2498
+ "attributes": [
2499
+ {
2500
+ "name": "storage",
2501
+ "arguments": [
2502
+ "read"
2503
+ ]
2504
+ }
2505
+ ]
2506
+ },
1818
2507
  {
1819
2508
  "name": "get_heap_price",
1820
2509
  "inputs": [
@@ -1988,6 +2677,28 @@ const abi = {
1988
2677
  }
1989
2678
  ]
1990
2679
  },
2680
+ {
2681
+ "name": "get_locked_balance_of",
2682
+ "inputs": [
2683
+ {
2684
+ "name": "trader",
2685
+ "concreteTypeId": "ab7cd04e05be58e3fc15d424c2c4a57f824a2a2d97d67252440a3925ebdc1335"
2686
+ },
2687
+ {
2688
+ "name": "order_id",
2689
+ "concreteTypeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
2690
+ }
2691
+ ],
2692
+ "output": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
2693
+ "attributes": [
2694
+ {
2695
+ "name": "storage",
2696
+ "arguments": [
2697
+ "read"
2698
+ ]
2699
+ }
2700
+ ]
2701
+ },
1991
2702
  {
1992
2703
  "name": "get_maker_fee",
1993
2704
  "inputs": [],
@@ -2530,6 +3241,78 @@ const abi = {
2530
3241
  }
2531
3242
  ]
2532
3243
  },
3244
+ {
3245
+ "name": "get_trigger_order",
3246
+ "inputs": [
3247
+ {
3248
+ "name": "order_id",
3249
+ "concreteTypeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
3250
+ }
3251
+ ],
3252
+ "output": "aa46988b96e71d9a5994f2807f743c9a360e72be8e9865141192345e539187f5",
3253
+ "attributes": [
3254
+ {
3255
+ "name": "storage",
3256
+ "arguments": [
3257
+ "read"
3258
+ ]
3259
+ }
3260
+ ]
3261
+ },
3262
+ {
3263
+ "name": "get_trigger_order_parent",
3264
+ "inputs": [
3265
+ {
3266
+ "name": "order_id",
3267
+ "concreteTypeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
3268
+ }
3269
+ ],
3270
+ "output": "0c2beb9013490c4f753f2757dfe2d8340b22ce3827d596d81d249b7038033cb6",
3271
+ "attributes": [
3272
+ {
3273
+ "name": "storage",
3274
+ "arguments": [
3275
+ "read"
3276
+ ]
3277
+ }
3278
+ ]
3279
+ },
3280
+ {
3281
+ "name": "get_trigger_order_sibling",
3282
+ "inputs": [
3283
+ {
3284
+ "name": "order_id",
3285
+ "concreteTypeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
3286
+ }
3287
+ ],
3288
+ "output": "0c2beb9013490c4f753f2757dfe2d8340b22ce3827d596d81d249b7038033cb6",
3289
+ "attributes": [
3290
+ {
3291
+ "name": "storage",
3292
+ "arguments": [
3293
+ "read"
3294
+ ]
3295
+ }
3296
+ ]
3297
+ },
3298
+ {
3299
+ "name": "get_trigger_orders_at_price",
3300
+ "inputs": [
3301
+ {
3302
+ "name": "trigger_price",
3303
+ "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
3304
+ }
3305
+ ],
3306
+ "output": "90bd4a53a7770f92afd12f9ceaea3e7f99a6c46d42d3ddedeef0874b7be6c92a",
3307
+ "attributes": [
3308
+ {
3309
+ "name": "storage",
3310
+ "arguments": [
3311
+ "read"
3312
+ ]
3313
+ }
3314
+ ]
3315
+ },
2533
3316
  {
2534
3317
  "name": "get_whitelist_id",
2535
3318
  "inputs": [],
@@ -2859,6 +3642,44 @@ const abi = {
2859
3642
  }
2860
3643
  ]
2861
3644
  },
3645
+ {
3646
+ "name": "eject_trigger_order",
3647
+ "inputs": [],
3648
+ "output": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d",
3649
+ "attributes": [
3650
+ {
3651
+ "name": "doc-comment",
3652
+ "arguments": [
3653
+ " Owner-only escape hatch: removes the trigger at the head of the global queue,"
3654
+ ]
3655
+ },
3656
+ {
3657
+ "name": "doc-comment",
3658
+ "arguments": [
3659
+ " refunds any held lock to the trader, clears all linked state, and unhalts the book"
3660
+ ]
3661
+ },
3662
+ {
3663
+ "name": "doc-comment",
3664
+ "arguments": [
3665
+ " if it was halted. Used when a trigger at the head is stuck (e.g. systematically"
3666
+ ]
3667
+ },
3668
+ {
3669
+ "name": "doc-comment",
3670
+ "arguments": [
3671
+ " running OOG and blocking subsequent triggers)."
3672
+ ]
3673
+ },
3674
+ {
3675
+ "name": "storage",
3676
+ "arguments": [
3677
+ "read",
3678
+ "write"
3679
+ ]
3680
+ }
3681
+ ]
3682
+ },
2862
3683
  {
2863
3684
  "name": "emit_orderbook_config",
2864
3685
  "inputs": [],
@@ -3238,6 +4059,14 @@ const abi = {
3238
4059
  "logId": "4997665884103701952",
3239
4060
  "concreteTypeId": "455b46a49016f5c03c18ce54b969ea3d0d33c9b00263b3dcc36aa8da27558b8a"
3240
4061
  },
4062
+ {
4063
+ "logId": "11872035487494935780",
4064
+ "concreteTypeId": "a4c1f16008f794e4bb5f1e3dee0e961b2c480dad11ea5b89fc2eacfe38631db5"
4065
+ },
4066
+ {
4067
+ "logId": "10821972466347811362",
4068
+ "concreteTypeId": "962f5e9ef1b8222269128afe35ff4d3241c140c267d673365de624d353b563c8"
4069
+ },
3241
4070
  {
3242
4071
  "logId": "1043998670105365804",
3243
4072
  "concreteTypeId": "0e7d0742559c4d2c273298fdc0b9b7e9b07f7f944855ca3020dba8617515e2f0"
@@ -3293,6 +4122,18 @@ const abi = {
3293
4122
  {
3294
4123
  "logId": "11719039397861176592",
3295
4124
  "concreteTypeId": "a2a2643e0252b510328c0323a0ea60724fb4cb3309a2322ab31b27566ff9a79d"
4125
+ },
4126
+ {
4127
+ "logId": "1559614116885970782",
4128
+ "concreteTypeId": "15a4dcc6afac3f5e9d69383292c88895475737c599b518309c34cf8c1104f8f5"
4129
+ },
4130
+ {
4131
+ "logId": "16602627312738262893",
4132
+ "concreteTypeId": "e668619391f65f6ddbe3de3cfd8a1777035887bc8bbb31c7847131031159841a"
4133
+ },
4134
+ {
4135
+ "logId": "8092143774995562521",
4136
+ "concreteTypeId": "704d11e3abffc019b7c89fea24cbc379742ed0dc7ddc01c5425a143c1f0bc2b8"
3296
4137
  }
3297
4138
  ],
3298
4139
  "messagesTypes": [],
@@ -3300,133 +4141,139 @@ const abi = {
3300
4141
  {
3301
4142
  "name": "INITIAL_OWNER",
3302
4143
  "concreteTypeId": "287a382c1e0b1f11d12a422e77a248d27761327cd17515cc6e6369d528cf31ca",
3303
- "offset": 76896,
4144
+ "offset": 147376,
3304
4145
  "indirect": false
3305
4146
  },
3306
4147
  {
3307
4148
  "name": "BASE_ASSET",
3308
4149
  "concreteTypeId": "c0710b6731b1dd59799cf6bef33eee3b3b04a2e40e80a0724090215bbf2ca974",
3309
- "offset": 76784,
4150
+ "offset": 147264,
3310
4151
  "indirect": false
3311
4152
  },
3312
4153
  {
3313
4154
  "name": "QUOTE_ASSET",
3314
4155
  "concreteTypeId": "c0710b6731b1dd59799cf6bef33eee3b3b04a2e40e80a0724090215bbf2ca974",
3315
- "offset": 77040,
4156
+ "offset": 147520,
3316
4157
  "indirect": false
3317
4158
  },
3318
4159
  {
3319
4160
  "name": "MIN_ORDER",
3320
4161
  "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
3321
- "offset": 77008,
4162
+ "offset": 147488,
3322
4163
  "indirect": false
3323
4164
  },
3324
4165
  {
3325
4166
  "name": "MAKER_FEE",
3326
4167
  "concreteTypeId": "1b5759d94094368cfd443019e7ca5ec4074300e544e5ea993a979f5da627261e",
3327
- "offset": 76944,
4168
+ "offset": 147424,
3328
4169
  "indirect": false
3329
4170
  },
3330
4171
  {
3331
4172
  "name": "TAKER_FEE",
3332
4173
  "concreteTypeId": "1b5759d94094368cfd443019e7ca5ec4074300e544e5ea993a979f5da627261e",
3333
- "offset": 77096,
4174
+ "offset": 147576,
3334
4175
  "indirect": false
3335
4176
  },
3336
4177
  {
3337
4178
  "name": "BASE_DECIMALS",
3338
4179
  "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
3339
- "offset": 76816,
4180
+ "offset": 147296,
3340
4181
  "indirect": false
3341
4182
  },
3342
4183
  {
3343
4184
  "name": "QUOTE_DECIMALS",
3344
4185
  "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
3345
- "offset": 77072,
4186
+ "offset": 147552,
3346
4187
  "indirect": false
3347
4188
  },
3348
4189
  {
3349
4190
  "name": "PRICE_WINDOW",
3350
4191
  "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
3351
- "offset": 77024,
4192
+ "offset": 147504,
3352
4193
  "indirect": false
3353
4194
  },
3354
4195
  {
3355
4196
  "name": "PRICE_PRECISION",
3356
4197
  "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
3357
- "offset": 77016,
4198
+ "offset": 147496,
3358
4199
  "indirect": false
3359
4200
  },
3360
4201
  {
3361
4202
  "name": "QUANTITY_PRECISION",
3362
4203
  "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
3363
- "offset": 77032,
4204
+ "offset": 147512,
3364
4205
  "indirect": false
3365
4206
  },
3366
4207
  {
3367
4208
  "name": "DUST",
3368
4209
  "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
3369
- "offset": 76888,
4210
+ "offset": 147368,
3370
4211
  "indirect": false
3371
4212
  },
3372
4213
  {
3373
4214
  "name": "BASE_GAS",
3374
4215
  "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
3375
- "offset": 76824,
4216
+ "offset": 147304,
3376
4217
  "indirect": false
3377
4218
  },
3378
4219
  {
3379
4220
  "name": "MATCH_EVENT_GAS",
3380
4221
  "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
3381
- "offset": 76976,
4222
+ "offset": 147456,
3382
4223
  "indirect": false
3383
4224
  },
3384
4225
  {
3385
4226
  "name": "MATCH_SINGLE_LEVEL_GAS",
3386
4227
  "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
3387
- "offset": 76992,
4228
+ "offset": 147472,
3388
4229
  "indirect": false
3389
4230
  },
3390
4231
  {
3391
4232
  "name": "MATCH_MULTI_LEVEL_GAS",
3392
4233
  "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
3393
- "offset": 76984,
4234
+ "offset": 147464,
3394
4235
  "indirect": false
3395
4236
  },
3396
4237
  {
3397
4238
  "name": "MIN_GAS",
3398
4239
  "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
3399
- "offset": 77000,
4240
+ "offset": 147480,
3400
4241
  "indirect": false
3401
4242
  },
3402
4243
  {
3403
4244
  "name": "ALLOW_FRACTIONAL_PRICE",
3404
4245
  "concreteTypeId": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903",
3405
- "offset": 76776,
4246
+ "offset": 147256,
4247
+ "indirect": false
4248
+ },
4249
+ {
4250
+ "name": "TRIGGER_MAX_SLIPPAGE",
4251
+ "concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0",
4252
+ "offset": 147608,
3406
4253
  "indirect": false
3407
4254
  },
3408
4255
  {
3409
4256
  "name": "BASE_SYMBOL",
3410
4257
  "concreteTypeId": "338a25cb65b9251663dcce6362b744fe10aa849758299590f4efed5dd299bf50",
3411
- "offset": 76832,
4258
+ "offset": 147312,
3412
4259
  "indirect": false
3413
4260
  },
3414
4261
  {
3415
4262
  "name": "QUOTE_SYMBOL",
3416
4263
  "concreteTypeId": "338a25cb65b9251663dcce6362b744fe10aa849758299590f4efed5dd299bf50",
3417
- "offset": 77080,
4264
+ "offset": 147560,
3418
4265
  "indirect": false
3419
4266
  },
3420
4267
  {
3421
4268
  "name": "WHITE_LIST_CONTRACT",
3422
4269
  "concreteTypeId": "0d79387ad3bacdc3b7aad9da3a96f4ce60d9a1b6002df254069ad95a3931d5c8",
3423
- "offset": 77128,
4270
+ "offset": 147616,
3424
4271
  "indirect": false
3425
4272
  },
3426
4273
  {
3427
4274
  "name": "BLACK_LIST_CONTRACT",
3428
4275
  "concreteTypeId": "0d79387ad3bacdc3b7aad9da3a96f4ce60d9a1b6002df254069ad95a3931d5c8",
3429
- "offset": 76848,
4276
+ "offset": 147328,
3430
4277
  "indirect": false
3431
4278
  }
3432
4279
  ],
@@ -3434,6 +4281,14 @@ const abi = {
3434
4281
  "panickingCalls": {}
3435
4282
  };
3436
4283
  const storageSlots = [
4284
+ {
4285
+ "key": "0e37d740667cc57abb67fd7a1336769600f94d8b7ee55c86be3d3ab1b450d5f6",
4286
+ "value": "0000000000000000000000000000000000000000000000000000000000000000"
4287
+ },
4288
+ {
4289
+ "key": "4d01d421159e00072c30c0e33ebb92efc2ad962501ea745cc6443828196d0262",
4290
+ "value": "0000000000000000000000000000000000000000000000000000000000000000"
4291
+ },
3437
4292
  {
3438
4293
  "key": "7ceadc98468d452f30f6b180bc1065fbce8620efac57fef287b5c34e4c9687f4",
3439
4294
  "value": "0000000000000000000000000000000000000000000000000000000000000000"
@@ -3445,6 +4300,10 @@ const storageSlots = [
3445
4300
  {
3446
4301
  "key": "ad467f799b8cd85bf32c612ea056ff074c7e9fef2ca8673e7a9b34743223d66f",
3447
4302
  "value": "000000000000000000000000000000000000000000000000ffffffffffffffff"
4303
+ },
4304
+ {
4305
+ "key": "d86e355c3987290610faa33c5721bb75366b3434e51536793b2486554f8c4d0c",
4306
+ "value": "0000000000000000000000000000000000000000000000000000000000000000"
3448
4307
  }
3449
4308
  ];
3450
4309
  export class OrderBookInterface extends Interface {