Regarding connecting dapp with metamask #3329
Unanswered
nick70007
asked this question in
Developer Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have changed the allowed domains to "https://ubionline.io" and "https://*.ubionline.io" and also changed the DefaultSocketFactory to the following
`extension WebSocket: WebSocketConnecting { }
struct DefaultSocketFactory: WebSocketFactory {
func create(with url: URL) -> WebSocketConnecting {
var urlRequest = URLRequest(url: url)
urlRequest.addValue("allowed.domain.com", forHTTPHeaderField: "Origin")
return WebSocket(request: urlRequest)
}
}`
When trying to connect, then it is giving me error of "Websocket is not connected to any URL."
This is my current code
`let methods: Set = ["eth_sendTransaction","personal_sign"]
let blockchains: Set = [TestnetChain]
let requiredNamespaces: [String: ProposalNamespace] = [
"eip155": ProposalNamespace(
chains: blockchains, methods: methods, events: ["accountsChanged", "chainChanged"]
),
]
Beta Was this translation helpful? Give feedback.
All reactions