Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 952 Bytes

MISTAPI.md

File metadata and controls

30 lines (21 loc) · 952 Bytes

Mist API

Using the Provider

An Ethereum Provider as specified in EIP-1193 is available on window.ethereum.

Call window.ethereum.enable() to enable a full provider with authenticated account(s). It returns a promise that resolves with an array of the authenticated accounts' public key(s), or rejects with error 4001: User Denied Full Provider.

window.mist.createAccount

window.mist.createAccount(): Promise<String>

Opens the Create Account dialog in Mist.

Returns a promise that resolves with the new account's public key, or rejects with an Error object.

Example

window.mist
  .createAccount()
  .then(account => {
    console.log(`New account: ${account}`);
  })
  .catch(error => {
    console.error(`Error creating new account: ${error}`);
  });