cawfree / ethers-url

πŸ¦„ πŸ”— Convert high level ethers transactions into sharable links!

Home Page:https://twitter.com/cawfree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚠️ This project is still under development.

πŸ¦„ 🐝 Ethereum URL parsing and generation using ethers.

πŸš€ getting started

You can download ethers-url from Yarn:

yarn add ethers@5.7.2 bignumber.js ethers-url

Next, it's easy to take any existing contract interactions you're using and generate the corresponding URL:

import {ethers} from 'ethers';
import {wrap} from 'ethers-url';

import erc20 from './erc20.abi.json';

// This is a proxy of the Contract.
// Traditionally, where you'd usually invoke transactions, you will now receive equivalent transaction URLs.
const wrappedWeth = wrap(
  new ethers.Contract('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', erc20)
);

const erc20TokenTransferUrl = await wrappedWeth.transfer(
  ethers.utils.getAddress('0x8e23ee67d1332ad560396262c48ffbb01f93d052'),
  ethers.BigNumber.from('1'),
); // 'ethereum:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/transfer?address=0x8e23Ee67d1332aD560396262C48ffbB01F93D052&uint256=1'

πŸ™ attribution

Huge thanks to @brunobar79 for his compliant implementations of EIP-681 and EIP-831:

✌️ license

CC0-1.0

About

πŸ¦„ πŸ”— Convert high level ethers transactions into sharable links!

https://twitter.com/cawfree

License:Creative Commons Zero v1.0 Universal


Languages

Language:TypeScript 98.9%Language:JavaScript 1.1%