@levrbet/shared 0.1.152 → 0.1.153
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/core/socket.io/events.d.ts +20 -0
- package/dist/core/socket.io/events.js +20 -0
- package/dist/core/socket.io/events.js.map +1 -0
- package/dist/core/socket.io/index.d.ts +1 -2
- package/dist/core/socket.io/index.js +1 -2
- package/dist/core/socket.io/index.js.map +1 -1
- package/dist/core/types/oracle/market/markets.types.d.ts +3 -3
- package/dist/server/oracle/redis-cache-manager/channels.d.ts +1 -5
- package/dist/server/oracle/redis-cache-manager/channels.js +4 -13
- package/dist/server/oracle/redis-cache-manager/channels.js.map +1 -1
- package/package.json +1 -1
- package/dist/core/socket.io/events.names.d.ts +0 -9
- package/dist/core/socket.io/events.names.js +0 -15
- package/dist/core/socket.io/events.names.js.map +0 -1
- package/dist/core/socket.io/events.types.d.ts +0 -2
- package/dist/core/socket.io/events.types.js +0 -3
- package/dist/core/socket.io/events.types.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GamePhase, Odds, Scores } from "../prisma";
|
|
2
|
+
import { LevrFixtureId } from "../types";
|
|
3
|
+
export declare enum RoomEvent {
|
|
4
|
+
JoinRoom = "joinRoom",
|
|
5
|
+
LeaveRoom = "leaveRoom"
|
|
6
|
+
}
|
|
7
|
+
export declare enum GameEvent {
|
|
8
|
+
ScoreUpdate = "gameScoreUpdate",
|
|
9
|
+
PhaseUpdate = "gamePhaseUpdate"
|
|
10
|
+
}
|
|
11
|
+
export type GameScoreUpdate = Scores;
|
|
12
|
+
export type GamePhaseUpdate = {
|
|
13
|
+
chainId: number;
|
|
14
|
+
levrFixtureId: LevrFixtureId;
|
|
15
|
+
phase: GamePhase;
|
|
16
|
+
};
|
|
17
|
+
export declare enum MarketEvent {
|
|
18
|
+
OddsUpdate = "marketOddsUpdate"
|
|
19
|
+
}
|
|
20
|
+
export type MarketOddsUpdate = Odds;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MarketEvent = exports.GameEvent = exports.RoomEvent = void 0;
|
|
4
|
+
var RoomEvent;
|
|
5
|
+
(function (RoomEvent) {
|
|
6
|
+
RoomEvent["JoinRoom"] = "joinRoom";
|
|
7
|
+
RoomEvent["LeaveRoom"] = "leaveRoom";
|
|
8
|
+
})(RoomEvent || (exports.RoomEvent = RoomEvent = {}));
|
|
9
|
+
// GAME EVENTS AND TYPES
|
|
10
|
+
var GameEvent;
|
|
11
|
+
(function (GameEvent) {
|
|
12
|
+
GameEvent["ScoreUpdate"] = "gameScoreUpdate";
|
|
13
|
+
GameEvent["PhaseUpdate"] = "gamePhaseUpdate";
|
|
14
|
+
})(GameEvent || (exports.GameEvent = GameEvent = {}));
|
|
15
|
+
// MARKET EVENTS AND TYPES
|
|
16
|
+
var MarketEvent;
|
|
17
|
+
(function (MarketEvent) {
|
|
18
|
+
MarketEvent["OddsUpdate"] = "marketOddsUpdate";
|
|
19
|
+
})(MarketEvent || (exports.MarketEvent = MarketEvent = {}));
|
|
20
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/core/socket.io/events.ts"],"names":[],"mappings":";;;AAGA,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,kCAAqB,CAAA;IACrB,oCAAuB,CAAA;AAC3B,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED,wBAAwB;AACxB,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,4CAA+B,CAAA;IAC/B,4CAA+B,CAAA;AACnC,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAQD,0BAA0B;AAC1B,IAAY,WAEX;AAFD,WAAY,WAAW;IACnB,8CAA+B,CAAA;AACnC,CAAC,EAFW,WAAW,2BAAX,WAAW,QAEtB"}
|
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./events
|
|
18
|
-
__exportStar(require("./events.types"), exports);
|
|
17
|
+
__exportStar(require("./events"), exports);
|
|
19
18
|
__exportStar(require("./rooms"), exports);
|
|
20
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/socket.io/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/socket.io/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,0CAAuB"}
|
|
@@ -19,7 +19,7 @@ export interface MarketPriceBroadcast {
|
|
|
19
19
|
gamePhase: GamePhase;
|
|
20
20
|
gamePeriod: number;
|
|
21
21
|
gameClock: number;
|
|
22
|
-
gameMarketId:
|
|
22
|
+
gameMarketId: LevrGameMarketId;
|
|
23
23
|
nFactor: number;
|
|
24
24
|
providerObjectId: string;
|
|
25
25
|
levrGameObjectId: string;
|
|
@@ -91,5 +91,5 @@ export declare const SIDE_UNDER: number;
|
|
|
91
91
|
*/
|
|
92
92
|
export declare const GROUP_OUTCOME: number;
|
|
93
93
|
export declare const GROUP_TOTAL: number;
|
|
94
|
-
export type
|
|
95
|
-
export type
|
|
94
|
+
export type LevrGameMarketId = Bytes32;
|
|
95
|
+
export type LevrFixtureId = Bytes16;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
import Redis from "ioredis";
|
|
2
|
-
|
|
3
|
-
export declare const LEVR_GAME_UPDATES = "game_updates";
|
|
4
|
-
export declare const LEVR_MARKET_UPDATES = "market_updates";
|
|
5
|
-
export declare const publishToGameUpdatesChannel: (redis: Redis, data: LevrScores) => Promise<void>;
|
|
6
|
-
export declare const publishToMarketUpdatesChannel: (redis: Redis, data: Odds) => Promise<void>;
|
|
2
|
+
export declare const publishToChannel: (redis: Redis, channel: string, data: unknown) => Promise<void>;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.publishToChannel = void 0;
|
|
4
4
|
const cache_keys_utils_1 = require("./cache.keys.utils");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// add different types as we need
|
|
8
|
-
const publishToGameUpdatesChannel = async (redis, data) => {
|
|
9
|
-
const success = (await redis.publish(exports.LEVR_GAME_UPDATES, JSON.stringify(data)));
|
|
5
|
+
const publishToChannel = async (redis, channel, data) => {
|
|
6
|
+
const success = (await redis.publish(channel, JSON.stringify(data)));
|
|
10
7
|
if (success <= cache_keys_utils_1.RedisNumStates.failure)
|
|
11
8
|
throw Error("Failed to publish to redis channel");
|
|
12
9
|
};
|
|
13
|
-
exports.
|
|
14
|
-
const publishToMarketUpdatesChannel = async (redis, data) => {
|
|
15
|
-
const success = (await redis.publish(exports.LEVR_MARKET_UPDATES, JSON.stringify(data)));
|
|
16
|
-
if (success <= cache_keys_utils_1.RedisNumStates.failure)
|
|
17
|
-
throw Error("Failed to publish to redis channel");
|
|
18
|
-
};
|
|
19
|
-
exports.publishToMarketUpdatesChannel = publishToMarketUpdatesChannel;
|
|
10
|
+
exports.publishToChannel = publishToChannel;
|
|
20
11
|
//# sourceMappingURL=channels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/channels.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/channels.ts"],"names":[],"mappings":";;;AACA,yDAAmD;AAE5C,MAAM,gBAAgB,GAAG,KAAK,EAAE,KAAY,EAAE,OAAe,EAAE,IAAa,EAAiB,EAAE;IAClG,MAAM,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAmB,CAAA;IACtF,IAAI,OAAO,IAAI,iCAAc,CAAC,OAAO;QAAE,MAAM,KAAK,CAAC,oCAAoC,CAAC,CAAA;AAC5F,CAAC,CAAA;AAHY,QAAA,gBAAgB,oBAG5B"}
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GameEventName = exports.RoomEventName = void 0;
|
|
4
|
-
var RoomEventName;
|
|
5
|
-
(function (RoomEventName) {
|
|
6
|
-
RoomEventName["joinRoom"] = "joinRoom";
|
|
7
|
-
RoomEventName["leaveRoom"] = "leaveRoom";
|
|
8
|
-
})(RoomEventName || (exports.RoomEventName = RoomEventName = {}));
|
|
9
|
-
var GameEventName;
|
|
10
|
-
(function (GameEventName) {
|
|
11
|
-
GameEventName["gameOddsUpdate"] = "gameOddsUpdate";
|
|
12
|
-
GameEventName["gameScoreUpdate"] = "gameScoreUpdate";
|
|
13
|
-
GameEventName["gameStatusUpdate"] = "gameStatusUpdate";
|
|
14
|
-
})(GameEventName || (exports.GameEventName = GameEventName = {}));
|
|
15
|
-
//# sourceMappingURL=events.names.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.names.js","sourceRoot":"","sources":["../../../src/core/socket.io/events.names.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,sCAAqB,CAAA;IACrB,wCAAuB,CAAA;AAC3B,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,kDAAiC,CAAA;IACjC,oDAAmC,CAAA;IACnC,sDAAqC,CAAA;AACzC,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.types.js","sourceRoot":"","sources":["../../../src/core/socket.io/events.types.ts"],"names":[],"mappings":""}
|