Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cawfree/ethers-url
🦄 🔗 Convert high level ethers transactions into sharable links!
https://github.com/cawfree/ethers-url
eip-681 eip-831 eth ethereum ethers tx url
Last synced: 14 days ago
JSON representation
🦄 🔗 Convert high level ethers transactions into sharable links!
- Host: GitHub
- URL: https://github.com/cawfree/ethers-url
- Owner: cawfree
- License: cc0-1.0
- Created: 2023-02-09T11:30:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-11T00:41:23.000Z (almost 2 years ago)
- Last Synced: 2024-10-17T07:02:12.480Z (about 1 month ago)
- Topics: eip-681, eip-831, eth, ethereum, ethers, tx, url
- Language: TypeScript
- Homepage: https://twitter.com/cawfree
- Size: 81.1 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## [`ethers-url`](https://github.com/cawfree/ethers-url)
> ⚠️ This project is still under development.
🦄 🐝 [__Ethereum URL__](https://eips.ethereum.org/EIPS/eip-681) parsing and generation using [`ethers`](https://github.com/ethers-io/ethers.js).
### 🚀 getting started
You can download [`ethers-url`](https://github.com/cawfree/ethers-url) from [__Yarn__](https://yarnpkg.com):
```shell
yarn add [email protected] bignumber.js ethers-url
```Next, it's easy to take any existing contract interactions you're using and generate the corresponding URL:
```typescript
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`](https://twitter.com/brunobar79) for his compliant implementations of [__EIP-681__](https://eips.ethereum.org/EIPS/eip-681) and [__EIP-831__](https://eips.ethereum.org/EIPS/eip-831):
- [`eth-url-parser`](https://github.com/brunobar79/eth-url-parser)
- [`eip681-link-generator`](https://github.com/brunobar79/eip681-link-generator)### ✌️ license
[__CC0-1.0__](./LICENSE)