@riocrypto/common-server 1.0.2789 → 1.0.2791

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.
@@ -35,19 +35,6 @@ const NON_COSIGNER_PROVIDERS = new Set([
35
35
  common_1.FXProvider.Matching,
36
36
  common_1.FXProvider.Other,
37
37
  ]);
38
- /**
39
- * Providers for which a `tradeAsTwoWaySettlementDateOffset` override on
40
- * the band is meaningful. Matching is internal book netting and has no
41
- * upstream tenor; Other is the manual fallback. The runtime ignores the
42
- * override for these providers even if it was somehow persisted on the
43
- * band, so a stale value can never accidentally affect routing.
44
- */
45
- const PROVIDERS_SUPPORTING_TRADE_AS_OVERRIDE = new Set([
46
- common_1.FXProvider.Emarkets,
47
- common_1.FXProvider.Transnetwork,
48
- common_1.FXProvider.StoneX,
49
- ]);
50
- const isOverrideAllowedForProvider = (provider) => PROVIDERS_SUPPORTING_TRADE_AS_OVERRIDE.has(provider);
51
38
  const FALLBACK_RESOLUTION = {
52
39
  provider: common_1.FXProvider.Other,
53
40
  automatic: true,
@@ -289,10 +276,11 @@ const resolveFXProviderForAmount = (policy, fiat, amountFiat, offset, now = new
289
276
  // when set, otherwise the trade's own offset). This lets an operator
290
277
  // route a T+0 band to StoneX by overriding to T+1, or a T+3 band to
291
278
  // Emarkets/Transnetwork by overriding to T+2 - the upstream provider
292
- // only ever sees the override.
293
- const tradeAsTwoWaySettlementDateOffset = isOverrideAllowedForProvider(matchedAmountRange.provider)
294
- ? matchedAmountRange.tradeAsTwoWaySettlementDateOffset
295
- : undefined;
279
+ // only ever sees the override. For Matching / Other the override is
280
+ // applied to the FX trade's operative settlement date (which is what
281
+ // matching nets by) even though those providers have no upstream
282
+ // value-date concept.
283
+ const tradeAsTwoWaySettlementDateOffset = matchedAmountRange.tradeAsTwoWaySettlementDateOffset;
296
284
  const effectiveOffset = tradeAsTwoWaySettlementDateOffset !== null && tradeAsTwoWaySettlementDateOffset !== void 0 ? tradeAsTwoWaySettlementDateOffset : offset;
297
285
  if (!isProviderEligible(matchedAmountRange.provider, fiat, amountFiat, effectiveOffset)) {
298
286
  return Object.assign(Object.assign({}, FALLBACK_RESOLUTION), { executionThresholdMs });
@@ -24,7 +24,7 @@ interface ExternalTradeAttrs {
24
24
  settlementType?: EmarketsSettlementType;
25
25
  };
26
26
  stonex?: {
27
- valueDate?: Date;
27
+ valueDate?: string;
28
28
  quoteReqId?: string;
29
29
  bidPx?: number;
30
30
  offerPx?: number;
@@ -65,7 +65,7 @@ interface ExternalTradeDoc extends Document {
65
65
  settlementType?: EmarketsSettlementType;
66
66
  };
67
67
  stonex?: {
68
- valueDate?: Date;
68
+ valueDate?: string;
69
69
  quoteReqId?: string;
70
70
  bidPx?: number;
71
71
  offerPx?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2789",
3
+ "version": "1.0.2791",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -28,10 +28,10 @@
28
28
  "@google-cloud/secret-manager": "^5.6.0",
29
29
  "@google-cloud/storage": "^7.19.0",
30
30
  "@hyperdx/node-opentelemetry": "^0.10.3",
31
- "@riocrypto/common": "1.0.2595",
31
+ "@riocrypto/common": "1.0.2596",
32
32
  "@slack/web-api": "^7.15.0",
33
33
  "@types/express": "^4.17.25",
34
- "axios": "1.15.2",
34
+ "axios": "1.16.0",
35
35
  "crypto-js": "^4.2.0",
36
36
  "express": "^4.22.1",
37
37
  "express-rate-limit": "^7.5.1",