8

Using the Javascript SDK I'm trying different ways of unsetting the home domain and inflation destination options without success. Is this something that is supported at all on the network, is it just the SDK that doesn't implement it, or is there a trick I haven't thought of to do this?

The use-case I came across was that someone had found out that in German tax law there's a substantial benefit to not receiving inflation payout, and therefore wanted to unset the inflation destination. The only solution I could come up with was to set the inflation destination to an alternative address that would not result in them receiving inflation payout.

13

No, you can't.

If we look at the XDR definition of setOptionsOp, we can see all the fields are optional, if a field is not None then the corresponding value will be set.

So what can you do?

Home domain

From the SQL definition of the accounts table we see that homedomain cannot be null, by default it's the empty string. To unset it we simply set it to ''.

Inflation Destination

I think the best solution for this is to set the inflation destination to the account itself.

Source

const StellarSdk = require('stellar-sdk');
StellarSdk.Network.useTestNetwork();


const server = new StellarSdk.Server('https://horizon-testnet.stellar.org');

const keypair = StellarSdk.Keypair.fromSecret(YOUR_SECRET);

server.loadAccount(keypair.publicKey()).then(account => {
  const op = StellarSdk.Operation.setOptions({
    inflationDest: account.account_id,
    homeDomain: '',
  });
  let tx = new StellarSdk.TransactionBuilder(account)
      .addOperation(op)
      .build();
  tx.sign(keypair);

  return server.submitTransaction(tx);
}).then(res => {
  console.log(res);
}).catch(err => {
  console.log('Error submitting transaction: ' + err);
});
  • Yep, setting home domain to the empty string seems to work. I could also imagine a special value for inflation destination that would wipe it. – Dupe Jan 18 '18 at 14:19
  • 1
    The inflation destination can not be unset. You can set it to yourself, as suggested, but that's not equivalent. github.com/stellar/stellar-core/issues/1598 – Tomer Weller Sep 25 '18 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.