Constructors
constructor
- new HarmonyExtension(wallet: ExtensionInterface, config?: HarmonyConfig): HarmonyExtension
-
Parameters
-
wallet: ExtensionInterface
-
Default value config: HarmonyConfig = {chainId: utils.defaultConfig.Default.Chain_ID,chainType: utils.defaultConfig.Default.Chain_Type,}
Methods
isExtension
- isExtension(wallet: ExtensionInterface): void
-
Parameters
-
wallet: ExtensionInterface
Returns void
login
- login(): Promise<ExtensionAccount>
-
Returns Promise<ExtensionAccount>
logout
-
Returns Promise<void>
setProvider
-
Parameters
Returns void
setShardID
- setShardID(shardID: number): void
-
Parameters
Returns void
shardingStructures
- shardingStructures(shardingStructures: ShardingItem[]): void
-
Parameters
-
shardingStructures: ShardingItem[]
Returns void
Create an blockchain instance support wallet injection
// Using Mathwallet instance export const initEx = async() => { hmyEx = new HarmonyExtension(window.harmony); } // Using OneWallet instance export const initEx = async() => { hmyEx = new HarmonyExtension(window.onewallet); }