@cowprotocol/sdk-order-book 3.1.0 → 3.2.1

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 CHANGED
@@ -24,6 +24,7 @@ __export(src_exports, {
24
24
  CompetitionOrderStatus: () => CompetitionOrderStatus,
25
25
  DEFAULT_BACKOFF_OPTIONS: () => DEFAULT_BACKOFF_OPTIONS,
26
26
  DEFAULT_LIMITER_OPTIONS: () => DEFAULT_LIMITER_OPTIONS,
27
+ DebugFeePolicy: () => DebugFeePolicy,
27
28
  EcdsaSigningScheme: () => EcdsaSigningScheme,
28
29
  ORDER_BOOK_PARTNER_PROD_CONFIG: () => ORDER_BOOK_PARTNER_PROD_CONFIG,
29
30
  ORDER_BOOK_PARTNER_STAGING_CONFIG: () => ORDER_BOOK_PARTNER_STAGING_CONFIG,
@@ -43,6 +44,7 @@ __export(src_exports, {
43
44
  PriceQuality: () => PriceQuality,
44
45
  SellTokenSource: () => SellTokenSource,
45
46
  SigningScheme: () => SigningScheme,
47
+ SimulationType: () => SimulationType,
46
48
  getProtocolFeeAmount: () => getProtocolFeeAmount,
47
49
  getQuoteAmountsAfterPartnerFee: () => getQuoteAmountsAfterPartnerFee,
48
50
  getQuoteAmountsAfterSlippage: () => getQuoteAmountsAfterSlippage,
@@ -191,7 +193,8 @@ var ORDER_BOOK_PROD_CONFIG = {
191
193
  [import_sdk_config2.SupportedChainId.BNB]: `${PROD_BASE_URL}/bnb`,
192
194
  [import_sdk_config2.SupportedChainId.LINEA]: `${PROD_BASE_URL}/linea`,
193
195
  [import_sdk_config2.SupportedChainId.PLASMA]: `${PROD_BASE_URL}/plasma`,
194
- [import_sdk_config2.SupportedChainId.INK]: `${PROD_BASE_URL}/ink`
196
+ [import_sdk_config2.SupportedChainId.INK]: `${PROD_BASE_URL}/ink`,
197
+ [import_sdk_config2.SupportedChainId.SOLANA]: `${PROD_BASE_URL}/solana`
195
198
  };
196
199
  var ORDER_BOOK_STAGING_CONFIG = {
197
200
  [import_sdk_config2.SupportedChainId.MAINNET]: `${STAGING_BASE_URL}/mainnet`,
@@ -204,7 +207,8 @@ var ORDER_BOOK_STAGING_CONFIG = {
204
207
  [import_sdk_config2.SupportedChainId.BNB]: `${STAGING_BASE_URL}/bnb`,
205
208
  [import_sdk_config2.SupportedChainId.LINEA]: `${STAGING_BASE_URL}/linea`,
206
209
  [import_sdk_config2.SupportedChainId.PLASMA]: `${STAGING_BASE_URL}/plasma`,
207
- [import_sdk_config2.SupportedChainId.INK]: `${STAGING_BASE_URL}/ink`
210
+ [import_sdk_config2.SupportedChainId.INK]: `${STAGING_BASE_URL}/ink`,
211
+ [import_sdk_config2.SupportedChainId.SOLANA]: `${STAGING_BASE_URL}/solana`
208
212
  };
209
213
  var ORDER_BOOK_PARTNER_PROD_CONFIG = {
210
214
  [import_sdk_config2.SupportedChainId.MAINNET]: `${PARTNER_PROD_BASE_URL}/mainnet`,
@@ -217,7 +221,8 @@ var ORDER_BOOK_PARTNER_PROD_CONFIG = {
217
221
  [import_sdk_config2.SupportedChainId.BNB]: `${PARTNER_PROD_BASE_URL}/bnb`,
218
222
  [import_sdk_config2.SupportedChainId.LINEA]: `${PARTNER_PROD_BASE_URL}/linea`,
219
223
  [import_sdk_config2.SupportedChainId.PLASMA]: `${PARTNER_PROD_BASE_URL}/plasma`,
220
- [import_sdk_config2.SupportedChainId.INK]: `${PARTNER_PROD_BASE_URL}/ink`
224
+ [import_sdk_config2.SupportedChainId.INK]: `${PARTNER_PROD_BASE_URL}/ink`,
225
+ [import_sdk_config2.SupportedChainId.SOLANA]: `${PARTNER_PROD_BASE_URL}/solana`
221
226
  };
222
227
  var ORDER_BOOK_PARTNER_STAGING_CONFIG = {
223
228
  [import_sdk_config2.SupportedChainId.MAINNET]: `${PARTNER_STAGING_BASE_URL}/mainnet`,
@@ -230,7 +235,8 @@ var ORDER_BOOK_PARTNER_STAGING_CONFIG = {
230
235
  [import_sdk_config2.SupportedChainId.BNB]: `${PARTNER_STAGING_BASE_URL}/bnb`,
231
236
  [import_sdk_config2.SupportedChainId.LINEA]: `${PARTNER_STAGING_BASE_URL}/linea`,
232
237
  [import_sdk_config2.SupportedChainId.PLASMA]: `${PARTNER_STAGING_BASE_URL}/plasma`,
233
- [import_sdk_config2.SupportedChainId.INK]: `${PARTNER_STAGING_BASE_URL}/ink`
238
+ [import_sdk_config2.SupportedChainId.INK]: `${PARTNER_STAGING_BASE_URL}/ink`,
239
+ [import_sdk_config2.SupportedChainId.SOLANA]: `${PARTNER_STAGING_BASE_URL}/solana`
234
240
  };
235
241
  function cleanObjectFromUndefinedValues(obj) {
236
242
  return Object.keys(obj).reduce(
@@ -525,6 +531,17 @@ var CompetitionOrderStatus;
525
531
  })(type = CompetitionOrderStatus2.type || (CompetitionOrderStatus2.type = {}));
526
532
  })(CompetitionOrderStatus || (CompetitionOrderStatus = {}));
527
533
 
534
+ // src/generated/models/DebugFeePolicy.ts
535
+ var DebugFeePolicy;
536
+ ((DebugFeePolicy2) => {
537
+ let kind;
538
+ ((kind2) => {
539
+ kind2["SURPLUS"] = "surplus";
540
+ kind2["VOLUME"] = "volume";
541
+ kind2["PRICE_IMPROVEMENT"] = "priceImprovement";
542
+ })(kind = DebugFeePolicy2.kind || (DebugFeePolicy2.kind = {}));
543
+ })(DebugFeePolicy || (DebugFeePolicy = {}));
544
+
528
545
  // src/generated/models/EcdsaSigningScheme.ts
529
546
  var EcdsaSigningScheme = /* @__PURE__ */ ((EcdsaSigningScheme2) => {
530
547
  EcdsaSigningScheme2["EIP712"] = "eip712";
@@ -604,7 +621,9 @@ var OrderPostError;
604
621
  errorType2["UNSUPPORTED_TOKEN"] = "UnsupportedToken";
605
622
  errorType2["INVALID_APP_DATA"] = "InvalidAppData";
606
623
  errorType2["APP_DATA_HASH_MISMATCH"] = "AppDataHashMismatch";
624
+ errorType2["APP_DATA_MISMATCH"] = "AppDataMismatch";
607
625
  errorType2["APPDATA_FROM_MISMATCH"] = "AppdataFromMismatch";
626
+ errorType2["METADATA_SERIALIZATION_FAILED"] = "MetadataSerializationFailed";
608
627
  errorType2["OLD_ORDER_ACTIVELY_BID_ON"] = "OldOrderActivelyBidOn";
609
628
  })(errorType = OrderPostError2.errorType || (OrderPostError2.errorType = {}));
610
629
  })(OrderPostError || (OrderPostError = {}));
@@ -638,7 +657,7 @@ var PriceEstimationError;
638
657
  ((errorType2) => {
639
658
  errorType2["QUOTE_NOT_VERIFIED"] = "QuoteNotVerified";
640
659
  errorType2["UNSUPPORTED_TOKEN"] = "UnsupportedToken";
641
- errorType2["ZERO_AMOUNT"] = "ZeroAmount";
660
+ errorType2["NO_LIQUIDITY"] = "NoLiquidity";
642
661
  errorType2["UNSUPPORTED_ORDER_TYPE"] = "UnsupportedOrderType";
643
662
  })(errorType = PriceEstimationError2.errorType || (PriceEstimationError2.errorType = {}));
644
663
  })(PriceEstimationError || (PriceEstimationError = {}));
@@ -668,6 +687,13 @@ var SigningScheme = /* @__PURE__ */ ((SigningScheme2) => {
668
687
  return SigningScheme2;
669
688
  })(SigningScheme || {});
670
689
 
690
+ // src/generated/models/SimulationType.ts
691
+ var SimulationType = /* @__PURE__ */ ((SimulationType2) => {
692
+ SimulationType2["FULL"] = "full";
693
+ SimulationType2["QUICK"] = "quick";
694
+ return SimulationType2;
695
+ })(SimulationType || {});
696
+
671
697
  // src/quoteAmountsAndCosts/quoteAmountsAndCosts.const.ts
672
698
  var HUNDRED_THOUSANDS = 1e5;
673
699
  var ONE_HUNDRED_BPS = BigInt(100 * 100);
@@ -826,6 +852,7 @@ function getQuoteAmountsAndCosts(params) {
826
852
  CompetitionOrderStatus,
827
853
  DEFAULT_BACKOFF_OPTIONS,
828
854
  DEFAULT_LIMITER_OPTIONS,
855
+ DebugFeePolicy,
829
856
  EcdsaSigningScheme,
830
857
  ORDER_BOOK_PARTNER_PROD_CONFIG,
831
858
  ORDER_BOOK_PARTNER_STAGING_CONFIG,
@@ -845,6 +872,7 @@ function getQuoteAmountsAndCosts(params) {
845
872
  PriceQuality,
846
873
  SellTokenSource,
847
874
  SigningScheme,
875
+ SimulationType,
848
876
  getProtocolFeeAmount,
849
877
  getQuoteAmountsAfterPartnerFee,
850
878
  getQuoteAmountsAfterSlippage,
package/dist/index.mjs CHANGED
@@ -142,7 +142,8 @@ var ORDER_BOOK_PROD_CONFIG = {
142
142
  [SupportedChainId.BNB]: `${PROD_BASE_URL}/bnb`,
143
143
  [SupportedChainId.LINEA]: `${PROD_BASE_URL}/linea`,
144
144
  [SupportedChainId.PLASMA]: `${PROD_BASE_URL}/plasma`,
145
- [SupportedChainId.INK]: `${PROD_BASE_URL}/ink`
145
+ [SupportedChainId.INK]: `${PROD_BASE_URL}/ink`,
146
+ [SupportedChainId.SOLANA]: `${PROD_BASE_URL}/solana`
146
147
  };
147
148
  var ORDER_BOOK_STAGING_CONFIG = {
148
149
  [SupportedChainId.MAINNET]: `${STAGING_BASE_URL}/mainnet`,
@@ -155,7 +156,8 @@ var ORDER_BOOK_STAGING_CONFIG = {
155
156
  [SupportedChainId.BNB]: `${STAGING_BASE_URL}/bnb`,
156
157
  [SupportedChainId.LINEA]: `${STAGING_BASE_URL}/linea`,
157
158
  [SupportedChainId.PLASMA]: `${STAGING_BASE_URL}/plasma`,
158
- [SupportedChainId.INK]: `${STAGING_BASE_URL}/ink`
159
+ [SupportedChainId.INK]: `${STAGING_BASE_URL}/ink`,
160
+ [SupportedChainId.SOLANA]: `${STAGING_BASE_URL}/solana`
159
161
  };
160
162
  var ORDER_BOOK_PARTNER_PROD_CONFIG = {
161
163
  [SupportedChainId.MAINNET]: `${PARTNER_PROD_BASE_URL}/mainnet`,
@@ -168,7 +170,8 @@ var ORDER_BOOK_PARTNER_PROD_CONFIG = {
168
170
  [SupportedChainId.BNB]: `${PARTNER_PROD_BASE_URL}/bnb`,
169
171
  [SupportedChainId.LINEA]: `${PARTNER_PROD_BASE_URL}/linea`,
170
172
  [SupportedChainId.PLASMA]: `${PARTNER_PROD_BASE_URL}/plasma`,
171
- [SupportedChainId.INK]: `${PARTNER_PROD_BASE_URL}/ink`
173
+ [SupportedChainId.INK]: `${PARTNER_PROD_BASE_URL}/ink`,
174
+ [SupportedChainId.SOLANA]: `${PARTNER_PROD_BASE_URL}/solana`
172
175
  };
173
176
  var ORDER_BOOK_PARTNER_STAGING_CONFIG = {
174
177
  [SupportedChainId.MAINNET]: `${PARTNER_STAGING_BASE_URL}/mainnet`,
@@ -181,7 +184,8 @@ var ORDER_BOOK_PARTNER_STAGING_CONFIG = {
181
184
  [SupportedChainId.BNB]: `${PARTNER_STAGING_BASE_URL}/bnb`,
182
185
  [SupportedChainId.LINEA]: `${PARTNER_STAGING_BASE_URL}/linea`,
183
186
  [SupportedChainId.PLASMA]: `${PARTNER_STAGING_BASE_URL}/plasma`,
184
- [SupportedChainId.INK]: `${PARTNER_STAGING_BASE_URL}/ink`
187
+ [SupportedChainId.INK]: `${PARTNER_STAGING_BASE_URL}/ink`,
188
+ [SupportedChainId.SOLANA]: `${PARTNER_STAGING_BASE_URL}/solana`
185
189
  };
186
190
  function cleanObjectFromUndefinedValues(obj) {
187
191
  return Object.keys(obj).reduce(
@@ -476,6 +480,17 @@ var CompetitionOrderStatus;
476
480
  })(type = CompetitionOrderStatus2.type || (CompetitionOrderStatus2.type = {}));
477
481
  })(CompetitionOrderStatus || (CompetitionOrderStatus = {}));
478
482
 
483
+ // src/generated/models/DebugFeePolicy.ts
484
+ var DebugFeePolicy;
485
+ ((DebugFeePolicy2) => {
486
+ let kind;
487
+ ((kind2) => {
488
+ kind2["SURPLUS"] = "surplus";
489
+ kind2["VOLUME"] = "volume";
490
+ kind2["PRICE_IMPROVEMENT"] = "priceImprovement";
491
+ })(kind = DebugFeePolicy2.kind || (DebugFeePolicy2.kind = {}));
492
+ })(DebugFeePolicy || (DebugFeePolicy = {}));
493
+
479
494
  // src/generated/models/EcdsaSigningScheme.ts
480
495
  var EcdsaSigningScheme = /* @__PURE__ */ ((EcdsaSigningScheme2) => {
481
496
  EcdsaSigningScheme2["EIP712"] = "eip712";
@@ -555,7 +570,9 @@ var OrderPostError;
555
570
  errorType2["UNSUPPORTED_TOKEN"] = "UnsupportedToken";
556
571
  errorType2["INVALID_APP_DATA"] = "InvalidAppData";
557
572
  errorType2["APP_DATA_HASH_MISMATCH"] = "AppDataHashMismatch";
573
+ errorType2["APP_DATA_MISMATCH"] = "AppDataMismatch";
558
574
  errorType2["APPDATA_FROM_MISMATCH"] = "AppdataFromMismatch";
575
+ errorType2["METADATA_SERIALIZATION_FAILED"] = "MetadataSerializationFailed";
559
576
  errorType2["OLD_ORDER_ACTIVELY_BID_ON"] = "OldOrderActivelyBidOn";
560
577
  })(errorType = OrderPostError2.errorType || (OrderPostError2.errorType = {}));
561
578
  })(OrderPostError || (OrderPostError = {}));
@@ -589,7 +606,7 @@ var PriceEstimationError;
589
606
  ((errorType2) => {
590
607
  errorType2["QUOTE_NOT_VERIFIED"] = "QuoteNotVerified";
591
608
  errorType2["UNSUPPORTED_TOKEN"] = "UnsupportedToken";
592
- errorType2["ZERO_AMOUNT"] = "ZeroAmount";
609
+ errorType2["NO_LIQUIDITY"] = "NoLiquidity";
593
610
  errorType2["UNSUPPORTED_ORDER_TYPE"] = "UnsupportedOrderType";
594
611
  })(errorType = PriceEstimationError2.errorType || (PriceEstimationError2.errorType = {}));
595
612
  })(PriceEstimationError || (PriceEstimationError = {}));
