@ciganov/contracts 1.1.9 → 1.1.10

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.
@@ -0,0 +1,20 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "betting.v1";
3
+ export interface PlaceBetRequest {
4
+ userId: string;
5
+ outcomeId: string;
6
+ amount: number;
7
+ coefficient: number;
8
+ }
9
+ export interface PlaceBetResponse {
10
+ ok: boolean;
11
+ }
12
+ export declare const BETTING_V1_PACKAGE_NAME = "betting.v1";
13
+ export interface BettingServiceClient {
14
+ placeBet(request: PlaceBetRequest): Observable<PlaceBetResponse>;
15
+ }
16
+ export interface BettingServiceController {
17
+ placeBet(request: PlaceBetRequest): Promise<PlaceBetResponse> | Observable<PlaceBetResponse> | PlaceBetResponse;
18
+ }
19
+ export declare function BettingServiceControllerMethods(): (constructor: Function) => void;
20
+ export declare const BETTING_SERVICE_NAME = "BettingService";
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.6
5
+ // protoc v3.21.12
6
+ // source: betting.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.BETTING_SERVICE_NAME = exports.BETTING_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.BettingServiceControllerMethods = BettingServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "betting.v1";
13
+ exports.BETTING_V1_PACKAGE_NAME = "betting.v1";
14
+ function BettingServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = ["placeBet"];
17
+ for (const method of grpcMethods) {
18
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
+ (0, microservices_1.GrpcMethod)("BettingService", method)(constructor.prototype[method], method, descriptor);
20
+ }
21
+ const grpcStreamMethods = [];
22
+ for (const method of grpcStreamMethods) {
23
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
24
+ (0, microservices_1.GrpcStreamMethod)("BettingService", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ };
27
+ }
28
+ exports.BETTING_SERVICE_NAME = "BettingService";
@@ -0,0 +1,21 @@
1
+ syntax = "proto3";
2
+
3
+ package betting.v1;
4
+
5
+
6
+ service BettingService {
7
+ rpc PlaceBet(PlaceBetRequest) returns (PlaceBetResponse);
8
+ }
9
+
10
+ message PlaceBetRequest {
11
+ string userId = 1;
12
+ string outcomeId = 2;
13
+ float amount = 3;
14
+ float coefficient = 4;
15
+ }
16
+
17
+
18
+
19
+ message PlaceBetResponse {
20
+ bool ok = 1;
21
+ }
@@ -4,4 +4,5 @@ export declare const PROTO_PATHS: {
4
4
  readonly USER: string;
5
5
  readonly BALANCE: string;
6
6
  readonly ODD: string;
7
+ readonly BETTING: string;
7
8
  };
@@ -7,5 +7,6 @@ exports.PROTO_PATHS = {
7
7
  ACCOUNT: (0, node_path_1.join)(__dirname, './contracts/account.proto'),
8
8
  USER: (0, node_path_1.join)(__dirname, './contracts/user.proto'),
9
9
  BALANCE: (0, node_path_1.join)(__dirname, './contracts/balance.proto'),
10
- ODD: (0, node_path_1.join)(__dirname, './contracts/odd.proto')
10
+ ODD: (0, node_path_1.join)(__dirname, './contracts/odd.proto'),
11
+ BETTING: (0, node_path_1.join)(__dirname, './contracts/betting.proto')
11
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ciganov/contracts",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "Protobuf definitions and generated ts types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",