@arbiwallet/contracts 1.0.2 → 1.0.4
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/gen/auth.ts +7 -17
- package/package.json +1 -1
- package/proto/auth.proto +4 -9
package/gen/auth.ts
CHANGED
|
@@ -11,20 +11,10 @@ import { Observable } from "rxjs";
|
|
|
11
11
|
export const protobufPackage = "auth";
|
|
12
12
|
|
|
13
13
|
export interface TelegramAuthRequest {
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/** может быть пустым */
|
|
19
|
-
firstName: string;
|
|
20
|
-
/** может быть пустым */
|
|
21
|
-
lastName: string;
|
|
22
|
-
/** может быть пустым */
|
|
23
|
-
photoUrl: string;
|
|
24
|
-
/** unix time (seconds) */
|
|
25
|
-
authDate: number;
|
|
26
|
-
/** подпись от Telegram */
|
|
27
|
-
hash: string;
|
|
14
|
+
/**
|
|
15
|
+
* Telegram.WebApp.initData (raw query string).
|
|
16
|
+
* Contains auth_date, hash, user (JSON), query_id, etc.
|
|
17
|
+
*/
|
|
28
18
|
initData: string;
|
|
29
19
|
}
|
|
30
20
|
|
|
@@ -40,18 +30,18 @@ export interface TelegramAuthResponse {
|
|
|
40
30
|
export const AUTH_PACKAGE_NAME = "auth";
|
|
41
31
|
|
|
42
32
|
export interface TelegramAuthServiceClient {
|
|
43
|
-
|
|
33
|
+
telegramAuth(request: TelegramAuthRequest): Observable<TelegramAuthResponse>;
|
|
44
34
|
}
|
|
45
35
|
|
|
46
36
|
export interface TelegramAuthServiceController {
|
|
47
|
-
|
|
37
|
+
telegramAuth(
|
|
48
38
|
request: TelegramAuthRequest,
|
|
49
39
|
): Promise<TelegramAuthResponse> | Observable<TelegramAuthResponse> | TelegramAuthResponse;
|
|
50
40
|
}
|
|
51
41
|
|
|
52
42
|
export function TelegramAuthServiceControllerMethods() {
|
|
53
43
|
return function (constructor: Function) {
|
|
54
|
-
const grpcMethods: string[] = ["
|
|
44
|
+
const grpcMethods: string[] = ["telegramAuth"];
|
|
55
45
|
for (const method of grpcMethods) {
|
|
56
46
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
57
47
|
GrpcMethod("TelegramAuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbiwallet/contracts",
|
|
3
3
|
"descriptions": "Generate and manage smart contracts for ArbiWallet",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
7
7
|
},
|
package/proto/auth.proto
CHANGED
|
@@ -2,18 +2,13 @@ syntax = "proto3";
|
|
|
2
2
|
package auth;
|
|
3
3
|
|
|
4
4
|
service TelegramAuthService {
|
|
5
|
-
rpc
|
|
5
|
+
rpc TelegramAuth (TelegramAuthRequest) returns (TelegramAuthResponse);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
message TelegramAuthRequest {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
string
|
|
12
|
-
string last_name = 4; // может быть пустым
|
|
13
|
-
string photo_url = 5; // может быть пустым
|
|
14
|
-
int64 auth_date = 6; // unix time (seconds)
|
|
15
|
-
string hash = 7; // подпись от Telegram
|
|
16
|
-
string init_data = 8;
|
|
9
|
+
// Telegram.WebApp.initData (raw query string).
|
|
10
|
+
// Contains auth_date, hash, user (JSON), query_id, etc.
|
|
11
|
+
string init_data = 1;
|
|
17
12
|
}
|
|
18
13
|
|
|
19
14
|
message TelegramAuthResponse {
|