diff --git a/.changeset/config.json b/.changeset/config.json index 163f264..44459d6 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -7,5 +7,5 @@ "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": [] + "ignore": ["reverse-mirage-next-example"] } diff --git a/.changeset/fast-laws-battle.md b/.changeset/fast-laws-battle.md new file mode 100644 index 0000000..481cda7 --- /dev/null +++ b/.changeset/fast-laws-battle.md @@ -0,0 +1,5 @@ +--- +"reverse-mirage": minor +--- + +Migrated to peer dependency viem to v2. diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index d7cf65d..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -pnpm codegen - -pnpm build - -pnpm typecheck - -pnpm lint diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..ba64f22 --- /dev/null +++ b/.npmrc @@ -0,0 +1,4 @@ +auto-install-peers=false +enable-pre-post-scripts=true +link-workspace-packages=deep +strict-peer-dependencies=false \ No newline at end of file diff --git a/README.md b/README.md index 77072c6..7c6462d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Building blocks for Ethereum app development. Built using [Viem](https://viem.sh ## Features -- ✅ 10x-100x faster, 10.4x smaller than [`@uniswap/sdk-core`](https://github.com/uniswap/sdk-core) +- ✅ 10x-100x faster, 11.6x smaller than [`@uniswap/sdk-core`](https://github.com/uniswap/sdk-core) - ✅ Abstactions for most commonly used token standards - ✅ Supports `permit` - ✅ Extensible to build apps and libraries @@ -56,7 +56,7 @@ $ npm i reverse-mirage ## Benchmarks -Benchmarks are done with [mitata](https://github.com/evanwashere/mitata). To reproduce: +Benchmarks are done with [mitata](https://github.com/evanwashere/mitata). To reproduce: ```sh $ cd packages/core/ @@ -65,13 +65,13 @@ $ bun run src/amount/utils.bench.ts ### Results -* amount add: `reverse mirage` **8.17x** faster than `@uniswap/sdk-core` -* amount equal to: `reverse-mirage` **10.63x** faster than `@uniswap/sdk-core` -* amount to number: `reverse-mirage` **136.14x** faster than `@uniswap/sdk-core` -* amount to significant: `reverse-mirage` **30.03x** faster than `@uniswap/sdk-core` +- amount add: `reverse mirage` **8.31x** faster than `@uniswap/sdk-core` +- amount equal to: `reverse-mirage` **18.9x** faster than `@uniswap/sdk-core` +- amount to number: `reverse-mirage` **313x** faster than `@uniswap/sdk-core` +- amount to significant: `reverse-mirage` **27.1x** faster than `@uniswap/sdk-core` ## Bundle Size -`reverse-mirage`: **5.12 kB** +`reverse-mirage`: **4.61 kB** `@uniswap/sdk-core`: **53.4 kB** diff --git a/biome.json b/biome.json index b8b217b..33c31f1 100644 --- a/biome.json +++ b/biome.json @@ -1,12 +1,14 @@ { - "$schema": "https://biomejs.dev/schemas/1.0.0/schema.json", + "$schema": "https://biomejs.dev/schemas/1.6.1/schema.json", "files": { "ignore": [ - "**/node_modules", - "CHANGELOG.md", + "node_modules", + ".vitepress", + ".next", + "coverage", "dist", - "tsconfig.json", - "tsconfig.*.json", + "generated.ts", + "CHANGELOG.md", "pnpm-lock.yaml" ] }, @@ -17,7 +19,7 @@ "enabled": true, "formatWithErrors": true, "indentStyle": "space", - "indentSize": 2, + "indentWidth": 2, "lineWidth": 80 }, "linter": { diff --git a/docs/benchmark.md b/docs/benchmark.md index 306afd3..80651f9 100644 --- a/docs/benchmark.md +++ b/docs/benchmark.md @@ -2,13 +2,13 @@ ## Results -* amount add: `reverse mirage` **8.17x** faster than `@uniswap/sdk-core` -* amount equal to: `reverse-mirage` **10.63x** faster than `@uniswap/sdk-core` -* amount to number: `reverse-mirage` **136.14x** faster than `@uniswap/sdk-core` -* amount to significant: `reverse-mirage` **30.03x** faster than `@uniswap/sdk-core` +* amount add: `reverse mirage` **8.31x** faster than `@uniswap/sdk-core` +* amount equal to: `reverse-mirage` **18.9x** faster than `@uniswap/sdk-core` +* amount to number: `reverse-mirage` **313x** faster than `@uniswap/sdk-core` +* amount to significant: `reverse-mirage` **27.1x** faster than `@uniswap/sdk-core` ## Bundle Size -`reverse-mirage`: **5.12 kB** +`reverse-mirage`: **4.61 kB** `@uniswap/sdk-core`: **53.4 kB** diff --git a/docs/index.md b/docs/index.md index f635d5a..15de8d3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,7 +10,7 @@ This documentation is still under active development. ## Features -- ✅ 10x-100x faster, 10.4x smaller than [`@uniswap/sdk-core`](https://github.com/uniswap/sdk-core) +- ✅ 10x-100x faster, 11.6x smaller than [`@uniswap/sdk-core`](https://github.com/uniswap/sdk-core) - ✅ Abstactions for most commonly used token standards - ✅ Extensible to build apps and libraries - ✅ Seamless extension to [Viem](https://github.com/wagmi-dev/viem) diff --git a/docs/start.md b/docs/start.md index 3e8f94a..5740548 100644 --- a/docs/start.md +++ b/docs/start.md @@ -15,7 +15,7 @@ ### Tokens -Tokens represent an asset on Ethereum. Tokens by themselves don't hold any specific state, but can be used to read from Ethereum or send a transaction. Currently `reverse-mirage` has: +Tokens represent an asset on Ethereum. Currently `reverse-mirage` has: - **ERC20**: Fungible tokens - **ERC721**: Non-fungible tokens diff --git a/examples/next-interface/CHANGELOG.md b/examples/next-interface/CHANGELOG.md deleted file mode 100644 index ac1f082..0000000 --- a/examples/next-interface/CHANGELOG.md +++ /dev/null @@ -1,33 +0,0 @@ -# reverse-mirage-next-example - -## 0.1.4 - -### Patch Changes - -- Updated dependencies [b9090d2] - - reverse-mirage@1.0.3 - -## 0.1.3 - -### Patch Changes - -- Updated dependencies [aef4b34] - - reverse-mirage@1.0.2 - -## 0.1.2 - -### Patch Changes - -- Updated dependencies [041bcc9] - - reverse-mirage@1.0.1 - -## 0.1.1 - -### Patch Changes - -- Updated dependencies [ad4046c] -- Updated dependencies [22f43d0] -- Updated dependencies [64ac88a] -- Updated dependencies [51e3d32] -- Updated dependencies [89add6a] - - reverse-mirage@1.0.0 diff --git a/examples/next-interface/biome.json b/examples/next-interface/biome.json deleted file mode 100644 index 9c71ce0..0000000 --- a/examples/next-interface/biome.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/1.0.0/schema.json", - "files": { - "ignore": [ - "**/node_modules", - "CHANGELOG.md", - "dist", - ".next", - "tsconfig.json", - "gql", - "tsconfig.*.json", - "generated.ts", - "pnpm-lock.yaml" - ] - }, - "organizeImports": { - "enabled": true - }, - "formatter": { - "enabled": true, - "formatWithErrors": true, - "indentStyle": "space", - "indentSize": 2, - "lineWidth": 80 - }, - "linter": { - "enabled": true, - "rules": { - "style": { - "noNonNullAssertion": "off" - } - } - } -} diff --git a/examples/next-interface/components/beet.tsx b/examples/next-interface/components/beet.tsx index 7b0d640..f35cfbc 100644 --- a/examples/next-interface/components/beet.tsx +++ b/examples/next-interface/components/beet.tsx @@ -1,10 +1,10 @@ import { clsx } from "clsx"; import Link from "next/link"; -import React from "react"; +import type React from "react"; import { toast } from "react-hot-toast"; import type { TransactionReceipt } from "viem"; -import type { Address } from "wagmi"; -import { useNetwork } from "wagmi"; +import type { Address } from "viem"; +import { useChains } from "wagmi"; export type BeetTx = { title: string; @@ -68,7 +68,7 @@ export class DefaultToasterWrapper { txSending(tx: Omit) { toast.loading(this._buildToastContainer({ ...tx, status: "sending" }), { id: tx.id, - duration: Infinity, + duration: Number.POSITIVE_INFINITY, position: "bottom-left", }); } @@ -106,15 +106,15 @@ export class DefaultToasterWrapper { tx: TxSending | TxSuccess | TxError | TxPending, ) { return ( -
-
-

+

+
+

{tx.title} {tx.humanCount}