@0xsequence/network
Advanced tools
Comparing version 0.9.6 to 0.10.0
# @0xsequence/network | ||
## 0.10.0 | ||
### Minor Changes | ||
- Deployed new contracts with ERC1271 signer support | ||
### Patch Changes | ||
- Updated dependencies [undefined] | ||
- @0xsequence/utils@0.10.0 | ||
## 0.9.6 | ||
@@ -4,0 +15,0 @@ |
@@ -216,3 +216,3 @@ 'use strict'; | ||
if (typeof networks === 'function') { | ||
if (typeof networks === 'function' && vars) { | ||
config = networks(vars); | ||
@@ -336,7 +336,7 @@ } else { | ||
const sequenceContext = { | ||
factory: '0x6813Da82a84e31f98824146a50d9Ba0Fbd4cbF14', | ||
mainModule: '0xBf7aa3d072d4052D894cDd32EC818B02D9ba4FeC', | ||
mainModuleUpgradable: '0xc97c6276702A89741F2313d2F8fC9C7D4dC86128', | ||
guestModule: '0xd1345a45Cc1Dc792389a85d722CB911118Bb52Ef', | ||
sequenceUtils: '0x6fA52553CCFB101f26d55a7342F84A10e1054E58' | ||
factory: '0x73025F64A80f5DF7f86b80c597Bc96DdfAdae072', | ||
mainModule: '0x52080556206Ecc3953BA6e280eb1a26b63692829', | ||
mainModuleUpgradable: '0x7520d4b8835CD394ed5BDAa903BD732f5991BF5B', | ||
guestModule: '0x4CE2cf42F93afcdF5378DEAb5Cff011cBEAf309f', | ||
sequenceUtils: '0xCa731e0f33Afbcfa9363d6F7449d1f5447d10C80' | ||
}; | ||
@@ -437,4 +437,6 @@ | ||
reject(error); | ||
} else if (response) { | ||
resolve(response.result); | ||
} else { | ||
resolve(response.result); | ||
resolve(undefined); | ||
} | ||
@@ -535,3 +537,3 @@ }, chainId || this.defaultChainId); | ||
if (this.cachableJsonRpcMethods.includes(request.method)) { | ||
if (response.result) { | ||
if (response && response.result) { | ||
const key = this.cacheKey(request.method, request.params, chainId || this.defaultChainId); | ||
@@ -616,3 +618,3 @@ this.setCacheValue(key, response.result); | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: `${this.props.chainId}` | ||
@@ -629,3 +631,3 @@ }); | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: ethers.ethers.utils.hexlify(this.props.chainId) | ||
@@ -642,4 +644,4 @@ }); | ||
jsonrpc: '2.0', | ||
id, | ||
result: [this.props.accountAddress.toLowerCase()] | ||
id: id, | ||
result: [ethers.ethers.utils.getAddress(this.props.accountAddress)] | ||
}); | ||
@@ -655,3 +657,3 @@ return; | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: this.props.walletContext | ||
@@ -677,3 +679,3 @@ }); | ||
next(request, (error, response) => { | ||
if (!error && response.error) { | ||
if (!error && response && response.error) { | ||
if (typeof response.error === 'string') { | ||
@@ -719,3 +721,3 @@ throw new Error(response.error); | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: `${networkChainId}` | ||
@@ -728,3 +730,3 @@ }); | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: ethers.ethers.utils.hexlify(networkChainId) | ||
@@ -772,3 +774,3 @@ }); | ||
// When provider is configured, send non-private methods to our local public provider | ||
if (this.provider !== null && !this.privateJsonRpcMethods.includes(request.method)) { | ||
if (this.provider && !this.privateJsonRpcMethods.includes(request.method)) { | ||
this.provider.send(request.method, request.params).then(r => { | ||
@@ -790,3 +792,5 @@ callback(undefined, { | ||
this.setRpcUrl(rpcUrl); | ||
if (rpcUrl) { | ||
this.setRpcUrl(rpcUrl); | ||
} | ||
} | ||
@@ -800,4 +804,4 @@ | ||
if (!rpcUrl || rpcUrl === '') { | ||
this.rpcUrl = null; | ||
this.provider = null; | ||
this.rpcUrl = undefined; | ||
this.provider = undefined; | ||
} else { | ||
@@ -804,0 +808,0 @@ this.rpcUrl = rpcUrl; |
@@ -216,3 +216,3 @@ 'use strict'; | ||
if (typeof networks === 'function') { | ||
if (typeof networks === 'function' && vars) { | ||
config = networks(vars); | ||
@@ -336,7 +336,7 @@ } else { | ||
const sequenceContext = { | ||
factory: '0x6813Da82a84e31f98824146a50d9Ba0Fbd4cbF14', | ||
mainModule: '0xBf7aa3d072d4052D894cDd32EC818B02D9ba4FeC', | ||
mainModuleUpgradable: '0xc97c6276702A89741F2313d2F8fC9C7D4dC86128', | ||
guestModule: '0xd1345a45Cc1Dc792389a85d722CB911118Bb52Ef', | ||
sequenceUtils: '0x6fA52553CCFB101f26d55a7342F84A10e1054E58' | ||
factory: '0x73025F64A80f5DF7f86b80c597Bc96DdfAdae072', | ||
mainModule: '0x52080556206Ecc3953BA6e280eb1a26b63692829', | ||
mainModuleUpgradable: '0x7520d4b8835CD394ed5BDAa903BD732f5991BF5B', | ||
guestModule: '0x4CE2cf42F93afcdF5378DEAb5Cff011cBEAf309f', | ||
sequenceUtils: '0xCa731e0f33Afbcfa9363d6F7449d1f5447d10C80' | ||
}; | ||
@@ -437,4 +437,6 @@ | ||
reject(error); | ||
} else if (response) { | ||
resolve(response.result); | ||
} else { | ||
resolve(response.result); | ||
resolve(undefined); | ||
} | ||
@@ -535,3 +537,3 @@ }, chainId || this.defaultChainId); | ||
if (this.cachableJsonRpcMethods.includes(request.method)) { | ||
if (response.result) { | ||
if (response && response.result) { | ||
const key = this.cacheKey(request.method, request.params, chainId || this.defaultChainId); | ||
@@ -616,3 +618,3 @@ this.setCacheValue(key, response.result); | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: `${this.props.chainId}` | ||
@@ -629,3 +631,3 @@ }); | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: ethers.ethers.utils.hexlify(this.props.chainId) | ||
@@ -642,4 +644,4 @@ }); | ||
jsonrpc: '2.0', | ||
id, | ||
result: [this.props.accountAddress.toLowerCase()] | ||
id: id, | ||
result: [ethers.ethers.utils.getAddress(this.props.accountAddress)] | ||
}); | ||
@@ -655,3 +657,3 @@ return; | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: this.props.walletContext | ||
@@ -677,3 +679,3 @@ }); | ||
next(request, (error, response) => { | ||
if (!error && response.error) { | ||
if (!error && response && response.error) { | ||
if (typeof response.error === 'string') { | ||
@@ -719,3 +721,3 @@ throw new Error(response.error); | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: `${networkChainId}` | ||
@@ -728,3 +730,3 @@ }); | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: ethers.ethers.utils.hexlify(networkChainId) | ||
@@ -772,3 +774,3 @@ }); | ||
// When provider is configured, send non-private methods to our local public provider | ||
if (this.provider !== null && !this.privateJsonRpcMethods.includes(request.method)) { | ||
if (this.provider && !this.privateJsonRpcMethods.includes(request.method)) { | ||
this.provider.send(request.method, request.params).then(r => { | ||
@@ -790,3 +792,5 @@ callback(undefined, { | ||
this.setRpcUrl(rpcUrl); | ||
if (rpcUrl) { | ||
this.setRpcUrl(rpcUrl); | ||
} | ||
} | ||
@@ -800,4 +804,4 @@ | ||
if (!rpcUrl || rpcUrl === '') { | ||
this.rpcUrl = null; | ||
this.provider = null; | ||
this.rpcUrl = undefined; | ||
this.provider = undefined; | ||
} else { | ||
@@ -804,0 +808,0 @@ this.rpcUrl = rpcUrl; |
@@ -212,3 +212,3 @@ import { urlClean } from '@0xsequence/utils'; | ||
if (typeof networks === 'function') { | ||
if (typeof networks === 'function' && vars) { | ||
config = networks(vars); | ||
@@ -332,7 +332,7 @@ } else { | ||
const sequenceContext = { | ||
factory: '0x6813Da82a84e31f98824146a50d9Ba0Fbd4cbF14', | ||
mainModule: '0xBf7aa3d072d4052D894cDd32EC818B02D9ba4FeC', | ||
mainModuleUpgradable: '0xc97c6276702A89741F2313d2F8fC9C7D4dC86128', | ||
guestModule: '0xd1345a45Cc1Dc792389a85d722CB911118Bb52Ef', | ||
sequenceUtils: '0x6fA52553CCFB101f26d55a7342F84A10e1054E58' | ||
factory: '0x73025F64A80f5DF7f86b80c597Bc96DdfAdae072', | ||
mainModule: '0x52080556206Ecc3953BA6e280eb1a26b63692829', | ||
mainModuleUpgradable: '0x7520d4b8835CD394ed5BDAa903BD732f5991BF5B', | ||
guestModule: '0x4CE2cf42F93afcdF5378DEAb5Cff011cBEAf309f', | ||
sequenceUtils: '0xCa731e0f33Afbcfa9363d6F7449d1f5447d10C80' | ||
}; | ||
@@ -433,4 +433,6 @@ | ||
reject(error); | ||
} else if (response) { | ||
resolve(response.result); | ||
} else { | ||
resolve(response.result); | ||
resolve(undefined); | ||
} | ||
@@ -531,3 +533,3 @@ }, chainId || this.defaultChainId); | ||
if (this.cachableJsonRpcMethods.includes(request.method)) { | ||
if (response.result) { | ||
if (response && response.result) { | ||
const key = this.cacheKey(request.method, request.params, chainId || this.defaultChainId); | ||
@@ -612,3 +614,3 @@ this.setCacheValue(key, response.result); | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: `${this.props.chainId}` | ||
@@ -625,3 +627,3 @@ }); | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: ethers.utils.hexlify(this.props.chainId) | ||
@@ -638,4 +640,4 @@ }); | ||
jsonrpc: '2.0', | ||
id, | ||
result: [this.props.accountAddress.toLowerCase()] | ||
id: id, | ||
result: [ethers.utils.getAddress(this.props.accountAddress)] | ||
}); | ||
@@ -651,3 +653,3 @@ return; | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: this.props.walletContext | ||
@@ -673,3 +675,3 @@ }); | ||
next(request, (error, response) => { | ||
if (!error && response.error) { | ||
if (!error && response && response.error) { | ||
if (typeof response.error === 'string') { | ||
@@ -715,3 +717,3 @@ throw new Error(response.error); | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: `${networkChainId}` | ||
@@ -724,3 +726,3 @@ }); | ||
jsonrpc: '2.0', | ||
id, | ||
id: id, | ||
result: ethers.utils.hexlify(networkChainId) | ||
@@ -768,3 +770,3 @@ }); | ||
// When provider is configured, send non-private methods to our local public provider | ||
if (this.provider !== null && !this.privateJsonRpcMethods.includes(request.method)) { | ||
if (this.provider && !this.privateJsonRpcMethods.includes(request.method)) { | ||
this.provider.send(request.method, request.params).then(r => { | ||
@@ -786,3 +788,5 @@ callback(undefined, { | ||
this.setRpcUrl(rpcUrl); | ||
if (rpcUrl) { | ||
this.setRpcUrl(rpcUrl); | ||
} | ||
} | ||
@@ -796,4 +800,4 @@ | ||
if (!rpcUrl || rpcUrl === '') { | ||
this.rpcUrl = null; | ||
this.provider = null; | ||
this.rpcUrl = undefined; | ||
this.provider = undefined; | ||
} else { | ||
@@ -800,0 +804,0 @@ this.rpcUrl = rpcUrl; |
@@ -8,4 +8,4 @@ import { JsonRpcHandlerFunc, JsonRpcRequest, JsonRpcResponseCallback, JsonRpcMiddlewareHandler } from '../types'; | ||
constructor(defaultChainId?: number); | ||
sendAsyncMiddleware: (next: JsonRpcHandlerFunc) => (request: JsonRpcRequest, callback: JsonRpcResponseCallback, chainId?: number) => void; | ||
cacheKey: (method: string, params: any[], chainId?: number) => string; | ||
sendAsyncMiddleware: (next: JsonRpcHandlerFunc) => (request: JsonRpcRequest, callback: JsonRpcResponseCallback, chainId?: number | undefined) => void; | ||
cacheKey: (method: string, params: any[], chainId?: number | undefined) => string; | ||
getCache: () => { | ||
@@ -12,0 +12,0 @@ [key: string]: any; |
@@ -11,3 +11,3 @@ import { JsonRpcHandlerFunc, JsonRpcRequest, JsonRpcResponseCallback, JsonRpcMiddlewareHandler } from '../types'; | ||
constructor(props: EagerProviderProps); | ||
sendAsyncMiddleware: (next: JsonRpcHandlerFunc) => (request: JsonRpcRequest, callback: JsonRpcResponseCallback, chainId?: number) => void; | ||
sendAsyncMiddleware: (next: JsonRpcHandlerFunc) => (request: JsonRpcRequest, callback: JsonRpcResponseCallback, chainId?: number | undefined) => void; | ||
} |
@@ -8,4 +8,4 @@ import { JsonRpcHandlerFunc, JsonRpcRequest, JsonRpcResponseCallback, JsonRpcMiddlewareHandler } from '../types'; | ||
sendAsyncMiddleware: (next: JsonRpcHandlerFunc) => (request: JsonRpcRequest, callback: JsonRpcResponseCallback) => void; | ||
getRpcUrl(): string | null; | ||
getRpcUrl(): string | undefined; | ||
setRpcUrl(rpcUrl: string): void; | ||
} |
@@ -6,3 +6,3 @@ import { JsonRpcHandlerFunc, JsonRpcRequest, JsonRpcResponseCallback, JsonRpcMiddlewareHandler, JsonRpcHandler } from '../types'; | ||
constructor(provider: JsonRpcHandler); | ||
sendAsyncMiddleware: (next: JsonRpcHandlerFunc) => (request: JsonRpcRequest, callback: JsonRpcResponseCallback, chainId?: number) => void; | ||
sendAsyncMiddleware: (next: JsonRpcHandlerFunc) => (request: JsonRpcRequest, callback: JsonRpcResponseCallback, chainId?: number | undefined) => void; | ||
} |
@@ -8,3 +8,3 @@ import { JsonRpcProvider, ExternalProvider } from '@ethersproject/providers'; | ||
constructor(provider: JsonRpcProvider | JsonRpcHandler | JsonRpcFetchFunc, defaultChainId?: number); | ||
sendAsync: (request: JsonRpcRequest, callback: JsonRpcResponseCallback | ((error: any, response: any) => void), chainId?: number) => void; | ||
sendAsync: (request: JsonRpcRequest, callback: JsonRpcResponseCallback | ((error: any, response: any) => void), chainId?: number | undefined) => void; | ||
} | ||
@@ -11,0 +11,0 @@ export declare class JsonRpcExternalProvider implements ExternalProvider, JsonRpcHandler { |
@@ -0,5 +1,6 @@ | ||
import { ethers } from 'ethers'; | ||
import { NetworkConfig, Networks, NetworksBuilder, ChainId } from './config'; | ||
export declare function isNetworkConfig(cand: any): cand is NetworkConfig; | ||
export declare const getNetworkId: (chainId: ChainId) => number; | ||
export declare const maybeNetworkId: (chainId?: ChainId) => number | undefined; | ||
export declare const maybeNetworkId: (chainId?: string | number | NetworkConfig | ethers.BigNumber | ethers.utils.Bytes | undefined) => number | undefined; | ||
export declare const getAuthNetwork: (networks: NetworkConfig[]) => NetworkConfig | undefined; | ||
@@ -9,8 +10,8 @@ export declare const isValidNetworkConfig: (networkConfig: NetworkConfig | NetworkConfig[], raise?: boolean, skipRelayerCheck?: boolean) => boolean; | ||
export declare const ensureUniqueNetworks: (networks: NetworkConfig[], raise?: boolean) => boolean; | ||
export declare const sortNetworks: (networks: Networks, defaultChainId?: string | number) => Networks; | ||
export declare const sortNetworks: (networks: Networks, defaultChainId?: string | number | undefined) => Networks; | ||
export declare const updateNetworkConfig: (src: Partial<NetworkConfig>, dest: NetworkConfig) => void; | ||
export declare const createNetworkConfig: (networks: Networks | NetworksBuilder, defaultChainId?: number, vars?: { | ||
export declare const createNetworkConfig: (networks: Networks | NetworksBuilder, defaultChainId?: number | undefined, vars?: { | ||
[key: string]: any; | ||
}) => Networks; | ||
export declare const findNetworkConfig: (networks: NetworkConfig[], chainId: ChainId) => NetworkConfig; | ||
} | undefined) => Networks; | ||
export declare const findNetworkConfig: (networks: NetworkConfig[], chainId: ChainId) => NetworkConfig | undefined; | ||
export declare const checkNetworkConfig: (network: NetworkConfig, networkId: string | number) => boolean; | ||
@@ -17,0 +18,0 @@ export declare const networksIndex: (networks: NetworkConfig[]) => { |
{ | ||
"name": "@0xsequence/network", | ||
"version": "0.9.6", | ||
"version": "0.10.0", | ||
"description": "network sub-package for Sequence", | ||
@@ -16,3 +16,3 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/network", | ||
"dependencies": { | ||
"@0xsequence/utils": "^0.9.6", | ||
"@0xsequence/utils": "^0.10.0", | ||
"@ethersproject/providers": "^5.0.20", | ||
@@ -19,0 +19,0 @@ "ethers": "^5.0.31" |
@@ -15,7 +15,7 @@ // WalletContext is the module addresses deployed on a network, aka the context / environment | ||
export const sequenceContext: WalletContext = { | ||
factory: '0x6813Da82a84e31f98824146a50d9Ba0Fbd4cbF14', | ||
mainModule: '0xBf7aa3d072d4052D894cDd32EC818B02D9ba4FeC', | ||
mainModuleUpgradable: '0xc97c6276702A89741F2313d2F8fC9C7D4dC86128', | ||
guestModule: '0xd1345a45Cc1Dc792389a85d722CB911118Bb52Ef', | ||
sequenceUtils: '0x6fA52553CCFB101f26d55a7342F84A10e1054E58' | ||
factory: '0x73025F64A80f5DF7f86b80c597Bc96DdfAdae072', | ||
mainModule: '0x52080556206Ecc3953BA6e280eb1a26b63692829', | ||
mainModuleUpgradable: '0x7520d4b8835CD394ed5BDAa903BD732f5991BF5B', | ||
guestModule: '0x4CE2cf42F93afcdF5378DEAb5Cff011cBEAf309f', | ||
sequenceUtils: '0xCa731e0f33Afbcfa9363d6F7449d1f5447d10C80' | ||
} |
@@ -25,3 +25,3 @@ import { JsonRpcHandlerFunc, JsonRpcRequest, JsonRpcResponse, JsonRpcResponseCallback, JsonRpcMiddlewareHandler } from '../types' | ||
if (this.cachableJsonRpcMethods.includes(request.method)) { | ||
const key = this.cacheKey(request.method, request.params, chainId || this.defaultChainId) | ||
const key = this.cacheKey(request.method, request.params!, chainId || this.defaultChainId) | ||
const result = this.getCacheValue(key) | ||
@@ -31,3 +31,3 @@ if (result && result !== '') { | ||
jsonrpc: '2.0', | ||
id: request.id, | ||
id: request.id!, | ||
result: result | ||
@@ -43,4 +43,4 @@ }) | ||
if (this.cachableJsonRpcMethods.includes(request.method)) { | ||
if (response.result) { | ||
const key = this.cacheKey(request.method, request.params, chainId || this.defaultChainId) | ||
if (response && response.result) { | ||
const key = this.cacheKey(request.method, request.params!, chainId || this.defaultChainId) | ||
this.setCacheValue(key, response.result) | ||
@@ -47,0 +47,0 @@ } |
@@ -32,3 +32,3 @@ import { ethers } from 'ethers' | ||
if (this.props.chainId) { | ||
callback(undefined, { jsonrpc: '2.0', id, result: `${this.props.chainId}` }) | ||
callback(undefined, { jsonrpc: '2.0', id: id!, result: `${this.props.chainId}` }) | ||
return | ||
@@ -40,3 +40,3 @@ } | ||
if (this.props.chainId) { | ||
callback(undefined, { jsonrpc: '2.0', id, result: ethers.utils.hexlify(this.props.chainId) }) | ||
callback(undefined, { jsonrpc: '2.0', id: id!, result: ethers.utils.hexlify(this.props.chainId) }) | ||
return | ||
@@ -48,3 +48,3 @@ } | ||
if (this.props.accountAddress) { | ||
callback(undefined, { jsonrpc: '2.0', id, result: [this.props.accountAddress.toLowerCase()] }) | ||
callback(undefined, { jsonrpc: '2.0', id: id!, result: [ethers.utils.getAddress(this.props.accountAddress)] }) | ||
return | ||
@@ -56,3 +56,3 @@ } | ||
if (this.props.walletContext) { | ||
callback(undefined, { jsonrpc: '2.0', id, result: this.props.walletContext }) | ||
callback(undefined, { jsonrpc: '2.0', id: id!, result: this.props.walletContext }) | ||
return | ||
@@ -59,0 +59,0 @@ } |
@@ -7,3 +7,3 @@ import { JsonRpcHandlerFunc, JsonRpcRequest, JsonRpcResponse, JsonRpcResponseCallback, JsonRpcMiddleware } from '../types' | ||
if (!error && response.error) { | ||
if (!error && response && response.error) { | ||
if (typeof(response.error) === 'string') { | ||
@@ -10,0 +10,0 @@ throw new Error(response.error) |
@@ -13,7 +13,7 @@ import { ethers } from 'ethers' | ||
case 'net_version': | ||
callback(undefined, { jsonrpc: '2.0', id, result: `${networkChainId}` }) | ||
callback(undefined, { jsonrpc: '2.0', id: id!, result: `${networkChainId}` }) | ||
return | ||
case 'eth_chainId': | ||
callback(undefined, { jsonrpc: '2.0', id, result: ethers.utils.hexlify(networkChainId) }) | ||
callback(undefined, { jsonrpc: '2.0', id: id!, result: ethers.utils.hexlify(networkChainId) }) | ||
return | ||
@@ -20,0 +20,0 @@ |
@@ -15,3 +15,5 @@ import { JsonRpcProvider } from '@ethersproject/providers' | ||
constructor(rpcUrl?: string) { | ||
this.setRpcUrl(rpcUrl) | ||
if (rpcUrl) { | ||
this.setRpcUrl(rpcUrl) | ||
} | ||
} | ||
@@ -22,7 +24,7 @@ | ||
// When provider is configured, send non-private methods to our local public provider | ||
if (this.provider !== null && !this.privateJsonRpcMethods.includes(request.method)) { | ||
this.provider.send(request.method, request.params).then(r => { | ||
if (this.provider && !this.privateJsonRpcMethods.includes(request.method)) { | ||
this.provider.send(request.method, request.params!).then(r => { | ||
callback(undefined, { | ||
jsonrpc: '2.0', | ||
id: request.id, | ||
id: request.id!, | ||
result: r | ||
@@ -40,3 +42,3 @@ }) | ||
getRpcUrl(): string | null { | ||
getRpcUrl() { | ||
return this.rpcUrl | ||
@@ -47,4 +49,4 @@ } | ||
if (!rpcUrl || rpcUrl === '') { | ||
this.rpcUrl = null | ||
this.provider = null | ||
this.rpcUrl = undefined | ||
this.provider = undefined | ||
} else { | ||
@@ -51,0 +53,0 @@ this.rpcUrl = rpcUrl |
@@ -31,4 +31,6 @@ import { JsonRpcProvider, ExternalProvider } from '@ethersproject/providers' | ||
reject(error) | ||
} else if (response) { | ||
resolve(response.result) | ||
} else { | ||
resolve(response.result) | ||
resolve(undefined) | ||
} | ||
@@ -67,3 +69,3 @@ }, chainId || this.defaultChainId) | ||
this.provider | ||
.send(request.method, request.params) | ||
.send(request.method, request.params!) | ||
.then(r => { | ||
@@ -70,0 +72,0 @@ callback(undefined, { |
@@ -205,6 +205,6 @@ import { ethers, BigNumberish } from 'ethers' | ||
let config: NetworkConfig[] = [] | ||
if (typeof(networks) === 'function') { | ||
if (typeof(networks) === 'function' && vars) { | ||
config = networks(vars) | ||
} else { | ||
config = networks | ||
config = networks as Networks | ||
} | ||
@@ -225,3 +225,3 @@ | ||
export const findNetworkConfig = (networks: NetworkConfig[], chainId: ChainId): NetworkConfig => { | ||
export const findNetworkConfig = (networks: NetworkConfig[], chainId: ChainId): NetworkConfig | undefined => { | ||
if (typeof chainId === 'string') { | ||
@@ -228,0 +228,0 @@ if (chainId.startsWith('0x')) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114877
3031
+ Added@0xsequence/utils@0.10.9(transitive)
+ Added@ethersproject/abstract-signer@5.0.14(transitive)
- Removed@0xsequence/utils@0.9.6(transitive)
- Removed@ethersproject/abstract-signer@5.0.12(transitive)
Updated@0xsequence/utils@^0.10.0