@taphubhq/sdk-core 0.17.0 → 0.17.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.cjs +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -903,6 +903,7 @@ var USER_SCOPED_SUFFIXES = ["bid_result", "balance_update"];
|
|
|
903
903
|
var TOPIC_PREFIX = "game";
|
|
904
904
|
var MARKET_TOPIC_PREFIX = "market";
|
|
905
905
|
var WALLET_TOPIC_PREFIX = "wallet";
|
|
906
|
+
var PUBLIC_PREFIX = "public";
|
|
906
907
|
function walletBalanceTopic(userId) {
|
|
907
908
|
return `${WALLET_TOPIC_PREFIX}/users/${userId}/balance`;
|
|
908
909
|
}
|
|
@@ -913,7 +914,7 @@ function topicFor(gameId, suffix, userId) {
|
|
|
913
914
|
if (USER_SCOPED_SUFFIXES.includes(suffix)) {
|
|
914
915
|
return `${TOPIC_PREFIX}/${gameId}/user/${userId}/${suffix}`;
|
|
915
916
|
}
|
|
916
|
-
return `${TOPIC_PREFIX}/${gameId}/${suffix}`;
|
|
917
|
+
return `${PUBLIC_PREFIX}/${TOPIC_PREFIX}/${gameId}/${suffix}`;
|
|
917
918
|
}
|
|
918
919
|
function normaliseUserId(userId) {
|
|
919
920
|
return userId && userId !== "" ? userId : null;
|
|
@@ -1068,7 +1069,7 @@ function createMqttTransport(endpoint, opts = {}) {
|
|
|
1068
1069
|
}
|
|
1069
1070
|
},
|
|
1070
1071
|
subscribeCandle(pairId, onCandle) {
|
|
1071
|
-
const topic = `${MARKET_TOPIC_PREFIX}/${pairId}/candle`;
|
|
1072
|
+
const topic = `${PUBLIC_PREFIX}/${MARKET_TOPIC_PREFIX}/${pairId}/candle`;
|
|
1072
1073
|
if (candleSubscriptions.has(pairId)) return;
|
|
1073
1074
|
const mqttClient = ensureConnected();
|
|
1074
1075
|
candleSubscriptions.set(pairId, { topic, onCandle });
|
package/dist/index.js
CHANGED
|
@@ -838,6 +838,7 @@ var USER_SCOPED_SUFFIXES = ["bid_result", "balance_update"];
|
|
|
838
838
|
var TOPIC_PREFIX = "game";
|
|
839
839
|
var MARKET_TOPIC_PREFIX = "market";
|
|
840
840
|
var WALLET_TOPIC_PREFIX = "wallet";
|
|
841
|
+
var PUBLIC_PREFIX = "public";
|
|
841
842
|
function walletBalanceTopic(userId) {
|
|
842
843
|
return `${WALLET_TOPIC_PREFIX}/users/${userId}/balance`;
|
|
843
844
|
}
|
|
@@ -848,7 +849,7 @@ function topicFor(gameId, suffix, userId) {
|
|
|
848
849
|
if (USER_SCOPED_SUFFIXES.includes(suffix)) {
|
|
849
850
|
return `${TOPIC_PREFIX}/${gameId}/user/${userId}/${suffix}`;
|
|
850
851
|
}
|
|
851
|
-
return `${TOPIC_PREFIX}/${gameId}/${suffix}`;
|
|
852
|
+
return `${PUBLIC_PREFIX}/${TOPIC_PREFIX}/${gameId}/${suffix}`;
|
|
852
853
|
}
|
|
853
854
|
function normaliseUserId(userId) {
|
|
854
855
|
return userId && userId !== "" ? userId : null;
|
|
@@ -1003,7 +1004,7 @@ function createMqttTransport(endpoint, opts = {}) {
|
|
|
1003
1004
|
}
|
|
1004
1005
|
},
|
|
1005
1006
|
subscribeCandle(pairId, onCandle) {
|
|
1006
|
-
const topic = `${MARKET_TOPIC_PREFIX}/${pairId}/candle`;
|
|
1007
|
+
const topic = `${PUBLIC_PREFIX}/${MARKET_TOPIC_PREFIX}/${pairId}/candle`;
|
|
1007
1008
|
if (candleSubscriptions.has(pairId)) return;
|
|
1008
1009
|
const mqttClient = ensureConnected();
|
|
1009
1010
|
candleSubscriptions.set(pairId, { topic, onCandle });
|