diff --git a/README.md b/README.md index 375e95d..d5c8cda 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This package provides a client library for RISE Chain, specifically designed for ## Custom RPC Methods -RISE Chain introduces new RPC methods that extend standard Ethereum functionality: +RISE Chain introduces a new RPC method that extend standard Ethereum functionality: ### eth_sendRawTransactionSync @@ -19,22 +19,25 @@ RISE Chain introduces new RPC methods that extend standard Ethereum functionalit With this method, you can send a transaction and receive extremely fast responses, as low as 5ms if the client is close to the sequencer. -### rise_subscribe +## eth_subscribe -- **rise_subscribe**: Enables real-time subscriptions to shreds and events on the RISE network - - Subscribe to new shreds as they are processed and confirmed - - Watch for specific contract events that have been processed as shreds +RISE Chain extends the standard `eth_subscribe` method with enhanced functionality: + +- **New subscription type "shred"**: A new subscription type added to `eth_subscribe` for real-time shred monitoring + - Use `["shred"]` params to subscribe to new shreds as they are processed and confirmed - Receive real-time updates without polling - - Provides abstractions through various `watchShred*` actions for different use cases +- **Enhanced "logs" subscription**: The standard `["logs"]` subscription is patched to broadcast events from shreds instead of blocks + - Use the familiar `["logs"]` params to watch for contract events + - Events now come from shreds for faster, more granular updates + - Maintains compatibility with standard Ethereum event filtering ## Features - **Shreds Client:** Interact with Shreds on the RISE Network with synchronous transaction capabilities. - **Synchronous Transactions:** Leverages RISE Chain's custom `eth_sendRawTransactionSync` RPC method for fast, single-call transaction handling. -- **Real-time Subscriptions:** Provides abstractions for the `rise_subscribe` RPC method through various `watchShred*` actions: +- **Real-time Subscriptions:** - `watchShreds`: Subscribe to new shreds as they are processed and confirmed - - `watchShredEvent`: Watch for specific events that have been processed as shreds - - `watchContractShredEvent`: Monitor contract events processed as shreds with ABI decoding + - Use standard Viem's `watchEvent` and `watchContractEvent` actions - they automatically listen to events from shreds instead of blocks on RISE Chain - **Viem Integration:** Built on top of Viem for robust and type-safe interactions with the blockchain. - **WebSocket Transport:** Includes a custom WebSocket transport for real-time Shreds monitoring. - **Fast Response Times:** Achieve transaction confirmations as low as 5ms when close to the sequencer. @@ -97,19 +100,21 @@ publicClient.watchShreds({ }) ``` -### Watching for Shred Events +### Watching for Events + +On RISE Chain, you can use the standard Viem `watchEvent` and `watchContractEvent` actions to listen for events. These automatically receive events from shreds instead of blocks, providing faster and more granular updates. -#### watchShredEvent +#### watchEvent -Watch for specific events that have been processed and confirmed as shreds on the RISE network. +Watch for specific events using the standard Viem action: ```typescript -import { createPublicShredClient, shredsWebSocket } from 'shreds/viem' +import { createPublicClient, webSocket } from 'viem' import { riseTestnet } from 'viem/chains' -const client = createPublicShredClient({ +const client = createPublicClient({ chain: riseTestnet, - transport: shredsWebSocket(), + transport: webSocket(), }) // Define the event ABI you want to watch @@ -123,8 +128,8 @@ const transferEvent = { ], } as const -// Watch for Transfer events -const unsubscribe = client.watchShredEvent({ +// Watch for Transfer events - automatically receives events from shreds +const unsubscribe = client.watchEvent({ event: transferEvent, address: '0x742d35Cc6634C0532925a3b8D0C9e3e0C8b0e8c8', // Optional: filter by contract onLogs: (logs) => { @@ -135,9 +140,9 @@ const unsubscribe = client.watchShredEvent({ }) ``` -#### watchContractShredEvent +#### watchContractEvent -Watch for contract events using the full contract ABI with automatic event decoding. +Watch for contract events using the full contract ABI with automatic event decoding: ```typescript // ERC-20 contract ABI (partial) @@ -162,8 +167,8 @@ const erc20Abi = [ }, ] as const -// Watch for all events from the contract -const unsubscribe = client.watchContractShredEvent({ +// Watch for all events from the contract - events come from shreds +const unsubscribe = client.watchContractEvent({ abi: erc20Abi, address: '0x742d35Cc6634C0532925a3b8D0C9e3e0C8b0e8c8', onLogs: (logs) => { @@ -174,7 +179,7 @@ const unsubscribe = client.watchContractShredEvent({ }) // Watch for specific event only -const unsubscribeTransfers = client.watchContractShredEvent({ +const unsubscribeTransfers = client.watchContractEvent({ abi: erc20Abi, eventName: 'Transfer', address: '0x742d35Cc6634C0532925a3b8D0C9e3e0C8b0e8c8', @@ -186,6 +191,8 @@ const unsubscribeTransfers = client.watchContractShredEvent({ }) ``` +> **Note:** On RISE Chain, these standard Viem actions automatically receive events from shreds instead of blocks, providing faster event processing without requiring any special configuration. + ### Using sendRawTransactionSync The `sendRawTransactionSync` method is the core feature that enables synchronous transaction processing on RISE Chain. Here are several ways to use it: diff --git a/bun.lock b/bun.lock index fa1f3c7..126faa1 100644 --- a/bun.lock +++ b/bun.lock @@ -3,25 +3,22 @@ "workspaces": { "": { "name": "tsdown-starter", - "dependencies": { - "isows": "^1.0.7", - }, "devDependencies": { - "@sxzz/eslint-config": "^7.0.3", - "@sxzz/prettier-config": "^2.2.1", - "@types/node": "^24.0.3", + "@sxzz/eslint-config": "^7.0.4", + "@sxzz/prettier-config": "^2.2.3", + "@types/node": "^24.0.10", "abitype": "^1.0.8", "bumpp": "^10.2.0", - "eslint": "^9.29.0", + "eslint": "^9.30.1", "happy-dom": "^18.0.1", - "prettier": "^3.5.3", - "tsdown": "^0.12.8", + "prettier": "^3.6.2", + "tsdown": "^0.12.9", "tsx": "^4.20.3", "typescript": "^5.8.3", "vitest": "^3.2.4", }, "peerDependencies": { - "viem": "^2.30.0", + "viem": "^2.31.7", }, }, }, @@ -37,9 +34,9 @@ "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.27.1", "", {}, "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow=="], - "@babel/parser": ["@babel/parser@7.27.5", "", { "dependencies": { "@babel/types": "^7.27.3" }, "bin": "./bin/babel-parser.js" }, "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg=="], + "@babel/parser": ["@babel/parser@7.28.0", "", { "dependencies": { "@babel/types": "^7.28.0" }, "bin": "./bin/babel-parser.js" }, "sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g=="], - "@babel/types": ["@babel/types@7.27.6", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" } }, "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q=="], + "@babel/types": ["@babel/types@7.28.0", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" } }, "sha512-jYnje+JyZG5YThjHiF28oT4SIZLnYOcSBb6+SDaFIyzDVSkXQmQQYclJ2R+YxcdmK0AX6x1E5OQNtuh3jHDrUg=="], "@emnapi/core": ["@emnapi/core@1.4.3", "", { "dependencies": { "@emnapi/wasi-threads": "1.0.2", "tslib": "^2.4.0" } }, "sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g=="], @@ -107,17 +104,17 @@ "@eslint/compat": ["@eslint/compat@1.2.9", "", { "peerDependencies": { "eslint": "^9.10.0" }, "optionalPeers": ["eslint"] }, "sha512-gCdSY54n7k+driCadyMNv8JSPzYLeDVM/ikZRtvtROBpRdFSkS8W9A82MqsaY7lZuwL0wiapgD0NT1xT0hyJsA=="], - "@eslint/config-array": ["@eslint/config-array@0.20.1", "", { "dependencies": { "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", "minimatch": "^3.1.2" } }, "sha512-OL0RJzC/CBzli0DrrR31qzj6d6i6Mm3HByuhflhl4LOBiWxN+3i6/t/ZQQNii4tjksXi8r2CRW1wMpWA2ULUEw=="], + "@eslint/config-array": ["@eslint/config-array@0.21.0", "", { "dependencies": { "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", "minimatch": "^3.1.2" } }, "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ=="], - "@eslint/config-helpers": ["@eslint/config-helpers@0.2.2", "", {}, "sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg=="], + "@eslint/config-helpers": ["@eslint/config-helpers@0.3.0", "", {}, "sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw=="], "@eslint/core": ["@eslint/core@0.14.0", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg=="], "@eslint/eslintrc": ["@eslint/eslintrc@3.3.1", "", { "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^10.0.1", "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ=="], - "@eslint/js": ["@eslint/js@9.29.0", "", {}, "sha512-3PIF4cBw/y+1u2EazflInpV+lYsSG0aByVIQzAgb1m1MhHFSbqTyNqtBKHgWf/9Ykud+DhILS9EGkmekVhbKoQ=="], + "@eslint/js": ["@eslint/js@9.30.1", "", {}, "sha512-zXhuECFlyep42KZUhWjfvsmXGX39W8K8LFb8AWXM9gSV9dQB+MrJGLKvW6Zw0Ggnbpw0VHTtrhFXYe3Gym18jg=="], - "@eslint/markdown": ["@eslint/markdown@6.5.0", "", { "dependencies": { "@eslint/core": "^0.14.0", "@eslint/plugin-kit": "^0.3.1", "mdast-util-from-markdown": "^2.0.2", "mdast-util-frontmatter": "^2.0.1", "mdast-util-gfm": "^3.0.0", "micromark-extension-frontmatter": "^2.0.0", "micromark-extension-gfm": "^3.0.0" } }, "sha512-oSkF0p8X21vKEEAGTZASi7q3tbdTvlGduQ02Xz2A1AFncUP4RLVcNz27XurxVW4fs1JXuh0xBtvokXdtp/nN+Q=="], + "@eslint/markdown": ["@eslint/markdown@6.6.0", "", { "dependencies": { "@eslint/core": "^0.14.0", "@eslint/plugin-kit": "^0.3.1", "github-slugger": "^2.0.0", "mdast-util-from-markdown": "^2.0.2", "mdast-util-frontmatter": "^2.0.1", "mdast-util-gfm": "^3.0.0", "micromark-extension-frontmatter": "^2.0.0", "micromark-extension-gfm": "^3.0.0" } }, "sha512-IsWPy2jU3gaQDlioDC4sT4I4kG1hX1OMWs/q2sWwJrPoMASHW/Z4SDw+6Aql6EsHejGbagYuJbFq9Zvx+Y1b1Q=="], "@eslint/object-schema": ["@eslint/object-schema@2.1.6", "", {}, "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA=="], @@ -155,39 +152,71 @@ "@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="], - "@oxc-project/runtime": ["@oxc-project/runtime@0.72.3", "", {}, "sha512-FtOS+0v7rZcnjXzYTTqv1vu/KDptD1UztFgoZkYBGe/6TcNFm+SP/jQoLvzau1SPir95WgDOBOUm2Gmsm+bQag=="], + "@oxc-parser/binding-android-arm64": ["@oxc-parser/binding-android-arm64@0.74.0", "", { "os": "android", "cpu": "arm64" }, "sha512-lgq8TJq22eyfojfa2jBFy2m66ckAo7iNRYDdyn9reXYA3I6Wx7tgGWVx1JAp1lO+aUiqdqP/uPlDaETL9tqRcg=="], + + "@oxc-parser/binding-darwin-arm64": ["@oxc-parser/binding-darwin-arm64@0.74.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-xbY/io/hkARggbpYEMFX6CwFzb7f4iS6WuBoBeZtdqRWfIEi7sm/uYWXfyVeB8uqOATvJ07WRFC2upI8PSI83g=="], + + "@oxc-parser/binding-darwin-x64": ["@oxc-parser/binding-darwin-x64@0.74.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-FIj2gAGtFaW0Zk+TnGyenMUoRu1ju+kJ/h71D77xc1owOItbFZFGa+4WSVck1H8rTtceeJlK+kux+vCjGFCl9Q=="], + + "@oxc-parser/binding-freebsd-x64": ["@oxc-parser/binding-freebsd-x64@0.74.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-W1I+g5TJg0TRRMHgEWNWsTIfe782V3QuaPgZxnfPNmDMywYdtlzllzclBgaDq6qzvZCCQc/UhvNb37KWTCTj8A=="], + + "@oxc-parser/binding-linux-arm-gnueabihf": ["@oxc-parser/binding-linux-arm-gnueabihf@0.74.0", "", { "os": "linux", "cpu": "arm" }, "sha512-gxqkyRGApeVI8dgvJ19SYe59XASW3uVxF1YUgkE7peW/XIg5QRAOVTFKyTjI9acYuK1MF6OJHqx30cmxmZLtiQ=="], + + "@oxc-parser/binding-linux-arm-musleabihf": ["@oxc-parser/binding-linux-arm-musleabihf@0.74.0", "", { "os": "linux", "cpu": "arm" }, "sha512-jpnAUP4Fa93VdPPDzxxBguJmldj/Gpz7wTXKFzpAueqBMfZsy9KNC+0qT2uZ9HGUDMzNuKw0Se3bPCpL/gfD2Q=="], + + "@oxc-parser/binding-linux-arm64-gnu": ["@oxc-parser/binding-linux-arm64-gnu@0.74.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-fcWyM7BNfCkHqIf3kll8fJctbR/PseL4RnS2isD9Y3FFBhp4efGAzhDaxIUK5GK7kIcFh1P+puIRig8WJ6IMVQ=="], + + "@oxc-parser/binding-linux-arm64-musl": ["@oxc-parser/binding-linux-arm64-musl@0.74.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-AMY30z/C77HgiRRJX7YtVUaelKq1ex0aaj28XoJu4SCezdS8i0IftUNTtGS1UzGjGZB8zQz5SFwVy4dRu4GLwg=="], + + "@oxc-parser/binding-linux-riscv64-gnu": ["@oxc-parser/binding-linux-riscv64-gnu@0.74.0", "", { "os": "linux", "cpu": "none" }, "sha512-/RZAP24TgZo4vV/01TBlzRqs0R7E6xvatww4LnmZEBBulQBU/SkypDywfriFqWuFoa61WFXPV7sLcTjJGjim/w=="], + + "@oxc-parser/binding-linux-s390x-gnu": ["@oxc-parser/binding-linux-s390x-gnu@0.74.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-620J1beNAlGSPBD+Msb3ptvrwxu04B8iULCH03zlf0JSLy/5sqlD6qBs0XUVkUJv1vbakUw1gfVnUQqv0UTuEg=="], + + "@oxc-parser/binding-linux-x64-gnu": ["@oxc-parser/binding-linux-x64-gnu@0.74.0", "", { "os": "linux", "cpu": "x64" }, "sha512-WBFgQmGtFnPNzHyLKbC1wkYGaRIBxXGofO0+hz1xrrkPgbxbJS1Ukva1EB8sPaVBBQ52Bdc2GjLSp721NWRvww=="], + + "@oxc-parser/binding-linux-x64-musl": ["@oxc-parser/binding-linux-x64-musl@0.74.0", "", { "os": "linux", "cpu": "x64" }, "sha512-y4mapxi0RGqlp3t6Sm+knJlAEqdKDYrEue2LlXOka/F2i4sRN0XhEMPiSOB3ppHmvK4I2zY2XBYTsX1Fel0fAg=="], + + "@oxc-parser/binding-wasm32-wasi": ["@oxc-parser/binding-wasm32-wasi@0.74.0", "", { "dependencies": { "@napi-rs/wasm-runtime": "^0.2.11" }, "cpu": "none" }, "sha512-yDS9bRDh5ymobiS2xBmjlrGdUuU61IZoJBaJC5fELdYT5LJNBXlbr3Yc6m2PWfRJwkH6Aq5fRvxAZ4wCbkGa8w=="], + + "@oxc-parser/binding-win32-arm64-msvc": ["@oxc-parser/binding-win32-arm64-msvc@0.74.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-XFWY52Rfb4N5wEbMCTSBMxRkDLGbAI9CBSL24BIDywwDJMl31gHEVlmHdCDRoXAmanCI6gwbXYTrWe0HvXJ7Aw=="], + + "@oxc-parser/binding-win32-x64-msvc": ["@oxc-parser/binding-win32-x64-msvc@0.74.0", "", { "os": "win32", "cpu": "x64" }, "sha512-1D3x6iU2apLyfTQHygbdaNbX3nZaHu4yaXpD7ilYpoLo7f0MX0tUuoDrqJyJrVGqvyXgc0uz4yXz9tH9ZZhvvg=="], + + "@oxc-project/runtime": ["@oxc-project/runtime@0.71.0", "", {}, "sha512-QwoF5WUXIGFQ+hSxWEib4U/aeLoiDN9JlP18MnBgx9LLPRDfn1iICtcow7Jgey6HLH4XFceWXQD5WBJ39dyJcw=="], - "@oxc-project/types": ["@oxc-project/types@0.72.3", "", {}, "sha512-CfAC4wrmMkUoISpQkFAIfMVvlPfQV3xg7ZlcqPXPOIMQhdKIId44G8W0mCPgtpWdFFAyJ+SFtiM+9vbyCkoVng=="], + "@oxc-project/types": ["@oxc-project/types@0.71.0", "", {}, "sha512-5CwQ4MI+P4MQbjLWXgNurA+igGwu/opNetIE13LBs9+V93R64MLvDKOOLZIXSzEfovU3Zef3q3GjPnMTgJTn2w=="], "@pkgr/core": ["@pkgr/core@0.2.7", "", {}, "sha512-YLT9Zo3oNPJoBjBc4q8G2mjU4tqIbf5CEOORbUUr48dCD9q3umJ3IPlVqOqDakPfd2HuwccBaqlGhN4Gmr5OWg=="], + "@prettier/plugin-oxc": ["@prettier/plugin-oxc@0.0.4", "", { "dependencies": { "oxc-parser": "0.74.0" } }, "sha512-UGXe+g/rSRbglL0FOJiar+a+nUrst7KaFmsg05wYbKiInGWP6eAj/f8A2Uobgo5KxEtb2X10zeflNH6RK2xeIQ=="], + "@quansync/fs": ["@quansync/fs@0.1.3", "", { "dependencies": { "quansync": "^0.2.10" } }, "sha512-G0OnZbMWEs5LhDyqy2UL17vGhSVHkQIfVojMtEWVenvj0V5S84VBgy86kJIuNsGDp2p7sTKlpSIpBUWdC35OKg=="], - "@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.0.0-beta.15", "", { "os": "darwin", "cpu": "arm64" }, "sha512-YInZppDBLp5DadbJZGc7xBfDrMCSj3P6i2rPlvOCMlvjBQxJi2kX8Jquh+LufsWUiHD3JsvvH5EuUUc/tF5fkA=="], + "@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.0.0-beta.9-commit.d91dfb5", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Mp0/gqiPdepHjjVm7e0yL1acWvI0rJVVFQEADSezvAjon9sjQ7CEg9JnXICD4B1YrPmN9qV/e7cQZCp87tTV4w=="], - "@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.0.0-beta.15", "", { "os": "darwin", "cpu": "x64" }, "sha512-Zwv8KHU/XdVwLseHG6slJ0FAFklPpiO0sjNvhrcMp1X3F2ajPzUdIO8Cnu3KLmX1GWVSvu6q1kyARLUqPvlh7Q=="], + "@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.0.0-beta.9-commit.d91dfb5", "", { "os": "darwin", "cpu": "x64" }, "sha512-40re4rMNrsi57oavRzIOpRGmg3QRlW6Ea8Q3znaqgOuJuKVrrm2bIQInTfkZJG7a4/5YMX7T951d0+toGLTdCA=="], - "@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.0.0-beta.15", "", { "os": "freebsd", "cpu": "x64" }, "sha512-FwhNC23Fz9ldHW1/rX4QaoQe4kyOybCgxO9eglue3cbb3ol28KWpQl3xJfvXc9+O6PDefAs4oFBCbtTh8seiUw=="], + "@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.0.0-beta.9-commit.d91dfb5", "", { "os": "freebsd", "cpu": "x64" }, "sha512-8BDM939bbMariZupiHp3OmP5N+LXPT4mULA0hZjDaq970PCxv4krZOSMG+HkWUUwmuQROtV+/00xw39EO0P+8g=="], - "@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.15", "", { "os": "linux", "cpu": "arm" }, "sha512-E60pNliWl4j7EFEVX2oeJZ5VzR+NG6fvDJoqfqRfCl8wtKIf9E1WPWVQIrT+zkz+Fhc5op8g7h25z6rtxsDy9g=="], + "@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.9-commit.d91dfb5", "", { "os": "linux", "cpu": "arm" }, "sha512-sntsPaPgrECpBB/+2xrQzVUt0r493TMPI+4kWRMhvMsmrxOqH1Ep5lM0Wua/ZdbfZNwm1aVa5pcESQfNfM4Fhw=="], - "@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.0.0-beta.15", "", { "os": "linux", "cpu": "arm64" }, "sha512-d+qo1LZ/a3EcQW08byIIZy0PBthmG/7dr69pifmNIet/azWR8jbceQaRFFczVc/NwVV3fsZDCmjG8mgJzsNEAg=="], + "@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.0.0-beta.9-commit.d91dfb5", "", { "os": "linux", "cpu": "arm64" }, "sha512-5clBW/I+er9F2uM1OFjJFWX86y7Lcy0M+NqsN4s3o07W+8467Zk8oQa4B45vdaXoNUF/yqIAgKkA/OEdQDxZqA=="], - "@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.0.0-beta.15", "", { "os": "linux", "cpu": "arm64" }, "sha512-P1hbtYF+5ftJI2Ergs4iARbAk6Xd6WnTQb3CF9kjN3KfJTsRYdo5/fvU8Lz/gzhZVvkCXXH3NxDd9308UBO8cw=="], + "@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.0.0-beta.9-commit.d91dfb5", "", { "os": "linux", "cpu": "arm64" }, "sha512-wv+rnAfQDk9p/CheX8/Kmqk2o1WaFa4xhWI9gOyDMk/ljvOX0u0ubeM8nI1Qfox7Tnh71eV5AjzSePXUhFOyOg=="], - "@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.0.0-beta.15", "", { "os": "linux", "cpu": "x64" }, "sha512-Q9NM9uMFN9cjcrW7gd9U087B5WzkEj9dQQHOgoENZSy+vYJYS2fINCIG40ljEVC6jXmVrJgUhJKv7elRZM1nng=="], + "@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.0.0-beta.9-commit.d91dfb5", "", { "os": "linux", "cpu": "x64" }, "sha512-gxD0/xhU4Py47IH3bKZbWtvB99tMkUPGPJFRfSc5UB9Osoje0l0j1PPbxpUtXIELurYCqwLBKXIMTQGifox1BQ=="], - "@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.0.0-beta.15", "", { "os": "linux", "cpu": "x64" }, "sha512-1tuCWuR8gx9PyW2pxAx2ZqnOnwhoY6NWBVP6ZmrjCKQ16NclYc61BzegFXSdugCy8w1QpBPT8/c5oh2W4E5aeA=="], + "@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.0.0-beta.9-commit.d91dfb5", "", { "os": "linux", "cpu": "x64" }, "sha512-HotuVe3XUjDwqqEMbm3o3IRkP9gdm8raY/btd/6KE3JGLF/cv4+3ff1l6nOhAZI8wulWDPEXPtE7v+HQEaTXnA=="], - "@rolldown/binding-wasm32-wasi": ["@rolldown/binding-wasm32-wasi@1.0.0-beta.15", "", { "dependencies": { "@napi-rs/wasm-runtime": "^0.2.10" }, "cpu": "none" }, "sha512-zrSeYrpTf27hRxMLh0qpkCoWgzRKG8EyR6o09Zt9xkqCOeE5tEK/S3jV1Nii9WSqVCWFRA+OYxKzMNoykV590g=="], + "@rolldown/binding-wasm32-wasi": ["@rolldown/binding-wasm32-wasi@1.0.0-beta.9-commit.d91dfb5", "", { "dependencies": { "@napi-rs/wasm-runtime": "^0.2.4" }, "cpu": "none" }, "sha512-8Cx+ucbd8n2dIr21FqBh6rUvTVL0uTgEtKR7l+MUZ5BgY4dFh1e4mPVX8oqmoYwOxBiXrsD2JIOCz4AyKLKxWA=="], - "@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.0.0-beta.15", "", { "os": "win32", "cpu": "arm64" }, "sha512-diR41DsMUnkvb9hvW8vuIrA0WaacAN1fu6lPseXhYifAOZN6kvxEwKn7Xib8i0zjdrYErLv7GNSQ48W+xiNOnA=="], + "@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.0.0-beta.9-commit.d91dfb5", "", { "os": "win32", "cpu": "arm64" }, "sha512-Vhq5vikrVDxAa75fxsyqj0c0Y/uti/TwshXI71Xb8IeUQJOBnmLUsn5dgYf5ljpYYkNa0z9BPAvUDIDMmyDi+w=="], - "@rolldown/binding-win32-ia32-msvc": ["@rolldown/binding-win32-ia32-msvc@1.0.0-beta.15", "", { "os": "win32", "cpu": "ia32" }, "sha512-oCbbcDC3Lk8YgdxCkG23UqVrvXVvllIBgmmwq89bhq5okPP899OI/P+oTTDsUTbhljzNq1pH8a+mR6YBxAFfvw=="], + "@rolldown/binding-win32-ia32-msvc": ["@rolldown/binding-win32-ia32-msvc@1.0.0-beta.9-commit.d91dfb5", "", { "os": "win32", "cpu": "ia32" }, "sha512-lN7RIg9Iugn08zP2aZN9y/MIdG8iOOCE93M1UrFlrxMTqPf8X+fDzmR/OKhTSd1A2pYNipZHjyTcb5H8kyQSow=="], - "@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.0.0-beta.15", "", { "os": "win32", "cpu": "x64" }, "sha512-w5hVsOv3dzKo10wAXizmnDvUo1yasn/ps+mcn9H9TiJ/GeRE5/15Y6hG6vUQYRQNLVbYRHUt2qG0MyOoasPcHg=="], + "@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.0.0-beta.9-commit.d91dfb5", "", { "os": "win32", "cpu": "x64" }, "sha512-7/7cLIn48Y+EpQ4CePvf8reFl63F15yPUlg4ZAhl+RXJIfydkdak1WD8Ir3AwAO+bJBXzrfNL+XQbxm0mcQZmw=="], - "@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-beta.15", "", {}, "sha512-lvFtIbidq5EqyAAeiVk41ZNjGRgUoGRBIuqpe1VRJ7R8Av7TLAgGWAwGlHNhO7MFkl7MNRX350CsTtIWIYkNIQ=="], + "@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-beta.9-commit.d91dfb5", "", {}, "sha512-8sExkWRK+zVybw3+2/kBkYBFeLnEUWz1fT7BLHplpzmtqkOfTbAQ9gkt4pzwGIIZmg4Qn5US5ACjUBenrhezwQ=="], "@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.42.0", "", { "os": "android", "cpu": "arm" }, "sha512-gldmAyS9hpj+H6LpRNlcjQWbuKUtb94lodB9uCz71Jm+7BxK1VIOo7y62tZZwxhA7j1ylv/yQz080L5WkS+LoQ=="], @@ -235,9 +264,9 @@ "@scure/bip39": ["@scure/bip39@1.6.0", "", { "dependencies": { "@noble/hashes": "~1.8.0", "@scure/base": "~1.2.5" } }, "sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A=="], - "@sxzz/eslint-config": ["@sxzz/eslint-config@7.0.3", "", { "dependencies": { "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0", "@eslint/js": "^9.29.0", "@eslint/markdown": "^6.5.0", "eslint-config-flat-gitignore": "^2.1.0", "eslint-config-prettier": "^10.1.5", "eslint-flat-config-utils": "^2.1.0", "eslint-plugin-antfu": "^3.1.1", "eslint-plugin-command": "^3.2.1", "eslint-plugin-de-morgan": "^1.3.0", "eslint-plugin-import-x": "^4.15.2", "eslint-plugin-jsdoc": "^51.0.1", "eslint-plugin-jsonc": "^2.20.1", "eslint-plugin-n": "^17.20.0", "eslint-plugin-perfectionist": "^4.14.0", "eslint-plugin-pnpm": "^0.3.1", "eslint-plugin-prettier": "^5.4.1", "eslint-plugin-regexp": "^2.9.0", "eslint-plugin-sxzz": "^0.3.0", "eslint-plugin-unicorn": "^59.0.1", "eslint-plugin-unused-imports": "^4.1.4", "eslint-plugin-vue": "^10.2.0", "eslint-plugin-yml": "^1.18.0", "globals": "^16.2.0", "jsonc-eslint-parser": "^2.4.0", "local-pkg": "^1.1.1", "prettier": "^3.5.3", "typescript-eslint": "^8.34.0", "vue-eslint-parser": "^10.1.3", "yaml-eslint-parser": "^1.3.0" }, "peerDependencies": { "@unocss/eslint-plugin": ">=65.0.0", "eslint": "^9.5.0" }, "optionalPeers": ["@unocss/eslint-plugin"] }, "sha512-+INlFNbVEAJeMBA4yW1D89snXmcqhDGKZKh8GNsKzFQeADSvteoP0TQ3zKfvL3Onih+8ue9duFubWiFMFvhStg=="], + "@sxzz/eslint-config": ["@sxzz/eslint-config@7.0.4", "", { "dependencies": { "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0", "@eslint/js": "^9.29.0", "@eslint/markdown": "^6.6.0", "eslint-config-flat-gitignore": "^2.1.0", "eslint-config-prettier": "^10.1.5", "eslint-flat-config-utils": "^2.1.0", "eslint-plugin-antfu": "^3.1.1", "eslint-plugin-command": "^3.3.0", "eslint-plugin-de-morgan": "^1.3.0", "eslint-plugin-import-x": "^4.15.2", "eslint-plugin-jsdoc": "^51.1.1", "eslint-plugin-jsonc": "^2.20.1", "eslint-plugin-n": "^17.20.0", "eslint-plugin-perfectionist": "^4.15.0", "eslint-plugin-pnpm": "^0.3.1", "eslint-plugin-prettier": "^5.5.0", "eslint-plugin-regexp": "^2.9.0", "eslint-plugin-sxzz": "^0.3.0", "eslint-plugin-unicorn": "^59.0.1", "eslint-plugin-unused-imports": "^4.1.4", "eslint-plugin-vue": "^10.2.0", "eslint-plugin-yml": "^1.18.0", "globals": "^16.2.0", "jsonc-eslint-parser": "^2.4.0", "local-pkg": "^1.1.1", "prettier": "^3.5.3", "typescript-eslint": "^8.34.1", "vue-eslint-parser": "^10.1.3", "yaml-eslint-parser": "^1.3.0" }, "peerDependencies": { "@unocss/eslint-plugin": ">=65.0.0", "eslint": "^9.5.0" }, "optionalPeers": ["@unocss/eslint-plugin"] }, "sha512-4o3stQQ5wVdQXJ4zWwHlfC5Mv489Ob6A7bmEnt2GGOr675eVV/IFqDdwu1MnbmcQVY5CVXsyhkBCNHQTjDqAiA=="], - "@sxzz/prettier-config": ["@sxzz/prettier-config@2.2.1", "", {}, "sha512-4eKrQdzJpMOFrUD9rFm1IfVkpchPvnPOObJvnX+DQB0KHRtHbU0vBwSpOLHioxLPYFwJGjSl6NC0trrCDkCtsA=="], + "@sxzz/prettier-config": ["@sxzz/prettier-config@2.2.3", "", { "dependencies": { "@prettier/plugin-oxc": "^0.0.4" } }, "sha512-J7pmxgW21XYjCRWD+yFjrgnBJPQOXFwSIMQtgZgixfmNS2K9cI7LBEpQwkU43AvYj0eJrm3JvZ6goXLSMGqq1A=="], "@tybys/wasm-util": ["@tybys/wasm-util@0.9.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw=="], @@ -255,7 +284,7 @@ "@types/ms": ["@types/ms@2.1.0", "", {}, "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="], - "@types/node": ["@types/node@24.0.3", "", { "dependencies": { "undici-types": "~7.8.0" } }, "sha512-R4I/kzCYAdRLzfiCabn9hxWfbuHS573x+r0dJMkkzThEa7pbrcDWK+9zu3e7aBOouf+rQAciqPFMnxwr0aWgKg=="], + "@types/node": ["@types/node@24.0.10", "", { "dependencies": { "undici-types": "~7.8.0" } }, "sha512-ENHwaH+JIRTDIEEbDK6QSQntAYGtbvdDXnMXnZaZ6k13Du1dPMmprkEHIL7ok2Wl2aZevetwTAb5S+7yIF+enA=="], "@types/unist": ["@types/unist@3.0.3", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="], @@ -357,7 +386,7 @@ "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], - "birpc": ["birpc@2.3.0", "", {}, "sha512-ijbtkn/F3Pvzb6jHypHRyve2QApOCZDR25D/VnkY2G/lBNcXCTsnsCxgY4k4PkVB7zfwzYbY3O9Lcqe3xufS5g=="], + "birpc": ["birpc@2.4.0", "", {}, "sha512-5IdNxTyhXHv2UlgnPHQ0h+5ypVmkrYHzL8QT+DwFZ//2N/oNV8Ch+BCRmTJ3x6/z9Axo/cXYBc9eprsUVK/Jsg=="], "boolbase": ["boolbase@1.0.0", "", {}, "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="], @@ -439,7 +468,7 @@ "electron-to-chromium": ["electron-to-chromium@1.5.165", "", {}, "sha512-naiMx1Z6Nb2TxPU6fiFrUrDTjyPMLdTtaOd2oLmG8zVSg2hCWGkhPyxwk+qRmZ1ytwVqUv0u7ZcDA5+ALhaUtw=="], - "empathic": ["empathic@1.1.0", "", {}, "sha512-rsPft6CK3eHtrlp9Y5ALBb+hfK+DWnA4WFebbazxjWyx8vSm3rZeoM3z9irsjcqO3PYRzlfv27XIB4tz2DV7RA=="], + "empathic": ["empathic@2.0.0", "", {}, "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA=="], "enhanced-resolve": ["enhanced-resolve@5.18.1", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" } }, "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg=="], @@ -451,7 +480,7 @@ "escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="], - "eslint": ["eslint@9.29.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.20.1", "@eslint/config-helpers": "^0.2.1", "@eslint/core": "^0.14.0", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "9.29.0", "@eslint/plugin-kit": "^0.3.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.4.0", "eslint-visitor-keys": "^4.2.1", "espree": "^10.4.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-GsGizj2Y1rCWDu6XoEekL3RLilp0voSePurjZIkxL3wlm5o5EC9VpgaP7lrCvjnkuLvzFBQWB3vWB3K5KQTveQ=="], + "eslint": ["eslint@9.30.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.21.0", "@eslint/config-helpers": "^0.3.0", "@eslint/core": "^0.14.0", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "9.30.1", "@eslint/plugin-kit": "^0.3.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.4.0", "eslint-visitor-keys": "^4.2.1", "espree": "^10.4.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-zmxXPNMOXmwm9E0yQLi5uqXHs7uq2UIiqEKo3Gq+3fwo1XrJ+hijAZImyF7hclW3E6oHz43Yk3RP8at6OTKflQ=="], "eslint-compat-utils": ["eslint-compat-utils@0.6.5", "", { "dependencies": { "semver": "^7.5.4" }, "peerDependencies": { "eslint": ">=6.0.0" } }, "sha512-vAUHYzue4YAa2hNACjB8HvUQj5yehAZgiClyFVVom9cP8z5NSFq3PwB/TtJslN2zAMgRX6FCFCjYBbQh71g5RQ=="], @@ -467,7 +496,7 @@ "eslint-plugin-antfu": ["eslint-plugin-antfu@3.1.1", "", { "peerDependencies": { "eslint": "*" } }, "sha512-7Q+NhwLfHJFvopI2HBZbSxWXngTwBLKxW1AGXLr2lEGxcEIK/AsDs8pn8fvIizl5aZjBbVbVK5ujmMpBe4Tvdg=="], - "eslint-plugin-command": ["eslint-plugin-command@3.2.1", "", { "dependencies": { "@es-joy/jsdoccomment": "^0.50.2" }, "peerDependencies": { "eslint": "*" } }, "sha512-PcpzWe8dvAPaBobxE9zgz1w94fO4JYvzciDzw6thlUb9Uqf5e2/gJz97itOGxvdq+mFeudi71m1OGFgvWmb93w=="], + "eslint-plugin-command": ["eslint-plugin-command@3.3.1", "", { "dependencies": { "@es-joy/jsdoccomment": "^0.50.2" }, "peerDependencies": { "eslint": "*" } }, "sha512-fBVTXQ2y48TVLT0+4A6PFINp7GcdIailHAXbvPBixE7x+YpYnNQhFZxTdvnb+aWk+COgNebQKen/7m4dmgyWAw=="], "eslint-plugin-de-morgan": ["eslint-plugin-de-morgan@1.3.0", "", { "peerDependencies": { "eslint": ">=8.0.0" } }, "sha512-UHCQ4XyDaEeSmk7lI0O1TEcsSBkvdyY8FV4H9TN2DvBfKV45SJR/qZ/rYwzt8JSBIbMXy8S0vNBhzngnpIreJw=="], @@ -475,17 +504,17 @@ "eslint-plugin-import-x": ["eslint-plugin-import-x@4.15.2", "", { "dependencies": { "@typescript-eslint/types": "^8.34.0", "comment-parser": "^1.4.1", "debug": "^4.4.1", "eslint-import-context": "^0.1.8", "is-glob": "^4.0.3", "minimatch": "^9.0.3 || ^10.0.1", "semver": "^7.7.2", "stable-hash-x": "^0.1.1", "unrs-resolver": "^1.9.0" }, "peerDependencies": { "@typescript-eslint/utils": "^8.0.0", "eslint": "^8.57.0 || ^9.0.0", "eslint-import-resolver-node": "*" }, "optionalPeers": ["@typescript-eslint/utils", "eslint-import-resolver-node"] }, "sha512-J5gx7sN6DTm0LRT//eP3rVVQ2Yi4hrX0B+DbWxa5er8PZ6JjLo9GUBwogIFvEDdwJaSqZplpQT+haK/cXhb7VQ=="], - "eslint-plugin-jsdoc": ["eslint-plugin-jsdoc@51.0.6", "", { "dependencies": { "@es-joy/jsdoccomment": "~0.51.1", "are-docs-informative": "^0.0.2", "comment-parser": "1.4.1", "debug": "^4.4.1", "escape-string-regexp": "^4.0.0", "espree": "^10.4.0", "esquery": "^1.6.0", "parse-imports-exports": "^0.2.4", "semver": "^7.7.2", "spdx-expression-parse": "^4.0.0" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" } }, "sha512-irPgtHKUnufQqbUzNyus9Y+oGW5SIxXdcxLGN013rCLyxq2G+wBzCfC0vkeMGYwRUY9PRD3y6fR4fPLowDzrNA=="], + "eslint-plugin-jsdoc": ["eslint-plugin-jsdoc@51.3.4", "", { "dependencies": { "@es-joy/jsdoccomment": "~0.52.0", "are-docs-informative": "^0.0.2", "comment-parser": "1.4.1", "debug": "^4.4.1", "escape-string-regexp": "^4.0.0", "espree": "^10.4.0", "esquery": "^1.6.0", "parse-imports-exports": "^0.2.4", "semver": "^7.7.2", "spdx-expression-parse": "^4.0.0" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" } }, "sha512-maz6qa95+sAjMr9m5oRyfejc+mnyQWsWSe9oyv9371bh4/T0kWOMryJNO4h8rEd97wo/9lbzwi3OOX4rDhnAzg=="], "eslint-plugin-jsonc": ["eslint-plugin-jsonc@2.20.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.5.1", "eslint-compat-utils": "^0.6.4", "eslint-json-compat-utils": "^0.2.1", "espree": "^9.6.1 || ^10.3.0", "graphemer": "^1.4.0", "jsonc-eslint-parser": "^2.4.0", "natural-compare": "^1.4.0", "synckit": "^0.6.2 || ^0.7.3 || ^0.11.5" }, "peerDependencies": { "eslint": ">=6.0.0" } }, "sha512-gUzIwQHXx7ZPypUoadcyRi4WbHW2TPixDr0kqQ4miuJBU0emJmyGTlnaT3Og9X2a8R1CDayN9BFSq5weGWbTng=="], "eslint-plugin-n": ["eslint-plugin-n@17.20.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.5.0", "@typescript-eslint/utils": "^8.26.1", "enhanced-resolve": "^5.17.1", "eslint-plugin-es-x": "^7.8.0", "get-tsconfig": "^4.8.1", "globals": "^15.11.0", "ignore": "^5.3.2", "minimatch": "^9.0.5", "semver": "^7.6.3", "ts-declaration-location": "^1.0.6" }, "peerDependencies": { "eslint": ">=8.23.0" } }, "sha512-IRSoatgB/NQJZG5EeTbv/iAx1byOGdbbyhQrNvWdCfTnmPxUT0ao9/eGOeG7ljD8wJBsxwE8f6tES5Db0FRKEw=="], - "eslint-plugin-perfectionist": ["eslint-plugin-perfectionist@4.14.0", "", { "dependencies": { "@typescript-eslint/types": "^8.33.1", "@typescript-eslint/utils": "^8.33.1", "natural-orderby": "^5.0.0" }, "peerDependencies": { "eslint": ">=8.45.0" } }, "sha512-BkhiOqzdum8vQSFgj1/q5+6UUWPMn4GELdxuX7uIsGegmAeH/+LnWsiVxgMrxalD0p68sYfMeKaHF1NfrpI/mg=="], + "eslint-plugin-perfectionist": ["eslint-plugin-perfectionist@4.15.0", "", { "dependencies": { "@typescript-eslint/types": "^8.34.1", "@typescript-eslint/utils": "^8.34.1", "natural-orderby": "^5.0.0" }, "peerDependencies": { "eslint": ">=8.45.0" } }, "sha512-pC7PgoXyDnEXe14xvRUhBII8A3zRgggKqJFx2a82fjrItDs1BSI7zdZnQtM2yQvcyod6/ujmzb7ejKPx8lZTnw=="], "eslint-plugin-pnpm": ["eslint-plugin-pnpm@0.3.1", "", { "dependencies": { "find-up-simple": "^1.0.1", "jsonc-eslint-parser": "^2.4.0", "pathe": "^2.0.3", "pnpm-workspace-yaml": "0.3.1", "tinyglobby": "^0.2.12", "yaml-eslint-parser": "^1.3.0" }, "peerDependencies": { "eslint": "^9.0.0" } }, "sha512-vi5iHoELIAlBbX4AW8ZGzU3tUnfxuXhC/NKo3qRcI5o9igbz6zJUqSlQ03bPeMqWIGTPatZnbWsNR1RnlNERNQ=="], - "eslint-plugin-prettier": ["eslint-plugin-prettier@5.4.1", "", { "dependencies": { "prettier-linter-helpers": "^1.0.0", "synckit": "^0.11.7" }, "peerDependencies": { "@types/eslint": ">=8.0.0", "eslint": ">=8.0.0", "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", "prettier": ">=3.0.0" }, "optionalPeers": ["@types/eslint", "eslint-config-prettier"] }, "sha512-9dF+KuU/Ilkq27A8idRP7N2DH8iUR6qXcjF3FR2wETY21PZdBrIjwCau8oboyGj9b7etWmTGEeM8e7oOed6ZWg=="], + "eslint-plugin-prettier": ["eslint-plugin-prettier@5.5.1", "", { "dependencies": { "prettier-linter-helpers": "^1.0.0", "synckit": "^0.11.7" }, "peerDependencies": { "@types/eslint": ">=8.0.0", "eslint": ">=8.0.0", "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", "prettier": ">=3.0.0" }, "optionalPeers": ["@types/eslint", "eslint-config-prettier"] }, "sha512-dobTkHT6XaEVOo8IO90Q4DOSxnm3Y151QxPJlM/vKC0bVy+d6cVWQZLlFiuZPP0wS6vZwSKeJgKkcS+KfMBlRw=="], "eslint-plugin-regexp": ["eslint-plugin-regexp@2.9.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.11.0", "comment-parser": "^1.4.0", "jsdoc-type-pratt-parser": "^4.0.0", "refa": "^0.12.1", "regexp-ast-analysis": "^0.7.1", "scslre": "^0.3.0" }, "peerDependencies": { "eslint": ">=8.44.0" } }, "sha512-9WqJMnOq8VlE/cK+YAo9C9YHhkOtcEtEk9d12a+H7OSZFwlpI6stiHmYPGa2VE0QhTzodJyhlyprUaXDZLgHBw=="], @@ -557,6 +586,8 @@ "giget": ["giget@2.0.0", "", { "dependencies": { "citty": "^0.1.6", "consola": "^3.4.0", "defu": "^6.1.4", "node-fetch-native": "^1.6.6", "nypm": "^0.6.0", "pathe": "^2.0.3" }, "bin": { "giget": "dist/cli.mjs" } }, "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA=="], + "github-slugger": ["github-slugger@2.0.0", "", {}, "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw=="], + "glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="], "globals": ["globals@16.2.0", "", {}, "sha512-O+7l9tPdHCU320IigZZPj5zmRCFG9xHmx9cU8FqU2Rp+JN714seHV+2S9+JslCpY4gJwU2vOGox0wzgae/MCEg=="], @@ -747,6 +778,8 @@ "ox": ["ox@0.8.1", "", { "dependencies": { "@adraffy/ens-normalize": "^1.11.0", "@noble/ciphers": "^1.3.0", "@noble/curves": "^1.9.1", "@noble/hashes": "^1.8.0", "@scure/bip32": "^1.7.0", "@scure/bip39": "^1.6.0", "abitype": "^1.0.8", "eventemitter3": "5.0.1" }, "peerDependencies": { "typescript": ">=5.4.0" }, "optionalPeers": ["typescript"] }, "sha512-e+z5epnzV+Zuz91YYujecW8cF01mzmrUtWotJ0oEPym/G82uccs7q0WDHTYL3eiONbTUEvcZrptAKLgTBD3u2A=="], + "oxc-parser": ["oxc-parser@0.74.0", "", { "dependencies": { "@oxc-project/types": "^0.74.0" }, "optionalDependencies": { "@oxc-parser/binding-android-arm64": "0.74.0", "@oxc-parser/binding-darwin-arm64": "0.74.0", "@oxc-parser/binding-darwin-x64": "0.74.0", "@oxc-parser/binding-freebsd-x64": "0.74.0", "@oxc-parser/binding-linux-arm-gnueabihf": "0.74.0", "@oxc-parser/binding-linux-arm-musleabihf": "0.74.0", "@oxc-parser/binding-linux-arm64-gnu": "0.74.0", "@oxc-parser/binding-linux-arm64-musl": "0.74.0", "@oxc-parser/binding-linux-riscv64-gnu": "0.74.0", "@oxc-parser/binding-linux-s390x-gnu": "0.74.0", "@oxc-parser/binding-linux-x64-gnu": "0.74.0", "@oxc-parser/binding-linux-x64-musl": "0.74.0", "@oxc-parser/binding-wasm32-wasi": "0.74.0", "@oxc-parser/binding-win32-arm64-msvc": "0.74.0", "@oxc-parser/binding-win32-x64-msvc": "0.74.0" } }, "sha512-2tDN/ttU8WE6oFh8EzKNam7KE7ZXSG5uXmvX85iNzxdJfMssDWcj3gpYzZi1E04XuE7m3v1dVWl/8BE886vPGw=="], + "p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], "p-locate": ["p-locate@5.0.0", "", { "dependencies": { "p-limit": "^3.0.2" } }, "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw=="], @@ -785,7 +818,7 @@ "prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="], - "prettier": ["prettier@3.5.3", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw=="], + "prettier": ["prettier@3.6.2", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ=="], "prettier-linter-helpers": ["prettier-linter-helpers@1.0.0", "", { "dependencies": { "fast-diff": "^1.1.2" } }, "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w=="], @@ -813,9 +846,9 @@ "reusify": ["reusify@1.1.0", "", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="], - "rolldown": ["rolldown@1.0.0-beta.15", "", { "dependencies": { "@oxc-project/runtime": "=0.72.3", "@oxc-project/types": "=0.72.3", "@rolldown/pluginutils": "1.0.0-beta.15", "ansis": "^4.0.0" }, "optionalDependencies": { "@rolldown/binding-darwin-arm64": "1.0.0-beta.15", "@rolldown/binding-darwin-x64": "1.0.0-beta.15", "@rolldown/binding-freebsd-x64": "1.0.0-beta.15", "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.15", "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.15", "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.15", "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.15", "@rolldown/binding-linux-x64-musl": "1.0.0-beta.15", "@rolldown/binding-wasm32-wasi": "1.0.0-beta.15", "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.15", "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.15", "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.15" }, "bin": { "rolldown": "bin/cli.mjs" } }, "sha512-ep788NsIGl0W5gT+99hBrSGe4Hdhcwc55PqM3O0mR5H0C4ZpGpDGgu9YzTJ8a6mFDLnFnc/LYC+Dszb7oWK/dg=="], + "rolldown": ["rolldown@1.0.0-beta.9-commit.d91dfb5", "", { "dependencies": { "@oxc-project/runtime": "0.71.0", "@oxc-project/types": "0.71.0", "@rolldown/pluginutils": "1.0.0-beta.9-commit.d91dfb5", "ansis": "^4.0.0" }, "optionalDependencies": { "@rolldown/binding-darwin-arm64": "1.0.0-beta.9-commit.d91dfb5", "@rolldown/binding-darwin-x64": "1.0.0-beta.9-commit.d91dfb5", "@rolldown/binding-freebsd-x64": "1.0.0-beta.9-commit.d91dfb5", "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.9-commit.d91dfb5", "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.9-commit.d91dfb5", "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.9-commit.d91dfb5", "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.9-commit.d91dfb5", "@rolldown/binding-linux-x64-musl": "1.0.0-beta.9-commit.d91dfb5", "@rolldown/binding-wasm32-wasi": "1.0.0-beta.9-commit.d91dfb5", "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.9-commit.d91dfb5", "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.9-commit.d91dfb5", "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.9-commit.d91dfb5" }, "bin": { "rolldown": "bin/cli.mjs" } }, "sha512-FHkj6gGEiEgmAXQchglofvUUdwj2Oiw603Rs+zgFAnn9Cb7T7z3fiaEc0DbN3ja4wYkW6sF2rzMEtC1V4BGx/g=="], - "rolldown-plugin-dts": ["rolldown-plugin-dts@0.13.11", "", { "dependencies": { "@babel/generator": "^7.27.5", "@babel/parser": "^7.27.5", "@babel/types": "^7.27.6", "ast-kit": "^2.1.0", "birpc": "^2.3.0", "debug": "^4.4.1", "dts-resolver": "^2.1.1", "get-tsconfig": "^4.10.1" }, "peerDependencies": { "@typescript/native-preview": ">=7.0.0-dev.20250601.1", "rolldown": "^1.0.0-beta.9", "typescript": "^5.0.0", "vue-tsc": "~2.2.0" }, "optionalPeers": ["@typescript/native-preview", "typescript", "vue-tsc"] }, "sha512-1TScN31JImk8xcq9kdm52z2W8/QX3zeDpEjFkyZmK+GcD0u8QqSWWARBsCEdfS99NyI6D9NIbUpsABXlcpZhig=="], + "rolldown-plugin-dts": ["rolldown-plugin-dts@0.13.13", "", { "dependencies": { "@babel/generator": "^7.27.5", "@babel/parser": "^7.27.7", "@babel/types": "^7.27.7", "ast-kit": "^2.1.0", "birpc": "^2.4.0", "debug": "^4.4.1", "dts-resolver": "^2.1.1", "get-tsconfig": "^4.10.1" }, "peerDependencies": { "@typescript/native-preview": ">=7.0.0-dev.20250601.1", "rolldown": "^1.0.0-beta.9", "typescript": "^5.0.0", "vue-tsc": "~2.2.0" }, "optionalPeers": ["@typescript/native-preview", "typescript", "vue-tsc"] }, "sha512-Nchx9nQoa4IpfQ/BJzodKMvtJ3H3dT322siAJSp3uvQJ+Pi1qgEjOp7hSQwGSQRhaC5gC+9hparbWEH5oiAL9Q=="], "rollup": ["rollup@4.42.0", "", { "dependencies": { "@types/estree": "1.0.7" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.42.0", "@rollup/rollup-android-arm64": "4.42.0", "@rollup/rollup-darwin-arm64": "4.42.0", "@rollup/rollup-darwin-x64": "4.42.0", "@rollup/rollup-freebsd-arm64": "4.42.0", "@rollup/rollup-freebsd-x64": "4.42.0", "@rollup/rollup-linux-arm-gnueabihf": "4.42.0", "@rollup/rollup-linux-arm-musleabihf": "4.42.0", "@rollup/rollup-linux-arm64-gnu": "4.42.0", "@rollup/rollup-linux-arm64-musl": "4.42.0", "@rollup/rollup-linux-loongarch64-gnu": "4.42.0", "@rollup/rollup-linux-powerpc64le-gnu": "4.42.0", "@rollup/rollup-linux-riscv64-gnu": "4.42.0", "@rollup/rollup-linux-riscv64-musl": "4.42.0", "@rollup/rollup-linux-s390x-gnu": "4.42.0", "@rollup/rollup-linux-x64-gnu": "4.42.0", "@rollup/rollup-linux-x64-musl": "4.42.0", "@rollup/rollup-win32-arm64-msvc": "4.42.0", "@rollup/rollup-win32-ia32-msvc": "4.42.0", "@rollup/rollup-win32-x64-msvc": "4.42.0", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-LW+Vse3BJPyGJGAJt1j8pWDKPd73QM8cRXYK1IxOBgL2AGLu7Xd2YOW0M2sLUBCkF5MshXXtMApyEAEzMVMsnw=="], @@ -875,7 +908,7 @@ "ts-declaration-location": ["ts-declaration-location@1.0.7", "", { "dependencies": { "picomatch": "^4.0.2" }, "peerDependencies": { "typescript": ">=4.0.0" } }, "sha512-EDyGAwH1gO0Ausm9gV6T2nUvBgXT5kGoCMJPllOaooZ+4VvJiKBdZE7wK18N1deEowhcUptS+5GXZK8U/fvpwA=="], - "tsdown": ["tsdown@0.12.8", "", { "dependencies": { "ansis": "^4.1.0", "cac": "^6.7.14", "chokidar": "^4.0.3", "debug": "^4.4.1", "diff": "^8.0.2", "empathic": "^1.1.0", "hookable": "^5.5.3", "rolldown": "1.0.0-beta.15", "rolldown-plugin-dts": "^0.13.11", "semver": "^7.7.2", "tinyexec": "^1.0.1", "tinyglobby": "^0.2.14", "unconfig": "^7.3.2" }, "peerDependencies": { "@arethetypeswrong/core": "^0.18.1", "publint": "^0.3.0", "typescript": "^5.0.0", "unplugin-lightningcss": "^0.4.0", "unplugin-unused": "^0.5.0" }, "optionalPeers": ["@arethetypeswrong/core", "publint", "typescript", "unplugin-lightningcss", "unplugin-unused"], "bin": { "tsdown": "dist/run.mjs" } }, "sha512-niHeVcFCNjvVZYVGTeoM4BF+/DWxP8pFH2tUs71sEKYdcKtJIbkSdEmtxByaRZeMgwVbVgPb8nv9i9okVwFLAA=="], + "tsdown": ["tsdown@0.12.9", "", { "dependencies": { "ansis": "^4.1.0", "cac": "^6.7.14", "chokidar": "^4.0.3", "debug": "^4.4.1", "diff": "^8.0.2", "empathic": "^2.0.0", "hookable": "^5.5.3", "rolldown": "^1.0.0-beta.19", "rolldown-plugin-dts": "^0.13.12", "semver": "^7.7.2", "tinyexec": "^1.0.1", "tinyglobby": "^0.2.14", "unconfig": "^7.3.2" }, "peerDependencies": { "@arethetypeswrong/core": "^0.18.1", "publint": "^0.3.0", "typescript": "^5.0.0", "unplugin-lightningcss": "^0.4.0", "unplugin-unused": "^0.5.0" }, "optionalPeers": ["@arethetypeswrong/core", "publint", "typescript", "unplugin-lightningcss", "unplugin-unused"], "bin": { "tsdown": "dist/run.mjs" } }, "sha512-MfrXm9PIlT3saovtWKf/gCJJ/NQCdE0SiREkdNC+9Qy6UHhdeDPxnkFaBD7xttVUmgp0yUHtGirpoLB+OVLuLA=="], "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], @@ -909,7 +942,7 @@ "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], - "viem": ["viem@2.31.3", "", { "dependencies": { "@noble/curves": "1.9.2", "@noble/hashes": "1.8.0", "@scure/bip32": "1.7.0", "@scure/bip39": "1.6.0", "abitype": "1.0.8", "isows": "1.0.7", "ox": "0.8.1", "ws": "8.18.2" }, "peerDependencies": { "typescript": ">=5.0.4" }, "optionalPeers": ["typescript"] }, "sha512-q3JGI5QFB4LEiLfg9f2ZwjUygAn2W0wMLtj++7E/L2i8Y7zKAkR4TEEOhwBn7gyYXpuc7f1vfd26PJbkEKuj5w=="], + "viem": ["viem@2.31.7", "", { "dependencies": { "@noble/curves": "1.9.2", "@noble/hashes": "1.8.0", "@scure/bip32": "1.7.0", "@scure/bip39": "1.6.0", "abitype": "1.0.8", "isows": "1.0.7", "ox": "0.8.1", "ws": "8.18.2" }, "peerDependencies": { "typescript": ">=5.0.4" }, "optionalPeers": ["typescript"] }, "sha512-mpB8Hp6xK77E/b/yJmpAIQcxcOfpbrwWNItjnXaIA8lxZYt4JS433Pge2gg6Hp3PwyFtaUMh01j5L8EXnLTjQQ=="], "vite": ["vite@6.3.5", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", "tinyglobby": "^0.2.13" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ=="], @@ -939,6 +972,10 @@ "zwitch": ["zwitch@2.0.4", "", {}, "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A=="], + "@babel/generator/@babel/parser": ["@babel/parser@7.27.5", "", { "dependencies": { "@babel/types": "^7.27.3" }, "bin": "./bin/babel-parser.js" }, "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg=="], + + "@babel/generator/@babel/types": ["@babel/types@7.27.6", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" } }, "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q=="], + "@es-joy/jsdoccomment/@typescript-eslint/types": ["@typescript-eslint/types@8.33.1", "", {}, "sha512-xid1WfizGhy/TKMTwhtVOgalHwPtV8T32MS9MaH50Cwvz6x6YqRIPdD2WvW0XaqOzTV9p5xdLY0h/ZusU5Lokg=="], "@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="], @@ -973,6 +1010,8 @@ "@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@4.2.0", "", {}, "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw=="], + "ast-kit/@babel/parser": ["@babel/parser@7.27.5", "", { "dependencies": { "@babel/types": "^7.27.3" }, "bin": "./bin/babel-parser.js" }, "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg=="], + "chai/loupe": ["loupe@3.1.3", "", {}, "sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug=="], "clean-regexp/escape-string-regexp": ["escape-string-regexp@1.0.5", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="], @@ -981,7 +1020,7 @@ "eslint-plugin-import-x/minimatch": ["minimatch@10.0.1", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ=="], - "eslint-plugin-jsdoc/@es-joy/jsdoccomment": ["@es-joy/jsdoccomment@0.51.1", "", { "dependencies": { "@types/estree": "^1.0.8", "@typescript-eslint/types": "^8.34.1", "comment-parser": "1.4.1", "esquery": "^1.6.0", "jsdoc-type-pratt-parser": "~4.1.0" } }, "sha512-fPn7AW/unCg3JRLt8Wg44HLRVkAEfkFIXiGRJbeOIrd7Hgl4iOFwVHpvVR8I5hJYpn5mNFWwIXR6A16ZRA/M9w=="], + "eslint-plugin-jsdoc/@es-joy/jsdoccomment": ["@es-joy/jsdoccomment@0.52.0", "", { "dependencies": { "@types/estree": "^1.0.8", "@typescript-eslint/types": "^8.34.1", "comment-parser": "1.4.1", "esquery": "^1.6.0", "jsdoc-type-pratt-parser": "~4.1.0" } }, "sha512-BXuN7BII+8AyNtn57euU2Yxo9yA/KUDNzrpXyi3pfqKmBhhysR6ZWOebFh3vyPoqA3/j1SOvGgucElMGwlXing=="], "eslint-plugin-jsonc/espree": ["espree@10.3.0", "", { "dependencies": { "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^4.2.0" } }, "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg=="], @@ -989,7 +1028,7 @@ "eslint-plugin-n/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], - "eslint-plugin-perfectionist/@typescript-eslint/types": ["@typescript-eslint/types@8.33.1", "", {}, "sha512-xid1WfizGhy/TKMTwhtVOgalHwPtV8T32MS9MaH50Cwvz6x6YqRIPdD2WvW0XaqOzTV9p5xdLY0h/ZusU5Lokg=="], + "eslint-plugin-perfectionist/@typescript-eslint/utils": ["@typescript-eslint/utils@8.34.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", "@typescript-eslint/scope-manager": "8.34.1", "@typescript-eslint/types": "8.34.1", "@typescript-eslint/typescript-estree": "8.34.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-mqOwUdZ3KjtGk7xJJnLbHxTuWVn3GO2WZZuM+Slhkun4+qthLdXx32C8xIXbO1kfCECb3jIs3eoxK3eryk7aoQ=="], "eslint-plugin-unicorn/@eslint/plugin-kit": ["@eslint/plugin-kit@0.2.8", "", { "dependencies": { "@eslint/core": "^0.13.0", "levn": "^0.4.1" } }, "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA=="], @@ -1011,6 +1050,8 @@ "nypm/tinyexec": ["tinyexec@0.3.2", "", {}, "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA=="], + "oxc-parser/@oxc-project/types": ["@oxc-project/types@0.74.0", "", {}, "sha512-KOw/RZrVlHGhCXh1RufBFF7Nuo7HdY5w1lRJukM/igIl6x9qtz8QycDvZdzb4qnHO7znrPyo2sJrFJK2eKHgfQ=="], + "regjsparser/jsesc": ["jsesc@3.0.2", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g=="], "rollup/@types/estree": ["@types/estree@1.0.7", "", {}, "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ=="], @@ -1039,12 +1080,18 @@ "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], + "ast-kit/@babel/parser/@babel/types": ["@babel/types@7.27.6", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" } }, "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q=="], + "eslint-plugin-import-x/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], "eslint-plugin-jsonc/espree/eslint-visitor-keys": ["eslint-visitor-keys@4.2.0", "", {}, "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw=="], "eslint-plugin-n/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], + "eslint-plugin-perfectionist/@typescript-eslint/utils/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.34.1", "", { "dependencies": { "@typescript-eslint/types": "8.34.1", "@typescript-eslint/visitor-keys": "8.34.1" } }, "sha512-beu6o6QY4hJAgL1E8RaXNC071G4Kso2MGmJskCFQhRhg8VOH/FDbC8soP8NHN7e/Hdphwp8G8cE6OBzC8o41ZA=="], + + "eslint-plugin-perfectionist/@typescript-eslint/utils/@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.34.1", "", { "dependencies": { "@typescript-eslint/project-service": "8.34.1", "@typescript-eslint/tsconfig-utils": "8.34.1", "@typescript-eslint/types": "8.34.1", "@typescript-eslint/visitor-keys": "8.34.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-rjCNqqYPuMUF5ODD+hWBNmOitjBWghkGKJg6hiCHzUvXRy6rK22Jd3rwbP2Xi+R7oYVvIKhokHVhH41BxPV5mA=="], + "eslint-plugin-unicorn/@eslint/plugin-kit/@eslint/core": ["@eslint/core@0.13.0", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw=="], "happy-dom/@types/node/undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], @@ -1065,6 +1112,16 @@ "@typescript-eslint/parser/@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], + "eslint-plugin-perfectionist/@typescript-eslint/utils/@typescript-eslint/scope-manager/@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.34.1", "", { "dependencies": { "@typescript-eslint/types": "8.34.1", "eslint-visitor-keys": "^4.2.1" } }, "sha512-xoh5rJ+tgsRKoXnkBPFRLZ7rjKM0AfVbC68UZ/ECXoDbfggb9RbEySN359acY1vS3qZ0jVTVWzbtfapwm5ztxw=="], + + "eslint-plugin-perfectionist/@typescript-eslint/utils/@typescript-eslint/typescript-estree/@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.34.1", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.34.1", "@typescript-eslint/types": "^8.34.1", "debug": "^4.3.4" }, "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-nuHlOmFZfuRwLJKDGQOVc0xnQrAmuq1Mj/ISou5044y1ajGNp2BNliIqp7F2LPQ5sForz8lempMFCovfeS1XoA=="], + + "eslint-plugin-perfectionist/@typescript-eslint/utils/@typescript-eslint/typescript-estree/@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.34.1", "", { "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-K4Sjdo4/xF9NEeA2khOb7Y5nY6NSXBnod87uniVYW9kHP+hNlDV8trUSFeynA2uxWam4gIWgWoygPrv9VMWrYg=="], + + "eslint-plugin-perfectionist/@typescript-eslint/utils/@typescript-eslint/typescript-estree/@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.34.1", "", { "dependencies": { "@typescript-eslint/types": "8.34.1", "eslint-visitor-keys": "^4.2.1" } }, "sha512-xoh5rJ+tgsRKoXnkBPFRLZ7rjKM0AfVbC68UZ/ECXoDbfggb9RbEySN359acY1vS3qZ0jVTVWzbtfapwm5ztxw=="], + + "eslint-plugin-perfectionist/@typescript-eslint/utils/@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], + "typescript-eslint/@typescript-eslint/eslint-plugin/@typescript-eslint/type-utils/@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.34.1", "", { "dependencies": { "@typescript-eslint/project-service": "8.34.1", "@typescript-eslint/tsconfig-utils": "8.34.1", "@typescript-eslint/types": "8.34.1", "@typescript-eslint/visitor-keys": "8.34.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-rjCNqqYPuMUF5ODD+hWBNmOitjBWghkGKJg6hiCHzUvXRy6rK22Jd3rwbP2Xi+R7oYVvIKhokHVhH41BxPV5mA=="], "typescript-eslint/@typescript-eslint/utils/@typescript-eslint/scope-manager/@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.34.1", "", { "dependencies": { "@typescript-eslint/types": "8.34.1", "eslint-visitor-keys": "^4.2.1" } }, "sha512-xoh5rJ+tgsRKoXnkBPFRLZ7rjKM0AfVbC68UZ/ECXoDbfggb9RbEySN359acY1vS3qZ0jVTVWzbtfapwm5ztxw=="], @@ -1077,6 +1134,8 @@ "typescript-eslint/@typescript-eslint/utils/@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], + "eslint-plugin-perfectionist/@typescript-eslint/utils/@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], + "typescript-eslint/@typescript-eslint/eslint-plugin/@typescript-eslint/type-utils/@typescript-eslint/typescript-estree/@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.34.1", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.34.1", "@typescript-eslint/types": "^8.34.1", "debug": "^4.3.4" }, "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-nuHlOmFZfuRwLJKDGQOVc0xnQrAmuq1Mj/ISou5044y1ajGNp2BNliIqp7F2LPQ5sForz8lempMFCovfeS1XoA=="], "typescript-eslint/@typescript-eslint/eslint-plugin/@typescript-eslint/type-utils/@typescript-eslint/typescript-estree/@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.34.1", "", { "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-K4Sjdo4/xF9NEeA2khOb7Y5nY6NSXBnod87uniVYW9kHP+hNlDV8trUSFeynA2uxWam4gIWgWoygPrv9VMWrYg=="], diff --git a/package.json b/package.json index 629420f..c543b76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shreds", - "version": "0.1.6", + "version": "0.2.1", "packageManager": "bun@1.2.16", "description": "Shreds client for the Rise Network.", "type": "module", @@ -44,21 +44,18 @@ "prepublishOnly": "bun run build" }, "peerDependencies": { - "viem": "^2.30.0" - }, - "dependencies": { - "isows": "^1.0.7" + "viem": "^2.31.7" }, "devDependencies": { - "@sxzz/eslint-config": "^7.0.3", - "@sxzz/prettier-config": "^2.2.1", - "@types/node": "^24.0.3", + "@sxzz/eslint-config": "^7.0.4", + "@sxzz/prettier-config": "^2.2.3", + "@types/node": "^24.0.10", "abitype": "^1.0.8", "bumpp": "^10.2.0", - "eslint": "^9.29.0", + "eslint": "^9.30.1", "happy-dom": "^18.0.1", - "prettier": "^3.5.3", - "tsdown": "^0.12.8", + "prettier": "^3.6.2", + "tsdown": "^0.12.9", "tsx": "^4.20.3", "typescript": "^5.8.3", "vitest": "^3.2.4" diff --git a/src/viem/actions/shred/watchContractShredEvent.ts b/src/viem/actions/shred/watchContractShredEvent.ts deleted file mode 100644 index a648813..0000000 --- a/src/viem/actions/shred/watchContractShredEvent.ts +++ /dev/null @@ -1,206 +0,0 @@ -import { - decodeEventLog, - DecodeLogDataMismatch, - DecodeLogTopicsMismatch, - encodeEventTopics, - formatLog, - type Chain, - type Client, - type ContractEventArgs, - type ContractEventName, - type EncodeEventTopicsParameters, - type FallbackTransport, - type LogTopic, - type Transport, -} from 'viem' -import type { ShredsWebSocketTransport } from '../../clients/transports/shredsWebSocket' -import type { ShredLog } from '../../types/log' -import type { Abi, Address, ExtractAbiEvent } from 'abitype' - -/** - * The parameter for the `onLogs` callback in {@link watchContractShredEvent}. - */ -export type WatchContractShredEventOnLogsParameter< - abi extends Abi | readonly unknown[] = Abi, - eventName extends ContractEventName = ContractEventName, - strict extends boolean | undefined = undefined, -> = abi extends Abi - ? Abi extends abi - ? ShredLog[] - : ShredLog, strict>[] - : ShredLog[] - -/** - * The callback function for when new contract event logs are received in {@link watchContractShredEvent}. - */ -export type WatchContractShredEventOnLogsFn< - abi extends Abi | readonly unknown[] = Abi, - eventName extends ContractEventName = ContractEventName, - strict extends boolean | undefined = undefined, -> = ( - logs: WatchContractShredEventOnLogsParameter, -) => void - -/** - * Parameters for {@link watchContractShredEvent}. - */ -export type WatchContractShredEventParameters< - abi extends Abi | readonly unknown[] = Abi, - eventName extends ContractEventName | undefined = ContractEventName, - strict extends boolean | undefined = undefined, -> = { - /** The address of the contract. */ - address?: Address | Address[] | undefined - /** Contract ABI. */ - abi: abi - args?: - | ContractEventArgs< - abi, - eventName extends ContractEventName - ? eventName - : ContractEventName - > - | undefined - /** Contract event. */ - eventName?: eventName | ContractEventName | undefined - /** The callback to call when an error occurred when trying to get for a new block. */ - onError?: ((error: Error) => void) | undefined - /** The callback to call when new event logs are received. */ - onLogs: WatchContractShredEventOnLogsFn< - abi, - eventName extends ContractEventName - ? eventName - : ContractEventName, - strict - > - /** - * Whether or not the logs must match the indexed/non-indexed arguments on `event`. - * @default false - */ - strict?: strict | boolean | undefined -} - -/** - * Return type for {@link watchContractShredEvent}. - */ -export type WatchContractShredEventReturnType = () => void - -/** - * Watches and returns emitted contract events that have been processed and confirmed as shreds - * on the RISE network. - * - * @param client - Client to use. - * @param parameters - {@link WatchContractShredEventParameters} - * @returns A function that can be used to unsubscribe from the event. {@link WatchContractShredEventReturnType} - */ -export function watchContractShredEvent< - chain extends Chain | undefined, - const abi_ extends Abi | readonly unknown[], - eventName_ extends ContractEventName | undefined = undefined, - strict extends boolean | undefined = undefined, - transport extends - | ShredsWebSocketTransport - | FallbackTransport< - readonly [ShredsWebSocketTransport, ...Transport[]] - > = ShredsWebSocketTransport, ->( - client: Client, - parameters: WatchContractShredEventParameters, -): WatchContractShredEventReturnType { - const { - abi, - address, - args, - eventName, - onError, - onLogs, - strict: strict_, - } = parameters - - const transport_ = (() => { - if (client.transport.type === 'webSocket') return client.transport - - const wsTransport = ( - client.transport as ReturnType< - FallbackTransport - >['value'] - )?.transports.find( - (transport: ReturnType) => - transport.config.type === 'webSocket', - ) - - if (!wsTransport) throw new Error('A shredWebSocket transport is required') - - return wsTransport.value - })() as NonNullable['value']> - - const subscribeShredContractEvent = () => { - let active = true - let unsubscribe = () => { - active = false - } - - ;(async () => { - try { - const topics: LogTopic[] = eventName - ? encodeEventTopics({ - abi, - eventName, - args, - } as EncodeEventTopicsParameters) - : [] - - const { unsubscribe: unsubscribe_ } = await transport_.riseSubscribe({ - params: ['logs', { address, topics }], - onData(data: any) { - if (!active) return - const log = data.result - try { - const { eventName, args } = decodeEventLog({ - abi, - data: log.data, - topics: log.topics as any, - strict: strict_, - }) - const formatted = formatLog(log, { - args, - eventName: eventName as string, - }) - onLogs([formatted] as any) - } catch (error) { - let eventName: string | undefined - let isUnnamed: boolean | undefined - if ( - error instanceof DecodeLogDataMismatch || - error instanceof DecodeLogTopicsMismatch - ) { - // If strict mode is on, and log data/topics do not match event definition, skip. - if (strict_) return - eventName = error.abiItem.name - isUnnamed = error.abiItem.inputs?.some( - (x) => !('name' in x) || !x.name, - ) - } - - // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch). - const formatted = formatLog(log, { - args: isUnnamed ? [] : {}, - eventName, - }) - onLogs([formatted] as any) - } - }, - onError(error: Error) { - onError?.(error) - }, - }) - unsubscribe = unsubscribe_ - if (!active) unsubscribe() - } catch (error) { - onError?.(error as Error) - } - })() - return () => unsubscribe() - } - return subscribeShredContractEvent() -} diff --git a/src/viem/actions/shred/watchShredEvent.ts b/src/viem/actions/shred/watchShredEvent.ts deleted file mode 100644 index 6a2db7a..0000000 --- a/src/viem/actions/shred/watchShredEvent.ts +++ /dev/null @@ -1,230 +0,0 @@ -import { - decodeEventLog, - DecodeLogDataMismatch, - DecodeLogTopicsMismatch, - encodeEventTopics, - formatLog, - type AbiEvent, - type Address, - type Chain, - type Client, - type EncodeEventTopicsParameters, - type FallbackTransport, - type LogTopic, - type MaybeAbiEventName, - type MaybeExtractEventArgsFromAbi, - type Transport, -} from 'viem' -import type { ShredsWebSocketTransport } from '../../clients/transports/shredsWebSocket' -import type { ShredLog } from '../../types/log' - -/** - * The parameter for the `onLogs` callback in {@link watchShredEvent}. - */ -export type WatchShredEventOnLogsParameter< - abiEvent extends AbiEvent | undefined = undefined, - abiEvents extends - | readonly AbiEvent[] - | readonly unknown[] - | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined, - strict extends boolean | undefined = undefined, - eventName extends string | undefined = MaybeAbiEventName, -> = ShredLog[] - -/** - * The callback function for when new event logs are received in {@link watchShredEvent}. - */ -export type WatchShredEventOnLogsFn< - abiEvent extends AbiEvent | undefined = undefined, - abiEvents extends - | readonly AbiEvent[] - | readonly unknown[] - | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined, - strict extends boolean | undefined = undefined, - // - _eventName extends string | undefined = MaybeAbiEventName, -> = ( - logs: WatchShredEventOnLogsParameter, -) => void - -/** - * Parameters for {@link watchShredEvent}. - */ -export type WatchShredEventParameters< - abiEvent extends AbiEvent | undefined = undefined, - abiEvents extends - | readonly AbiEvent[] - | readonly unknown[] - | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined, - strict extends boolean | undefined = undefined, - // - _eventName extends string | undefined = MaybeAbiEventName, -> = { - /** The address of the contract. */ - address?: Address | Address[] | undefined - /** The callback to call when an error occurred when trying to get for a new block. */ - onError?: ((error: Error) => void) | undefined - /** The callback to call when new event logs are received. */ - onLogs: WatchShredEventOnLogsFn -} & ( - | { - event: abiEvent - events?: undefined - args?: MaybeExtractEventArgsFromAbi | undefined - /** - * Whether or not the logs must match the indexed/non-indexed arguments on `event`. - * @default false - */ - strict?: strict | undefined - } - | { - event?: undefined - events?: abiEvents | undefined - args?: undefined - /** - * Whether or not the logs must match the indexed/non-indexed arguments on `event`. - * @default false - */ - strict?: strict | undefined - } - | { - event?: undefined - events?: undefined - args?: undefined - strict?: undefined - } -) - -/** - * Return type for {@link watchShredEvent}. - */ -export type WatchShredEventReturnType = () => void - -/** - * Watches and returns emitted events that have been processed and confirmed as shreds - * on the RISE network. - * - * @param client - Client to use. - * @param parameters - {@link WatchShredEventParameters} - * @returns A function that can be used to unsubscribe from the event. {@link WatchShredEventReturnType} - */ -export function watchShredEvent< - chain extends Chain | undefined, - const abiEvent extends AbiEvent | undefined = undefined, - const abiEvents extends - | readonly AbiEvent[] - | readonly unknown[] - | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined, - strict extends boolean | undefined = undefined, - transport extends - | ShredsWebSocketTransport - | FallbackTransport< - readonly [ShredsWebSocketTransport, ...Transport[]] - > = ShredsWebSocketTransport, ->( - client: Client, - { - address, - args, - event, - events, - onError, - onLogs, - strict: strict_, - }: WatchShredEventParameters, -): WatchShredEventReturnType { - const transport_ = (() => { - if (client.transport.type === 'webSocket') return client.transport - - const wsTransport = ( - client.transport as ReturnType< - FallbackTransport - >['value'] - )?.transports.find( - (transport: ReturnType) => - transport.config.type === 'webSocket', - ) - - if (!wsTransport) throw new Error('A shredWebSocket transport is required') - - return wsTransport.value - })() as NonNullable['value']> - - const isStrict = strict_ ?? false - - const subscribeShredEvents = () => { - let active = true - let unsubscribe = () => { - active = false - } - - ;(async () => { - try { - const events_ = events ?? (event ? [event] : undefined) - let topics: LogTopic[] = [] - if (events_) { - const encoded = (events_ as AbiEvent[]).flatMap((event) => - encodeEventTopics({ - abi: [event], - eventName: (event as AbiEvent).name, - args, - } as EncodeEventTopicsParameters), - ) - // TODO: Clean up type casting - topics = [encoded as LogTopic] - if (event) topics = topics[0] as LogTopic[] - } - - const { unsubscribe: unsubscribe_ } = await transport_.riseSubscribe({ - params: ['logs', { address, topics }], - onData(data: any) { - if (!active) return - const log = data.result - try { - const { eventName, args } = decodeEventLog({ - abi: events_ ?? [], - data: log.data, - topics: log.topics, - strict: isStrict, - }) - const formatted = formatLog(log, { args, eventName }) - onLogs([formatted] as any) - } catch (error) { - let eventName: string | undefined - let isUnnamed: boolean | undefined - if ( - error instanceof DecodeLogDataMismatch || - error instanceof DecodeLogTopicsMismatch - ) { - // If strict mode is on, and log data/topics do not match event definition, skip. - if (isStrict) return - eventName = error.abiItem.name - isUnnamed = error.abiItem.inputs?.some( - (x) => !('name' in x) || !x.name, - ) - } - - // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch). - const formatted = formatLog(log, { - args: isUnnamed ? [] : {}, - eventName, - }) - onLogs([formatted] as any) - } - }, - onError: (error: Error) => { - onError?.(error) - }, - }) - unsubscribe = unsubscribe_ - if (!active) unsubscribe() - } catch (error) { - onError?.(error as Error) - } - })() - - return () => unsubscribe() - } - - return subscribeShredEvents() -} diff --git a/src/viem/actions/shred/watchShreds.ts b/src/viem/actions/shred/watchShreds.ts index c65d594..5ffb944 100644 --- a/src/viem/actions/shred/watchShreds.ts +++ b/src/viem/actions/shred/watchShreds.ts @@ -1,7 +1,6 @@ import { formatShred } from '../../utils/formatters/shred' -import type { ShredsWebSocketTransport } from '../../clients/transports/shredsWebSocket' import type { RpcShred, Shred } from '../../types/shred' -import type { Chain, Client, FallbackTransport, Transport } from 'viem' +import type { Chain, Client, Transport } from 'viem' /** * Parameters for {@link watchShreds}. @@ -24,11 +23,7 @@ export type WatchShredsReturnType = () => void */ export function watchShreds< chain extends Chain | undefined, - transport extends - | ShredsWebSocketTransport - | FallbackTransport< - readonly [ShredsWebSocketTransport, ...Transport[]] - > = ShredsWebSocketTransport, + transport extends Transport = Transport, >( client: Client, { onShred, onError }: WatchShredsParameters, @@ -36,19 +31,15 @@ export function watchShreds< const transport_ = (() => { if (client.transport.type === 'webSocket') return client.transport - const wsTransport = ( - client.transport as ReturnType< - FallbackTransport - >['value'] - )?.transports.find( + const wsTransport = client.transport?.transports.find( (transport: ReturnType) => transport.config.type === 'webSocket', ) - if (!wsTransport) throw new Error('A shredWebSocket transport is required') + if (!wsTransport) throw new Error('A websocket transport is required') return wsTransport.value - })() as NonNullable['value']> + })() const subscribeShreds = () => { let active = true @@ -57,8 +48,8 @@ export function watchShreds< } ;(async () => { try { - const { unsubscribe: unsubscribe_ } = await transport_.riseSubscribe({ - params: [], + const { unsubscribe: unsubscribe_ } = await transport_.subscribe({ + params: ['shreds'], // TODO: update this onData: (data: any) => { if (!active) return diff --git a/src/viem/clients/createPublicShredClient.ts b/src/viem/clients/createPublicShredClient.ts index d860829..fc64eaf 100644 --- a/src/viem/clients/createPublicShredClient.ts +++ b/src/viem/clients/createPublicShredClient.ts @@ -3,7 +3,6 @@ import { type Account, type Chain, type Client, - type FallbackTransport, type ParseAccount, type Prettify, type PublicActions, @@ -14,14 +13,9 @@ import { } from 'viem' import type { ShredRpcSchema } from '../types/rpcSchema' import { shredActions, type ShredActions } from './decorators/shred' -import type { ShredsWebSocketTransport } from './transports/shredsWebSocket' export type PublicShredClient< - transport extends - | ShredsWebSocketTransport - | FallbackTransport = - | ShredsWebSocketTransport - | FallbackTransport, + transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, accountOrAddress extends Account | undefined = undefined, rpcSchema extends RpcSchema | undefined = undefined, @@ -31,16 +25,14 @@ export type PublicShredClient< chain, accountOrAddress, rpcSchema extends RpcSchema - ? [...PublicRpcSchema, ...rpcSchema] - : PublicRpcSchema, + ? [...PublicRpcSchema, ...ShredRpcSchema, ...rpcSchema] + : [...PublicRpcSchema, ...ShredRpcSchema], PublicActions & ShredActions > > export function createPublicShredClient< - transport extends - | ShredsWebSocketTransport - | FallbackTransport, + transport extends Transport, chain extends Chain | undefined = undefined, accountOrAddress extends Account | undefined = undefined, rpcSchema extends [...RpcSchema, ...ShredRpcSchema] | undefined = undefined, diff --git a/src/viem/clients/createPublicSyncClient.ts b/src/viem/clients/createPublicSyncClient.ts deleted file mode 100644 index 5c616e8..0000000 --- a/src/viem/clients/createPublicSyncClient.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { - createPublicClient, - type Account, - type Chain, - type Client, - type ParseAccount, - type Prettify, - type PublicActions, - type PublicClientConfig, - type PublicRpcSchema, - type RpcSchema, -} from 'viem' -import type { ShredRpcSchema } from '../types/rpcSchema' -import { syncActions, type SyncActions } from './decorators/sync' -import type { ShredsWebSocketTransport } from './transports/shredsWebSocket' - -export type PublicSyncClient< - transport extends ShredsWebSocketTransport = ShredsWebSocketTransport, - chain extends Chain | undefined = Chain | undefined, - accountOrAddress extends Account | undefined = undefined, - rpcSchema extends RpcSchema | undefined = undefined, -> = Prettify< - Client< - transport, - chain, - accountOrAddress, - rpcSchema extends RpcSchema - ? [...PublicRpcSchema, ...rpcSchema, ...ShredRpcSchema] - : [...PublicRpcSchema, ...ShredRpcSchema], - PublicActions & SyncActions - > -> - -export function createPublicSyncClient< - transport extends ShredsWebSocketTransport, - chain extends Chain | undefined = undefined, - accountOrAddress extends Account | undefined = undefined, - rpcSchema extends [...RpcSchema, ...ShredRpcSchema] | undefined = undefined, ->( - parameters: PublicClientConfig, -): PublicSyncClient< - transport, - chain, - ParseAccount, - rpcSchema -> { - return createPublicClient({ ...parameters }).extend(syncActions) as any -} diff --git a/src/viem/clients/decorators/shred.ts b/src/viem/clients/decorators/shred.ts index 18500e1..d7d5f14 100644 --- a/src/viem/clients/decorators/shred.ts +++ b/src/viem/clients/decorators/shred.ts @@ -1,66 +1,20 @@ import { - watchContractShredEvent, - type WatchContractShredEventParameters, - type WatchContractShredEventReturnType, -} from '../../actions/shred/watchContractShredEvent' -import { - watchShredEvent, - type WatchShredEventParameters, - type WatchShredEventReturnType, -} from '../../actions/shred/watchShredEvent' + sendRawTransactionSync, + type SendRawTransactionSyncParameters, + type SendRawTransactionSyncReturnType, +} from '../../actions/shred/sendRawTransactionSync' import { watchShreds, type WatchShredsParameters, type WatchShredsReturnType, } from '../../actions/shred/watchShreds' -import type { ShredsWebSocketTransport } from '../transports/shredsWebSocket' -import type { - Abi, - AbiEvent, - Account, - Chain, - Client, - ContractEventName, - FallbackTransport, - Transport, -} from 'viem' +import type { Account, Chain, Client, Transport } from 'viem' /** * Actions for interacting with Shreds on the RISE network, enabling real-time * transaction confirmation by processing blocks in smaller, instantly confirmed units. */ -export type ShredActions = { - /** - * Watches and returns emitted contract events that have been processed and confirmed as shreds - * on the RISE network. - * - * @param parameters - {@link WatchContractShredEventParameters} - * @returns A function that can be used to unsubscribe from the event. {@link WatchContractShredEventReturnType} - */ - watchContractShredEvent: < - const abi_ extends Abi | readonly unknown[], - eventName_ extends ContractEventName | undefined = undefined, - strict extends boolean | undefined = undefined, - >( - parameters: WatchContractShredEventParameters, - ) => WatchContractShredEventReturnType - /** - * Watches and returns emitted events that have been processed and confirmed as shreds - * on the RISE network. - * - * @param parameters - {@link WatchShredEventParameters} - * @returns A function that can be used to unsubscribe from the event. {@link WatchShredEventReturnType} - */ - watchShredEvent: < - const abiEvent extends AbiEvent | undefined = undefined, - const abiEvents extends - | readonly AbiEvent[] - | readonly unknown[] - | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined, - strict extends boolean | undefined = undefined, - >( - parameters: WatchShredEventParameters, - ) => WatchShredEventReturnType +export type ShredActions = { /** * Watches for new shreds on the RISE network. * @@ -68,18 +22,25 @@ export type ShredActions = { * @returns A function that can be used to unsubscribe from the shred. */ watchShreds: (parameters: WatchShredsParameters) => WatchShredsReturnType + /** + * Sends a raw transaction to the RISE network, where it is processed as a shred, + * and waits for its real-time confirmation. + * + * @param parameters - {@link SendRawTransactionSyncParameters} + * @returns The transaction hash. {@link SendRawTransactionSyncReturnType} + */ + sendRawTransactionSync: ( + parameters: SendRawTransactionSyncParameters, + ) => Promise> } export function shredActions< - transport extends - | ShredsWebSocketTransport - | FallbackTransport, + transport extends Transport, chain extends Chain | undefined = undefined, account extends Account | undefined = undefined, >(client: Client): ShredActions { return { - watchContractShredEvent: (args) => watchContractShredEvent(client, args), - watchShredEvent: (args) => watchShredEvent(client, args), watchShreds: (args) => watchShreds(client, args), + sendRawTransactionSync: (args) => sendRawTransactionSync(client, args), } } diff --git a/src/viem/clients/decorators/sync.ts b/src/viem/clients/decorators/sync.ts deleted file mode 100644 index fdc7f46..0000000 --- a/src/viem/clients/decorators/sync.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { - sendRawTransactionSync, - type SendRawTransactionSyncParameters, - type SendRawTransactionSyncReturnType, -} from '../../actions/shred/sendRawTransactionSync' -import type { ShredRpcSchema } from '../../types/rpcSchema' -import type { Account, Chain, Client, RpcSchema, Transport } from 'viem' - -/** - * Actions for interacting with Shreds on the RISE network, enabling real-time - * transaction confirmation by processing blocks in smaller, instantly confirmed units. - */ -export type SyncActions = { - /** - * Sends a raw transaction to the RISE network, where it is processed as a shred, - * and waits for its real-time confirmation. - * - * @param parameters - {@link SendRawTransactionSyncParameters} - * @returns The transaction hash. {@link SendRawTransactionSyncReturnType} - */ - sendRawTransactionSync: ( - parameters: SendRawTransactionSyncParameters, - ) => Promise> -} - -export function syncActions< - transport extends Transport, - chain extends Chain | undefined = undefined, - account extends Account | undefined = undefined, - rpcSchema extends [...RpcSchema, ...ShredRpcSchema] | undefined = undefined, ->(client: Client): SyncActions { - return { - sendRawTransactionSync: (args) => sendRawTransactionSync(client, args), - } -} diff --git a/src/viem/clients/transports/shredsWebSocket.ts b/src/viem/clients/transports/shredsWebSocket.ts deleted file mode 100644 index 8f7eb0d..0000000 --- a/src/viem/clients/transports/shredsWebSocket.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { - UrlRequiredError, - webSocket, - type Address, - type Hash, - type LogTopic, - type Transport, - type WebSocketTransport, - type WebSocketTransportConfig, -} from 'viem' -import { getWebSocketRpcClient } from '../../utils/rpc/webSocket' -import type { ShredsRpcResponse } from '../../types/rpc' - -type ShredsWebSocketTransportSubscribeParameters = { - onData: (data: ShredsRpcResponse['params']) => void - onError?: ((error: any) => void) | undefined -} - -type ShredsWebSocketTransportSubscribeReturnType = { - subscriptionId: Hash - unsubscribe: () => Promise> -} - -type ShredsWebSocketTransportSubscribe = { - riseSubscribe: ( - args: ShredsWebSocketTransportSubscribeParameters & - ( - | { - params: [] - } - | { - params: [ - 'logs', - { - address?: Address | Address[] - topics?: LogTopic[] - }, - ] - } - ), - ) => Promise -} - -export type ShredsWebSocketTransport = - WebSocketTransport extends Transport - ? Transport< - type, - rpcAttributes & { - riseSubscribe: ShredsWebSocketTransportSubscribe['riseSubscribe'] - } - > - : never - -export function shredsWebSocket( - url?: string, - config: WebSocketTransportConfig = {}, -): ShredsWebSocketTransport { - const { keepAlive, reconnect } = config - const ws = webSocket(url, config) - return (params) => { - const { chain } = params - const ws_ = ws(params) - const url_ = url || chain?.rpcUrls.default.webSocket?.[0] - const wsRpcClientOpts = { keepAlive, reconnect } - if (!url_) throw new UrlRequiredError() - - return { - config: ws_.config, - request: ws_.request, - value: ws_.value - ? { - getSocket: ws_.value.getSocket, - getRpcClient: ws_.value.getRpcClient, - subscribe: ws_.value.subscribe, - async riseSubscribe({ params, onData, onError }) { - const rpcClient = await getWebSocketRpcClient( - url_, - wsRpcClientOpts, - ) - const { result: subscriptionId } = await new Promise( - (resolve, reject) => - rpcClient.request({ - body: { - method: 'rise_subscribe', - params, - }, - onError(error) { - reject(error) - onError?.(error) - return - }, - onResponse(response) { - if (response.error) { - reject(response.error) - onError?.(response.error) - return - } - - if (typeof response.id === 'number') { - resolve(response) - return - } - if (response.method !== 'rise_subscription') return - - onData(response.params) - }, - }), - ) - return { - subscriptionId, - unsubscribe() { - return new Promise((resolve) => - rpcClient.request({ - body: { - method: 'rise_unsubscribe', - params: [subscriptionId], - }, - onResponse: resolve, - }), - ) - }, - } - }, - } - : undefined, - } - } -} diff --git a/src/viem/index.ts b/src/viem/index.ts index 0f1146f..1ccd43e 100644 --- a/src/viem/index.ts +++ b/src/viem/index.ts @@ -3,12 +3,7 @@ export { createPublicShredClient, type PublicShredClient, } from './clients/createPublicShredClient' -export { - createPublicSyncClient, - type PublicSyncClient, -} from './clients/createPublicSyncClient' export { shredActions, type ShredActions } from './clients/decorators/shred' -export { syncActions, type SyncActions } from './clients/decorators/sync' export { sendRawTransactionSync, type SendRawTransactionSyncParameters, @@ -19,25 +14,6 @@ export { type WatchShredsParameters, type WatchShredsReturnType, } from './actions/shred/watchShreds' -export { - watchContractShredEvent, - type WatchContractShredEventOnLogsFn, - type WatchContractShredEventOnLogsParameter, - type WatchContractShredEventParameters, - type WatchContractShredEventReturnType, -} from './actions/shred/watchContractShredEvent' -export { - watchShredEvent, - type WatchShredEventOnLogsFn, - type WatchShredEventOnLogsParameter, - type WatchShredEventParameters, - type WatchShredEventReturnType, -} from './actions/shred/watchShredEvent' -export { - shredsWebSocket, - type ShredsWebSocketTransport, -} from './clients/transports/shredsWebSocket' -export type { ShredLog } from './types/log' export type { RpcShred, RpcShredDepositTransaction, diff --git a/src/viem/types/log.ts b/src/viem/types/log.ts deleted file mode 100644 index abe7ac0..0000000 --- a/src/viem/types/log.ts +++ /dev/null @@ -1,129 +0,0 @@ -import type { ExtractAbiEvent, ExtractAbiEventNames } from 'abitype' -import type { - Abi, - AbiEvent, - AbiEventParametersToPrimitiveTypes, - Address, - GetEventArgs, - Hash, - Hex, -} from 'viem' - -export type ShredLog< - quantity = bigint, - index = number, - abiEvent extends AbiEvent | undefined = undefined, - strict extends boolean | undefined = undefined, - abi extends Abi | readonly unknown[] | undefined = abiEvent extends AbiEvent - ? [abiEvent] - : undefined, - eventName extends string | undefined = abiEvent extends AbiEvent - ? abiEvent['name'] - : undefined, -> = { - /** The address from which this log originated */ - address: Address - /** Hash of block is always null in a shred */ - blockHash: null - /** Number of block containing this log or `null` if pending */ - blockNumber: quantity - /** Contains the non-indexed arguments of the log */ - data: Hex - /** Index of this log within its block or `null` if pending */ - logIndex: index - /** Hash of the transaction that created this log or `null` if pending */ - transactionHash: Hash - /** Index of the transaction that created this log or `null` if pending */ - transactionIndex: index - /** `true` if this filter has been destroyed and is invalid */ - removed: boolean -} & GetInferredLogValues - -type Topics< - head extends AbiEvent['inputs'], - base = [Hex], -> = head extends readonly [ - infer _Head, - ...infer Tail extends AbiEvent['inputs'], -] - ? _Head extends { indexed: true } - ? [Hex, ...Topics] - : Topics - : base - -type GetTopics< - abiEvent extends AbiEvent | undefined = undefined, - abi extends Abi | readonly unknown[] = [abiEvent], - eventName extends string | undefined = abiEvent extends AbiEvent - ? abiEvent['name'] - : undefined, - _AbiEvent extends AbiEvent | undefined = abi extends Abi - ? eventName extends string - ? ExtractAbiEvent - : undefined - : undefined, - _Args = _AbiEvent extends AbiEvent - ? AbiEventParametersToPrimitiveTypes<_AbiEvent['inputs']> - : never, - _FailedToParseArgs = - | ([_Args] extends [never] ? true : false) - | (readonly unknown[] extends _Args ? true : false), -> = true extends _FailedToParseArgs - ? [Hex, ...Hex[]] | [] - : abiEvent extends AbiEvent - ? Topics - : _AbiEvent extends AbiEvent - ? Topics<_AbiEvent['inputs']> - : [Hex, ...Hex[]] | [] - -type GetInferredLogValues< - abiEvent extends AbiEvent | undefined = undefined, - abi extends Abi | readonly unknown[] | undefined = abiEvent extends AbiEvent - ? [abiEvent] - : undefined, - eventName extends string | undefined = abiEvent extends AbiEvent - ? abiEvent['name'] - : undefined, - strict extends boolean | undefined = undefined, - _EventNames extends string = abi extends Abi - ? Abi extends abi - ? string - : ExtractAbiEventNames - : string, -> = abi extends Abi - ? eventName extends string - ? { - args: GetEventArgs< - abi, - eventName, - { - EnableUnion: false - IndexedOnly: false - Required: strict extends boolean ? strict : false - } - > - /** The event name decoded from `topics`. */ - eventName: eventName - /** List of order-dependent topics */ - topics: GetTopics - } - : { - [name in _EventNames]: { - args: GetEventArgs< - abi, - name, - { - EnableUnion: false - IndexedOnly: false - Required: strict extends boolean ? strict : false - } - > - /** The event name decoded from `topics`. */ - eventName: name - /** List of order-dependent topics */ - topics: GetTopics - } - }[_EventNames] - : { - topics: [Hex, ...Hex[]] | [] - } diff --git a/src/viem/types/rpc.ts b/src/viem/types/rpc.ts deleted file mode 100644 index 165ce13..0000000 --- a/src/viem/types/rpc.ts +++ /dev/null @@ -1,40 +0,0 @@ -type SuccessResult = { - method?: undefined - result: result - error?: undefined - params?: undefined -} -type ErrorResult = { - method?: undefined - result?: undefined - error: error - params?: undefined -} -type Subscription = { - method: 'rise_subscription' - error?: undefined - result?: undefined - params: - | { - subscription: string - result: result - error?: undefined - } - | { - subscription: string - result?: undefined - error: error - } -} - -export type RpcRequest = { - jsonrpc?: '2.0' | undefined - method: string - params?: any | undefined - id?: number | undefined -} - -export type ShredsRpcResponse = { - jsonrpc: `${number}` - id: number -} & (SuccessResult | ErrorResult | Subscription) diff --git a/src/viem/types/shred.ts b/src/viem/types/shred.ts index 4d51e9b..e20a8d7 100644 --- a/src/viem/types/shred.ts +++ b/src/viem/types/shred.ts @@ -95,8 +95,10 @@ export type ShredStateChange = { } export type Shred = { + blockTimestamp: bigint blockNumber: bigint shredIndex: number + startingLogIndex: number transactions: ( | ShredTransactionEip1559 | ShredTransactionLegacy @@ -181,6 +183,8 @@ export type RpcShredStateChanges = { export type RpcShred = { block_number: number shred_idx: number + block_timestamp: number + starting_log_index: number transactions: ( | { transaction: RpcShredTransactionLegacy diff --git a/src/viem/utils/formatters/shred.ts b/src/viem/utils/formatters/shred.ts index e10aa85..b0570a4 100644 --- a/src/viem/utils/formatters/shred.ts +++ b/src/viem/utils/formatters/shred.ts @@ -46,6 +46,8 @@ export function formatShred(shred: RpcShred): Shred { return { blockNumber: BigInt(shred.block_number), shredIndex: shred.shred_idx, + blockTimestamp: BigInt(shred.block_timestamp), + startingLogIndex: shred.starting_log_index, stateChanges: formatShredStateChange(shred.state_changes), transactions: shred.transactions.map(({ receipt, transaction }) => { if ('Legacy' in receipt && receipt.Legacy) { diff --git a/src/viem/utils/promise/createBatchScheduler.ts b/src/viem/utils/promise/createBatchScheduler.ts deleted file mode 100644 index 70e09bd..0000000 --- a/src/viem/utils/promise/createBatchScheduler.ts +++ /dev/null @@ -1,108 +0,0 @@ -import type { ErrorType } from '../../errors/utils.js' -import { withResolvers, type PromiseWithResolvers } from './withResolvers' - -type Resolved = [ - result: returnType[number], - results: returnType, -] - -type SchedulerItem = { - args: unknown - resolve: PromiseWithResolvers['resolve'] - reject: PromiseWithResolvers['reject'] -} - -type BatchResultsCompareFn = (a: result, b: result) => number - -type CreateBatchSchedulerArguments< - parameters = unknown, - returnType extends readonly unknown[] = readonly unknown[], -> = { - fn: (args: parameters[]) => Promise - id: number | string - shouldSplitBatch?: ((args: parameters[]) => boolean) | undefined - wait?: number | undefined - sort?: BatchResultsCompareFn | undefined -} - -type CreateBatchSchedulerReturnType< - parameters = unknown, - returnType extends readonly unknown[] = readonly unknown[], -> = { - flush: () => void - schedule: parameters extends undefined - ? (args?: parameters | undefined) => Promise> - : (args: parameters) => Promise> -} - -export type CreateBatchSchedulerErrorType = ErrorType - -const schedulerCache = /*#__PURE__*/ new Map() - -/** @internal */ -export function createBatchScheduler< - parameters, - returnType extends readonly unknown[], ->({ - fn, - id, - shouldSplitBatch, - wait = 0, - sort, -}: CreateBatchSchedulerArguments< - parameters, - returnType ->): CreateBatchSchedulerReturnType { - const exec = () => { - const scheduler = getScheduler() - flush() - - const args = scheduler.map(({ args }) => args) - - if (args.length === 0) return - - fn(args as parameters[]) - .then((data) => { - if (sort && Array.isArray(data)) data.sort(sort) - for (const [i, { resolve }] of scheduler.entries()) { - resolve?.([data[i], data]) - } - }) - .catch((error) => { - for (const { reject } of scheduler) { - reject?.(error) - } - }) - } - - const flush = () => schedulerCache.delete(id) - - const getBatchedArgs = () => - getScheduler().map(({ args }) => args) as parameters[] - - const getScheduler = () => schedulerCache.get(id) || [] - - const setScheduler = (item: SchedulerItem) => - schedulerCache.set(id, [...getScheduler(), item]) - - return { - flush, - schedule(args: parameters) { - const { promise, resolve, reject } = withResolvers() - - const split = shouldSplitBatch?.([...getBatchedArgs(), args]) - - if (split) exec() - - const hasActiveScheduler = getScheduler().length > 0 - if (hasActiveScheduler) { - setScheduler({ args, resolve, reject }) - return promise - } - - setScheduler({ args, resolve, reject }) - setTimeout(exec, wait) - return promise - }, - } as unknown as CreateBatchSchedulerReturnType -} diff --git a/src/viem/utils/promise/withResolvers.ts b/src/viem/utils/promise/withResolvers.ts deleted file mode 100644 index 5adb02e..0000000 --- a/src/viem/utils/promise/withResolvers.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** @internal */ -export type PromiseWithResolvers = { - promise: Promise - resolve: (value: type | PromiseLike) => void - reject: (reason?: unknown) => void -} - -/** @internal */ -export function withResolvers(): PromiseWithResolvers { - let resolve: PromiseWithResolvers['resolve'] = () => undefined - let reject: PromiseWithResolvers['reject'] = () => undefined - - const promise = new Promise((resolve_, reject_) => { - resolve = resolve_ - reject = reject_ - }) - - return { promise, resolve, reject } -} diff --git a/src/viem/utils/rpc/id.ts b/src/viem/utils/rpc/id.ts deleted file mode 100644 index 3ef4cd7..0000000 --- a/src/viem/utils/rpc/id.ts +++ /dev/null @@ -1,13 +0,0 @@ -function createIdStore() { - return { - current: 0, - take() { - return this.current++ - }, - reset() { - this.current = 0 - }, - } -} - -export const idCache = /*#__PURE__*/ createIdStore() diff --git a/src/viem/utils/rpc/socket.ts b/src/viem/utils/rpc/socket.ts deleted file mode 100644 index 21373a3..0000000 --- a/src/viem/utils/rpc/socket.ts +++ /dev/null @@ -1,295 +0,0 @@ -import { SocketClosedError, TimeoutError, withTimeout } from 'viem' -import { - createBatchScheduler, - type CreateBatchSchedulerErrorType, -} from '../promise/createBatchScheduler' -import type { ErrorType } from '../../errors/utils' -import type { RpcRequest, ShredsRpcResponse } from '../../types/rpc' -import { idCache } from './id' - -type Id = string | number -type CallbackFn = { - body?: RpcRequest - onResponse: (message: any) => void - onError?: ((error?: Error | Event | undefined) => void) | undefined -} -type CallbackMap = Map - -export type GetSocketParameters = { - onClose: () => void - onError: (error?: Error | Event | undefined) => void - onOpen: () => void - onResponse: (data: ShredsRpcResponse) => void -} - -export type Socket = socket & { - close: () => void - ping?: (() => void) | undefined - request: (params: { body: RpcRequest }) => void -} - -export type SocketRpcClient = { - close: () => void - socket: Socket - request: (params: { - body: RpcRequest - onError?: ((error?: Error | Event | undefined) => void) | undefined - onResponse: (message: ShredsRpcResponse) => void - }) => void - requestAsync: (params: { - body: RpcRequest - timeout?: number | undefined - }) => Promise - requests: CallbackMap - subscriptions: CallbackMap - url: string -} - -export type GetSocketRpcClientParameters = { - getSocket: (params: GetSocketParameters) => Promise> - /** - * Whether or not to send keep-alive messages. - * @default true - */ - keepAlive?: - | boolean - | { - /** - * The interval (in ms) to send keep-alive messages. - * @default 30_000 - */ - interval?: number | undefined - } - | undefined - key?: string - /** - * Whether or not to attempt to reconnect on socket failure or closure. - * @default true - */ - reconnect?: - | boolean - | { - /** - * The maximum number of reconnection attempts. - * @default 5 - */ - attempts?: number | undefined - /** - * The delay (in ms) between reconnection attempts. - * @default 2_000 - */ - delay?: number | undefined - } - | undefined - url: string -} - -export type GetSocketRpcClientErrorType = - | CreateBatchSchedulerErrorType - | ErrorType - -export const socketClientCache = /*#__PURE__*/ new Map< - string, - SocketRpcClient> ->() - -export async function getSocketRpcClient( - parameters: GetSocketRpcClientParameters, -): Promise> { - const { - getSocket, - keepAlive = true, - key = 'socket', - reconnect = true, - url, - } = parameters - const { interval: keepAliveInterval = 30_000 } = - typeof keepAlive === 'object' ? keepAlive : {} - const { attempts = 5, delay = 2_000 } = - typeof reconnect === 'object' ? reconnect : {} - - let socketClient = socketClientCache.get(`${key}:${url}`) - - // If the socket already exists, return it. - if (socketClient) return socketClient as {} as SocketRpcClient - - let reconnectCount = 0 - const { schedule } = createBatchScheduler< - undefined, - [SocketRpcClient] - >({ - id: `${key}:${url}`, - fn: async () => { - // Set up a cache for incoming "synchronous" requests. - const requests = new Map() - - // Set up a cache for subscriptions (rise_subscribe). - const subscriptions = new Map() - - let error: Error | Event | undefined - let socket: Socket<{}> - let keepAliveTimer: ReturnType | undefined - - // Set up socket implementation. - async function setup() { - const result = await getSocket({ - onClose() { - // Notify all requests and subscriptions of the closure error. - for (const request of requests.values()) - request.onError?.(new SocketClosedError({ url })) - for (const subscription of subscriptions.values()) - subscription.onError?.(new SocketClosedError({ url })) - - // Attempt to reconnect. - if (reconnect && reconnectCount < attempts) - setTimeout(async () => { - reconnectCount++ - await setup().catch(console.error) - }, delay) - // Otherwise, clear all requests and subscriptions. - else { - requests.clear() - subscriptions.clear() - } - }, - onError(error_) { - error = error_ - - // Notify all requests and subscriptions of the error. - for (const request of requests.values()) request.onError?.(error) - for (const subscription of subscriptions.values()) - subscription.onError?.(error) - - // Make sure socket is definitely closed. - socketClient?.close() - - // Attempt to reconnect. - if (reconnect && reconnectCount < attempts) - setTimeout(async () => { - reconnectCount++ - await setup().catch(console.error) - }, delay) - // Otherwise, clear all requests and subscriptions. - else { - requests.clear() - subscriptions.clear() - } - }, - onOpen() { - error = undefined - reconnectCount = 0 - }, - onResponse(data) { - const isSubscription = data.method === 'rise_subscription' - const id = isSubscription ? data.params.subscription : data.id - const cache = isSubscription ? subscriptions : requests - const callback = cache.get(id) - if (callback) callback.onResponse(data) - if (!isSubscription) cache.delete(id) - }, - }) - - socket = result - - if (keepAlive) { - if (keepAliveTimer) clearInterval(keepAliveTimer) - keepAliveTimer = setInterval(() => socket.ping?.(), keepAliveInterval) - } - - if (reconnect && subscriptions.size > 0) { - const subscriptionEntries = subscriptions.entries() - for (const [ - key, - { onResponse, body, onError }, - ] of subscriptionEntries) { - if (!body) continue - - subscriptions.delete(key) - socketClient?.request({ body, onResponse, onError }) - } - } - - return result - } - await setup() - error = undefined - - // Create a new socket instance. - socketClient = { - close() { - keepAliveTimer && clearInterval(keepAliveTimer) - socket.close() - socketClientCache.delete(`${key}:${url}`) - }, - get socket() { - return socket - }, - request({ body, onError, onResponse }) { - if (error && onError) onError(error) - - const id = body.id ?? idCache.take() - - const callback = (response: ShredsRpcResponse) => { - if (typeof response.id === 'number' && id !== response.id) return - - // If we are subscribing to a topic, we want to set up a listener for incoming - // messages. - if ( - body.method === 'rise_subscribe' && - typeof response.result === 'string' - ) - subscriptions.set(response.result, { - onResponse: callback, - onError, - body, - }) - - // If we are unsubscribing from a topic, we want to remove the listener. - if (body.method === 'rise_unsubscribe') - subscriptions.delete(body.params?.[0]) - - onResponse(response) - } - - requests.set(id, { onResponse: callback, onError }) - try { - socket.request({ - body: { - jsonrpc: '2.0', - id, - ...body, - }, - }) - } catch (error) { - onError?.(error as Error) - } - }, - requestAsync({ body, timeout = 10_000 }) { - return withTimeout( - () => - new Promise((onResponse, onError) => - this.request({ - body, - onError, - onResponse, - }), - ), - { - errorInstance: new TimeoutError({ body, url }), - timeout, - }, - ) - }, - requests, - subscriptions, - url, - } - socketClientCache.set(`${key}:${url}`, socketClient) - - return [socketClient as {} as SocketRpcClient] - }, - }) - - const [, [socketClient_]] = await schedule() - return socketClient_ -} diff --git a/src/viem/utils/rpc/webSocket.ts b/src/viem/utils/rpc/webSocket.ts deleted file mode 100644 index 7b95771..0000000 --- a/src/viem/utils/rpc/webSocket.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { SocketClosedError, WebSocketRequestError } from 'viem' -import type { RpcRequest } from '../../types/rpc' - -import { - getSocketRpcClient, - type GetSocketRpcClientParameters, - type Socket, - type SocketRpcClient, -} from './socket' -import type { MessageEvent } from 'isows' - -export type GetWebSocketRpcClientOptions = Pick< - GetSocketRpcClientParameters, - 'keepAlive' | 'reconnect' -> - -export function getWebSocketRpcClient( - url: string, - options: GetWebSocketRpcClientOptions | undefined = {}, -): Promise> { - const { keepAlive, reconnect } = options - - return getSocketRpcClient({ - async getSocket({ onClose, onError, onOpen, onResponse }) { - const WebSocket = await import('isows').then((module) => module.WebSocket) - const socket = new WebSocket(url) - - function onClose_() { - socket.removeEventListener('close', onClose_) - socket.removeEventListener('message', onMessage) - socket.removeEventListener('error', onError) - socket.removeEventListener('open', onOpen) - onClose() - } - function onMessage({ data }: MessageEvent) { - try { - const _data = JSON.parse(data) - onResponse(_data) - } catch (error) { - onError(error as Error) - } - } - - // Setup event listeners for RPC & subscription responses. - socket.addEventListener('close', onClose_) - socket.addEventListener('message', onMessage) - socket.addEventListener('error', onError) - socket.addEventListener('open', onOpen) - - // Wait for the socket to open. - if (socket.readyState === WebSocket.CONNECTING) { - await new Promise((resolve, reject) => { - if (!socket) return - socket.addEventListener('open', resolve) - socket.addEventListener('error', (error) => { - reject( - new WebSocketRequestError({ - url: socket.url, - cause: error as unknown as Error, - }), - ) - }) - }) - } - - const { close: close_ } = socket - - return Object.assign(socket, { - close() { - close_.bind(socket)() - onClose_() - }, - ping() { - try { - if ( - socket.readyState === socket.CLOSED || - socket.readyState === socket.CLOSING - ) - throw new WebSocketRequestError({ - url: socket.url, - cause: new SocketClosedError({ url: socket.url }), - }) - - const body: RpcRequest = { - jsonrpc: '2.0', - method: 'net_version', - params: [], - } - socket.send(JSON.stringify(body)) - } catch (error) { - onError(error as Error) - } - }, - request({ body }) { - if ( - socket.readyState === socket.CLOSED || - socket.readyState === socket.CLOSING - ) - throw new WebSocketRequestError({ - body, - url: socket.url, - cause: new SocketClosedError({ url: socket.url }), - }) - - return socket.send(JSON.stringify(body)) - }, - } as Socket) - }, - keepAlive, - reconnect, - url, - }) -} diff --git a/tests/viem/actions/shred/watchContractShredEvent.test.ts b/tests/viem/actions/shred/watchContractShredEvent.test.ts index 1aa4b8f..fa04b0d 100644 --- a/tests/viem/actions/shred/watchContractShredEvent.test.ts +++ b/tests/viem/actions/shred/watchContractShredEvent.test.ts @@ -1,7 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { watchContractShredEvent } from '../../../../src/viem/actions/shred/watchContractShredEvent' -import type { ShredsWebSocketTransport } from '../../../../src/viem/clients/transports/shredsWebSocket' -import type { Abi, Chain, Client } from 'viem' +import type { Abi, Chain, Client, WebSocketTransport } from 'viem' // Mock ABI for testing const mockAbi = [ @@ -26,11 +25,11 @@ const createMockTransport = () => ({ const createMockClient = (transport: any) => ({ transport, - }) as unknown as Client + }) as unknown as Client describe('watchContractShredEvent', () => { let mockTransport: ReturnType - let mockClient: Client + let mockClient: Client let mockOnLogs: ReturnType let mockOnError: ReturnType diff --git a/tests/viem/actions/shred/watchShredEvent.test.ts b/tests/viem/actions/shred/watchShredEvent.test.ts index 3eec7d9..0ee2f82 100644 --- a/tests/viem/actions/shred/watchShredEvent.test.ts +++ b/tests/viem/actions/shred/watchShredEvent.test.ts @@ -1,7 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { watchShredEvent } from '../../../../src/viem/actions/shred/watchShredEvent' -import type { ShredsWebSocketTransport } from '../../../../src/viem/clients/transports/shredsWebSocket' -import type { AbiEvent, Chain, Client } from 'viem' +import type { AbiEvent, Chain, Client, WebSocketTransport } from 'viem' // Mock event for testing const mockEvent: AbiEvent = { @@ -24,11 +23,11 @@ const createMockTransport = () => ({ const createMockClient = (transport: any) => ({ transport, - }) as unknown as Client + }) as unknown as Client describe('watchShredEvent', () => { let mockTransport: ReturnType - let mockClient: Client + let mockClient: Client let mockOnLogs: ReturnType let mockOnError: ReturnType diff --git a/tests/viem/actions/shred/watchShreds.test.ts b/tests/viem/actions/shred/watchShreds.test.ts index 5f553a1..8bf8f09 100644 --- a/tests/viem/actions/shred/watchShreds.test.ts +++ b/tests/viem/actions/shred/watchShreds.test.ts @@ -1,7 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { watchShreds } from '../../../../src/viem/actions/shred/watchShreds' -import type { ShredsWebSocketTransport } from '../../../../src/viem/clients/transports/shredsWebSocket' -import type { Chain, Client } from 'viem' +import type { Chain, Client, WebSocketTransport } from 'viem' // Mock the formatShred utility vi.mock('../../../../src/viem/utils/formatters/shred', () => ({ @@ -21,11 +20,11 @@ const createMockTransport = () => ({ const createMockClient = (transport: any) => ({ transport, - }) as unknown as Client + }) as unknown as Client describe('watchShreds', () => { let mockTransport: ReturnType - let mockClient: Client + let mockClient: Client let mockOnShred: ReturnType let mockOnError: ReturnType