Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@samanager/sdk

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@samanager/sdk

A TypeScript SDK that enables integration of Smart Account Manager into your Dapp

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
15
-6.25%
Maintainers
1
Weekly downloads
 
Created
Source

SAManager SDK

  • Demo: https://johnson86tw.github.io/dapp5792/
  • Example Code: https://github.com/johnson86tw/dapp5792/blob/main/src/App.vue
  • Standards:

Usage

  • Install the library
npm install @samanager/sdk
  • Create the wallet provider
import { announceSAManagerProvider, SAManagerProvider } from '@samanager/sdk'
// announce EIP-6963 provider
announceSAManagerProvider({
    origin: "https://testnet.samanager.xyz", // optional; default is https://samanager.xyz
    debug: true, // optional; will print console.log
})

// or use the provider directly
const provider = new SAManagerProvider({
    origin: 'https://testnet.samanager.xyz',
})
  • RPC Methods
await provider.request({
    method: 'eth_requestAccounts',
    params: [],
})

await provider.request({
    method: 'eth_chainId',
    params: [],
})

await provider.request({
    method: 'eth_getBlockByNumber',
    params: ['latest', false],
})

await provider.request({
    method: 'wallet_switchEthereumChain',
    params: [{ chainId }],
})

// EIP-5792 & ERC-7677

await provider.request({
    method: 'wallet_getCapabilities',
    params: [from, [chainId]], // the second parameter (chainId) is optional
})

const callIdentifier = await provider.request({
    method: 'wallet_sendCalls',
    params: [
        {
            version: '2.0',
            chainId,
            from,
            atomicRequired: true,
            calls: [
                {
                    to: '0x96e44D241D3A6B069C3DF4e69DE28Ea098805b18',
                    value: '0x0',
                    data: '0xd09de08a',
                },
            ],
            capabilities: {
                paymasterService: {
                    url: "",
                    context: {
                        name: "",
                        icon: "",
                        sponsorshipPolicyId: ""
                    },
                },
            },
        },
    ],
})

await provider.request({
    method: 'wallet_getCallsStatus',
    params: [callIdentifier],
})

await provider.request({
    method: 'wallet_showCallsStatus',
    params: [callIdentifier],
})

Credits

This SDK is heavily based on the Coinbase Wallet SDK.
Many parts of the code are adapted or modified from the original Coinbase Wallet SDK repository.
We thank the Coinbase Wallet SDK team for their excellent work and open source contributions.

Keywords

ERC-4337

FAQs

Package last updated on 11 Sep 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