Skip to content

Commit

Permalink
⬆️ attempting to force node-fetch to be 2.6.7 or higher
Browse files Browse the repository at this point in the history
Replaced other fetches with isomorphic fetch
  • Loading branch information
maschad committed Mar 18, 2022
1 parent bed5950 commit c835f05
Show file tree
Hide file tree
Showing 12 changed files with 1,336 additions and 1,330 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@
"wait-on": "^6.0.0",
"wsrun": "^5.2.4"
},
"resolutions": {},
"resolutions": {
"node-fetch": "^2.6.7"
},
"workspaces": [
"packages/*"
],
Expand Down
9 changes: 7 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"cross-fetch": "^3.1.4"
"isomorphic-fetch": "^3.0.0"
},
"resolutions": {
"node-fetch": "^2.6.7"
},
"peerDependencies": {},
"devDependencies": {},
"devDependencies": {
"@types/isomorphic-fetch": "^0.0.36"
},
"files": [
"src",
"dist"
Expand Down
3 changes: 1 addition & 2 deletions packages/api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export * from './api.gen'

import fetch from 'cross-fetch'

import fetch from 'isomorphic-fetch'
import { API as BaseSequenceAPI } from './api.gen'

export class SequenceAPIClient extends BaseSequenceAPI {
Expand Down
9 changes: 7 additions & 2 deletions packages/indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"cross-fetch": "^3.1.4"
"isomorphic-fetch": "^3.0.0"
},
"resolutions": {
"node-fetch": "^2.6.7"
},
"peerDependencies": {},
"devDependencies": {},
"devDependencies": {
"@types/isomorphic-fetch": "^0.0.36"
},
"files": [
"src",
"dist"
Expand Down
5 changes: 2 additions & 3 deletions packages/indexer/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
export * from './indexer.gen'

import fetch from 'cross-fetch'

import fetch from 'isomorphic-fetch'
import { Indexer as BaseSequenceIndexer } from './indexer.gen'

export enum SequenceIndexerServices {
MAINNET = 'https://mainnet-indexer.sequence.app',
POLYGON = 'https://polygon-indexer.sequence.app',

RINKEBY = 'https://rinkeby-indexer.sequence.app',
POLYGON_MUMBAI = 'https://mumbai-indexer.sequence.app'
}
Expand Down
9 changes: 7 additions & 2 deletions packages/metadata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"cross-fetch": "^3.1.4"
"isomorphic-fetch": "^3.0.0"
},
"resolutions": {
"node-fetch": "^2.6.7"
},
"peerDependencies": {},
"devDependencies": {},
"devDependencies": {
"@types/isomorphic-fetch": "^0.0.36"
},
"files": [
"src",
"dist"
Expand Down
3 changes: 1 addition & 2 deletions packages/metadata/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export * from './metadata.gen'

import fetch from 'cross-fetch'

import fetch from 'isomorphic-fetch'
import { Metadata as BaseSequenceMetadata } from './metadata.gen'

export class SequenceMetadataClient extends BaseSequenceMetadata {
Expand Down
9 changes: 7 additions & 2 deletions packages/relayer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@
"@0xsequence/utils": "^0.36.7",
"@ethersproject/providers": "^5.5.1",
"ethers": "^5.5.2",
"fetch-ponyfill": "^7.1.0"
"isomorphic-fetch": "^3.0.0"
},
"resolutions": {
"node-fetch": "^2.6.7"
},
"peerDependencies": {},
"devDependencies": {},
"devDependencies": {
"@types/isomorphic-fetch": "^0.0.36"
},
"files": [
"src",
"dist"
Expand Down
24 changes: 12 additions & 12 deletions packages/relayer/src/rpc-relayer/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { TransactionResponse } from '@ethersproject/providers'
import { ethers } from 'ethers'
import fetchPonyfill from 'fetch-ponyfill'
import { walletContracts } from '@0xsequence/abi'
import { addressOf, buildStubSignature, WalletConfig } from '@0xsequence/config'
import { WalletContext } from '@0xsequence/network'
import {
Transaction,
readSequenceNonce,
appendNonce,
computeMetaTxnHash,
decodeNonce,
MetaTransactionsType,
readSequenceNonce,
sequenceTxAbiEncode,
SignedTransactions,
computeMetaTxnHash,
decodeNonce
Transaction
} from '@0xsequence/transactions'
import { BaseRelayer, BaseRelayerOptions } from '../base-relayer'
import { FeeOption, FeeQuote, Relayer, SimulateResult } from '..'
import { WalletContext } from '@0xsequence/network'
import { WalletConfig, addressOf, buildStubSignature } from '@0xsequence/config'
import { logger } from '@0xsequence/utils'
import { TransactionResponse } from '@ethersproject/providers'
import { ethers } from 'ethers'
import fetch from 'isomorphic-fetch'
import { FeeOption, FeeQuote, Relayer, SimulateResult } from '..'
import { BaseRelayer, BaseRelayerOptions } from '../base-relayer'
import * as proto from './relayer.gen'

export { proto }
Expand All @@ -36,7 +36,7 @@ export class RpcRelayer extends BaseRelayer implements Relayer {

constructor(options: RpcRelayerOptions) {
super(options)
this.service = new proto.Relayer(options.url, fetchPonyfill().fetch)
this.service = new proto.Relayer(options.url, fetch)
}

async waitReceipt(metaTxnHash: string | SignedTransactions, wait: number = 1000): Promise<proto.GetMetaTxnReceiptReturn> {
Expand Down
6 changes: 5 additions & 1 deletion packages/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@
"@ethersproject/properties": "^5.5.0",
"@ethersproject/providers": "^5.5.1",
"ethers": "^5.5.2",
"fetch-ponyfill": "^7.1.0"
"isomorphic-fetch": "^3.0.0"
},
"resolutions": {
"node-fetch": "^2.6.7"
},
"peerDependencies": {},
"devDependencies": {
"@0xsequence/wallet-contracts": "1.9.6",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/isomorphic-fetch": "^0.0.36",
"ganache-core": "^2.13.2",
"web3": "^1.7.0"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/wallet/src/remote-signers/guard-remote-signer.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fetchPonyfill from 'fetch-ponyfill'
import { BigNumber, ethers, BytesLike } from 'ethers'
import { RemoteSigner } from './remote-signer'
import { GuarddService } from '@0xsequence/guard'
import { ChainId, ChainIdLike } from '@0xsequence/network'
import { BigNumber, BytesLike, ethers } from 'ethers'
import fetch from 'isomorphic-fetch'
import { RemoteSigner } from './remote-signer'

export class GuardRemoteSigner extends RemoteSigner {
private readonly _guardd: GuarddService
Expand All @@ -15,7 +15,7 @@ export class GuardRemoteSigner extends RemoteSigner {
public defaultChainId: number = ChainId.MAINNET
) {
super()
this._guardd = new GuarddService(hostname, fetchPonyfill().fetch)
this._guardd = new GuarddService(hostname, fetch)
this._address = address
}

Expand Down
Loading

0 comments on commit c835f05

Please sign in to comment.