@avaprotocol/sdk-js 0.6.5 → 0.6.6
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 +4522 -0
- package/dist/index.d.cts +1504 -0
- package/dist/index.d.ts +1504 -0
- package/dist/index.js +4511 -0
- package/grpc_codegen/avs_grpc_pb.d.ts +632 -178
- package/grpc_codegen/avs_grpc_pb.js +4 -2
- package/grpc_codegen/avs_pb.d.ts +1 -1
- package/grpc_codegen/avs_pb.js +2 -0
- package/jest.config.cjs +4 -1
- package/package.json +1 -1
- package/src/index.ts +4 -9
- package/tsconfig.json +6 -5
|
@@ -216,7 +216,7 @@ function deserialize_google_protobuf_BoolValue(buffer_arg) {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
|
|
219
|
-
|
|
219
|
+
const AggregatorService = {
|
|
220
220
|
// Auth
|
|
221
221
|
getKey: {
|
|
222
222
|
path: '/aggregator.Aggregator/GetKey',
|
|
@@ -344,4 +344,6 @@ ping: {
|
|
|
344
344
|
},
|
|
345
345
|
};
|
|
346
346
|
|
|
347
|
-
|
|
347
|
+
const AggregatorClient = grpc.makeGenericClientConstructor(AggregatorService);
|
|
348
|
+
|
|
349
|
+
export { AggregatorService, AggregatorClient };
|
package/grpc_codegen/avs_pb.d.ts
CHANGED
package/grpc_codegen/avs_pb.js
CHANGED
package/jest.config.cjs
CHANGED
|
@@ -6,7 +6,7 @@ module.exports = {
|
|
|
6
6
|
moduleFileExtensions: ['ts', 'js'],
|
|
7
7
|
testMatch: ['**/__tests__/**/*.test.ts'],
|
|
8
8
|
transform: {
|
|
9
|
-
'^.+\\.ts$': ['ts-jest', {
|
|
9
|
+
'^.+\\.(ts|tsx|js|jsx)$': ['ts-jest', {
|
|
10
10
|
useESM: true,
|
|
11
11
|
}],
|
|
12
12
|
},
|
|
@@ -15,4 +15,7 @@ module.exports = {
|
|
|
15
15
|
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
16
16
|
},
|
|
17
17
|
setupFiles: ['dotenv/config'],
|
|
18
|
+
transformIgnorePatterns: [
|
|
19
|
+
'node_modules/(?!(avs_pb.js|avs_grpc_pb.js)/)',
|
|
20
|
+
],
|
|
18
21
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -3,16 +3,11 @@ import { Metadata } from "@grpc/grpc-js";
|
|
|
3
3
|
import { DEFAULT_JWT_EXPIRATION, getRpcEndpoint } from "./config";
|
|
4
4
|
import { Environment } from "./types";
|
|
5
5
|
import { getKeyRequestMessage } from "./auth";
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
6
|
+
import { AggregatorClient } from "../grpc_codegen/avs_grpc_pb";
|
|
7
|
+
import * as avs_pb from "../grpc_codegen/avs_pb";
|
|
8
8
|
|
|
9
|
-
const AggregatorClient = (avsGrpcPb as any).AggregatorClient;
|
|
10
9
|
const metadata = new grpc.Metadata();
|
|
11
10
|
|
|
12
|
-
// console.log("protoDescriptor:", protoDescriptor);
|
|
13
|
-
// console.log("apProto:", apProto);
|
|
14
|
-
// console.log("apProto.Aggregator:", (new (apProto as any)).Aggregator));
|
|
15
|
-
|
|
16
11
|
// Move interfaces to a separate file, e.g., types.ts
|
|
17
12
|
import {
|
|
18
13
|
KeyExchangeResp,
|
|
@@ -86,12 +81,12 @@ class BaseClient {
|
|
|
86
81
|
);
|
|
87
82
|
|
|
88
83
|
// Create a new GetKeyReq message
|
|
89
|
-
const request = new
|
|
84
|
+
const request = new avs_pb.GetKeyReq();
|
|
90
85
|
request.setOwner(address);
|
|
91
86
|
request.setExpiredAt(expiredAtEpoch);
|
|
92
87
|
request.setSignature(signature);
|
|
93
88
|
|
|
94
|
-
let result = await this._callRPC<
|
|
89
|
+
let result = await this._callRPC<avs_pb.KeyResp, avs_pb.GetKeyReq>(
|
|
95
90
|
"getKey",
|
|
96
91
|
request
|
|
97
92
|
);
|
package/tsconfig.json
CHANGED
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
"module": "ESNext",
|
|
5
5
|
"moduleResolution": "node",
|
|
6
6
|
"esModuleInterop": true,
|
|
7
|
+
"allowSyntheticDefaultImports": true,
|
|
7
8
|
"strict": true,
|
|
8
9
|
"outDir": "./dist",
|
|
9
10
|
"declaration": true,
|
|
10
|
-
"rootDir": "src"
|
|
11
|
-
"paths": {
|
|
12
|
-
"@avaprotocol/*": ["./packages/*"]
|
|
13
|
-
}
|
|
11
|
+
"rootDir": "src"
|
|
14
12
|
},
|
|
15
|
-
"include": [
|
|
13
|
+
"include": [
|
|
14
|
+
"src/**/*",
|
|
15
|
+
"grpc_codegen/**/*"
|
|
16
|
+
],
|
|
16
17
|
"ts-node": {
|
|
17
18
|
"esm": true
|
|
18
19
|
}
|