@taphubhq/sdk-core 0.17.3 → 0.18.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
@@ -610,7 +610,7 @@ var LeaderboardModule = class {
610
610
  this.#graphql = deps.graphql;
611
611
  }
612
612
  async list(args) {
613
- const body = await this.#graphql.request(
613
+ const body = await this.#graphql.publicRequest(
614
614
  LEADERBOARD_QUERY,
615
615
  { period: args.period, sort_by: args.sortBy },
616
616
  args.signal ? { signal: args.signal } : void 0
@@ -722,17 +722,17 @@ var LocaleModule = class {
722
722
 
723
723
  // src/modules/pair/normalise.ts
724
724
  function normalisePair(node) {
725
- if (typeof node.id !== "string" || node.id === "" || typeof node.pair !== "string" || node.pair === "" || typeof node.status !== "string" || node.status === "" || !node.config) {
725
+ if (typeof node.id !== "string" || node.id === "" || !node.pair || typeof node.pair.pair !== "string" || node.pair.pair === "" || typeof node.status !== "string" || node.status === "" || !node.config) {
726
726
  throw new TaphubServerError("Invalid response from server", {
727
727
  code: "InvalidResponse"
728
728
  });
729
729
  }
730
730
  return {
731
731
  id: node.id,
732
- pair: node.pair,
732
+ pair: node.pair.pair,
733
733
  status: node.status,
734
734
  config: normaliseGameConfig(node.config),
735
- createdAt: node.created_at || null
735
+ createdAt: node.createdAt || null
736
736
  };
737
737
  }
738
738
  function normaliseGameConfig(node) {
@@ -796,9 +796,9 @@ function normalisePairInfo(node) {
796
796
  }
797
797
 
798
798
  // src/modules/pair/queries.ts
799
- var PAIR_QUERY = `query Pair($pairId: ID!) {
800
- pair(pairId: $pairId) {
801
- id pair status created_at
799
+ var PAIR_QUERY = `query AgencyPair($pairId: ID!) {
800
+ agencyPair(pairId: $pairId) {
801
+ id pair { id pair source thumb } status createdAt
802
802
  config {
803
803
  gridConfig { cellSizeTime cellSizeValue candleSize baseline baselineTime }
804
804
  constraints { minBetTime maxBetTime slippage priceMinRange priceMaxRange coefMults maxCoef }
@@ -845,13 +845,13 @@ var PairModule = class {
845
845
  }
846
846
  throw err;
847
847
  }
848
- if (body.pair === null) {
848
+ if (body.agencyPair === null) {
849
849
  throw new TaphubValidationError("Game not found for pair", {
850
850
  code: "GameNotFound",
851
851
  details: { pairId }
852
852
  });
853
853
  }
854
- return normalisePair(body.pair);
854
+ return normalisePair(body.agencyPair);
855
855
  }
856
856
  /**
857
857
  * Returns available game pairs, optionally filtered by gameplay.
package/dist/index.js CHANGED
@@ -545,7 +545,7 @@ var LeaderboardModule = class {
545
545
  this.#graphql = deps.graphql;
546
546
  }
547
547
  async list(args) {
548
- const body = await this.#graphql.request(
548
+ const body = await this.#graphql.publicRequest(
549
549
  LEADERBOARD_QUERY,
550
550
  { period: args.period, sort_by: args.sortBy },
551
551
  args.signal ? { signal: args.signal } : void 0
@@ -657,17 +657,17 @@ var LocaleModule = class {
657
657
 
658
658
  // src/modules/pair/normalise.ts
659
659
  function normalisePair(node) {
660
- if (typeof node.id !== "string" || node.id === "" || typeof node.pair !== "string" || node.pair === "" || typeof node.status !== "string" || node.status === "" || !node.config) {
660
+ if (typeof node.id !== "string" || node.id === "" || !node.pair || typeof node.pair.pair !== "string" || node.pair.pair === "" || typeof node.status !== "string" || node.status === "" || !node.config) {
661
661
  throw new TaphubServerError("Invalid response from server", {
662
662
  code: "InvalidResponse"
663
663
  });
664
664
  }
665
665
  return {
666
666
  id: node.id,
667
- pair: node.pair,
667
+ pair: node.pair.pair,
668
668
  status: node.status,
669
669
  config: normaliseGameConfig(node.config),
670
- createdAt: node.created_at || null
670
+ createdAt: node.createdAt || null
671
671
  };
672
672
  }
673
673
  function normaliseGameConfig(node) {
@@ -731,9 +731,9 @@ function normalisePairInfo(node) {
731
731
  }
732
732
 
733
733
  // src/modules/pair/queries.ts
734
- var PAIR_QUERY = `query Pair($pairId: ID!) {
735
- pair(pairId: $pairId) {
736
- id pair status created_at
734
+ var PAIR_QUERY = `query AgencyPair($pairId: ID!) {
735
+ agencyPair(pairId: $pairId) {
736
+ id pair { id pair source thumb } status createdAt
737
737
  config {
738
738
  gridConfig { cellSizeTime cellSizeValue candleSize baseline baselineTime }
739
739
  constraints { minBetTime maxBetTime slippage priceMinRange priceMaxRange coefMults maxCoef }
@@ -780,13 +780,13 @@ var PairModule = class {
780
780
  }
781
781
  throw err;
782
782
  }
783
- if (body.pair === null) {
783
+ if (body.agencyPair === null) {
784
784
  throw new TaphubValidationError("Game not found for pair", {
785
785
  code: "GameNotFound",
786
786
  details: { pairId }
787
787
  });
788
788
  }
789
- return normalisePair(body.pair);
789
+ return normalisePair(body.agencyPair);
790
790
  }
791
791
  /**
792
792
  * Returns available game pairs, optionally filtered by gameplay.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taphubhq/sdk-core",
3
- "version": "0.17.3",
3
+ "version": "0.18.0",
4
4
  "description": "Core SDK for building on the TabHub platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs",