Skip to content

Instantly share code, notes, and snippets.

@Alex0007
Created May 1, 2021 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Alex0007/613bfc47e24b625066c5222db1b59e03 to your computer and use it in GitHub Desktop.
Save Alex0007/613bfc47e24b625066c5222db1b59e03 to your computer and use it in GitHub Desktop.
Reset stellar wallet home_domain and inflation_dest
const StellarSdk = require('stellar-sdk');
const secret = 'YOUR_SECRET'
const main = async () => {
const server = new StellarSdk.Server('https://horizon.stellar.org');
const keypair = StellarSdk.Keypair.fromSecret(secret);
const account = await server.loadAccount(keypair.publicKey())
const op = StellarSdk.Operation.setOptions({
inflationDest: account.account_id,
homeDomain: '',
});
const tx = new StellarSdk.TransactionBuilder(account, {
fee: '100',
networkPassphrase: StellarSdk.Networks.PUBLIC
})
.addOperation(op)
.setTimeout(60)
.build();
tx.sign(keypair);
return server.submitTransaction(tx);
}
main().then(console.log).catch(console.error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment