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

@walletconnect/channel-provider

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@walletconnect/channel-provider

Channel Provider for WalletConnect

  • 1.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-30%
Maintainers
1
Weekly downloads
 
Created
Source

WalletConnect Channel Provider

Channel Provider for WalletConnect

For more details, read the documentation

Example

import * as connext from "@connext/client";
import WalletConnectChannelProvider from "@walletconnect/channel-provider";

/**
 *  Create WalletConnect Provider (qrcode modal will be displayed automatically)
 */
const channelProvider = new WalletConnectChannelProvider();

/**
 *  Create a channel
 */
const channel: Channel = await connext.connect({
  channelProvider,
  nodeUrl: "<INSERT_NODE_URL>",
  store
});

/**
 *  Deposit
 */
channel.deposit({
  amount: "0x3abc", // represented as bignumber
  assetId: AddressZero // Use the AddressZero to srepresent ETH, or enter the token address
});

/**
 * Exchange
 */
await channel.exchange({
  amount: "0x3abc" // in Wei, represented as bignumber
  toAssetId: "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359" // Dai
  fromAssetId: AddressZero // ETH
})


/**
 * Transfer
 */
await channel.transfer({
  recipient: "xpub1abcdef"  //counterparty's xPub
  meta: "Metadata for transfer"
  amount: "0x3abc" // in Wei, represented as bignumber
  assetId: AddressZero // represents ETH
})


/**
 * Withdrawing
 */
await channel.withdraw({
  recipient: // defaults to signer xpub but can be changed to withdraw to any recipient
  amount: "0x3abc" // in Wei, represented as bignumber
  assetId: AddressZero
})

Keywords

FAQs

Package last updated on 29 Mar 2021

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