/get_wallet
Gets more in depth details on a specified single wallet.
This endpoint returns details about a wallet registered to a user, including:
- Wallet ID
- nickname
- whether it is a default destination
- current balance
- current pending balance
- remote account details (account and routing number of Priority ledger account)
The sila_balance
and sila_available_balance
both reflect the amount of settled funds in the wallet. The sila_pending_balance
reflects the total balance of funds that have not yet fully settled.
Request
When using legacy ECDSA authentication
Both authsignature
and usersignature
are required for this request. The usersignature
header should be generated with a keypair associated with the user; see Authentication section for more details.
When using Authentication Tokens
Use a valid access token in an Authorization: Bearer request header.
POST /0.2/get_wallet HTTP/1.1
sandbox.silamoney.com
Content-Type: application/json
// if using OAuth2
Authorization: Bearer [GENERATED JWT TOKEN HERE]
// if using ECDSA
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
usersignature: [GENERATED USERSIGNATURE HEX STRING HERE]
// ECDSA
{
"header": {
"created": 1234567890,
"app_handle": "app_handle",
"user_handle":"user_handle",
"version": "0.2",
"reference": "<your unique id>"
}
}
// Authentication Token
{
"header": {
"created": 1234567890,
"app_handle": "app_handle",
"user_handle":"user_handle",
"version": "0.2",
"reference": "<your unique id>"
},
"nickname": "<wallet nickname>",
"wallet_id": "<wallet id>"
}
***
HTTP/1.1 200 OK
{
"success": true,
"reference": "1751994699",
"wallet": {
"wallet_id": "<uuid>",
"payment_instrument_id": "<uuid>",
"nickname": "<wallet_nickname>",
"default": false,
"wallet_address": null,
"network": null,
"statements_enabled": true,
"provider": "PRIORITY_BANK",
"remote_account_details": {
"account_number": "<account_number>",
"routing_number": "<routing_number>",
"wire_account_number": "<wire_account_number>",
"wire_routing_number": "<wire_routing_number>"
}
},
"is_whitelisted": true,
"sila_balance": 3012900,
"sila_available_balance": 3012900,
"sila_pending_balance": 0,
"status": "SUCCESS",
"sila_reference_id": "req_qnfr723jlebtflja609s92qrqo",
"response_time_ms": "975"
}
// ECDSA
{
"success": true,
"status": "SUCCESS",
"response_time_ms": "171",
"reference": "<your unique id>",
"sila_reference_id": "sila_assigned_id",
"wallet": {
"wallet_id": "37d7d51f-2f3a-4f16-9003-41366218a74c",
"nickname": "my_wallet_nickname",
"default": false,
"wallet_address": "wallet_address", // legacy, backwards compatibility only
"network": "network" // legacy, backwards compatibility only
},
"is_whitelisted": true,
"available_balance": 300,
"pending_balance": 0,
}
// Authentication Tokens
{
"success": true,
"reference": "<your unique id>",
"sila_reference_id": "sila_assigned_id",
"wallet": {
"default": true
},
"is_whitelisted": true,
"available_balance": 0,
"pending_balance": 0,
"status": "SUCCESS",
"response_time_ms": "49"
}
const res = await Sila.getWallet(userHandle, walletPrivateKey);
// Success Response Object
console.log(res.statusCode); // 200
console.log(res.data.reference);
console.log(res.data.success); // TRUE
console.log(res.data.status);
console.log(res.data.is_whitelisted); // Indicates if the wallet is able to perform transactions
console.log(res.data.sila_available_balance); // new field for sila_balance
console.log(res.data.sila_pending_balance); // new field for sila_balance
console.log(res.data.wallet);
console.log(res.data.wallet.statements_enabled);
console.log(res.data.wallet.nickname);
console.log(res.data.wallet.default);
console.log(res.data.wallet.blockchain_address);
console.log(res.data.wallet.blockchain_network);
payload = {
"user_handle": "user_handle"
}
response = Wallet.getWallet(app, payload, user_private_key)
### Success Response Object
{
"status": 'SUCCESS',
"status_code": 200,
"success": True,
"reference": "ref",
"wallet": {
"nickname": "my_wallet_nickname",
"default": False,
"blockchain_address": "0x...",
"blockchain_network": "ETH"
},
"is_whitelisted": True,
"sila_balance": 300.0,
"sila_available_balance": 300,
"sila_pending_balance": 0
}
### Failure Response Object
{
"success": False,
"reference": "ref",
"message": "Error message"
}
ApiResponse response = api.getWallet(userHandle, userPrivateKey);
GetWalletResponse parsedResponse = (GetWalletResponse) response.getData();
// Success Response Object
System.out.println(response.getStatusCode()); // 200
System.out.println(parsedResponse.getSuccess());
System.out.println(parsedResponse.getStatus());
System.out.println(parsedResponse.getReference());
System.out.println(parsedResponse.getWallet()); // Wallet object
System.out.println(parsedResponse.getWallet().getBlockChainAddress());
System.out.println(parsedResponse.getWallet().getBlockChainNetwork());
System.out.println(parsedResponse.getWallet().getWalletId());
System.out.println(parsedResponse.getWallet().getPrivateKey());
System.out.println(parsedResponse.getWallet().getNickname());
System.out.println(parsedResponse.getWallet().isDefaultWallet());
System.out.println(parsedResponse.getWallet().isFrozen());
System.out.println(parsedResponse.getWallet().getWalletId());
System.out.println(parsedResponse.getWallet().isStatementsEnabled()); // Boolean
System.out.println(parsedResponse.isWhitelisted()); // Boolean
System.out.println(parsedResponse.getSilaBalance()); // Sila balance
System.out.println(parsedResponse.getSilaAvailableBalance()); // Sila available balance
System.out.println(parsedResponse.getSilaPendingBalance()); // Sila pending balance
$userHandle = 'user_handle';
$userPrivateKey = 'some private key'; // Hex format
// Call the api
$response = $client->getWallet($userHandle, $userPrivateKey);
// Success 200
echo $response->getStatusCode(); // 200
echo $response->getData()->status;
echo $response->getData()->success; // TRUE
echo $response->getData()->reference; // Random reference number
echo $response->getData()->wallet; // The wallet requested
echo $response->getData()->is_whitelisted; // Indicates if the wallet is whitelisted
echo $response->getData()->sila_balance; // The current sila balance of the wallet.
echo $response->getData()->sila_balance; // The current sila balance of the wallet.
echo $response->getData()->sila_available_balance;
echo $response->getData()->sila_pending_balance;
echo $response->getData()->wallet->statements_enabled;
ApiResponse<object> response = api.GetWallet(userHandle, walletPrivateKey);
// Success Object Response
Console.WriteLine(response.StatusCode); // 200
var parsedData = (SingleWalletResponse)response.Data;
Console.WriteLine(parsedData.Success); // TRUE
Console.WriteLine(parsedData.Reference); // Reference
Console.WriteLine(parsedData.IsWhitelisted); // Is Whitelisted?
Console.WriteLine(parsedData.SilaBalance); // # of Sila tokens
Console.WriteLine(parsedData.Wallet); // Wallet details (nickname, default...)
Console.WriteLine(parsedData.Wallet.WalletId); // wallet_id "37d7d51f-2f3a-4f16-9003-41366218a74c"
Console.WriteLine(parsedData.SilaAvailableBalance); // 300
Console.WriteLine(parsedData.SilaPendingBalance); // 0
Key | Type | Description |
---|---|---|
header | JSON object | Required. |
wallet_id | string | Optional; JWT only Use to specify payment instrument UUID of the wallet to pull details for. |
nickname | string | Optional; JWT only User to specific nickname of the wallet to pull details for. |
Responses
The success attribute is a JSON key sent in the response body.
Status Code | success Attribute | Description |
---|---|---|
200 | true | Successfully fetched and returned wallet. |
400 | false | Bad request format. |
403 | false | Auth signature is absent or derived address does not belong to app_handle. |
500 | false | Temporarily unable to check contract for whitelisting and balance details (see response message for details). |
Updated 15 days ago