@taphubhq/sdk-core 0.17.4 → 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 +8 -8
- package/dist/index.js +8 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -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.
|
|
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
|
|
800
|
-
|
|
801
|
-
id pair status
|
|
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.
|
|
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.
|
|
854
|
+
return normalisePair(body.agencyPair);
|
|
855
855
|
}
|
|
856
856
|
/**
|
|
857
857
|
* Returns available game pairs, optionally filtered by gameplay.
|
package/dist/index.js
CHANGED
|
@@ -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.
|
|
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
|
|
735
|
-
|
|
736
|
-
id pair status
|
|
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.
|
|
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.
|
|
789
|
+
return normalisePair(body.agencyPair);
|
|
790
790
|
}
|
|
791
791
|
/**
|
|
792
792
|
* Returns available game pairs, optionally filtered by gameplay.
|