Skip to main content
GET
/
v1
/
wallets
/
{wallet_id}
/
earn
/
ethereum
/
vaults
Get earn vault position
curl --request GET \
  --url https://api.privy.io/v1/wallets/{wallet_id}/earn/ethereum/vaults \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'privy-app-id: <privy-app-id>'
HttpResponse<String> response = Unirest.get("https://api.privy.io/v1/wallets/{wallet_id}/earn/ethereum/vaults")
.header("privy-app-id", "<privy-app-id>")
.header("Authorization", "Basic <encoded-value>")
.asString();
const options = {
method: 'GET',
headers: {'privy-app-id': '<privy-app-id>', Authorization: 'Basic <encoded-value>'}
};

fetch('https://api.privy.io/v1/wallets/{wallet_id}/earn/ethereum/vaults', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.privy.io/v1/wallets/{wallet_id}/earn/ethereum/vaults",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"privy-app-id: <privy-app-id>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.privy.io/v1/wallets/{wallet_id}/earn/ethereum/vaults"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("privy-app-id", "<privy-app-id>")
req.Header.Add("Authorization", "Basic <encoded-value>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
{
  "asset": {
    "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "symbol": "usdc",
    "decimals": 6
  },
  "total_deposited": "1000000",
  "total_withdrawn": "0",
  "assets_in_vault": "1050000",
  "shares_in_vault": "1000000000000000000"
}

Authorizations

Authorization
string
header
required

Basic Auth header with your app ID as the username and your app secret as the password.

Headers

privy-app-id
string
required

ID of your Privy app.

Path Parameters

wallet_id
string
required

ID of the wallet.

Query Parameters

vault_id
string
required

The vault ID to get position for.

include_archived
boolean

Include archived wallets in lookup. Defaults to false.

Response

200 - application/json

Earn vault position retrieved successfully.

A wallet's position in an earn vault.

asset
EarnAsset · object
required

Asset metadata for an earn vault position.

Example:
{
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"symbol": "usdc",
"decimals": 6
}
total_deposited
string
required

Total amount deposited into the vault, in smallest unit.

total_withdrawn
string
required

Total amount withdrawn from the vault, in smallest unit.

assets_in_vault
string
required

Current asset value in the vault (realtime from ERC-4626), in smallest unit.

shares_in_vault
string
required

Current vault shares held (realtime from ERC-4626).