Skip to content

synaps-archive/web3-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web3Provider

Delegate your wallet interaction to another frame

NPM JavaScript Style Guide

Install

With npm

npm install @synaps-io/web3-provider

With yarn

yarn add @synaps-io/web3-provider

Import

In your frame that have your Web3 provider

import { installProviderProxyFor, BRAVE } from '@synaps-io/web3-provider'

In the frame that you want to use the remote provider

import { getRemoteProviderWhen, BRAVE } from '@synaps-io/web3-provider'

Usage

In your frame that have your Web3 provider

const uninstallProviderProxy = installProviderProxyFor(wallets=[BRAVE], target=YOUR_WINDOW, targetUrl=YOUR_WINDOW_URL)

In the frame that you want to use the remote provider

const provider = new ethers.providers.Web3Provider(await getRemoteProviderWhen(wallets=[BRAVE]))

Documentation

installProviderProxyFor

Allows to set up the receiver of the interactions with the Wallet according to the criterion Wallet

const uninstallProviderProxy = installProviderProxyFor(wallets=[BRAVE], target=YOUR_WINDOW, targetUrl=YOUR_WINDOW_URL)

getRemoteProviderWhen

it allows to have the remoteProvider if the wallet criterion and the page criterion an iframe or not are respected or it returns the default provider window.ethereum

const provider = new ethers.providers.Web3Provider(await getRemoteProviderWhen(wallets=[BRAVE]))

RemoteProvider

Web3 Provider which allows to transfer the interactions to another frame

const provider = new ethers.providers.Web3Provider(new RemoteProvider(target=WINDOW_FRAME, targetUrl=WINDOW_FRAME_URL))

installProviderProxy

Allows to set up the receiver of the interactions with the Wallet

const uninstallProviderProxy = installProviderProxy(target=YOUR_WINDOW, targetUrl=YOUR_WINDOW_URL)

License

MIT © Synaps

Synaps is an all-in-one compliance platform. It offers a simple, fast and secure way to meet compliance requirements at scale.

Visit Synaps.io | Read the Synaps documentation

enter image description here

About

Web3 Provider wrapped provided by Synaps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published