/delete_wallet

Deletes a user wallet.

This endpoint allows deletion of a user's wallet. This action cannot be performed on a user's only wallet, a user's default destination wallet, or an a wallet with a non-zero balance.

The wallet/address to be deleted is the one derived from the usersignature header.

  

Requests

Both authsignature and usersignature headers are required for this request. The usersignature header should be generated with the user's wallet to be deleted.

Note - We recently renamed the field auth_handle to app_handle. For backward compatibility, auth_handle is still valid but has been removed from our documentation.

  
POST /0.2/delete_wallet HTTP/1.1
Host: sandbox.silamoney.com
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
usersignature: [GENERATED USERSIGNATURE HEX STRING HERE]
Content-Type: application/json

{
  "header": {
    "created": 1234567890, 
    "app_handle": "handle.silamoney.eth", 
    "user_handle":"user.silamoney.eth", 
    "version": "0.2", 
    "crypto": "ETH", 
    "reference": "<your unique id>"
  }
}

***

HTTP/1.1 200 OK

{
  "message": "Address [address] deleted; can no longer be used to sign user requests through the API.",
  "success": true,
  "status": "SUCCESS",
  "response_time_ms": "171",
  "reference": "ref"
}
const res = await Sila.deleteWallet(userHandle, walletPrivateKey);

// Success Response Object
console.log(res.statusCode); // 200
console.log(res.data.reference); // Random reference number
console.log(res.data.status);
console.log(res.data.success); // TRUE
console.log(res.data.message); // Wallet deleted
payload = {
    "user_handle": "user.silamoney.eth"
}

response = Wallet.deleteWallet(app, payload, user_private_key)

### Success Response Object
{
  "status": 'SUCCESS',
  "status_code": 200,
  "message": "Address [address] deleted; can no longer be used to sign user requests through the API.",
  "success": True,
  "reference": "ref"
}

### Failure Response Object
{
  "message": "Error message",
  "success": False,
  "reference": "ref"
}
ApiResponse response = api.deleteWallet(userHandle, userPrivateKey);
BaseResponse parsedResponse = (BaseResponse) 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.getMessage()); 
System.out.println(parsedResponse.getReference());
$userHandle = 'user.silamoney.eth';
$userPrivateKey = 'some private key'; // Hex format

// Call the api
$response = $client->deleteWallet($userHandle, $userPrivateKey);

// Success 200
echo $response->getStatusCode(); // 200
echo $response->getData()->status;
echo $response->getData()->success; // TRUE
echo $response->getData()->message; // Message
echo $response->getData()->reference; // your unique reference id
ApiResponse<object> response = api.DeleteWallet(userHandle, walletPrivateKey);

// Success Object Response

Console.WriteLine(response.StatusCode); // 200
var parsedData = (UpdateWalletResponse)response.Data;
Console.WriteLine(parsedData.Success); // TRUE
Console.WriteLine(parsedData.Message); // Message
Console.WriteLine(parsedData.Reference); // your unique reference id

Key

Type

Description

header

JSON object

Required. Requires these keys in JSON format: created, app_handle, user_handle. See the /check_handle endpoint for the complete list of fields in this object.

  

Responses

The success attribute is a JSON key sent in the response body.

Status Code

success Attribute

Description

200

true

Successfully deleted wallet.

400

false

Bad request format.

401

false

Auth signature is absent or derived address does not belong to app_handle.

403

false

Wallet cannot be deleted (see response message for details).


Did this page help you?