Faucet
Faucet is only available on test environments for testers to get test funds and test native tokens.
Installation
pnpm install @dydxprotocol/v4-client-js
Getting Test Funds
import { FaucetClient } from "@dydxprotocol/v4-client-js";
const client = new FaucetClient(FaucetApiHost.TESTNET);
const address = /* your dYdX chain address */;
const faucetResponse = await client?.fill(address, 0, 2000);
Getting Test Native Tokens
import { FaucetClient } from "@dydxprotocol/v4-client-js";
const client = new FaucetClient(FaucetApiHost.TESTNET);
const address = /* your dYdX chain address */;
const faucetResponse = await client?.fill_native(address);