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

Fix: EthereumWalletRegistry initialization typo #727

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion typescript/src/lib/electrum/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ import {
} from "../bitcoin"
import Electrum from "electrum-client-js"
import { BigNumber } from "ethers"
import { URL } from "url"
import { URL as nodeURL } from "url"
import { backoffRetrier, Hex, RetrierFn } from "../utils"

import MainnetElectrumUrls from "./urls/mainnet.json"
import TestnetElectrumUrls from "./urls/testnet.json"

const browserURL = window.URL
const URL = nodeURL ?? browserURL

/**
* Represents a set of credentials required to establish an Electrum connection.
*/
Expand Down Expand Up @@ -143,6 +146,7 @@ export class ElectrumClient implements BitcoinClient {
*/
private static parseElectrumCredentials(url: string): ElectrumCredentials {
const urlObj = new URL(url)
console.log({url, urlObj})

return {
host: urlObj.hostname,
Expand Down
2 changes: 1 addition & 1 deletion typescript/src/lib/ethereum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export async function loadEthereumContracts(
const tbtcVault = new EthereumTBTCVault({ signerOrProvider: signer }, network)
const walletRegistry = new EthereumWalletRegistry(
{ signerOrProvider: signer },
"mainnet"
network
)

const bridgeWalletRegistry = await bridge.walletRegistry()
Expand Down
2 changes: 1 addition & 1 deletion typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ES2017",
"module": "commonjs",
"lib": ["es2020"],
"lib": ["es2020", "dom"],
"declaration": true,
"declarationMap": true,
"sourceMap": true,
Expand Down