@@ -619,6 +636,13 @@ var SigningScheme = /* @__PURE__ */ ((SigningScheme2) => {
619
636
  return SigningScheme2;
620
637
  })(SigningScheme || {});
621
638
 
639
+ // src/generated/models/SimulationType.ts
640
+ var SimulationType = /* @__PURE__ */ ((SimulationType2) => {
641
+ SimulationType2["FULL"] = "full";
642
+ SimulationType2["QUICK"] = "quick";
643
+ return SimulationType2;
644
+ })(SimulationType || {});
645
+
622
646
  // src/quoteAmountsAndCosts/quoteAmountsAndCosts.const.ts
623
647
  var HUNDRED_THOUSANDS = 1e5;
624
648
  var ONE_HUNDRED_BPS = BigInt(100 * 100);
@@ -776,6 +800,7 @@ export {
776
800
  CompetitionOrderStatus,
777
801
  DEFAULT_BACKOFF_OPTIONS,
778
802
  DEFAULT_LIMITER_OPTIONS,
803
+ DebugFeePolicy,
779
804
  EcdsaSigningScheme,
780
805
  ORDER_BOOK_PARTNER_PROD_CONFIG,
781
806
  ORDER_BOOK_PARTNER_STAGING_CONFIG,
@@ -795,6 +820,7 @@ export {
795
820
  PriceQuality,
796
821
  SellTokenSource,
797
822
  SigningScheme,
823
+ SimulationType,
798
824
  getProtocolFeeAmount,
799
825
  getQuoteAmountsAfterPartnerFee,
800
826
  getQuoteAmountsAfterSlippage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/sdk-order-book",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "description": "CowProtocol Order Book package",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,8 +36,8 @@
36
36
  "cross-fetch": "^3.2.0",
37
37
  "exponential-backoff": "^3.1.2",
38
38
  "limiter": "^3.0.0",
39
- "@cowprotocol/sdk-common": "0.10.3",
40
- "@cowprotocol/sdk-config": "2.1.0"
39
+ "@cowprotocol/sdk-config": "2.2.1",
40
+ "@cowprotocol/sdk-common": "0.11.1"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "tsup src/index.ts --format esm,cjs --dts",
@@ -46,7 +46,7 @@
46
46
  "test": "jest",
47
47
  "test:coverage": "jest --coverage --json --outputFile=jest.results.json && npx coveralls < ./coverage/lcov.info",
48
48
  "test:coverage:html": "jest --silent=false --coverage --coverageReporters html",
49
- "swagger:codegen": "openapi --input https://raw.githubusercontent.com/cowprotocol/services/dfb50cb4a103e8f949f5a7145beb6be63ef41c85/crates/orderbook/openapi.yml --output src/generated --exportServices false --exportCore false",
49
+ "swagger:codegen": "openapi --input https://raw.githubusercontent.com/cowprotocol/services/5341875c9498b2026d1b6f67c840b086e4696dcd/crates/orderbook/openapi.yml --output src/generated --exportServices false --exportCore false",
50
50
  "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
51
51
  "typecheck": "tsc --noEmit"
52
52
  }