Socket
Book a DemoInstallSign in
Socket

@polymarket/abstract-signer

Package Overview
Dependencies
Maintainers
11
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polymarket/abstract-signer

Abstraction over the ethers v5 Wallet, ethers v5 JsonRpcSigner or Viem WalletClient

latest
npmnpm
Version
0.0.5
Version published
Weekly downloads
373
-21.8%
Maintainers
11
Weekly downloads
 
Created
Source

abstract-signer

Abstraction over the ethers v5 Wallet, ethers v5 JsonRpcSigner or Viem WalletClient

Installation

pnpm install @polymarket/abstract-signer

Usage

import { ethers } from "ethers";
import { createWalletClient, http} from "viem";
import { privateKeyToAccount } from 'viem/accounts';

import { createAbstractSigner, IAbstractSigner, Transaction } from "@polymarket/abstract-signer";

const chainId = parseInt(`${process.env.CHAIN_ID}`);

// ethers
// Instantiate an ethers Wallet
const provider = new ethers.providers.JsonRpcProvider(`${process.env.RPC_URL}`);
const pk = new ethers.Wallet(`${process.env.PK}`);
const wallet = pk.connect(provider);

// viem
// Instantiate a Viem wallet
const account = privateKeyToAccount(`${process.env.PK}`);
const wallet = createWalletClient({
    account: account,
    transport: http(`${process.env.RPC_URL}`)
});


const abstractSigner: IAbstractSigner = createAbstractSigner(chainId, wallet);

const tx : Transaction = {
    to: await abstractSigner.getAddress(),
    value: 10000000000000000n,
    gasPrice: 100000000000n,
};

const txHash = await abstractSigner.sendTransaction(tx);
console.log(`Tx hash: ${txHash}`);
const receipt = await abstractSigner.waitTillMined(txHash);

console.log(receipt);

FAQs

Package last updated on 29 Jun 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