/get_sila_balance (ECDSA only)

Checks token balance on a blockchain address.

IMPORTANT: This endpoint allows checking the balance of a wallet address, and is only valid for apps still using the legacy ECDSA authentication. For apps using JWT you can check the balance of a wallet with the /get_wallet endpoint.

Requests

The authsignature and usersignature headers are not required for this request; this is a public endpoint.

POST /0.2/get_sila_balance HTTP/1.1
Host: sandbox.silamoney.com
Content-Type: application/json

{
  "address": "0x..."
}

***

HTTP/1.1 200 OK

{
  "status_code": 200,
  "success": true,
  "status": "SUCCESS",
  "response_time_ms": "171",  
  "address": "0x...",
  "sila_balance": 10000
}
const res = await Sila.getSilaBalance(walletAddress);

// Success Response Object
console.log(res.statusCode); // 200
console.log(res.data.status);
console.log(res.data.success); // TRUE
console.log(res.data.address); // Wallet address
console.log(res.data.sila_balance); // Amount of Sila tokens in the wallet
silaBalance = User.getSilaBalance(app, eth_address)

### Success Response Object
{
  "success": true,
  "address": "0x...",
  "sila_balance": 100.0
}

### Failure Response Object
{
  "success": false
}
ApiResponse response = api.silaBalance(address);
GetSilaBalanceResponse parsedResponse = (GetSilaBalanceResponse) response.getData();

// Success Object Response
System.out.println(response.getStatusCode()); // 200
System.out.println(parsedResponse.getSuccess());//true
System.out.println(parsedResponse.getStatus());
System.out.println(parsedResponse.getAddress()); // Address
System.out.println(parsedResponse.getSilaBalance()); // Sila balance.
$address = '0xabc123abc123abc123'
$response = $client->silaBalance($address);

// Success 200
echo $response->getStatusCode(); // 200
echo $response->getData()->status;
echo $response->getData()->success; // TRUE
echo $response->getData()->address; // The requested blockchain address
echo $response->getData()->sila_balance; // The amount of sila tokens in the wallet
ApiResponse<object> response = api.GetSilaBalance(walletAddress);

// Success Object Response

Console.WriteLine(response.StatusCode); // 200
var parsedData = (GetSilaBalanceResponse)response.Data;
Console.WriteLine(parsedData.Success); // True
Console.WriteLine(parsedData.Address); // Wallet address
Console.WriteLine(parsedData.SilaBalance); // Sila tokens
KeyTypeDescription
uuidStringRequired if supplied as an alternate to address.
Must be a UUID in the canonical form: five groups separated by hyphens, in the form 8-4-4-4-12.

Responses

Status Codesuccess AttributeDescription
200trueSuccessfully checked and returned current balance.
400falseBad request format.

📘

Need to check a user's bank account balance?

Try using the /get_account_balance endpoint instead.