Mint

Mint.wait

Monitor a gateway for incoming transactions.

Standard Parameters
Standard Parameters

Parameter

Type

Description

confirmations

number

Number of confirmations to wait for.

Examples:

// Wait for the Darknodes to detect the BTC transfer.
const zeroConf = await mint.wait(0);
console.log(`Transaction started`, zeroConf)
// Wait for the Darknodes to confirm the BTC transfer.
const fullConf = await mint.wait(6);

Returns

PromiEvent <this, { "deposit": [RenVMUTXO] }>

Mint.submit

Request a signature from RenVM.

Standard Parameters
Standard Parameters

Parameter

Type

Description

specifyUTXO(optional)

UTXOInput

UTXO for an incoming transaction.

Examples:

// Retrieve signature from RenVM.
this.log("Submitting to RenVM...");
const signature = await deposit.submit();

Returns

PromiEvent <Mint, { "renTxHash": [string], "status": [TxStatus] }>

Mint.submitEthereumTx

Submit a mint transaction to Ethereum.

Standard Parameters
Standard Parameters

Parameter

Type

Description

web3Provider

provider

Local web3 provider.

txConfig (optional)

TransactionConfig

Transaction options to be passed to Web3.

Examples:

// Submit the signature to Ethereum and receive zBTC.
this.log("Submitting to smart contract...");
await signature.submitEthereumTx(web3.currentProvider);
this.log(`Deposited ${amount} BTC.`);

Returns

PromiEvent <TransactionReceipt, Web3Events & RenWeb3Events>

Mint.waitAndSubmit

Combines the functionality of wait and submit in sequential order.

Standard Parameters
Standard Parameters

Parameter

Type

Description

web3Provider

provider

Local web3 provider.

confirmations

number

Number of confirmations to wait for.

txConfig (optional)

TransactionConfig

Transaction options to be passed to Web3.

Examples:

await signature.waitAndSubmit(web3.currentProvider, 6);
this.log(`Deposited ${amount} BTC.`);

Returns

PromiEvent <TransactionReceipt, Web3Events & RenWeb3Events>

Mint.createEthereumTx

Alternative to submitToEthereum that doesn't need a web3 instance.

Standard Parameters
Standard Parameters

Parameter

Type

Description

txConfig (optional)

TransactionConfig

Transaction options to be passed to Web3.

Examples:

await signature.createEthereumTx();
this.log(`Deposited ${amount} BTC.`);

Mint.gatewayAddress

Returns the gateway address for the mint.

Standard Parameters
Standard Parameters

Examples:

const address = mint.gatewayAddress();
this.log(`Deposit to ${address}`);

Returns

string

Mint.txHash

Returns the cross-chain transaction hash for the gateway.

Standard Parameters
Standard Parameters

Parameter

Type

Description

specifyUTXO (optional)

UTXOInput

UTXO for an incoming transaction.

Examples:

const hash = mint.txHash();
this.log(`Ren tx id: ${hash}`);

Returns

string

Mint.queryTx

Return info about a cross-chain transaction.

Standard Parameters
Standard Parameters

Parameter

Type

Description

specifyUTXO (optional)

UTXOInput

UTXO for an incoming transaction.

Examples:

const tx = mint.queryTx();
console.log(`Ren tx:` tx);

Returns

RenVMTx