Comment on page

Purge wallet

Erase wallet's public and private keys.
This command deletes all wallet data, including public and private key.
This operation is irreversible.
This command can be disabled if wallet was created during card personalization with special config flag, that protect wallets from purging.


walletPublicKey <Data> The wallet's public key.
cardId <String> CID, Unique Tangem card ID number.
initialMessage <Message> [optional] This message will be shown in the NFC session dialog. Default: "Tap the card to your phone exactly as it shown above".


This command will return the SuccessResponse object in response.


JS (React Native)
JS (Cordova)
let walletPublicKey = card.wallets[0].publicKey //Will purge the first wallet
let cardId = card.cardId
tangemSdk.purgeWallet(walletPublicKey: walletPublicKey, cardId: cardId) { result in
switch result {
case .success:
print("The wallet deleted")
case .failure(let error):
val walletPublicKey = card.wallets.first().publicKey //Will purge the first wallet
val cardId = card.cardId
walletPublicKey = walletPublicKey,
cardId = cardId
) { result ->
when (result) {
is CompletionResult.Success -> {
runOnUiThread {
Log.d(TAG, "Wallet #1 has been successfully deleted")
is CompletionResult.Failure -> {
runOnUiThread {
Log.d(TAG, result.error)
byte[] walletPublicKey = card.getWallets().get(0).getPublicKey();
String cardId = card.getCardId();
tangemSdk.purgeWallet(walletPublicKey, cardId, null, result -> {
if (result instanceof CompletionResult.Success) {
SuccessResponse response = ((CompletionResult.Success<SuccessResponse>) result).getData();
Log.d(TAG, "Wallet #1 was successfully deleted");
} else if (result instanceof CompletionResult.Failure) {
TangemError error = ((CompletionResult.Failure<SuccessResponse>) result).getError();
Log.d(TAG, error.getCustomMessage());
return Unit.INSTANCE;
const walletPublicKey = card.wallets[0].publicKey;
const cardId =;
TangemSdk.purgeWallet(walletPublicKey, cardId)
.then((result) => console.log(result))
.catch((err) => console.log(err));
var walletPublicKey = card.wallets[0].publicKey;
var cardId = card.cardId;
var initialMessage = {"body": "body", "header": "header"};
var callback = function (response, error) {
if (error) {
alert({ "error": error });
} else {
alert({"response": response});
TangemSdk.purgeWallet(walletPublicKey, cardId, initialMessage, callback);
// Request
// Response