-
Notifications
You must be signed in to change notification settings - Fork 487
Open
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels