-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add new type in api - settings in order to support different types of… #476
Changes from 6 commits
7b1f70e
aa48a54
0404d5d
1f1d610
631d33e
c6497d6
50ad848
e55346b
02e2977
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,11 @@ | |
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { Settings, settings } from './Settings'; | ||
import { Endpoint, EndpointType, JsonRpcEndpoint, SubstrateConnectEndpoint } from './types'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
export { ENDPOINT_DEFAULT, ICON_DEFAULT, ICON_DEFAULT_HOST, LANGUAGE_DEFAULT, LOCKING_DEFAULT, PREFIX_DEFAULT, UIMODE_DEFAULT, UITHEME_DEFAULT } from './defaults'; | ||
export { packageInfo } from './packageInfo'; | ||
|
||
export { settings, Settings }; | ||
export { settings, Settings, Endpoint, JsonRpcEndpoint, SubstrateConnectEndpoint, EndpointType }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the type exports here. (We always only have the types in |
||
|
||
export default settings; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ export type Option = { | |
} | ||
|
||
export interface SettingsStruct { | ||
apiType: Endpoint; | ||
apiUrl: string; | ||
camera: string; | ||
i18nLang: string; | ||
|
@@ -28,3 +29,19 @@ export interface NetworkSpecsStruct { | |
title: string; | ||
unit: string; | ||
} | ||
|
||
export type Endpoint = JsonRpcEndpoint | SubstrateConnectEndpoint; | ||
export interface JsonRpcEndpoint { | ||
type: EndpointType.jrpc; | ||
url: string; | ||
} | ||
|
||
export interface SubstrateConnectEndpoint { | ||
type: EndpointType.substrateconnect; | ||
chain: string; | ||
} | ||
|
||
export enum EndpointType { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the enum, it is hugely problematic (polkadot-js doesn't use these at all) -
This is sufficient: |
||
jrpc = 'json-rpc', | ||
substrateconnect = 'substrate-connect' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to be
import type