diff --git a/packages/plugin-infra/src/web3-types.ts b/packages/plugin-infra/src/web3-types.ts index ea66110d55ff..4e428c0b264a 100644 --- a/packages/plugin-infra/src/web3-types.ts +++ b/packages/plugin-infra/src/web3-types.ts @@ -21,6 +21,12 @@ export enum TokenType { NonFungible = 'NonFungible', } +type ColorRGB = `rgb(${number}, ${number}, ${number})` +type ColorRGBA = `rgba(${number}, ${number}, ${number}, ${number})` +type ColorHEX = `#${string}${string}${string}${string}${string}${string}` | `#${string}${string}${string}` +type ColorHSL = `hsl(${number}, ${number}%, ${number}%)` +type Color = ColorRGB | ColorRGBA | ColorHEX | ColorHSL + export declare namespace Web3Plugin { /** * Plugin can declare what chain it supports to trigger side effects (e.g. create a new transaction). @@ -47,7 +53,7 @@ export declare namespace Web3Plugin { /** The network icon */ icon: URL /** The network icon in fixed color */ - iconColor: string + iconColor: Color /** The network name */ name: string /** Is a mainnet network */ diff --git a/packages/plugins/Flow/src/constants.ts b/packages/plugins/Flow/src/constants.ts index b457746f1391..f9a5a1532d48 100644 --- a/packages/plugins/Flow/src/constants.ts +++ b/packages/plugins/Flow/src/constants.ts @@ -14,7 +14,7 @@ export const PLUGIN_NETWORKS: Web3Plugin.NetworkDescriptor[] = [ type: NetworkType.Flow, name: 'Flow', icon: new URL('./assets/flow.png', import.meta.url), - iconColor: 'rgb(54 173 104)', + iconColor: 'rgb(54, 173, 104)', isMainnet: true, }, { @@ -24,7 +24,7 @@ export const PLUGIN_NETWORKS: Web3Plugin.NetworkDescriptor[] = [ type: NetworkType.Flow, name: 'Flow Testnet', icon: new URL('./assets/flow.png', import.meta.url), - iconColor: 'rgb(54 173 104)', + iconColor: 'rgb(54, 173, 104)', isMainnet: false, }, ]