Skip to main content
POST
/
v1
/
master-wallets
/
{masterId}
/
recover
Recover assets from a master wallet
curl --request POST \
  --url https://api.xentfi.com/v1/master-wallets/{masterId}/recover \
  --header 'Content-Type: application/json' \
  --header 'apiKey: <api-key>' \
  --header 'orgId: <api-key>' \
  --data '
{
  "recipientAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0b5b5",
  "amount": "1.5"
}
'
const options = {
method: 'POST',
headers: {apiKey: '<api-key>', orgId: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({recipientAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0b5b5', amount: '1.5'})
};

fetch('https://api.xentfi.com/v1/master-wallets/{masterId}/recover', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://api.xentfi.com/v1/master-wallets/{masterId}/recover"

payload = {
"recipientAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0b5b5",
"amount": "1.5"
}
headers = {
"apiKey": "<api-key>",
"orgId": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
package main

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

func main() {

url := "https://api.xentfi.com/v1/master-wallets/{masterId}/recover"

payload := strings.NewReader("{\n \"recipientAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0b5b5\",\n \"amount\": \"1.5\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("apiKey", "<api-key>")
req.Header.Add("orgId", "<api-key>")
req.Header.Add("Content-Type", "application/json")

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

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

fmt.Println(string(body))

}
const options = {
method: 'POST',
headers: {apiKey: '<api-key>', orgId: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({recipientAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0b5b5', amount: '1.5'})
};

fetch('https://api.xentfi.com/v1/master-wallets/{masterId}/recover', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "success": true,
  "data": {
    "success": true,
    "txHash": "0x28a1bfa727a024dd450352e736f957ac6f08471825362130ef1c3b4da536ebfb",
    "blockchain": "EVM",
    "amount": "1.5",
    "token": "USDC",
    "fee": "0.00021",
    "message": "Assets recovered successfully"
  }
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Wallet not found",
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Wallet not found",
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Wallet not found",
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Wallet not found",
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}

Authorizations

apiKey
string
header
required
orgId
string
header
required

Path Parameters

masterId
string
required

ID of the master wallet to recover assets from

Body

application/json
recipientAddress
string
required

Address to send the recovered assets to

Example:

"0x742d35Cc6634C0532925a3b844Bc9e7595f0b5b5"

amount
string
required

Amount to recover (in human-readable format)

Example:

"1.5"

tokenAddress
string | null

Token contract address (omit for native token recovery)

Example:

"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

rpcUrl
string | null

Custom RPC URL for the blockchain (optional)

Example:

"https://eth-mainnet.g.alchemy.com/v2/your-key"

isL2
boolean
default:false

Set to true if recovering from a Layer 2 blockchain

Example:

false

crossNetwork
boolean
default:false

Set to true to recover assets sent to wrong network (e.g., mainnet assets on testnet address)

Example:

false

Response

Assets recovered successfully

success
boolean
Example:

true

data
object