-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
53 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { StorageCallback } from 'store/storage'; | ||
import { CustomNetworkType } from 'types/network.types'; | ||
import { EnvironmentsEnum } from 'types/enums.types'; | ||
import { NativeAuthConfigType } from 'services/nativeAuth/nativeAuth.types'; | ||
|
||
type BaseDappConfigType = { | ||
/** | ||
* The native auth configuration for the dApp. | ||
* If set to `true`, will fallback on default configuration. | ||
* If set to `false`, will disable native auth. | ||
* If set to `NativeAuthConfigType`, will set the native auth configuration. | ||
*/ | ||
nativeAuth?: boolean | NativeAuthConfigType; | ||
}; | ||
|
||
export type EnvironmentDappConfigType = BaseDappConfigType & { | ||
/** | ||
* If passed in, will automatically initialize the network with the given environment. | ||
*/ | ||
environment: EnvironmentsEnum; | ||
network?: CustomNetworkType; | ||
}; | ||
|
||
export type CustomNetworkDappConfigType = BaseDappConfigType & { | ||
/** | ||
* Can override the network configuration, e.g. for sovereign shards. | ||
* Must include `apiAddress` if provided. | ||
*/ | ||
network: CustomNetworkType & { apiAddress: string }; | ||
environment?: never; | ||
}; | ||
|
||
export type DappConfigType = | ||
| EnvironmentDappConfigType | ||
| CustomNetworkDappConfigType; | ||
|
||
export type InitAppType = { | ||
/** | ||
* The storage configuration for the dApp. | ||
*/ | ||
storage?: { | ||
/** | ||
* The callback to get the storage (custom storage). | ||
*/ | ||
getStorageCallback: StorageCallback; | ||
}; | ||
dAppConfig: DappConfigType; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters