🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@oko-wallet/ewallet-sdk-eth

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oko-wallet/ewallet-sdk-eth

latest
Source
npmnpm
Version
0.0.6-rc.116
Version published
Maintainers
3
Created
Source

ewallet_sdk_eth

  • This package is a variant of @oko-wallet/ewallet-sdk-core for Ethereum.
  • It provides a way to interact with Ethereum wallets using @oko-wallet/ewallet-sdk-core.

Example

Create Wallet

import { initKeplrEwallet } from "@oko-wallet/ewallet-sdk-core";
import { initEthEWallet } from "@oko-wallet/ewallet-sdk-eth";

const eWallet = await initKeplrEwallet({
  element_id: "oko-wallet",
});

const ethEWallet = await initEthEWallet({
  eWallet,
});

Get Provider

const provider = await ethEWallet.getEthereumProvider();
const chainId = await provider.request({
  method: "eth_chainId",
});

Viem Integration

  • Create a viem account
const account = await toViemAccount(eWallet);
  • Create a viem client
import { createPublicClient, createWalletClient, custom } from "viem";

const provider = await ethEWallet.getEthereumProvider();

const publicClient = createPublicClient({
  chain: sepolia,
  transport: custom(provider),
});

const walletClient = createWalletClient({
  account: (
    await provider.request({
      method: "eth_accounts",
    })
  )[0],
  chain: sepolia,
  transport: custom(provider),
});

Ethers Integration

import { BrowserProvider } from "ethers";

const provider = new BrowserProvider(await ethEWallet.getEthereumProvider());

const blockNumber = await provider.getBlockNumber();

const signer = await provider.getSigner();

const signature = await signer.signMessage("Hello, world!");

Create Provider only

import { initEWalletEIP1193Provider } from "@oko-wallet/ewallet-sdk-eth";

const provider = await initEWalletEIP1193Provider({
  id: "oko-wallet",
});

or create a provider manually

import { initEWalletEIP1193Provider } from "@oko-wallet/ewallet-sdk-eth";

const provider = new EWalletEIP1193Provider({
  id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
  chains: [
    {
      chainId: "0x1",
      chainName: "Ethereum Mainnet",
      nativeCurrency: {
        name: "Ether",
        symbol: "ETH",
        decimals: 18,
      },
      rpcUrls: ["https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID"],
      blockExplorerUrls: ["https://etherscan.io"],
    },
  ],
});

Tests

$ yarn test
$ yarn test:debug
$ yarn test:watch
$ yarn test:coverage

Keywords

keplr

FAQs

Package last updated on 24 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts