Skip to content

Instantly share code, notes, and snippets.

@katat
Last active November 18, 2019 03:31
Show Gist options
  • Save katat/34a407e2352e965fb22313f306ee7cb7 to your computer and use it in GitHub Desktop.
Save katat/34a407e2352e965fb22313f306ee7cb7 to your computer and use it in GitHub Desktop.
//update staged balance
for(const settlement of settlements.filter(s => s.isStageable)) {
await settlement.stage(wallet, {gasLimit, gasPrice});
}
//withdraw all staged balance for a currency back to base layer
const stagedBalanceBN = await wallet.getNahmiiStagedBalance(tokenInfo.symbol);
const withdrawMonetaryAmount = nahmii.MonetaryAmount.from(stagedBalanceBN, tokenInfo.currency);
await wallet.withdraw(withdrawMonetaryAmount, {gasLimit, gasPrice});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment