@taphubhq/sdk-core 0.22.3 → 0.23.0

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.cjs CHANGED
@@ -863,7 +863,15 @@ function normaliseGameConfig(node) {
863
863
  constraints: normaliseConstraints(node.constraints),
864
864
  acceptableBids: node.acceptableBids,
865
865
  minBidAmount: node.minBidAmount,
866
- maxBidAmount: node.maxBidAmount
866
+ maxBidAmount: node.maxBidAmount,
867
+ // Effective cancel policy. Distinguish three states so consumers can apply
868
+ // the right default:
869
+ // undefined → server omitted the field (older server) → use platform default
870
+ // 0 → builder explicitly disabled cancel → keep 0 (cancel OFF)
871
+ // > 0 → builder/effective threshold
872
+ // (null from the wire becomes undefined, NOT 0, so "not sent" ≠ "disabled".)
873
+ bidCancelRefundRate: node.bidCancelRefundRate ?? void 0,
874
+ bidCancelMinSeconds: node.bidCancelMinSeconds ?? void 0
867
875
  };
868
876
  }
869
877
  function normaliseGridConfig(node) {
@@ -925,6 +933,7 @@ var PAIR_QUERY = `query AgencyPair($pairId: ID!) {
925
933
  gridConfig { cellSizeTime cellSizeValue candleSize baseline baselineTime }
926
934
  constraints { minBetTime maxBetTime slippage priceMinRange priceMaxRange coefMults maxCoef }
927
935
  acceptableBids minBidAmount maxBidAmount
936
+ bidCancelRefundRate bidCancelMinSeconds
928
937
  }
929
938
  }
930
939
  }`;
package/dist/index.d.mts CHANGED
@@ -500,6 +500,19 @@ interface GameConfig {
500
500
  acceptableBids: number[];
501
501
  minBidAmount: number;
502
502
  maxBidAmount: number;
503
+ /**
504
+ * Effective cancel policy — the values the server's cancel engine actually
505
+ * enforces (per-game config, falling back to platform defaults). Use these
506
+ * to drive the Cancel button: a bid is cancellable while
507
+ * `time2 - now > bidCancelMinSeconds`; on cancel the player is refunded
508
+ * `amount * bidCancelRefundRate`.
509
+ *
510
+ * Optional for backward compatibility: a server (or a manually-constructed
511
+ * config) that predates this field omits it. normalisePair fills 0 from the
512
+ * wire; consumers should treat `undefined`/`0` as "use the platform default".
513
+ */
514
+ bidCancelRefundRate?: number;
515
+ bidCancelMinSeconds?: number;
503
516
  }
504
517
  interface GridConfig {
505
518
  cellSizeTime: number;
package/dist/index.d.ts CHANGED
@@ -500,6 +500,19 @@ interface GameConfig {
500
500
  acceptableBids: number[];
501
501
  minBidAmount: number;
502
502
  maxBidAmount: number;
503
+ /**
504
+ * Effective cancel policy — the values the server's cancel engine actually
505
+ * enforces (per-game config, falling back to platform defaults). Use these
506
+ * to drive the Cancel button: a bid is cancellable while
507
+ * `time2 - now > bidCancelMinSeconds`; on cancel the player is refunded
508
+ * `amount * bidCancelRefundRate`.
509
+ *
510
+ * Optional for backward compatibility: a server (or a manually-constructed
511
+ * config) that predates this field omits it. normalisePair fills 0 from the
512
+ * wire; consumers should treat `undefined`/`0` as "use the platform default".
513
+ */
514
+ bidCancelRefundRate?: number;
515
+ bidCancelMinSeconds?: number;
503
516
  }
504
517
  interface GridConfig {
505
518
  cellSizeTime: number;
package/dist/index.js CHANGED
@@ -798,7 +798,15 @@ function normaliseGameConfig(node) {
798
798
  constraints: normaliseConstraints(node.constraints),
799
799
  acceptableBids: node.acceptableBids,
800
800
  minBidAmount: node.minBidAmount,
801
- maxBidAmount: node.maxBidAmount
801
+ maxBidAmount: node.maxBidAmount,
802
+ // Effective cancel policy. Distinguish three states so consumers can apply
803
+ // the right default:
804
+ // undefined → server omitted the field (older server) → use platform default
805
+ // 0 → builder explicitly disabled cancel → keep 0 (cancel OFF)
806
+ // > 0 → builder/effective threshold
807
+ // (null from the wire becomes undefined, NOT 0, so "not sent" ≠ "disabled".)
808
+ bidCancelRefundRate: node.bidCancelRefundRate ?? void 0,
809
+ bidCancelMinSeconds: node.bidCancelMinSeconds ?? void 0
802
810
  };
803
811
  }
804
812
  function normaliseGridConfig(node) {
@@ -860,6 +868,7 @@ var PAIR_QUERY = `query AgencyPair($pairId: ID!) {
860
868
  gridConfig { cellSizeTime cellSizeValue candleSize baseline baselineTime }
861
869
  constraints { minBetTime maxBetTime slippage priceMinRange priceMaxRange coefMults maxCoef }
862
870
  acceptableBids minBidAmount maxBidAmount
871
+ bidCancelRefundRate bidCancelMinSeconds
863
872
  }
864
873
  }
865
874
  }`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taphubhq/sdk-core",
3
- "version": "0.22.3",
3
+ "version": "0.23.0",
4
4
  "description": "Core SDK for building on the TabHub platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs",