Skip to content

Commit 24aa2b8

Browse files
feat: add allowExperimentalNetworks option in IExecConfig
1 parent cc8c8d6 commit 24aa2b8

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

docs/interfaces/IExecConfigOptions.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### Properties
88

9+
- [allowExperimentalNetworks](IExecConfigOptions.md#allowexperimentalnetworks)
910
- [bridgeAddress](IExecConfigOptions.md#bridgeaddress)
1011
- [bridgedNetworkConf](IExecConfigOptions.md#bridgednetworkconf)
1112
- [confirms](IExecConfigOptions.md#confirms)
@@ -25,6 +26,16 @@
2526

2627
## Properties
2728

29+
### allowExperimentalNetworks
30+
31+
`Optional` **allowExperimentalNetworks**: `boolean`
32+
33+
if true allows using a provider connected to an experimental networks (default false)
34+
35+
⚠️ experimental networks are networks on which the iExec's stack is partially deployed, experimental networks can be subject to instabilities or discontinuity. Access is provided without warranties.
36+
37+
___
38+
2839
### bridgeAddress
2940

3041
`Optional` **bridgeAddress**: `string`

src/lib/IExecConfig.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ export interface IExecConfigOptions {
118118
* [ethers default provider](https://docs.ethers.io/v5/api/providers/#providers-getDefaultProvider) options
119119
*/
120120
providerOptions?: ProviderOptions | AnyRecord;
121+
/**
122+
* if true allows using a provider connected to an experimental networks (default false)
123+
*
124+
* ⚠️ experimental networks are networks on which the iExec's stack is partially deployed, experimental networks can be subject to instabilities or discontinuity. Access is provided without warranties.
125+
*/
126+
allowExperimentalNetworks?: boolean;
121127
}
122128

123129
/**

src/lib/IExecConfig.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default class IExecConfig {
3333
voucherSubgraphURL,
3434
defaultTeeFramework,
3535
providerOptions,
36+
allowExperimentalNetworks = false,
3637
} = {},
3738
) {
3839
if (
@@ -130,7 +131,10 @@ export default class IExecConfig {
130131

131132
const chainConfDefaultsPromise = (async () => {
132133
const { chainId } = await networkPromise;
133-
return getChainDefaults({ id: chainId });
134+
return getChainDefaults({
135+
id: chainId,
136+
allowExperimental: allowExperimentalNetworks,
137+
});
134138
})();
135139

136140
chainConfDefaultsPromise.catch((err) => {
@@ -182,6 +186,7 @@ export default class IExecConfig {
182186
}
183187
const bridgedChainConfDefaults = getChainDefaults({
184188
id: bridgedChainId,
189+
allowExperimental: allowExperimentalNetworks,
185190
});
186191
const bridgedRpcUrl =
187192
bridgedNetworkConf.rpcURL !== undefined

0 commit comments

Comments
 (0)