Jump to content
LeonidasH

XRPL Deletable Accounts Amendment Enabled, Grants 75% Balance Recovery

Recommended Posts

53 minutes ago, LetHerRip said:

How would I do this without getting too techy?

Write what you want to happen in a command, execute it and send the resulting text to the network which will then validate it and include it in the next ledger (usually within a few seconds).

Share this post


Link to post
Share on other sites
1 minute ago, Sukrim said:

Write what you want to happen in a command, execute it and send the resulting text to the network which will then validate it and include it in the next ledger (usually within a few seconds).

Thanks, but I wait a couple more days until a more user friendly option comes :)

Share this post


Link to post
Share on other sites

BTW, I strongly recommend submitting your AccountDelete transactions with the fail_hard option set to true. If for some reason the transaction can't be applied (like, you actually do have some object preventing your account from being deleted) then you'd really, really much rather have it be as if the transaction was never sent, than to send the transaction and destroy 5 XRP only to have it fail to delete the account.

Share this post


Link to post
Share on other sites

I've just added AccountDelete support to my old XRPtoolkit set of scripts. For me it works very well, it's a very simple nodejs script, though most users will probably wait for more fancy implementation with full UI.

Full repository: https://github.com/Duke67/xrptoolkit-nodejs

AccountDelete script: https://github.com/Duke67/xrptoolkit-nodejs/blob/master/delete.js

///////////////////////////////////////////////////////////
//
// Duke67 XRPtoolkit
// (C) 2020 Duke67 (MrDuke67@outlook.com)
// https://github.com/Duke67/xrptoolkit-nodejs
//
// delete.js - delete XRP account
// syntax: node delete [XRPL|TEST] ACCOUNT SECRET SEQ DST DSTTAG
//
///////////////////////////////////////////////////////////

'use strict';

const RippleAPI = require('ripple-lib').RippleAPI;

var api;
var net = process.argv[2];


if (net == 'TEST') {
    api = new RippleAPI({ server: 'wss://s.altnet.rippletest.net:51233', maxFeeXRP: '5' });
} else {
    api = new RippleAPI({ server: 'wss://s1.ripple.com:443', maxFeeXRP: '5' });
}



///
/// HINT
/// 1. use editor to preset the following variables with your data
/// 2. create custom copies of this script for frequent payments
///

var src = 'rHqaHPMmdWWSv2EmXGDwXmtgnC5hXR5zUy';	// account to be deleted
var dst = 'r4qSyg6j77me6seoBEDKXF3tueFiZtP5t2';	// destination account
var tag = '123';					// destination tag 
var scrt = 'spvdQ8sHG6wCP7K7nGHGUpe4LLFkq';		// source account's secret 

var seq = 1;						// source account's sequence (to get this info, use XRPtoolkit-Android or account_info.js)   
var fee = 5000000;					// fee (default is 5 XRPs (5000000 drops)

///

process.argv.forEach(function (val, index, array) {

	console.log(index + ': ' + val);

	switch(index) {
	case 2:net = val;break;
	case 3:src = val;break;
	case 4:scrt = val;break;
	case 5:seq = val;break;
	case 6:dst = val;break;
	case 7:tag = val;break;
	default:break;
	}

});

///////////////////////////////////////////////////////////

var rawTx = '{"TransactionType":"AccountDelete",' +
'"Account":"' + src +
'","Destination":"' + dst +
'","DestinationTag":' + tag +
',"Fee":"' + fee +
'","Sequence":' + seq +
',"Flags":2147483648' + 
'}';

///////////////////////////////////////////////////////////

console.log();
console.log(rawTx);

api.connect().then(() => {

	console.log('WORKING:');

	var sgnd = api.sign(rawTx, scrt).signedTransaction;
    	console.log(sgnd);
    
        api.submit(sgnd).then( response => {
		console.log('RESPONSE:');
		console.log(response.resultCode, response.resultMessage);
        }).catch(console.error)
    
}).then(() => {

	console.log('AccountDelete is being processed by XRPL...');

}).then(() => {

	api.disconnect();

}).catch(console.error);

console.log();

///////////////////////////////////////////////////////////

 

Just be careful. Do not expose your valuable secrets to anyone.

Cheers!

 

Share this post


Link to post
Share on other sites
10 hours ago, mDuo13 said:

One suggestion: first, upgrade to ripple-lib 1.7.0, then change this line

Good to know, I am still on 1.6.5.

Thanks!!

Share this post


Link to post
Share on other sites
Posted (edited)
On 5/13/2020 at 1:21 PM, Duke67 said:

Good to know, I am still on 1.6.5.

Thanks!!

i upgraded to 1.7 but it fails during broadcast with error Missing/inapplicable prior transaction. i researched a bit seems an error with sequence , like you suggested i am getting this sequence from address_info. LastLedgerSequence ? any ideas what could be the problem

 

{

TransactionType: "AccountDelete",

Account: address,

Destination: target_address,

DestinationTag: parseInt(destination_tag),

Fee: "5000000",

Sequence: address_info[address].LastLedgerSequence,

Flags: 2147483648,

};

 

Edited by Gopherine

Share this post


Link to post
Share on other sites
On 5/14/2020 at 10:40 PM, Gopherine said:

i upgraded to 1.7 but it fails during broadcast with error Missing/inapplicable prior transaction. i researched a bit seems an error with sequence , like you suggested i am getting this sequence from address_info. LastLedgerSequence ? any ideas what could be the problem

 


{

TransactionType: "AccountDelete",

Account: address,

Destination: target_address,

DestinationTag: parseInt(destination_tag),

Fee: "5000000",

Sequence: address_info[address].LastLedgerSequence,

Flags: 2147483648,

};

 

You need a sequence of transaction on your account, not the ledger sequence. 

You can find the next sequence number for your address in bithomp.com/explorer/ in the "Information" block. "Next sequence". 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...