Crypto Wallets API
Wallets API Sandbox Testing Guide
Please note you have to reach out to Alpaca to enable Crypto Wallets API access. Please reach out to your Customer Success Manager or your Sales Representative to enable this feature for you.
In order to test Wallets API in sandbox you’ll need to have access to a testnet wallet so that you can move coins between wallets on the blockchain without touching any real money. This tutorial walks through how to deposit GoerliETH into your external wallet which can be used for testing with Alpaca’s Wallet API.
Step 1: Create a Goerli Wallet
We recommend creating this via Metamask. If you don’t already have a Metamask account see the tutorial on how to create one here. Once you have a Metamask account, the Goerli Test Network should be available within your list of networks by default.
If it doesn’t show up as an option, you can add it by clicking “Add a network” and adding the following configurations:
Network Name: Goerli Test Network RPC Url: https://api.infura.io/v1/jsonrpc/goerli Chain ID: 5 Symbol: ETH Block Explorer URL: https://goerli.etherscan.io
Step 2: Fund your Goerli Wallet
You’ll have to use a faucet like Goerli Faucet to receive GoerliETH. These faucets typically have a limit as to how much you can receive per day so keep that in mind when testing. Clicking on your address in Metamask will copy it to your clipboard so you can paste it into the Goerli Faucet and click “Send Me ETH”. This will initiate a transfer of 0.2 ETH to your wallet. You can then check your Metamask account to confirm the funds have been received.
Step 3: Deposit Funds to your Alpaca Wallet
If you haven’t already created an ETH wallet with Alpaca’s Wallet API then you can call the [GET /v1/accounts/:account_id/wallets?asset=ETH](https://docs.alpaca.markets/reference/listcryptofundingwallets-1)
request to create one. Once your address has been created then you can initiate the transfer of GoerliETH from your external wallet to your Alpaca wallet. You can do this in Metamask by clicking “Send” and entering your Alpaca wallet address in the “To” field.
Confirm that you are sending funds from your Goerli wallet and not a real ETH wallet. Depositing real funds to the sandbox environment could result in the permanent loss of those funds.
Follow the steps in Metamask to finish executing the transfer. Once completed, you can confirm that the funds have been sent to your Alpaca wallet by calling the [GET /v1/accounts/:account_id/wallets/transfers](https://docs.alpaca.markets/reference/getcryptofundingtransfer-1)
request which will show the incoming transfer.
Once the status of the transfer is COMPLETE then the funds have landed in your wallet and you have deposited your first transfer to your Alpaca wallet!
Updated 3 months ago