New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tronweb3/tronwallet-adapter-metamask

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tronweb3/tronwallet-adapter-metamask

Wallet adapter for Metamask wallet extension and app.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-7.14%
Maintainers
0
Weekly downloads
 
Created
Source

@tronweb3/tronwallet-adapter-metamask

This package provides an adapter to enable DApps to connect to the MetaMask Wallet extension and MetaMask Wallet App.

Demo

import { MetaMaskAdapter } from '@tronweb3/tronwallet-adapter-metamask';

const adapter = new MetaMaskAdapter();
// connect
await adapter.connect();

// then you can get address
console.log(adapter.address);

// just use the sendTransaction method to send a transfer transaction.
const transaction = {
    value: '0x' + Number(0.01 * Math.pow(10, 18)).toString(16), // 0.01 is 0.01ETH
    to: 'your target address',
    from: adapter.address,
};
await adapter.sendTransaction(transaction);

Documentation

API

  • Constructor(config: MetaMaskAdapterOptions)

    import { MetaMaskAdapter } from '@tronweb3/tronwallet-adapter-metamask';
    interface MetaMaskAdapterOptions {
        /**
         * Set if open MetaMask app when in mobile device.
         * Default is true.
         */
        useDeeplink?: boolean;
    }
    const metaMaskAdapter = new MetaMaskAdapter({ useDeeplink: false });
    

More detailed API can be found in Abstract Adapter.

Keywords

FAQs

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