How to withdraw and transfer funds from a subaccount using Command Line
Prerequisites
1. Install tools (MacOS)
Make sure you have Homebrew installed
If not, execute
Make sure everything is up to date
You need git
v4-client-js
uses node v18
for development. You can use nvm
to manage different versions of node.
You can run the following commands to ensure that you are running the correct node
and npm
versions.
How to initiate a withdrawal from subaccount
1. Clone or fork the public dYdX solutions repo
Open a Terminal and run the following command:
2. Setup the environment
Copy the
.env.example
and rename as a.env
file.Now make sure to fill in the following parameters,
MNEMONIC
,NETWORK_TYPE
andRECIPIENT_ADDRESS (Address to withdraw funds to)
For testnet and testing purposes, feel free to use the mnemonic from the TS client library under
v4-client-js/examples/constants
.
3. Run the scripts with node
You should now see a /build
dir generated with JS files. We will use node to run these scripts
Open a terminal to run the example orders.
(OPTIONAL) Run the websocket to check orders for a given subaccount.
Last updated