Socket
Socket
Sign inDemoInstall

@safe-global/safe-apps-provider

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@safe-global/safe-apps-provider

A provider wrapper of Safe Apps SDK


Version published
Weekly downloads
209K
decreased by-1.38%
Maintainers
2
Weekly downloads
 
Created

What is @safe-global/safe-apps-provider?

@safe-global/safe-apps-provider is an npm package that provides a Web3 provider for Safe Apps. It allows developers to interact with the Gnosis Safe smart contract and build decentralized applications (dApps) that can be used within the Gnosis Safe ecosystem.

What are @safe-global/safe-apps-provider's main functionalities?

Initialize Safe Apps Provider

This feature allows you to initialize the Safe Apps Provider with the Gnosis Safe information and the Ethereum provider. It sets up the Web3 instance to interact with the Gnosis Safe smart contract.

const { SafeAppProvider } = require('@safe-global/safe-apps-provider');
const Web3 = require('web3');

const safe = { /* Safe information */ };
const provider = new SafeAppProvider(safe, window.ethereum);
const web3 = new Web3(provider);

Send Transactions

This feature allows you to send transactions from the Gnosis Safe. You can specify the sender address, recipient address, value, and data for the transaction.

const tx = {
  from: '0xYourSafeAddress',
  to: '0xRecipientAddress',
  value: web3.utils.toWei('1', 'ether'),
  data: '0x',
};

web3.eth.sendTransaction(tx).then(receipt => {
  console.log('Transaction receipt:', receipt);
});

Call Smart Contract Methods

This feature allows you to call smart contract methods using the Safe Apps Provider. You can interact with any smart contract by specifying the ABI and contract address.

const contract = new web3.eth.Contract(abi, contractAddress);

contract.methods.myMethod().call({ from: '0xYourSafeAddress' }).then(result => {
  console.log('Method call result:', result);
});

Other packages similar to @safe-global/safe-apps-provider

FAQs

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