@dydxprotocol/v4-client-js 1.1.30 → 1.2.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 +36 -1
- package/__native__/__ios__/v4-native-client.js +78 -22
- package/__tests__/modules/client/AccountEndpoints.test.ts +2 -0
- package/build/__tests__/modules/client/AccountEndpoints.test.js +2 -2
- package/build/examples/batch_cancel_orders_example.d.ts +1 -0
- package/build/examples/batch_cancel_orders_example.js +93 -0
- package/build/src/clients/composite-client.d.ts +24 -1
- package/build/src/clients/composite-client.js +28 -2
- package/build/src/clients/constants.d.ts +1 -0
- package/build/src/clients/constants.js +3 -2
- package/build/src/clients/lib/registry.js +2 -1
- package/build/src/clients/modules/account.d.ts +1 -1
- package/build/src/clients/modules/account.js +6 -4
- package/build/src/clients/modules/composer.d.ts +2 -0
- package/build/src/clients/modules/composer.js +16 -1
- package/build/src/clients/modules/post.d.ts +3 -1
- package/build/src/clients/modules/post.js +11 -1
- package/build/src/clients/native.js +11 -10
- package/examples/batch_cancel_orders_example.ts +130 -0
- package/package.json +1 -1
- package/src/clients/composite-client.ts +57 -2
- package/src/clients/constants.ts +2 -1
- package/src/clients/lib/registry.ts +3 -0
- package/src/clients/modules/account.ts +8 -4
- package/src/clients/modules/composer.ts +26 -0
- package/src/clients/modules/post.ts +40 -0
- package/src/clients/native.ts +12 -11
package/README.md
CHANGED
|
@@ -15,7 +15,8 @@ The v4-Client Typescript client is used for placing transactions and querying th
|
|
|
15
15
|
|
|
16
16
|
## Development
|
|
17
17
|
|
|
18
|
-
`v4-client-js` uses node `v18` for development
|
|
18
|
+
`v4-client-js` uses node `v18` for development, see the .nvmrc file [here](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-js/.nvmrc).
|
|
19
|
+
You can use `nvm` to manage different versions of node.
|
|
19
20
|
|
|
20
21
|
```
|
|
21
22
|
nvm install
|
|
@@ -30,6 +31,40 @@ node -v # expected: v18.x.x (should match .nvmrc)
|
|
|
30
31
|
npm -v # expected: 8.x.x
|
|
31
32
|
```
|
|
32
33
|
|
|
34
|
+
### 1. Clone or fork the V4 clients repo
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git clone git@github.com:dydxprotocol/v4-clients.git
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2. Go to one of the examples
|
|
41
|
+
|
|
42
|
+
- Go to `v4-client-js/examples`
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
cd v4-client-js/examples
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
These examples by default use a test account with `DYDX_TEST_MNEMONIC` from the TS client library under `v4-client-js/examples/constants`.
|
|
49
|
+
|
|
50
|
+
### 3. Run the scripts with node
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install
|
|
54
|
+
npm run build
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
You should now see a `/build/examples` dir generated with JS files. We will use node to run these scripts
|
|
58
|
+
|
|
59
|
+
- Open a terminal to run an example, e.g. account_endpoints.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
node ../build/examples/composite_example.js
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Everytime you change the TS code, you need to run `npm run build` again, before you execute using node.
|
|
67
|
+
|
|
33
68
|
## Single-JS for mobile apps
|
|
34
69
|
|
|
35
70
|
Mobile apps needs to load JS as a single JS file. To build, run
|