@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.
@@ -216,7 +216,7 @@ function deserialize_google_protobuf_BoolValue(buffer_arg) {
216
216
  }
217
217
 
218
218
 
219
- var AggregatorService = exports.AggregatorService = {
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
- exports.AggregatorClient = grpc.makeGenericClientConstructor(AggregatorService);
347
+ const AggregatorClient = grpc.makeGenericClientConstructor(AggregatorService);
348
+
349
+ export { AggregatorService, AggregatorClient };
@@ -955,4 +955,4 @@ export enum TaskStatus {
955
955
 
956
956
  export enum CustomCodeType {
957
957
  JAVASCRIPT = 0,
958
- }
958
+ }
@@ -7541,3 +7541,5 @@ proto.aggregator.CustomCodeType = {
7541
7541
  };
7542
7542
 
7543
7543
  goog.object.extend(exports, proto.aggregator);
7544
+
7545
+ export const { Task, CreateTaskReq, CreateTaskResp, GetKeyReq, KeyResp, UpdateChecksReq, UpdateChecksResp } = proto.aggregator;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avaprotocol/sdk-js",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
4
  "description": "A JavaScript/TypeScript SDK designed to simplify integration with Ava Protocol’s AVS",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
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 * as avsGrpcPb from "../grpc_codegen/avs_grpc_pb";
7
- import * as avsPb from "../grpc_codegen/avs_pb";
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 avsPb.GetKeyReq();
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<avsPb.KeyResp, avsPb.GetKeyReq>(
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": ["src/**/*"],
13
+ "include": [
14
+ "src/**/*",
15
+ "grpc_codegen/**/*"
16
+ ],
16
17
  "ts-node": {
17
18
  "esm": true
18
19
  }