Resuming transfers

Resuming a LockAndMint

In order to resume a LockAndMint, you need to pass the same parameters to RenJS.lockAndMint. It will pick-up any deposits that have previously been sent to the gateway address and haven't been minted.

In addition to receiving .on("deposit", ...) events, you can also manually provide the details of a deposit using mint.processDeposit. The parameter should match the type of deposit.depositDetails of a deposit object returned from.on("deposit", ...).

You may need to check for duplicate deposits if you are using both .on("deposit", ...) and .processDeposit.

Bitcoin example
Filecoin example
Bitcoin example
lockAndMint
.processDeposit({
transaction: {
txHash: "93864b94af9...",
vOut: 0,
amount: 290899, // sats
confirmations: 1,
},
amount: "290899",
})
.on(async (deposit) => {
// Handle deposit here. Same as .on("deposit", ...) callback.
// The default handler will keep retrying each step:
await RenJS.defaultDepositHandler(deposit);
})
.catch(console.error);
Filecoin example
lockAndMint
.processDeposit({
transaction: {
cid:
"bafy2bzacedvu74e7ohjcwlh4fbx7ddf6li42fiuosajob6metcj2qwkgkgof2",
to: "t1v2ftlxhedyoijv7uqgxfygiziaqz23lgkvks77i",
amount: (0.01 * 1e8).toString(),
params: "EzGbvVHf8lb0v8CUfjh8y+tLbZzfIFcnNnt/gh6axmw=",
confirmations: 1,
nonce: 7,
},
amount: (0.01 * 1e8).toString(),
})
.on(async (deposit) => {
// Handle deposit here. Same as .on("deposit") callback.
// The default handler will keep retrying each step:
await RenJS.defaultDepositHandler(deposit);
})
.catch(console.error);

Resuming a BurnAndRelease

Once a burn has been completed on the mint-chain, RenVM will automatically see it and process it. However, should you want to watch the progress of burn-and-release, it's possible to recreate the BurnAndRelease object with the details of the burn.

The details passed into a BurnAndRelease are not unique - the same burn can be repeated multiple times. To identify a specific burn, you either need the mint-chain's transaction hash, or the RenVM transaction hash.

They can be passed in as follows:

const burnAndRelease = await renJS.burnAndRelease({
asset: "FIL",
to: Filecoin().Address("t14wczuvodunv3xzexobzywpbj6qpr6jwdrbkrmbq"),
from: Ethereum(provider).BurnNonce(0x16a),
// Provide one of:
// The RenVM transaction hash
txHash: "0Nw-mdeQ1mc1TUC2xUnGgkoe_prdQ3uhO5sioDCVyFk",
// The mint-chain's transaction hash - if there are multiple burns the
// first will be chosen.
transaction: "0x1234...",
// The burn's unique identifier returned from the burn event
burnNonce: 1,
});