crypto-payment-url
Generate payment URLs and QR Codes for cryptocurrencies
Usage
var payment = var qr = // Create two different ethereum payment urls for 1000 Wei and 100000 Weipaymentqr // Adding in a LN invoice in an URLpaymentqr
API
cryptoUrl.ethereum({ address, functionName, args, amount, gas, gasLimit, gasPrice, chainId })
Returns a String
encoding the above parameters as a ethereum:
URL.
Be aware that some wallets do not support all parameters.
Specified in EIP 681: URL Format for Transaction Requests
cryptoUrl.bitcoin({ address, amount, label, message, lightning })
Returns a String
encoding the above parameters as a bitcoin:
URL.
Be aware that some wallets do not support all parameters.
Specified in BIP 21: URI Scheme
cryptoUrlQr.ethereum({ address, functionName, args, amount, gas, gasLimit, gasPrice, chainId })
Works like cryptoUrl.ethereum
, but returns an object of { qrcode: String, url: String }
,
Where qrcode
is a string of SVG code.
cryptoUrlQr.bitcoin({ address, amount, label, message, lightning })
Works like cryptoUrl.bitcoin
, but returns an object of { qrcode: String, url: String }
,
Where qrcode
is a string of SVG code.
Install
npm install crypto-payment-url