const b = await ensc.balance.get({ account: wallet, chain: 'celo', asset: 'ENSC' });
// b.balance (base units), b.formatted{
"v": 1,
"enc": "<string>",
"ciphertext": "<string>"
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}Read on-chain balance
Balance of a whitelisted asset (ENSC, USDC, USDT, CELO) for an account on a chain of the key environment. Response body is a SealedResponseEnvelope whose plaintext is BalanceResponse. Send X-ENSC-Key-Id to pick the recipient signing key when more than one is active.
const b = await ensc.balance.get({ account: wallet, chain: 'celo', asset: 'ENSC' });
// b.balance (base units), b.formatted{
"v": 1,
"enc": "<string>",
"ciphertext": "<string>"
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}Authorizations
Your secret key, generated in the ProsperaVest dashboard (Sandbox or Live). Send as: Authorization: Bearer ensc_live_sk_...
Headers
"sig_01HXY..."
Query Parameters
"0xAbC..."
ENSC, USDC, USDT, CELO "0xF50FFf..."
"celo"
Response
Sealed response
ENSC-RESP-V1. HPKE (RFC 9180; DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, ChaCha20-Poly1305) seal of the plaintext JSON response to the merchant signing key named by X-ENSC-Key-Id (Ed25519 key converted to X25519). info = "ENSC-RESP-V1\n{requestId}". The body is signed by ENSC: X-ENSC-Signature over "ENSC-RESP-V1\n{requestId}\n{timestamp}\n{sha256(body)}". Returned for sk/rk merchant keys only.