Created
May 1, 2021 17:44
-
-
Save Alex0007/613bfc47e24b625066c5222db1b59e03 to your computer and use it in GitHub Desktop.
Reset stellar wallet home_domain and inflation_dest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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