Quick Start

The quickest way to start minting and burning tokenized Bitcoin with GatewayJS.

Install GatewayJS

yarn add @renproject/gateway

Mint tokenized Bitcoin

const GatewayJS = require("@renproject/gateway");
new GatewayJS("testnet").open({
// Provide Web3 provider
web3Provider: await GatewayJS.utils.useBrowserWeb3(),
// Send BTC to an Ethereum address
sendToken: GatewayJS.Tokens.BTC.Btc2Eth,
// The recipient Ethereum address
sendTo: "0xD5B5b26521665Cb37623DCA0E49c553b41dbF076",

Burn and release tokenized Bitcoin

const web3 = require("web3");
const btcGatewayAddress = "0x1258d7FF385d1d81017d4a3d464c02f74C61902a"
const btcGatewayABI = (await fetch("https://api.etherscan.io/api?module=contract&action=getabi&address=" + btcGatewayAddress)).json()
const btcGatewayContract = new web3.eth.Contract(btcGatewayABI, btcGatewayAddress);
// Burn tokens
const result = await btcGatewayContract.methods.burn(
web3.utils.fromAscii("2NGZrVvZG92qGYqzTLjCAewvPZ7JE8S8VxE"), //_to
Math.floor(0.002 * (10 ** 8)), // _amount in Satoshis

For more details on all Gateway contracts, check out the deployed contracts page.

Faucets and other misc. helpers