@avaprotocol/sdk-js 0.7.2 → 0.8.0
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/README.md +30 -28
- package/dist/index.d.mts +686 -829
- package/dist/index.d.ts +686 -829
- package/dist/index.js +2873 -1810
- package/dist/index.mjs +2880 -1812
- package/package.json +4 -1
- package/dist/index.cjs +0 -4506
- package/dist/index.d.cts +0 -1499
package/README.md
CHANGED
|
@@ -33,9 +33,7 @@ import { AvaSDK } from "ava-sdk-js";
|
|
|
33
33
|
|
|
34
34
|
## Development
|
|
35
35
|
|
|
36
|
-
###
|
|
37
|
-
|
|
38
|
-
In the case of `.proto` files at https://github.com/AvaProtocol/EigenLayer-AVS/blob/main/protobuf/avs.proto changes, the gRPC types needs to be regenerated.Before regenerating the types from the protocol buffers, ensure that `grpc_tools_node_protoc` is installed globally on your system. You can install it using npm:
|
|
36
|
+
### Install Dependencies and Download Proto Files
|
|
39
37
|
|
|
40
38
|
```bash
|
|
41
39
|
npm install # install grpc-tools, etc. as dev dependencies
|
|
@@ -49,9 +47,10 @@ npm run proto-download
|
|
|
49
47
|
|
|
50
48
|
# Generate the TypeScript types and gRPC code based on the downloaded .proto file
|
|
51
49
|
npm run gen-protoc
|
|
52
|
-
```
|
|
53
50
|
|
|
54
|
-
|
|
51
|
+
# Build the source files in to ./dist folder
|
|
52
|
+
npm run build
|
|
53
|
+
```
|
|
55
54
|
|
|
56
55
|
### Running Tests
|
|
57
56
|
|
|
@@ -64,39 +63,42 @@ To ensure the SDK is functioning correctly, we have a comprehensive test suite.
|
|
|
64
63
|
```
|
|
65
64
|
2. Before running the e2e tests, make sure to configure the required environment variables in your `.env.test` file, based on the `.env.example` file.
|
|
66
65
|
|
|
67
|
-
3.
|
|
66
|
+
3. Bring up a locally environment for aggregator
|
|
68
67
|
|
|
69
68
|
```bash
|
|
70
|
-
|
|
71
|
-
npm test
|
|
72
|
-
|
|
73
|
-
# or, run a specific test
|
|
74
|
-
npm run test:select -- <authWithSignature>
|
|
69
|
+
docker compose up -d --pull always
|
|
75
70
|
```
|
|
76
71
|
|
|
77
|
-
|
|
72
|
+
> By default the above command will pull the docker image of the latest commit on the `main` branch of https://github.com/AvaProtocol/EigenLayer-AVS. Alternatively, we could also run tests against a specific commit with the below command.
|
|
73
|
+
>
|
|
74
|
+
> ```
|
|
75
|
+
> export AVS_BUILD_VERSION=git-commit-hash-123
|
|
76
|
+
> docker compose up -d --pull always
|
|
77
|
+
> ```
|
|
78
|
+
|
|
79
|
+
4. Generate a test API key for the local tests with the following command. It will automatically save the output to the `TEST_API_KEY` variable in `.env.test`.
|
|
80
|
+
|
|
78
81
|
```bash
|
|
79
|
-
npm run
|
|
82
|
+
npm run gen-apikey
|
|
80
83
|
```
|
|
81
84
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
## Version Management
|
|
85
|
+
5. Run the test command with env variables set in `.env.test`.
|
|
85
86
|
|
|
86
|
-
|
|
87
|
+
```bash
|
|
88
|
+
# Run all tests
|
|
89
|
+
npm test
|
|
87
90
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
4. Commit the generated changeset file along with your changes.
|
|
91
|
+
# or, run a specific test
|
|
92
|
+
npm run test:select -- <authWithSignature>
|
|
93
|
+
```
|
|
92
94
|
|
|
93
|
-
|
|
95
|
+
> Note: In order to individually test `cancelTask` or `deleteTask`, `createTask` test needs to run first.
|
|
94
96
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
> ```bash
|
|
98
|
+
> npm run test:select -- "createTask|cancelTask"
|
|
99
|
+
> ```
|
|
98
100
|
|
|
99
|
-
|
|
101
|
+
This will execute all unit and integration tests. Make sure all tests pass in local dev environment before submitting a pull request or deploying changes.
|
|
100
102
|
|
|
101
103
|
## Release Process
|
|
102
104
|
|
|
@@ -120,10 +122,10 @@ This repository uses a two-step workflow process for creating new releases:
|
|
|
120
122
|
|
|
121
123
|
The NPM publishing of dev versions can be handled manually, since the test cases reference the dist folder and don’t require a new version on NPM. NPM publish on dev tag is only required for testing the new version in a web app.
|
|
122
124
|
|
|
123
|
-
1. Publish a dev version and test it in your local environment
|
|
125
|
+
1. Publish a dev version and test it in your local environment. The `npm publish` will use the version number in `package.json`, so run `npm version prerelease --preid=dev` first if you need a new version number.
|
|
124
126
|
|
|
125
127
|
```bash
|
|
126
|
-
#
|
|
128
|
+
# Optionally, update version with dev tag in package.json
|
|
127
129
|
npm version prerelease --preid=dev
|
|
128
130
|
|
|
129
131
|
# Publish to npm with dev tag
|