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

The chainId in the returned data is empty #30

Open
VliceZ opened this issue Jan 5, 2021 · 12 comments
Open

The chainId in the returned data is empty #30

VliceZ opened this issue Jan 5, 2021 · 12 comments

Comments

@VliceZ
Copy link

VliceZ commented Jan 5, 2021

How can i get it right?

@montaigne2100
Copy link

@VliceZ Hi, did you manage to make it work?

@VliceZ
Copy link
Author

VliceZ commented Mar 1, 2021

@miohtama i have no idea,just shows a dialog for users to choose,like ETH、BSC。

@ligi
Copy link
Collaborator

ligi commented Mar 1, 2021

What exactly is the problem with this lib?
The lib should show no dialog.

@VliceZ
Copy link
Author

VliceZ commented Mar 1, 2021

What I mean is that I don’t know the chainId returned, so I let the user choose which chain the specific wallet is.

@montaigne2100
Copy link

@VliceZ @ligi The sample app is not working and when I fix it and click to connect button, it navigates me to the wallet app I chose and returns me this strings: isthis It just oppens the app not asks for permission. How can I fix it?

@VliceZ
Copy link
Author

VliceZ commented Mar 2, 2021

@miohtama The bridge parameter in in simple app is not working, try to change it to "https://bridge.walletconnect.org" ,the complete code like this in Application :
fun resetSession() {
nullOnThrow { session }?.clearCallbacks()
val icons: ArrayList = arrayListOf()
icons.add("https://images/xx.png")
val key = ByteArray(32).also { Random().nextBytes(it) }.toNoPrefixHexString()
config = Session.Config(UUID.randomUUID().toString(), "https://bridge.walletconnect.org", key)
session = WCSession(config,
MoshiPayloadAdapter(moshi),
storage,
OkHttpTransport.Builder(client, moshi),
Session.PeerMeta(name = "Dfox",icons = icons)
)
session?.offer()
}

@montaigne2100
Copy link

@VliceZ Hi, thank you so much for posting this code snippet :) I am now able to send permission request but it crashes when user accepts connection. Error:
E/AndroidRuntime: FATAL EXCEPTION: OkHttp https://bridge.walletconnect.org/...
Process: com.application.kotlinwalletconnectdeneme, PID: 20277
java.lang.IllegalStateException: Module with the Main dispatcher had failed to initialize

Can you take a look at this please? Thank you so much :)

@VliceZ
Copy link
Author

VliceZ commented Mar 2, 2021

@montaigne2100 I think the error is from this line "icons.add("https://images/xx.png")",the icons url just a example , you need add a real icon Url.

@montaigne2100
Copy link

@VliceZ Yeah I did that but problem was about coroutines library's version. I upgraded it and its fixed. Thank you so so much :) You saved my days

@ligi
Copy link
Collaborator

ligi commented Mar 18, 2021

So the problem is solved by using a valid icon URL? Maybe we should throw an exception as the library then

@kashifahmad662
Copy link

@miohtama The bridge parameter in in simple app is not working, try to change it to "https://bridge.walletconnect.org" ,the complete code like this in Application :
fun resetSession() {
nullOnThrow { session }?.clearCallbacks()
val icons: ArrayList = arrayListOf()
icons.add("https://images/xx.png")
val key = ByteArray(32).also { Random().nextBytes(it) }.toNoPrefixHexString()
config = Session.Config(UUID.randomUUID().toString(), "https://bridge.walletconnect.org", key)
session = WCSession(config,
MoshiPayloadAdapter(moshi),
storage,
OkHttpTransport.Builder(client, moshi),
Session.PeerMeta(name = "Dfox",icons = icons)
)
session?.offer()
}

Im having error after doing this
java.net.connection failed to connect bridge.walletconnect.org

I don’t know why is it coming before some time my code was working fine and now this exception throws every time i send request to metamask or trustwallet.

Can u help me out with this problem i have already raised a issue u can see my issue in issue tab with all the codes

@dophunhan
Copy link

How to get chaninId @ligi @VliceZ @kashifahmad662 @montaigne2100
I need to get the channel ID to check if the network matches or not

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

5 participants