Skip to content

Instantly share code, notes, and snippets.

@katat
Created November 17, 2019 08:13
Show Gist options
  • Save katat/d21eab36c0204c7ca003fdc3c481e8c8 to your computer and use it in GitHub Desktop.
Save katat/d21eab36c0204c7ca003fdc3c481e8c8 to your computer and use it in GitHub Desktop.
//specify the currency, amount and the recipient address
const payMonetaryAmount = nahmii.MonetaryAmount.from({
currency: {
ct: tokenInfo.currency,
id: '0'
},
amount: ethers.utils.parseUnits(payAmount, tokenInfo.decimals)
});
const payment = new nahmii.Payment(payMonetaryAmount, wallet.address, recipientAddress, wallet);
//sign the transfer transaction using the wallet initiated the Payment object
await payment.sign();
//send the signed payment to our operator, it will response a receipt
await payment.register();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment