Referencia de API para Obtener Wallet
Obtener Wallet
Devuelve información sobre un wallet específico en un blockchain determinado, incluyendo su clave pública, dirección, estado y grupos de autorización.
Solicitud
GET /wallets/{address}?blockchainId={blockchainId}
Por ejemplo, si su node está ejecutándose en https://tn-w-1.uledger.net/, la URL completa es:https://tn-w-1.uledger.net//wallets/{address}?blockchainId={ blockchainId}
Parámetros de ruta y consulta
address– Dirección del wallet a buscar.blockchainId– ID del blockchain donde existe este wallet.
Respuesta
La respuesta es un objeto wallet con los siguientes campos:
publicKey– Clave pública codificada en hexadecimal asociada al wallet.address– Dirección del wallet (clave de búsqueda para este endpoint).parent– Wallet padre, si existe (cadena vacía cuando no se usa).enabled– Si este wallet está actualmente habilitado.satelliteWallets– Array de wallets "satélite" vinculados (vacío si no hay ninguno).authGroups– Objeto que describe los permisos para grupos lógicos, comoWalletcon indicadorescreate/read/update/delete.keyType– Tipo de clave utilizada para este wallet (p. ej.secp256k1).
Ejemplo de respuesta
{
"publicKey": "PUBLIC_KEY_HEX_HERE",
"address": "WALLET_ADDRESS_HERE",
"parent": "",
"enabled": true,
"satelliteWallets": [],
"authGroups": {
"Wallet": {
"create": false,
"read": true,
"update": true,
"delete": false
}
},
"keyType": "secp256k1"
}
- cURL
curl -X GET -L https://tn-w-1.uledger.net//wallets/{address}?blockchainId={blockchainId} | jq
// Using native fetch (Node 18+)
const nodeUrl = "https://tn-w-1.uledger.net/";
const address = "<WALLET_ADDRESS>";
const blockchainId = "<BLOCKCHAIN_ID>";
const url = new URL(`${nodeUrl}/wallets/${address}`);
url.searchParams.set("blockchainId", blockchainId);
const res = await fetch(url.toString(), {
headers: { Accept: "application/json" },
});
if (!res.ok) {
throw new Error(`Request failed with status ${res.status}`);
}
const wallet = await res.json();
console.log("Address:", wallet.address);
console.log("Enabled:", wallet.enabled);
console.log("Key type:", wallet.keyType);
import requests
node_url = "https://tn-w-1.uledger.net/"
address = "<WALLET_ADDRESS>"
blockchain_id = "<BLOCKCHAIN_ID>"
resp = requests.get(
f"{node_url}/wallets/{address}",
params={"blockchainId": blockchain_id},
headers={"Accept": "application/json"},
)
resp.raise_for_status()
wallet = resp.json()
print("Address:", wallet["address"])
print("Enabled:", wallet["enabled"])
print("Key type:", wallet["keyType"])