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

Dashboard integration bugs #728

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix URL API error on the browser
The SDK uses a Node implementation of the URL API which is not
complementary to the native browser implementation. I have added
a conditional that if you have window.URL available then use it,
and if you don't have it then fallback to the Node implementation
  • Loading branch information
kpyszkowski committed Nov 1, 2023
commit a46b0f951d9cacc9d54ce212963f3fab73a52744
5 changes: 4 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 = browserURL ?? nodeURL

/**
* Represents a set of credentials required to establish an Electrum connection.
*/
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