Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@coinbase/wallet-sdk

Package Overview
Dependencies
Maintainers
15
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coinbase/wallet-sdk

Coinbase Wallet JavaScript SDK

  • 4.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
492K
increased by14.88%
Maintainers
15
Weekly downloads
 
Created

What is @coinbase/wallet-sdk?

@coinbase/wallet-sdk is a JavaScript library that allows developers to integrate Coinbase Wallet into their web applications. It provides functionalities for connecting to the wallet, managing user accounts, and interacting with the Ethereum blockchain.

What are @coinbase/wallet-sdk's main functionalities?

Connect to Coinbase Wallet

This feature allows you to connect to the Coinbase Wallet. You can specify the app name, logo URL, and whether to use dark mode. The `makeWeb3Provider` method creates a Web3 provider instance connected to the Ethereum mainnet.

const { CoinbaseWalletSDK } = require('@coinbase/wallet-sdk');
const wallet = new CoinbaseWalletSDK({ appName: 'My App', appLogoUrl: 'https://example.com/logo.png', darkMode: false });
const ethereum = wallet.makeWeb3Provider('https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID', 1);

Request Account Access

This feature allows you to request access to the user's Ethereum accounts. The `eth_requestAccounts` method prompts the user to connect their wallet and grants access to their accounts.

ethereum.request({ method: 'eth_requestAccounts' }).then(accounts => {
  console.log(accounts);
}).catch(error => {
  console.error(error);
});

Send Transactions

This feature allows you to send transactions from the connected wallet. You can specify the recipient address, sender address, value, and gas limit. The `eth_sendTransaction` method sends the transaction and returns the transaction hash.

const transactionParameters = {
  to: '0xRecipientAddress',
  from: '0xYourAddress',
  value: '0x29a2241af62c0000', // 0.1 ETH
  gas: '0x5208', // 21000 GWEI
};
ethereum.request({ method: 'eth_sendTransaction', params: [transactionParameters] }).then(txHash => {
  console.log(txHash);
}).catch(error => {
  console.error(error);
});

Other packages similar to @coinbase/wallet-sdk

Keywords

FAQs

Package last updated on 12 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc