Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit

Permalink
build: replace with node fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
xstelea committed Sep 4, 2023
1 parent a7139c6 commit 5cb695c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
File renamed without changes.
18 changes: 2 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
"@radixdlt/radix-dapp-toolkit": "0.6.1",
"@radixdlt/radix-engine-toolkit": "0.3.0",
"elliptic": "^6.5.4",
"isomorphic-fetch": "^3.0.0",
"neverthrow": "^6.0.0"
"neverthrow": "^6.0.0",
"node-fetch": "^2.7.0"
},
"repository": {
"type": "git",
Expand Down
11 changes: 11 additions & 0 deletions src/fetch-polyfill.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// @ts-nocheck
import fetch, { Headers, Request, Response } from 'node-fetch'

if (!globalThis.fetch) {
globalThis.fetch = fetch
globalThis.Headers = Headers
globalThis.Request = Request
globalThis.Response = Response
}

export {}
2 changes: 1 addition & 1 deletion src/rola.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'isomorphic-fetch'
import './fetch-polyfill'
import { ResultAsync, err, errAsync, ok } from 'neverthrow'
import { createSignatureMessage } from './helpers/create-signature-message'
import { verifyProofFactory } from './helpers/verify-proof'
Expand Down

0 comments on commit 5cb695c

Please sign in to comment.