Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kyscott18 committed Sep 20, 2023
1 parent 2eca06d commit 6a8b6b5
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,40 @@
[bundle-badge]:https://img.shields.io/bundlephobia/minzip/reverse-mirage/latest.svg

Application level typescript utilities for Ethereum.

## Features

-~30x faster than `@uniswap/sdk-core`
- ✅ Abstactions for most commonly used token standards
- ✅ Supports `permit`
- ✅ Extensible to build apps and libraries
- ✅ Seamless extension to [Viem](https://github.com/wagmi-dev/viem)
- ✅ TypeScript ready
- ✅ Test suite running against [forked](https://ethereum.org/en/glossary/#fork) Ethereum network

## Example

```ts
import { createPublicClient, http } from 'viem'
import {publicActions, amountToNumber} from 'reverse-mirage'

export const publicClient = createPublicClient({
chain: mainnet,
transport: http()
}).extend(publicActions)

// read token metadata
const usdc = await publicClient.getERC20({
address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // usdc
})

console.log(usdc.decimals) // 6

// read a balance
const vitalikBalance = await publicClient.getERC20Balance({
erc20: usdc,
address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045' // vitalik
})

console.log(amountToNumber(vitalikBalance)) // 420.69
```

1 comment on commit 6a8b6b5

@vercel
Copy link

@vercel vercel bot commented on 6a8b6b5 Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.