How to use the eth-url-parser.build function in eth-url-parser

To help you get started, we’ve selected a few eth-url-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MetaMask / metamask-mobile / app / util / payment-link-generator.js View on Github external
export function generateETHLink(receiverAddress, value, chainId) {
	const data = {
		chain_id: chainId,
		function_name: undefined,
		parameters: {
			value: value + 'e18'
		},
		scheme: 'ethereum',
		target_address: receiverAddress
	};
	return build(data);
}
github MetaMask / metamask-mobile / app / util / payment-link-generator.js View on Github external
export function generateERC20Link(receiverAddress, assetAddress, value, chainId) {
	const data = {
		chain_id: chainId,
		function_name: 'transfer',
		parameters: {
			address: receiverAddress,
			uint256: value
		},
		scheme: 'ethereum',
		target_address: assetAddress
	};
	return build(data);
}

eth-url-parser

Ethereum url parsing library

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular eth-url-parser functions