Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/mask/src/plugins/EVM/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
PLUGIN_DESCRIPTION,
PLUGIN_PROVIDERS,
PLUGIN_NETWORKS,
PLUGIN_APPLICATIONS,
PLUGIN_APPLICATION_CATEGORIES,
} from './constants'

Expand All @@ -21,9 +20,7 @@ export const base: Plugin.Shared.Definition = {
networks: { type: 'opt-out', networks: {} },
target: 'stable',
},
declareApplications: PLUGIN_APPLICATIONS,
declareApplicationCategories: PLUGIN_APPLICATION_CATEGORIES,
declareWeb3Networks: PLUGIN_NETWORKS,
declareWeb3Providers: PLUGIN_PROVIDERS,
}
;('')
7 changes: 0 additions & 7 deletions packages/mask/src/plugins/EVM/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,6 @@ export const PLUGIN_PROVIDERS: Web3Plugin.ProviderDescriptor[] = [
icon: new URL('./assets/fortmatic.png', import.meta.url),
},
]
export const PLUGIN_APPLICATIONS: Web3Plugin.ApplicationDescriptor[] = [
{
ID: `${PLUGIN_ID}_application_redpacket`,
name: 'Lucky Drop',
icon: new URL('./assets/lucky_drop.png', import.meta.url),
},
]
export const PLUGIN_APPLICATION_CATEGORIES: Web3Plugin.ApplicationCategoryDescriptor[] = [
{
ID: `${PLUGIN_ID}_category_nfts`,
Expand Down
27 changes: 25 additions & 2 deletions packages/plugin-infra/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ export namespace Plugin.Shared {
declareWeb3Networks?: Web3Plugin.NetworkDescriptor[]
/** Introduce wallet providers information. */
declareWeb3Providers?: Web3Plugin.ProviderDescriptor[]
/** Introduce application information. */
declareApplications?: Web3Plugin.ApplicationDescriptor[]
/** Introduce application category information. */
declareApplicationCategories?: Web3Plugin.ApplicationCategoryDescriptor[]
}
Expand Down Expand Up @@ -203,6 +201,8 @@ export namespace Plugin.SNSAdaptor {
CompositionDialogMetadataBadgeRender?: CompositionMetadataBadgeRender
/** This UI will be rendered as an entry in the toolbar (if the SNS has a Toolbar support) */
ToolbarEntry?: ToolbarEntry
/** This UI will be rendered as an entry in the wallet status dialog */
ApplicationEntry?: ApplicationEntry
}
//#region Composition entry
/**
Expand Down Expand Up @@ -279,6 +279,29 @@ export namespace Plugin.SNSAdaptor {
onClick: 'openCompositionEntry'
}
//#endregion

export interface ApplicationEntry {
/**
* The icon image URL
*/
icon: URL
/**
* The name of the application
*/
label: I18NStringField | string
/**
* Also an entrance in a sub-folder
*/
categoryID?: string
/**
* Used to order the applications on the board
*/
priority: number
/**
* What to do if the application icon is clicked.
*/
onClick(): void
}
}

/** This part runs in the dashboard */
Expand Down
18 changes: 0 additions & 18 deletions packages/plugin-infra/src/web3-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,6 @@ export declare namespace Web3Plugin {
name: string
}

export interface ApplicationDescriptor {
/** An unique ID for each application */
ID: string
/** A sub-category defined by each network plugin */
categoryID?: string
/** The application icon */
icon: URL
/** The application name */
name: string
}

export interface CryptoPrice {
[token: string]: {
[key in CurrencyType]?: number
Expand Down Expand Up @@ -331,11 +320,6 @@ export declare namespace Web3Plugin {
onClick?: (network: NetworkDescriptor, provider: ProviderDescriptor) => void
onSubmit?: (network: NetworkDescriptor, provider: ProviderDescriptor) => void
}
export interface ApplicationIconClickBaitProps {
application: ApplicationDescriptor
category?: ApplicationCategoryDescriptor
}

export interface ApplicationCategoryIconClickBaitProps {
category: ApplicationCategoryDescriptor
}
Expand All @@ -355,8 +339,6 @@ export declare namespace Web3Plugin {
ProviderIconClickBait?: Plugin.InjectUIReact<UI.ProviderIconClickBaitProps>
}
WalletStatusDialog?: {
/** This UI will receive application icon as children component, and the plugin may hook click handle on it. */
ApplicationIconClickBait?: Plugin.InjectUIReact<UI.ApplicationIconClickBaitProps>
/** This UI will receive application category icon as children component, and the plugin may hook click handle on it. */
ApplicationCategoryIconClickBait?: Plugin.InjectUIReact<UI.ApplicationCategoryIconClickBaitProps>
}
Expand Down
1 change: 0 additions & 1 deletion packages/plugins/Flow/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const base: Plugin.Shared.Definition = {
target: 'beta',
},
i18n: languages,
declareApplications: [],
declareApplicationCategories: [],
declareWeb3Networks: PLUGIN_NETWORKS,
declareWeb3Providers: PLUGIN_PROVIDERS,
Expand Down