Dev Guide V2 - Sei DApps V2 Integration

Welcome to Fin Extension Wallet Developer Guide. This documentation contains guides for developers to get started developing on Fin Extension Wallet.‌


The easiest way to connect to Fin Wallet

Check if the provider is window.fin.provider, if not, please replace it with the exclusive Fin Wallet provider window.fin.provider.

For example, see below:

function getProvider() {
  const provider = window.fin.provider;
  if (!provider) {
  return provider;

To detect Fin Wallet Extension

if(window.fin.provider ){
    console.log('Fin Extension is installed!');

To connect Fin Extension Wallet

To connect Fin Extension means to access the user's [blockchain - like Ethereum] account(s).

Access a user's accounts

We recommend providing a button to allow users to connect Fin Wallet to your dapp. Selecting this button should call eth_requestAccounts to access the user's accounts.

//Alias for connection
window.fin.provider.request({method: 'eth_requestAccounts'});​

Handle accounts

Use the eth_accounts RPC method to handle user accounts. Listen to the accountsChanged provider event to be notified when the user changes accounts.

// Connect & get accounts
window.fin.provider.request({method: 'eth_accounts'});

To check if Dapp connected


To disconnect Fin Extension Wallet

To disconnect Fin Extension, please use:


To experience functions

Once your account is connected, let's start experiencing more functions.‌


How to get Current Account

return Promise<Array[String]>

  • If wallet can not be found, return [] instead of throw Error

window.fin.provider.request({ method: 'eth_accounts' }).then(accounts => {
  if (accounts[0]) {
    // Do something with accounts
  } else {
    // Wallet not found

Sign Transaction


eth_signTypedData_v1, and eth_signTypedData_v3 are deprecated. We highly recommend user to use eth_signTypedData_v4 or personal_sign.


personal_sign provides a simple means to request signatures that are human-readable and don't require efficient processing on-chain. It's commonly used for signature challenges authenticated on a web server.

Fin Wallet implements both personal_sign and eth_sign. You might need to check what method your supported signers use for a given implementation.

method: 'personal_sign',
params: [msg, from],


eth_signTypedData_v4 offers highly legible signatures that can be processed efficiently on-chain. Adheres to the EIP-712 standard, enabling users to sign sign typed structured data that can be confirmed on-chain.

  const msgParams = JSON.stringify({
    domain: {
      chainId: 0x58,
      name: 'Ether Mail',
      verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
      version: '1',

    message: {
      contents: 'Hello, Bob!',
      attachedMoneyInEth: 4.2,
      from: {
        name: 'Cow',
        wallets: [
      to: [
          name: 'Bob',
          wallets: [
    primaryType: 'Mail',
    types: {
      EIP712Domain: [
        { name: 'name', type: 'string' },
        { name: 'version', type: 'string' },
        { name: 'chainId', type: 'uint256' },
        { name: 'verifyingContract', type: 'address' },
      Group: [
        { name: 'name', type: 'string' },
        { name: 'members', type: 'Person[]' },
      Mail: [
        { name: 'from', type: 'Person' },
        { name: 'to', type: 'Person[]' },
        { name: 'contents', type: 'string' },
      Person: [
        { name: 'name', type: 'string' },
        { name: 'wallets', type: 'address[]' },


Gas limit​ : is an optional parameter, since Fin Wallet automatically calculates a reasonable gas price.

chainid: The chain ID is derived from the user's current selected network at window.fin.provider.net_version.


personal_ecRecover returns the address associated with the private key that was used to calculate a signature.

method: 'personal_ecRecover',
params: [message, signature],


This method requires that the user has granted permission to interact with their account first, so please make sure to call eth_requestAccounts or wallet_requestPermissions first.


return Promise<hash>

  method: 'eth_sendTransaction',
  params: [
      from: 'string',
      to: 'string',
      gas: 'string',
      gasPrice: 'string',
      value: 'string',
      data: 'string',
      nonce: 'string'

Decrypt & Encrypt


Requests that Fin Wallet decrypt the specified encrypted message.

  • The message must have been encrypted using the public encryption key of the specified Ethereum address.

return Promise<string>

  method: 'eth_decrypt',
  params: [encryptedMessage, accounts[0]],
   .then((decryptedMessage) =>
    console.log('The decrypted message is:', decryptedMessage)
  .catch((error) => console.log(error.message));


Requests that the user share their public encryption key. Returns a public encryption key, or rejects if the user denies the request.

return Promise<string>- The public encryption key of the Ethereum account whose encryption key should be retrived

let encryptionPublicKey
  method: 'eth_getEncryptionPublicKey',
  params: [accounts[0]], // you must have access to the specified account
  .then((result) => {
    encryptionPublicKey = result;
  .catch((error) => {
    if (error.code === 4001) {
      // EIP-1193 userRejectedRequest error
      console.log("We can't encrypt anything without the key.");
    } else {


const ethUtil = require('ethereumjs-util');
const encryptedMessage = ethUtil.bufferToHex(

          publicKey: encryptionPublicKey,
          data: 'hello world!,
          version: 'x25519-xsalsa20-poly1305',

List of events

Currently we only support some action event from wallet extension

window.ethereum.on('event_name', callback);


window.fin.provider.on('disconnect', () => window.location.reload());

window.fin.provider.on('accountsChanged', () => window.location.reload());




Receive when active account changed in Extension


When active account remove connection with Dapp


Receive when active network changed in Extension



on(event, callback)

Add event listener

off(event, callback)

Remove event listener

Last updated