Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android DEMO not works with new "trust_min.js" #573

Open
ronaldoguedess opened this issue Nov 1, 2024 · 7 comments
Open

Android DEMO not works with new "trust_min.js" #573

ronaldoguedess opened this issue Nov 1, 2024 · 7 comments

Comments

@ronaldoguedess
Copy link

ronaldoguedess commented Nov 1, 2024

The new library doesn't work with the Android LoadProviderJs sample found at:
https://github.com/trustwallet/trust-web3-provider/blob/main/android/lib/src/main/res/raw/trust_min.js

It probably needs to be updated, as it’s no longer functioning with the new library provided above.

Here’s the relevant code snippet of the MainActivity:

 private fun loadProviderJs(): String {
        return resources.openRawResource(R.raw.trust_min).bufferedReader().use { it.readText() }
}

private fun loadInitJs(chainId: Int, rpcUrl: String): String {
        val source = """
        (function() {
            var config = {                
                ethereum: {
                    chainId: $chainId,
                    rpcUrl: "$rpcUrl"
                },
                solana: {
                    cluster: "mainnet-beta",
                },
                isDebug: true
            };
            trustwallet.ethereum = new trustwallet.Provider(config);
            trustwallet.solana = new trustwallet.SolanaProvider(config);
            trustwallet.postMessage = (json) => {
                window._tw_.postMessage(JSON.stringify(json));
            }
            window.ethereum = trustwallet.ethereum;
        })();
        """
        return  source
}

Could you please provide the updated version to connect with the new trust_min.js? Additionally, I would like to see how to incorporate TON in the implementation.

@ronaldoguedess
Copy link
Author

@y3fers0n Could you assist me with this?

I've been trying to use this modular provider for a couple of months, and I only need the Android sample updated for this new provider. Can you help me or reach out to the person responsible for that?

The new trust_min.js does not match the loadInitJs used in the Android sample app.

@ronaldoguedess
Copy link
Author

Hey man, please, give me at least an position about that..

@hany21
Copy link

hany21 commented Nov 29, 2024

No send

@ronaldoguedess
Copy link
Author

No send

what?

@Farnoosh85
Copy link

*Information regarding specific collections, websites and services will be communicated through our Discord and official channels.

1 similar comment
@Farnoosh85
Copy link

*Information regarding specific collections, websites and services will be communicated through our Discord and official channels.

@ronaldoguedess
Copy link
Author

Still waiting support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants