Class: MetaMaskSigner
The MetaMaskSigner is a class that allows for signing data using MetaMask. This signer can only be used inside a browser.
Example
import { MetaMaskSigner } from '@nilfoundation/niljs';
const signer = new MetaMaskSigner();
Implements
Constructors
new MetaMaskSigner()
new MetaMaskSigner(): MetaMaskSigner
Creates an instance of MetaMaskSigner.
Returns
Defined
@nilfoundation/niljs/src/signers/MetmaskSigner.ts:25
Methods
connect()
connect(): Promise<void>
Connects the signer to an existing MetaMask wallet.
Returns
Promise
<void
>
Async
Defined
@nilfoundation/niljs/src/signers/MetmaskSigner.ts:83
getAddress()
getAddress(): Promise<Uint8Array>
Retrieves the wallet address.
Returns
Promise
<Uint8Array
>
Async
Implementation of
Defined
@nilfoundation/niljs/src/signers/MetmaskSigner.ts:59
getPublicKey()
getPublicKey(): Promise<Uint8Array>
Retreieves the public key.
Returns
Promise
<Uint8Array
>
Async
Implementation of
Defined
@nilfoundation/niljs/src/signers/MetmaskSigner.ts:71
sign()
sign(data): Promise<Uint8Array>
Signs the data.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The input data. |
Returns
Promise
<Uint8Array
>
The signed data.
Async
Implementation of
Defined
@nilfoundation/niljs/src/signers/MetmaskSigner.ts:47