Socket
Book a DemoInstallSign in
Socket

argent-connect-core

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

argent-connect-core

Argent-Connect core library

0.2.9
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

argent-connect-core

Installation

Node.js

npm install argent-connect-core

Usage

Create a storage object for the dapp key:

const dappStorage = new ArgentConnect.StorageLocalEncrypted(); // or const dappStorage = new ArgentConnect.StorageLocal();

Define the contracts and methods your dapp will call:

const dappAuthorizations: [
    {
      contract: '<my contract 1 address>',
      methodName: '<method 1>',
      methodSig: ['0x5b372532']
    },
    {
      contract: '<my contract 1 address>',
      methodName: '<method 2>',
      methodSig: ['0xd5b50610']
    },
    {
      contract: '<my contract 2 address>',
      methodName: '<method 1>',
      methodSig: ['0xce0d947a']
    }
  ];

Create your Argent configuration:

const argentConfig = {
  dappName: "My Dapp",
  authorizations: dappAuthorizations,
  storage: dappStorage,
  rpcUrl: "https://ropsten.infura.io/v3/<my Infura Key>"
}

React

Include the Argent Connect button in your render method:

<ArgentConnectReactButton config={argentConfig} onConnected={this.onConnectedWithArgent} />

The button has a onConnected property that returns a Provider object when the User has successfully connected with Argent. Make sure to use this Provider to instantiate Web3:

onConnectedWithArgent = async (provider) => { this.web3 = new Web3(provider); }

Contribute

The initial project was crafted by the team at Argent. However, we encourage anyone to help implement new features and to keep this library up-to-date. For features and fixes, simply submit a pull request to the develop branch. Please follow the contributing guidelines.

For bug reports and feature requests, please open an issue.

License

Released under LGPL-3.0

FAQs

Package last updated on 02 Mar 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.