Skip to content

Commit 734dae1

Browse files
committed
Migrate TS client calls
1 parent 319772b commit 734dae1

File tree

2 files changed

+693
-124
lines changed

2 files changed

+693
-124
lines changed

slate-docs/source/includes/_clients-v4.md

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Clients
1+
<!-- # Clients
22
33
Python and TypeScript clients are available, allowing programmatic usage of dYdX.
44
@@ -11,7 +11,7 @@ This guide will help you get started with the dYdX Python SDK, which allows for
1111
Install `dydx-v3-python` from [PyPI](https://pypi.org/project/dydx-v3-python) using `pip`:
1212
1313
<pre class="center-column">
14-
pip install dydx-v4-client
14+
pip install dydx-v4-client
1515
</pre>
1616
1717
> Initialize
@@ -54,9 +54,9 @@ See the [examples](https://github.com/dydxprotocol/v4-clients/tree/main/v4-clien
5454
> Initialize
5555
5656
```typescript
57-
import { CompositeClient, Network } from '@dydxprotocol/v4-client-js';
57+
import { CompositeClient, Network } from "@dydxprotocol/v4-client-js";
5858
59-
/**
59+
/**
6060
// For the deployment by DYDX token holders, use below:
6161
6262
import { IndexerConfig, ValidatorConfig } from "@dydxprotocol/v4-client-js";
@@ -80,9 +80,9 @@ import { CompositeClient, Network } from '@dydxprotocol/v4-client-js';
8080
),
8181
);
8282
*/
83-
const NETWORK = Network.testnet();
83+
const NETWORK = Network.testnet();
8484
85-
const client = await CompositeClient.connect(NETWORK);
85+
const client = await CompositeClient.connect(NETWORK);
8686
```
8787
8888
The Typescript client is organized into various clients
@@ -91,34 +91,36 @@ The Typescript client is organized into various clients
9191
The Python client uses a node client as opposed to these various clients.
9292
</aside>
9393
94-
| Module | Description |
95-
| ----------- | ------------------------------------------------------------------------------------------------------------------- |
96-
| `Composite` | CompositeClient simplifies the transactions by transforming human readable parameters to chain-specific parameters. |
97-
| `Validator` | Validator client |
98-
| `Indexer` | Indexer client for read-only calls |
99-
| `Socket` | Websocket for streaming data read-only |
100-
| `Node` | Python Node client |
94+
| Module | Description |
95+
|------------|------------------------------------------------------------------|
96+
| `Composite` | CompositeClient simplifies the transactions by transforming human readable parameters to chain-specific parameters.|
97+
| `Validator` | Validator client |
98+
| `Indexer` | Indexer client for read-only calls |
99+
| `Socket` | Websocket for streaming data read-only |
100+
| `Node` | Python Node client |
101101
102102
The following configuration options are available:
103103
104-
| Parameter | Description |
105-
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
106-
| host | The HTTP API host. |
107-
| api_timeout | Timeout for HTTP requests, in milliseconds. |
108-
| default_ethereum_address | (Optional) The default account for Ethereum key auth and sending Ethereum transactions. |
109-
| eth_private_key | (Optional) May be used for Ethereum key auth. |
110-
| eth_send_options | (Optional) Options for Ethereum transactions, see [`sendTransaction`](https://web3py.readthedocs.io/en/stable/web3.eth.html?highlight=signTransaction#web3.eth.Eth.sendTransaction). |
111-
| network_id | (Optional) Chain ID for Ethereum key auth and smart contract addresses. Defaults to `web3.net.version` if available, or `1` (mainnet). |
112-
| stark_private_key | (Optional) STARK private key, used to sign orders and withdrawals. |
113-
| web3 | (Optional) Web3 object used for Ethereum key auth and/or smart contract interactions. |
114-
| web3_account | (Optional) May be used for Ethereum key auth. |
115-
| web3_provider | (Optional) Web3 provider object, same usage as `web3`. |
116-
| api_key_credentials | (Optional) Dictionary containing the key, secret and passphrase required for the private module to sign requests. |
117-
| crypto_c_exports_path | (Optional) For python only, will use faster C++ code to run hashing, signing and verifying. It's expected to be compiled from the `crypto_c_exports` target from Starkware's [repository](https://github.com/starkware-libs/crypto-cpp/blob/master/src/starkware/crypto/ffi/CMakeLists.txt). See [section on this below for more information](#c-methods-for-faster-stark-signing). |
118-
119-
## Rust, C++ and Python v1 (deprecated) Client
104+
| Parameter | Description |
105+
|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
106+
| host | The HTTP API host. |
107+
| api_timeout | Timeout for HTTP requests, in milliseconds. |
108+
| default_ethereum_address | (Optional) The default account for Ethereum key auth and sending Ethereum transactions. |
109+
| eth_private_key | (Optional) May be used for Ethereum key auth. |
110+
| eth_send_options | (Optional) Options for Ethereum transactions, see [`sendTransaction`](https://web3py.readthedocs.io/en/stable/web3.eth.html?highlight=signTransaction#web3.eth.Eth.sendTransaction). |
111+
| network_id | (Optional) Chain ID for Ethereum key auth and smart contract addresses. Defaults to `web3.net.version` if available, or `1` (mainnet). |
112+
| stark_private_key | (Optional) STARK private key, used to sign orders and withdrawals. |
113+
| web3 | (Optional) Web3 object used for Ethereum key auth and/or smart contract interactions. |
114+
| web3_account | (Optional) May be used for Ethereum key auth. |
115+
| web3_provider | (Optional) Web3 provider object, same usage as `web3`. |
116+
| api_key_credentials | (Optional) Dictionary containing the key, secret and passphrase required for the private module to sign requests. |
117+
| crypto_c_exports_path | (Optional) For python only, will use faster C++ code to run hashing, signing and verifying. It's expected to be compiled from the `crypto_c_exports` target from Starkware's [repository](https://github.com/starkware-libs/crypto-cpp/blob/master/src/starkware/crypto/ffi/CMakeLists.txt). See [section on this below for more information](#c-methods-for-faster-stark-signing).|
118+
119+
120+
## Rust, C++ and Python v1 (deprecated) Client
120121
121122
<aside class="notice">
122123
Notice that the V1 client (deprecated) will not be maintained further
123124
124125
</aside>
126+
-->

0 commit comments

Comments
 (0)