FunctionX Auto-Compounder : how-to

Hi everyone…

To follow on the recent announcement of FrenchXCore’s FX Auto-Compounder, you’ll find hereafter some instructions on what is required to run it and how to run it.

First, you’re gonna need to have a computer or VPS with Java (at least 17) installed. You’ll find the latest OpenJDK here for download.

Once Java is setup, you’re gonna need to download the FX AutoCompounder JAR with dependencies from our github. It is available here.

Scenario #1 - Windows user - JAR downloaded in D:\Autocompound
Run the following commands (to be adapted to your own folder):

  1. `d:'
  2. cd d:\Autocompound
  3. java -jar FxAutoCompounder-1.1.0-SNAPSHOT-jar-with-dependencies.jar enc
    This will allow you to encrypt your seedphrase with a password of your own.
  4. When required to enter a password (Enter root password [then press ENTER]:), setup a strong password (and note it somewhere safe) and press [ENTER]
  5. When required to enter a password (Enter root password again [then press ENTER]:), re-type your password and press [ENTER]
  6. When required to enter the value to encrypt (Enter value to encrypt [then press ENTER]:), copy and paste your seedphrase (all lowercase, words separated with a space), then press [ENTER]
  7. Copy in a text file the value after Encrypted value is :
    This is an version of your seedphrase encrypted using AES256 algorithm and your password.
  8. If you want to AutoCompound for multiple accounts (different seedphrases), repeat steps 3-7 with the other seedphrases.
  9. From there, you will be able to run the FX AutoCompounder without having to type your seedphrase anymore. To know all options, just run java -jar FxAutoCompounder-1.1.0-SNAPSHOT-jar-with-dependencies.jar ac
  10. If you want to simply autocompound for a single delegator, just run java -jar FXAutoCompounder.jar ac -d *YOUR-FX-DELEGATOR-ADDRESS* -s *YOUR-ENCRYPTED-SEEDPHRASE*

Scenario #2 - Linux user - JAR downloaded in /home/ubuntu/
Same as above, but replace steps 1-2 with :

  1. `cd /home/ubuntu’

Regards,
@FrenchXCore

Edit 30/JUL/2022: update to v1.1.0 containing minor bug corrections and fitting 2022/07 FXCore mainnet v2.2.1.

9 Likes

Thank you very much

1 Like

If this were to become a DApp, I think it will be a very popular one.

4 Likes

Working on it !!! :wink:

6 Likes

@zaccheah , @lancelai , @Richard , or whoever from the team could help me out…

In ordre to finalize my DApp autocompounder using f(x)Wallet and WalletConnect, I would need a description of the f(x)Wallet WC interface messages, such as functionx_sign, onSignMessage, etc.

Could someone provide me that please ?
I’m assuming it’s probable available since MarginX recompiled a special f(x)Wallet version on top of it.

Thanks.

Regards.

1 Like

@lancelai @Richard @zaccheah :

As I feared, f(x)wallet v2 removed the ‘functionx_sign’ interface (com.pundix.core.enums.MsgType) which I intended to use to provide an auto-compounder Dapp on our website.

I thought announcing how I did it on the forum would give FunctionX team notice that I intended to use it.

Nevertheless, I found some interesting features in f(x)Wallet v2’s code, but really would appreciate team’s guidance or documentation.

In f(x)Wallet v2, com.pundix.functionx.SignType have plenty of options, especially FUNCTIONX_WC_SIGN_V1 and FUNCTIONX_WC_SIGN_DIRECT_V1.

If possible, I’d like to avoid spending another week to reverse engineer f(x)Wallet v2’s code to find how to sign a transaction again.

Would it be possible to publish some documentation about how to use those com.pundix.functionx.SignType enums (an API) ?

Thanks.

Regards.

1 Like

Hey @FrenchXCore , where are you seeing the code?

I reverse-engineer f(x)Wallet v2 APK code.

There is some new documentation here, under the “For Developers” section:

2 Likes

Thx @malcolmT !!!

For the future, I would really appreciate if the team was announcing beforehand that they were working on such an effort, because I spent my whole summer working on it as well :frowning:

Anyway, thanks a lot !

Regards.

1 Like

Noted. Glad to be of help! :slight_smile:

1 Like

Hi @malcolmT, @zaccheah,

Unfortunately, current documentation is too “light” to try and code something neat.

Would it be possible to have a detailed documentation on how to use these 3 F(x)Wallet method calls thru WalletConnect and MetaMask ?

  1. functionx_wc_accounts_v1
  2. functionx_wc_sign_direct_tx_v1
  3. functionx_wc_sign_tx_v1

And maybe later those ones:

  1. cosmostation_wc_accounts_v1
  2. cosmostation_wc_sign_tx_v1
  3. onSendTransaction
  4. eth_sign
  5. eth_signTransaction
  6. eth_signTypedData
  7. eth_signTypedData_v3
  8. eth_signTypedData_v4
  9. keplr_get_key_wallet_connect_v1
  10. keplr_sign_amino_wallet_connect_v1
  11. personal_sign
  12. onSignMessage
  13. wallet_switchEthereumChain
  14. tron_js_sign
  15. eth_sendRawTransaction

Also, how can I grab the f(x)Wallet selected account public key ?
functionx_wc_accounts_v1 returns the algo and key bytes.
However, it is not specified how to grab the ethsecp256k1 and secp256k1 public key. And I need this in order to simulate a transaction to get approx. gas fee before requestion to sign the transaction.

Thanks.

Regards
@FrenchXCore

Hey @FrenchXCore ,

Unfortunately we are not able to provide much detailed documentation. But our team has provided an example for you to take a look at.

The three method calls provided by fxWallet are based on the WalletConnect protocol. By understanding the connection method of WalletConnect, you’ll be able to interact with fxWallet through the three methods.

After connecting through WalletConnect, fxCore transactions can be sent through the methods provided by fxWallet, example (without WalletConnect part):

1 Like

Hey @malcolmT (and @zaccheah ) !

Still trying to work my auto-compounder dApp using f(x)wallet and WalletConnect.
However, some details are annoying me.
In order to process authz transactions (unavoidable for autocompounding), I cannot sign them using amino legacy, thus I need to use the functionx_wc_sign_direct_tx_v1 protocol.

However, it looks like there is a bug in f(x) wallet Android app. It looks like “WcSignModel” Java class is using the key type tendermint/PubKeySecp256k1 for case 4, whereas it seems to me it should be using ethermint/PubKeyEthSecp256k1.

Thanks.

Regards,
@FrenchXCore