From 8cb97974e20b1c0a304920023bcfffdeb12eded8 Mon Sep 17 00:00:00 2001 From: Songkeys Date: Fri, 25 Oct 2024 12:35:01 +0800 Subject: [PATCH] feat: update deps --- biome.json | 14 - examples/vite/src/App.vue | 134 +- examples/vite/src/main.ts | 12 +- examples/vite/src/style.css | 6 +- examples/vite/tsconfig.json | 40 +- examples/vite/unocss.config.ts | 11 +- examples/vite/vite.config.ts | 18 +- package.json | 60 +- pnpm-lock.yaml | 1589 ++++++++++++------- scripts/update-abi.mjs | 112 +- src/contract/abi/cbt.ts | 346 ++--- src/contract/abi/entry.ts | 1642 ++++++++++---------- src/contract/abi/index.ts | 18 +- src/contract/abi/linklist.ts | 542 +++---- src/contract/abi/mira.ts | 422 ++--- src/contract/abi/newbie-villa.ts | 294 ++-- src/contract/abi/periphery.ts | 270 ++-- src/contract/abi/tips-with-config.ts | 208 +-- src/contract/abi/tips-with-fee.ts | 170 +- src/contract/abi/tips.ts | 98 +- src/contract/contract.ts | 32 +- src/contract/decorators/index.ts | 34 +- src/contract/index.ts | 4 +- src/contract/subcontracts/base.ts | 212 +-- src/contract/subcontracts/cbt.ts | 52 +- src/contract/subcontracts/character.ts | 298 ++-- src/contract/subcontracts/csb.ts | 36 +- src/contract/subcontracts/index.ts | 22 +- src/contract/subcontracts/link.ts | 364 ++--- src/contract/subcontracts/link_module.ts | 52 +- src/contract/subcontracts/mint_module.ts | 38 +- src/contract/subcontracts/note.ts | 378 ++--- src/contract/subcontracts/operator.ts | 232 +-- src/contract/subcontracts/revision.ts | 30 +- src/contract/subcontracts/tips.ts | 114 +- src/contract/subcontracts/tips_with_fee.ts | 82 +- src/index.ts | 12 +- src/indexer/index.ts | 4 +- src/indexer/indexer.ts | 72 +- src/indexer/subapis/achievement.ts | 24 +- src/indexer/subapis/base.ts | 88 +- src/indexer/subapis/character.ts | 36 +- src/indexer/subapis/feed.ts | 40 +- src/indexer/subapis/link.ts | 124 +- src/indexer/subapis/link_module.ts | 42 +- src/indexer/subapis/linklist.ts | 22 +- src/indexer/subapis/metadata.ts | 16 +- src/indexer/subapis/mint_module.ts | 32 +- src/indexer/subapis/minted_note.ts | 48 +- src/indexer/subapis/newbie.ts | 226 +-- src/indexer/subapis/note.ts | 100 +- src/indexer/subapis/notification.ts | 50 +- src/indexer/subapis/operators.ts | 26 +- src/indexer/subapis/search.ts | 44 +- src/indexer/subapis/siwe.ts | 180 +-- src/indexer/subapis/stat.ts | 20 +- src/indexer/subapis/tip.ts | 30 +- src/indexer/utils.ts | 20 +- src/ipfs/index.ts | 130 +- src/network/chains.ts | 18 +- src/network/index.ts | 44 +- src/types/contract/base.ts | 46 +- src/types/contract/character.ts | 14 +- src/types/contract/index.ts | 10 +- src/types/contract/link.ts | 34 +- src/types/contract/module.ts | 34 +- src/types/contract/note.ts | 46 +- src/types/index.ts | 8 +- src/types/indexer/achievement.ts | 68 +- src/types/indexer/base.ts | 6 +- src/types/indexer/character.ts | 40 +- src/types/indexer/feed.ts | 130 +- src/types/indexer/index.ts | 32 +- src/types/indexer/link.ts | 66 +- src/types/indexer/link_module.ts | 66 +- src/types/indexer/linklist.ts | 38 +- src/types/indexer/metadata.ts | 18 +- src/types/indexer/mint_module.ts | 46 +- src/types/indexer/minted_note.ts | 40 +- src/types/indexer/newbie.ts | 16 +- src/types/indexer/note.ts | 82 +- src/types/indexer/notification.ts | 44 +- src/types/indexer/operator.ts | 92 +- src/types/indexer/stat.ts | 20 +- src/types/indexer/tip.ts | 74 +- src/types/metadata/base.ts | 10 +- src/types/metadata/character.ts | 20 +- src/types/metadata/index.ts | 12 +- src/types/metadata/note.ts | 42 +- src/types/utils.ts | 6 +- src/utils/address.ts | 13 +- src/utils/csb.ts | 28 +- src/utils/index.ts | 12 +- src/utils/logger.ts | 12 +- src/utils/module.ts | 78 +- src/utils/nonce-manager.ts | 4 +- src/utils/normalize-character-metadata.ts | 22 +- src/utils/sdn.ts | 102 +- src/utils/validate-handle.ts | 66 +- src/utils/viem.ts | 129 +- test/contracts/cbt.test.ts | 6 +- test/contracts/character.test.ts | 226 +-- test/contracts/csb.test.ts | 24 +- test/contracts/link.test.ts | 126 +- test/contracts/mint-module.test.ts | 36 +- test/contracts/note.test.ts | 120 +- test/contracts/operator.test.ts | 44 +- test/contracts/revision.test.ts | 32 +- test/contracts/tips-with-fee.test.ts | 48 +- test/contracts/tips.test.ts | 48 +- test/indexer/dedupe-cache.test.ts | 122 +- test/indexer/indexer.test.ts | 72 +- test/indexer/newbie.test.ts | 35 +- test/indexer/notification.test.ts | 30 +- test/indexer/with-headers.test.ts | 38 +- test/mock.ts | 28 +- test/utils/csb.test.ts | 38 +- test/utils/ipfs.test.ts | 26 +- tsconfig.json | 32 +- tsup.config.ts | 34 +- vitest.config.ts | 8 +- 121 files changed, 6304 insertions(+), 5929 deletions(-) diff --git a/biome.json b/biome.json index 47d448837..3f6c79a30 100644 --- a/biome.json +++ b/biome.json @@ -3,9 +3,6 @@ "files": { "ignore": ["./dist/**/*"] }, - "formatter": { - "enabled": true - }, "linter": { "enabled": true, "rules": { @@ -17,16 +14,5 @@ "noExplicitAny": "off" } } - }, - "javascript": { - "formatter": { - "quoteStyle": "single", - "trailingComma": "all", - "semicolons": "asNeeded" - } - }, - - "organizeImports": { - "enabled": true } } diff --git a/examples/vite/src/App.vue b/examples/vite/src/App.vue index 706621a61..d5f4c181a 100644 --- a/examples/vite/src/App.vue +++ b/examples/vite/src/App.vue @@ -1,107 +1,107 @@ diff --git a/examples/vite/src/main.ts b/examples/vite/src/main.ts index c774e67af..8d550219e 100644 --- a/examples/vite/src/main.ts +++ b/examples/vite/src/main.ts @@ -1,7 +1,7 @@ -import '@unocss/reset/tailwind.css' -import 'uno.css' -import { createApp } from 'vue' -import App from './App.vue' -import './style.css' +import "@unocss/reset/tailwind.css"; +import "uno.css"; +import { createApp } from "vue"; +import App from "./App.vue"; +import "./style.css"; -createApp(App).mount('#app') +createApp(App).mount("#app"); diff --git a/examples/vite/src/style.css b/examples/vite/src/style.css index b46571548..41e15e0a6 100644 --- a/examples/vite/src/style.css +++ b/examples/vite/src/style.css @@ -1,11 +1,11 @@ input { - --at-apply: 'p2 w-250px bg-transparent border rounded border-gray-200 dark:border-gray-700 outline-none active:outline-none'; + --at-apply: "p2 w-250px bg-transparent border rounded border-gray-200 dark:border-gray-700 outline-none active:outline-none"; } button { - --at-apply: 'px-4 py-1 rounded inline-block bg-yellow-600 text-white cursor-pointer hover:bg-yellow-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'; + --at-apply: "px-4 py-1 rounded inline-block bg-yellow-600 text-white cursor-pointer hover:bg-yellow-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50"; } hr { - --at-apply: 'my-3'; + --at-apply: "my-3"; } diff --git a/examples/vite/tsconfig.json b/examples/vite/tsconfig.json index 803dd6f70..eda8f2b7f 100644 --- a/examples/vite/tsconfig.json +++ b/examples/vite/tsconfig.json @@ -1,22 +1,22 @@ { - "compilerOptions": { - "target": "ESNext", - "useDefineForClassFields": true, - "module": "ESNext", - "moduleResolution": "bundler", - "strict": true, - "jsx": "preserve", - "resolveJsonModule": true, - "isolatedModules": true, - "esModuleInterop": true, - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "noEmit": true, - "paths": { - "crossbell": ["../../src/index.ts"] - }, - "experimentalDecorators": true - }, - "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], - "references": [{ "path": "./tsconfig.node.json" }] + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "module": "ESNext", + "moduleResolution": "bundler", + "strict": true, + "jsx": "preserve", + "resolveJsonModule": true, + "isolatedModules": true, + "esModuleInterop": true, + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "noEmit": true, + "paths": { + "crossbell": ["../../src/index.ts"] + }, + "experimentalDecorators": true + }, + "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/examples/vite/unocss.config.ts b/examples/vite/unocss.config.ts index ef24dc640..e6777db24 100644 --- a/examples/vite/unocss.config.ts +++ b/examples/vite/unocss.config.ts @@ -1,7 +1,12 @@ -import transformerDirectives from '@unocss/transformer-directives' -import { defineConfig, presetAttributify, presetIcons, presetUno } from 'unocss' +import transformerDirectives from "@unocss/transformer-directives"; +import { + defineConfig, + presetAttributify, + presetIcons, + presetUno, +} from "unocss"; export default defineConfig({ presets: [presetUno(), presetAttributify(), presetIcons()], transformers: [transformerDirectives()], -}) +}); diff --git a/examples/vite/vite.config.ts b/examples/vite/vite.config.ts index c4ca71534..11e7f360b 100644 --- a/examples/vite/vite.config.ts +++ b/examples/vite/vite.config.ts @@ -1,21 +1,21 @@ -import path from 'node:path' -import Vue from '@vitejs/plugin-vue' -import UnoCSS from 'unocss/vite' -import { defineConfig, loadEnv } from 'vite' +import path from "node:path"; +import Vue from "@vitejs/plugin-vue"; +import UnoCSS from "unocss/vite"; +import { defineConfig, loadEnv } from "vite"; export default defineConfig(({ mode }) => { - const env = loadEnv(mode, process.cwd(), '') + const env = loadEnv(mode, process.cwd(), ""); return { resolve: { alias: { - crossbell: path.resolve(__dirname, '../../src/index.ts'), + crossbell: path.resolve(__dirname, "../../src/index.ts"), }, }, define: { - 'globalThis.process.env.CROSSBELL_RPC_ADDRESS': JSON.stringify( + "globalThis.process.env.CROSSBELL_RPC_ADDRESS": JSON.stringify( env.CROSSBELL_RPC_ADDRESS, ), }, plugins: [Vue(), UnoCSS()], - } -}) + }; +}); diff --git a/package.json b/package.json index f0986ea4a..f235375f0 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,9 @@ { "name": "crossbell", "version": "1.12.0", - "packageManager": "pnpm@9.4.0", + "packageManager": "pnpm@9.12.2", "description": "JavaScript SDK to interact with Crossbell", - "keywords": [ - "crossbell", - "eth", - "contract", - "web3" - ], + "keywords": ["crossbell", "eth", "contract", "web3"], "license": "MIT", "bugs": { "url": "https://github.com/Crossbell-Box/crossbell.js/issues" @@ -17,9 +12,7 @@ "type": "git", "url": "https://github.com/Crossbell-Box/crossbell.js.git" }, - "files": [ - "dist" - ], + "files": ["dist"], "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", @@ -58,21 +51,11 @@ }, "typesVersions": { "*": { - "contract": [ - "./dist/contract/index.d.ts" - ], - "indexer": [ - "./dist/indexer/index.d.ts" - ], - "ipfs": [ - "./dist/ipfs/index.d.ts" - ], - "network": [ - "./dist/network/index.d.ts" - ], - "utils": [ - "./dist/utils/index.d.ts" - ] + "contract": ["./dist/contract/index.d.ts"], + "indexer": ["./dist/indexer/index.d.ts"], + "ipfs": ["./dist/ipfs/index.d.ts"], + "network": ["./dist/network/index.d.ts"], + "utils": ["./dist/utils/index.d.ts"] } }, "publishConfig": { @@ -82,9 +65,8 @@ "build": "tsup --dts", "docs:build": "typedoc", "docs:preview": "serve docs", - "format": "biome format . --write", - "lint": "biome check .", - "lint:fix": "biome check . --apply", + "lint": "biome check", + "lint:fix": "biome check --write", "prepublishOnly": "npm run build", "release": "bumpp", "test": "vitest", @@ -99,25 +81,25 @@ "eip1193-types": "^0.2.1", "exponential-backoff": "^3.1.1", "p-limit": "3.1.0", - "viem": "^2.16.3" + "viem": "^2.21.34" }, "devDependencies": { - "@biomejs/biome": "^1.8.3", - "@types/async-retry": "^1.4.8", - "@types/node": "^20.14.9", - "abitype": "^1.0.4", - "bumpp": "^9.4.1", + "@biomejs/biome": "^1.9.4", + "@types/async-retry": "^1.4.9", + "@types/node": "^20.17.0", + "abitype": "^1.0.6", + "bumpp": "^9.7.1", "change-case": "^5.4.4", "simple-git-hooks": "^2.11.1", - "tsup": "^8.1.0", - "typedoc": "^0.26.2", - "typescript": "^5.5.2", - "vitest": "^1.6.0" + "tsup": "^8.3.0", + "typedoc": "^0.26.10", + "typescript": "^5.6.3", + "vitest": "^2.1.3" }, "engines": { "node": ">=16.14.0" }, "simple-git-hooks": { - "pre-commit": "npm run format && npm run lint:fix" + "pre-commit": "npm run lint:fix" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 582b10ee0..68143f561 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,24 +27,24 @@ importers: specifier: 3.1.0 version: 3.1.0 viem: - specifier: ^2.16.3 - version: 2.16.3(typescript@5.5.2) + specifier: ^2.21.34 + version: 2.21.34(typescript@5.6.3) devDependencies: '@biomejs/biome': - specifier: ^1.8.3 - version: 1.8.3 + specifier: ^1.9.4 + version: 1.9.4 '@types/async-retry': - specifier: ^1.4.8 - version: 1.4.8 + specifier: ^1.4.9 + version: 1.4.9 '@types/node': - specifier: ^20.14.9 - version: 20.14.9 + specifier: ^20.17.0 + version: 20.17.0 abitype: - specifier: ^1.0.4 - version: 1.0.4(typescript@5.5.2) + specifier: ^1.0.6 + version: 1.0.6(typescript@5.6.3) bumpp: - specifier: ^9.4.1 - version: 9.4.1 + specifier: ^9.7.1 + version: 9.7.1 change-case: specifier: ^5.4.4 version: 5.4.4 @@ -52,17 +52,17 @@ importers: specifier: ^2.11.1 version: 2.11.1 tsup: - specifier: ^8.1.0 - version: 8.1.0(postcss@8.4.33)(typescript@5.5.2) + specifier: ^8.3.0 + version: 8.3.0(jiti@1.21.6)(postcss@8.4.33)(typescript@5.6.3)(yaml@2.6.0) typedoc: - specifier: ^0.26.2 - version: 0.26.2(typescript@5.5.2) + specifier: ^0.26.10 + version: 0.26.10(typescript@5.6.3) typescript: - specifier: ^5.5.2 - version: 5.5.2 + specifier: ^5.6.3 + version: 5.6.3 vitest: - specifier: ^1.6.0 - version: 1.6.0(@types/node@20.14.9) + specifier: ^2.1.3 + version: 2.1.3(@types/node@20.17.0) examples/vite: dependencies: @@ -81,7 +81,7 @@ importers: version: 0.52.3 '@vitejs/plugin-vue': specifier: ^4.2.3 - version: 4.2.3(vite@4.3.8(@types/node@20.14.9))(vue@3.3.4) + version: 4.2.3(vite@4.3.8(@types/node@20.17.0))(vue@3.3.4) '@vueuse/core': specifier: ^10.1.2 version: 10.1.2(vue@3.3.4) @@ -90,18 +90,18 @@ importers: version: 5.0.4 unocss: specifier: ^0.52.3 - version: 0.52.3(postcss@8.4.33)(rollup@3.23.0)(vite@4.3.8(@types/node@20.14.9)) + version: 0.52.3(postcss@8.4.33)(rollup@3.23.0)(vite@4.3.8(@types/node@20.17.0)) vite: specifier: ^4.3.8 - version: 4.3.8(@types/node@20.14.9) + version: 4.3.8(@types/node@20.17.0) vue-tsc: specifier: ^1.6.5 version: 1.6.5(typescript@5.0.4) packages: - '@adraffy/ens-normalize@1.10.0': - resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} + '@adraffy/ens-normalize@1.11.0': + resolution: {integrity: sha512-/3DDPKHqqIqxUULp8yP4zODUY1i+2xvVWsv8A79xGWdCAG+8sb0hRh0Rk2QyOJUnnbyPUAZYcpBuRe3nS2OIUg==} '@ampproject/remapping@2.2.1': resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} @@ -130,55 +130,55 @@ packages: resolution: {integrity: sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q==} engines: {node: '>=6.9.0'} - '@biomejs/biome@1.8.3': - resolution: {integrity: sha512-/uUV3MV+vyAczO+vKrPdOW0Iaet7UnJMU4bNMinggGJTAnBPjCoLEYcyYtYHNnUNYlv4xZMH6hVIQCAozq8d5w==} + '@biomejs/biome@1.9.4': + resolution: {integrity: sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@1.8.3': - resolution: {integrity: sha512-9DYOjclFpKrH/m1Oz75SSExR8VKvNSSsLnVIqdnKexj6NwmiMlKk94Wa1kZEdv6MCOHGHgyyoV57Cw8WzL5n3A==} + '@biomejs/cli-darwin-arm64@1.9.4': + resolution: {integrity: sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@1.8.3': - resolution: {integrity: sha512-UeW44L/AtbmOF7KXLCoM+9PSgPo0IDcyEUfIoOXYeANaNXXf9mLUwV1GeF2OWjyic5zj6CnAJ9uzk2LT3v/wAw==} + '@biomejs/cli-darwin-x64@1.9.4': + resolution: {integrity: sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@1.8.3': - resolution: {integrity: sha512-9yjUfOFN7wrYsXt/T/gEWfvVxKlnh3yBpnScw98IF+oOeCYb5/b/+K7YNqKROV2i1DlMjg9g/EcN9wvj+NkMuQ==} + '@biomejs/cli-linux-arm64-musl@1.9.4': + resolution: {integrity: sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-arm64@1.8.3': - resolution: {integrity: sha512-fed2ji8s+I/m8upWpTJGanqiJ0rnlHOK3DdxsyVLZQ8ClY6qLuPc9uehCREBifRJLl/iJyQpHIRufLDeotsPtw==} + '@biomejs/cli-linux-arm64@1.9.4': + resolution: {integrity: sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-x64-musl@1.8.3': - resolution: {integrity: sha512-UHrGJX7PrKMKzPGoEsooKC9jXJMa28TUSMjcIlbDnIO4EAavCoVmNQaIuUSH0Ls2mpGMwUIf+aZJv657zfWWjA==} + '@biomejs/cli-linux-x64-musl@1.9.4': + resolution: {integrity: sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-linux-x64@1.8.3': - resolution: {integrity: sha512-I8G2QmuE1teISyT8ie1HXsjFRz9L1m5n83U1O6m30Kw+kPMPSKjag6QGUn+sXT8V+XWIZxFFBoTDEDZW2KPDDw==} + '@biomejs/cli-linux-x64@1.9.4': + resolution: {integrity: sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-win32-arm64@1.8.3': - resolution: {integrity: sha512-J+Hu9WvrBevfy06eU1Na0lpc7uR9tibm9maHynLIoAjLZpQU3IW+OKHUtyL8p6/3pT2Ju5t5emReeIS2SAxhkQ==} + '@biomejs/cli-win32-arm64@1.9.4': + resolution: {integrity: sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@1.8.3': - resolution: {integrity: sha512-/PJ59vA1pnQeKahemaQf4Nyj7IKUvGQSc3Ze1uIGi+Wvr1xF7rGobSrAAG01T/gUDG21vkDsZYM03NAmPiVkqg==} + '@biomejs/cli-win32-x64@1.9.4': + resolution: {integrity: sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -192,9 +192,9 @@ packages: cpu: [ppc64] os: [aix] - '@esbuild/aix-ppc64@0.21.5': - resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} - engines: {node: '>=12'} + '@esbuild/aix-ppc64@0.23.1': + resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} + engines: {node: '>=18'} cpu: [ppc64] os: [aix] @@ -210,9 +210,9 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm64@0.21.5': - resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} - engines: {node: '>=12'} + '@esbuild/android-arm64@0.23.1': + resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} + engines: {node: '>=18'} cpu: [arm64] os: [android] @@ -228,9 +228,9 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-arm@0.21.5': - resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} - engines: {node: '>=12'} + '@esbuild/android-arm@0.23.1': + resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} + engines: {node: '>=18'} cpu: [arm] os: [android] @@ -246,9 +246,9 @@ packages: cpu: [x64] os: [android] - '@esbuild/android-x64@0.21.5': - resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} - engines: {node: '>=12'} + '@esbuild/android-x64@0.23.1': + resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} + engines: {node: '>=18'} cpu: [x64] os: [android] @@ -264,9 +264,9 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-arm64@0.21.5': - resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} - engines: {node: '>=12'} + '@esbuild/darwin-arm64@0.23.1': + resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} + engines: {node: '>=18'} cpu: [arm64] os: [darwin] @@ -282,9 +282,9 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/darwin-x64@0.21.5': - resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} - engines: {node: '>=12'} + '@esbuild/darwin-x64@0.23.1': + resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} + engines: {node: '>=18'} cpu: [x64] os: [darwin] @@ -300,9 +300,9 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-arm64@0.21.5': - resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} - engines: {node: '>=12'} + '@esbuild/freebsd-arm64@0.23.1': + resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} + engines: {node: '>=18'} cpu: [arm64] os: [freebsd] @@ -318,9 +318,9 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/freebsd-x64@0.21.5': - resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} - engines: {node: '>=12'} + '@esbuild/freebsd-x64@0.23.1': + resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} + engines: {node: '>=18'} cpu: [x64] os: [freebsd] @@ -336,9 +336,9 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm64@0.21.5': - resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} - engines: {node: '>=12'} + '@esbuild/linux-arm64@0.23.1': + resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} + engines: {node: '>=18'} cpu: [arm64] os: [linux] @@ -354,9 +354,9 @@ packages: cpu: [arm] os: [linux] - '@esbuild/linux-arm@0.21.5': - resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} - engines: {node: '>=12'} + '@esbuild/linux-arm@0.23.1': + resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} + engines: {node: '>=18'} cpu: [arm] os: [linux] @@ -372,9 +372,9 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-ia32@0.21.5': - resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} - engines: {node: '>=12'} + '@esbuild/linux-ia32@0.23.1': + resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} + engines: {node: '>=18'} cpu: [ia32] os: [linux] @@ -390,9 +390,9 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-loong64@0.21.5': - resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} - engines: {node: '>=12'} + '@esbuild/linux-loong64@0.23.1': + resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} + engines: {node: '>=18'} cpu: [loong64] os: [linux] @@ -408,9 +408,9 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-mips64el@0.21.5': - resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} - engines: {node: '>=12'} + '@esbuild/linux-mips64el@0.23.1': + resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} + engines: {node: '>=18'} cpu: [mips64el] os: [linux] @@ -426,9 +426,9 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-ppc64@0.21.5': - resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} - engines: {node: '>=12'} + '@esbuild/linux-ppc64@0.23.1': + resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} + engines: {node: '>=18'} cpu: [ppc64] os: [linux] @@ -444,9 +444,9 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-riscv64@0.21.5': - resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} - engines: {node: '>=12'} + '@esbuild/linux-riscv64@0.23.1': + resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} + engines: {node: '>=18'} cpu: [riscv64] os: [linux] @@ -462,9 +462,9 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-s390x@0.21.5': - resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} - engines: {node: '>=12'} + '@esbuild/linux-s390x@0.23.1': + resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} + engines: {node: '>=18'} cpu: [s390x] os: [linux] @@ -480,9 +480,9 @@ packages: cpu: [x64] os: [linux] - '@esbuild/linux-x64@0.21.5': - resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} - engines: {node: '>=12'} + '@esbuild/linux-x64@0.23.1': + resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} + engines: {node: '>=18'} cpu: [x64] os: [linux] @@ -498,12 +498,18 @@ packages: cpu: [x64] os: [netbsd] - '@esbuild/netbsd-x64@0.21.5': - resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} - engines: {node: '>=12'} + '@esbuild/netbsd-x64@0.23.1': + resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} + engines: {node: '>=18'} cpu: [x64] os: [netbsd] + '@esbuild/openbsd-arm64@0.23.1': + resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-x64@0.17.19': resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} engines: {node: '>=12'} @@ -516,9 +522,9 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/openbsd-x64@0.21.5': - resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} - engines: {node: '>=12'} + '@esbuild/openbsd-x64@0.23.1': + resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} + engines: {node: '>=18'} cpu: [x64] os: [openbsd] @@ -534,9 +540,9 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/sunos-x64@0.21.5': - resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} - engines: {node: '>=12'} + '@esbuild/sunos-x64@0.23.1': + resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} + engines: {node: '>=18'} cpu: [x64] os: [sunos] @@ -552,9 +558,9 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-arm64@0.21.5': - resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} - engines: {node: '>=12'} + '@esbuild/win32-arm64@0.23.1': + resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} + engines: {node: '>=18'} cpu: [arm64] os: [win32] @@ -570,9 +576,9 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-ia32@0.21.5': - resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} - engines: {node: '>=12'} + '@esbuild/win32-ia32@0.23.1': + resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} + engines: {node: '>=18'} cpu: [ia32] os: [win32] @@ -588,9 +594,9 @@ packages: cpu: [x64] os: [win32] - '@esbuild/win32-x64@0.21.5': - resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} - engines: {node: '>=12'} + '@esbuild/win32-x64@0.23.1': + resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} + engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -604,10 +610,6 @@ packages: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} - '@jest/schemas@29.6.3': - resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jridgewell/gen-mapping@0.3.3': resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} @@ -626,6 +628,9 @@ packages: '@jridgewell/sourcemap-codec@1.4.15': resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + '@jridgewell/sourcemap-codec@1.5.0': + resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + '@jridgewell/trace-mapping@0.3.18': resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} @@ -633,12 +638,13 @@ packages: resolution: {integrity: sha512-f5DRIOZf7wxogefH03RjMPMdBF7ADTWUMoOs9kaJo06EfwF+aFhMZMDZxHg/Xe12hptN9xoZjGso2fdjapBRIA==} engines: {node: '>=10'} - '@noble/curves@1.2.0': - resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + '@noble/curves@1.6.0': + resolution: {integrity: sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==} + engines: {node: ^14.21.3 || >=16} - '@noble/hashes@1.3.2': - resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} - engines: {node: '>= 16'} + '@noble/hashes@1.5.0': + resolution: {integrity: sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==} + engines: {node: ^14.21.3 || >=16} '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} @@ -668,101 +674,205 @@ packages: rollup: optional: true + '@rollup/rollup-android-arm-eabi@4.24.0': + resolution: {integrity: sha512-Q6HJd7Y6xdB48x8ZNVDOqsbh2uByBhgK8PiQgPhwkIw/HC/YX5Ghq2mQY5sRMZWHb3VsFkWooUVOZHKr7DmDIA==} + cpu: [arm] + os: [android] + '@rollup/rollup-android-arm-eabi@4.9.4': resolution: {integrity: sha512-ub/SN3yWqIv5CWiAZPHVS1DloyZsJbtXmX4HxUTIpS0BHm9pW5iYBo2mIZi+hE3AeiTzHz33blwSnhdUo+9NpA==} cpu: [arm] os: [android] + '@rollup/rollup-android-arm64@4.24.0': + resolution: {integrity: sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA==} + cpu: [arm64] + os: [android] + '@rollup/rollup-android-arm64@4.9.4': resolution: {integrity: sha512-ehcBrOR5XTl0W0t2WxfTyHCR/3Cq2jfb+I4W+Ch8Y9b5G+vbAecVv0Fx/J1QKktOrgUYsIKxWAKgIpvw56IFNA==} cpu: [arm64] os: [android] + '@rollup/rollup-darwin-arm64@4.24.0': + resolution: {integrity: sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA==} + cpu: [arm64] + os: [darwin] + '@rollup/rollup-darwin-arm64@4.9.4': resolution: {integrity: sha512-1fzh1lWExwSTWy8vJPnNbNM02WZDS8AW3McEOb7wW+nPChLKf3WG2aG7fhaUmfX5FKw9zhsF5+MBwArGyNM7NA==} cpu: [arm64] os: [darwin] + '@rollup/rollup-darwin-x64@4.24.0': + resolution: {integrity: sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ==} + cpu: [x64] + os: [darwin] + '@rollup/rollup-darwin-x64@4.9.4': resolution: {integrity: sha512-Gc6cukkF38RcYQ6uPdiXi70JB0f29CwcQ7+r4QpfNpQFVHXRd0DfWFidoGxjSx1DwOETM97JPz1RXL5ISSB0pA==} cpu: [x64] os: [darwin] + '@rollup/rollup-linux-arm-gnueabihf@4.24.0': + resolution: {integrity: sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA==} + cpu: [arm] + os: [linux] + '@rollup/rollup-linux-arm-gnueabihf@4.9.4': resolution: {integrity: sha512-g21RTeFzoTl8GxosHbnQZ0/JkuFIB13C3T7Y0HtKzOXmoHhewLbVTFBQZu+z5m9STH6FZ7L/oPgU4Nm5ErN2fw==} cpu: [arm] os: [linux] + '@rollup/rollup-linux-arm-musleabihf@4.24.0': + resolution: {integrity: sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.24.0': + resolution: {integrity: sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA==} + cpu: [arm64] + os: [linux] + '@rollup/rollup-linux-arm64-gnu@4.9.4': resolution: {integrity: sha512-TVYVWD/SYwWzGGnbfTkrNpdE4HON46orgMNHCivlXmlsSGQOx/OHHYiQcMIOx38/GWgwr/po2LBn7wypkWw/Mg==} cpu: [arm64] os: [linux] + '@rollup/rollup-linux-arm64-musl@4.24.0': + resolution: {integrity: sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw==} + cpu: [arm64] + os: [linux] + '@rollup/rollup-linux-arm64-musl@4.9.4': resolution: {integrity: sha512-XcKvuendwizYYhFxpvQ3xVpzje2HHImzg33wL9zvxtj77HvPStbSGI9czrdbfrf8DGMcNNReH9pVZv8qejAQ5A==} cpu: [arm64] os: [linux] + '@rollup/rollup-linux-powerpc64le-gnu@4.24.0': + resolution: {integrity: sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.24.0': + resolution: {integrity: sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg==} + cpu: [riscv64] + os: [linux] + '@rollup/rollup-linux-riscv64-gnu@4.9.4': resolution: {integrity: sha512-LFHS/8Q+I9YA0yVETyjonMJ3UA+DczeBd/MqNEzsGSTdNvSJa1OJZcSH8GiXLvcizgp9AlHs2walqRcqzjOi3A==} cpu: [riscv64] os: [linux] + '@rollup/rollup-linux-s390x-gnu@4.24.0': + resolution: {integrity: sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.24.0': + resolution: {integrity: sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==} + cpu: [x64] + os: [linux] + '@rollup/rollup-linux-x64-gnu@4.9.4': resolution: {integrity: sha512-dIYgo+j1+yfy81i0YVU5KnQrIJZE8ERomx17ReU4GREjGtDW4X+nvkBak2xAUpyqLs4eleDSj3RrV72fQos7zw==} cpu: [x64] os: [linux] + '@rollup/rollup-linux-x64-musl@4.24.0': + resolution: {integrity: sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ==} + cpu: [x64] + os: [linux] + '@rollup/rollup-linux-x64-musl@4.9.4': resolution: {integrity: sha512-RoaYxjdHQ5TPjaPrLsfKqR3pakMr3JGqZ+jZM0zP2IkDtsGa4CqYaWSfQmZVgFUCgLrTnzX+cnHS3nfl+kB6ZQ==} cpu: [x64] os: [linux] + '@rollup/rollup-win32-arm64-msvc@4.24.0': + resolution: {integrity: sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ==} + cpu: [arm64] + os: [win32] + '@rollup/rollup-win32-arm64-msvc@4.9.4': resolution: {integrity: sha512-T8Q3XHV+Jjf5e49B4EAaLKV74BbX7/qYBRQ8Wop/+TyyU0k+vSjiLVSHNWdVd1goMjZcbhDmYZUYW5RFqkBNHQ==} cpu: [arm64] os: [win32] + '@rollup/rollup-win32-ia32-msvc@4.24.0': + resolution: {integrity: sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ==} + cpu: [ia32] + os: [win32] + '@rollup/rollup-win32-ia32-msvc@4.9.4': resolution: {integrity: sha512-z+JQ7JirDUHAsMecVydnBPWLwJjbppU+7LZjffGf+Jvrxq+dVjIE7By163Sc9DKc3ADSU50qPVw0KonBS+a+HQ==} cpu: [ia32] os: [win32] + '@rollup/rollup-win32-x64-msvc@4.24.0': + resolution: {integrity: sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw==} + cpu: [x64] + os: [win32] + '@rollup/rollup-win32-x64-msvc@4.9.4': resolution: {integrity: sha512-LfdGXCV9rdEify1oxlN9eamvDSjv9md9ZVMAbNHA87xqIfFCxImxan9qZ8+Un54iK2nnqPlbnSi4R54ONtbWBw==} cpu: [x64] os: [win32] - '@scure/base@1.1.5': - resolution: {integrity: sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ==} + '@scure/base@1.1.9': + resolution: {integrity: sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==} - '@scure/bip32@1.3.2': - resolution: {integrity: sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==} + '@scure/bip32@1.5.0': + resolution: {integrity: sha512-8EnFYkqEQdnkuGBVpCzKxyIwDCBLDVj3oiX0EKUFre/tOjL/Hqba1D6n/8RcmaQy4f95qQFrO2A8Sr6ybh4NRw==} - '@scure/bip39@1.2.1': - resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} + '@scure/bip39@1.4.0': + resolution: {integrity: sha512-BEEm6p8IueV/ZTfQLp/0vhw4NPnT9oWf5+28nvmeUICjP99f4vr2d+qc7AVGDDtwRep6ifR43Yed9ERVmiITzw==} - '@shikijs/core@1.9.1': - resolution: {integrity: sha512-EmUful2MQtY8KgCF1OkBtOuMcvaZEvmdubhW0UHCGXi21O9dRLeADVCj+k6ZS+de7Mz9d2qixOXJ+GLhcK3pXg==} + '@shikijs/core@1.22.1': + resolution: {integrity: sha512-bqAhT/Ri5ixV4oYsvJNH8UJjpjbINWlWyXY6tBTsP4OmD6XnFv43nRJ+lTdxd2rmG5pgam/x+zGR6kLRXrpEKA==} - '@sinclair/typebox@0.27.8': - resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + '@shikijs/engine-javascript@1.22.1': + resolution: {integrity: sha512-540pyoy0LWe4jj2BVbgELwOFu1uFvRI7lg4hdsExrSXA9x7gqfzZ/Nnh4RfX86aDAgJ647gx4TCmRwACbnQSvw==} - '@types/async-retry@1.4.8': - resolution: {integrity: sha512-Qup/B5PWLe86yI5I3av6ePGaeQrIHNKCwbsQotD6aHQ6YkHsMUxVZkZsmx/Ry3VZQ6uysHwTjQ7666+k6UjVJA==} + '@shikijs/engine-oniguruma@1.22.1': + resolution: {integrity: sha512-L+1Vmd+a2kk8HtogUFymQS6BjUfJnzcWoUp1BUgxoDiklbKSMvrsMuLZGevTOP1m0rEjgnC5MsDmsr8lX1lC+Q==} + + '@shikijs/types@1.22.1': + resolution: {integrity: sha512-+45f8mu/Hxqs6Kyhfm98Nld5n7Q7lwhjU8UtdQwrOPs7BnM4VAb929O3IQ2ce+4D7SlNFlZGd8CnKRSnwbQreQ==} + + '@shikijs/vscode-textmate@9.3.0': + resolution: {integrity: sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==} + + '@types/async-retry@1.4.9': + resolution: {integrity: sha512-s1ciZQJzRh3708X/m3vPExr5KJlzlZJvXsKpbtE2luqNcbROr64qU+3KpJsYHqWMeaxI839OvXf9PrUSw1Xtyg==} '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} - '@types/node@20.14.9': - resolution: {integrity: sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==} + '@types/estree@1.0.6': + resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + + '@types/hast@3.0.4': + resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + + '@types/mdast@4.0.4': + resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} + + '@types/node@20.17.0': + resolution: {integrity: sha512-a7zRo0f0eLo9K5X9Wp5cAqTUNGzuFLDG2R7C4HY2BhcMAsxgSPuRvAC1ZB6QkuUQXf0YZAgfOX2ZyrBa2n4nHQ==} '@types/retry@0.12.5': resolution: {integrity: sha512-3xSjTp3v03X/lSQLkczaN9UIEwJMoMCA1+Nb5HfbJEQWogdeQIyVtTvxPXDQjZ5zws8rFQfVfRdz03ARihPJgw==} + '@types/unist@3.0.3': + resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} + '@types/web-bluetooth@0.0.17': resolution: {integrity: sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==} + '@ungap/structured-clone@1.2.0': + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + '@unocss/astro@0.52.3': resolution: {integrity: sha512-S9Rb1TROB0Q1c4qgLBwLWqccaYq+Q+ZJaUvpgNjvDeKdam1pcGCELJos0HIK5oxOXpALSVmlMkGEh7OOZzDhCQ==} @@ -847,20 +957,35 @@ packages: vite: ^4.0.0 vue: ^3.2.25 - '@vitest/expect@1.6.0': - resolution: {integrity: sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==} + '@vitest/expect@2.1.3': + resolution: {integrity: sha512-SNBoPubeCJhZ48agjXruCI57DvxcsivVDdWz+SSsmjTT4QN/DfHk3zB/xKsJqMs26bLZ/pNRLnCf0j679i0uWQ==} + + '@vitest/mocker@2.1.3': + resolution: {integrity: sha512-eSpdY/eJDuOvuTA3ASzCjdithHa+GIF1L4PqtEELl6Qa3XafdMLBpBlZCIUCX2J+Q6sNmjmxtosAG62fK4BlqQ==} + peerDependencies: + '@vitest/spy': 2.1.3 + msw: ^2.3.5 + vite: ^5.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@2.1.3': + resolution: {integrity: sha512-XH1XdtoLZCpqV59KRbPrIhFCOO0hErxrQCMcvnQete3Vibb9UeIOX02uFPfVn3Z9ZXsq78etlfyhnkmIZSzIwQ==} - '@vitest/runner@1.6.0': - resolution: {integrity: sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==} + '@vitest/runner@2.1.3': + resolution: {integrity: sha512-JGzpWqmFJ4fq5ZKHtVO3Xuy1iF2rHGV4d/pdzgkYHm1+gOzNZtqjvyiaDGJytRyMU54qkxpNzCx+PErzJ1/JqQ==} - '@vitest/snapshot@1.6.0': - resolution: {integrity: sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==} + '@vitest/snapshot@2.1.3': + resolution: {integrity: sha512-qWC2mWc7VAXmjAkEKxrScWHWFyCQx/cmiZtuGqMi+WwqQJ2iURsVY4ZfAK6dVo6K2smKRU6l3BPwqEBvhnpQGg==} - '@vitest/spy@1.6.0': - resolution: {integrity: sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==} + '@vitest/spy@2.1.3': + resolution: {integrity: sha512-Nb2UzbcUswzeSP7JksMDaqsI43Sj5+Kry6ry6jQJT4b5gAK+NS9NED6mDb8FlMRCX8m5guaHCDZmqYMMWRy5nQ==} - '@vitest/utils@1.6.0': - resolution: {integrity: sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==} + '@vitest/utils@2.1.3': + resolution: {integrity: sha512-xpiVfDSg1RrYT0tX6czgerkpcKFmFOF/gCr30+Mve5V2kewCy4Prn1/NDMSRwaSmT7PRaOF83wu+bEtsY1wrvA==} '@volar/language-core@1.4.1': resolution: {integrity: sha512-EIY+Swv+TjsWpxOxujjMf1ZXqOjg9MT2VMXZ+1dKva0wD8W0L6EtptFFcCJdBbcKmGMFkr57Qzz9VNMWhs3jXQ==} @@ -922,8 +1047,8 @@ packages: '@vueuse/shared@10.1.2': resolution: {integrity: sha512-1uoUTPBlgyscK9v6ScGeVYDDzlPSFXBlxuK7SfrDGyUTBiznb3mNceqhwvZHjtDRELZEN79V5uWPTF1VDV8svA==} - abitype@1.0.4: - resolution: {integrity: sha512-UivtYZOGJGE8rsrM/N5vdRkUpqEZVmuTumfTuolm7m/6O09wprd958rx8kUBwVAAAhQDveGAgD0GJdBuR8s6tw==} + abitype@1.0.6: + resolution: {integrity: sha512-MMSqYh4+C/aVqI2RQaWqbvI4Kxo5cQV40WQ4QFtDnNzCkqChm8MuENhElmynZlO0qUy/ObkEUaXtKqYnx1Kp3A==} peerDependencies: typescript: '>=5.0.4' zod: ^3 >=3.22.0 @@ -933,15 +1058,16 @@ packages: zod: optional: true - acorn-walk@8.3.2: - resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} - engines: {node: '>=0.4.0'} - acorn@8.11.3: resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} engines: {node: '>=0.4.0'} hasBin: true + acorn@8.13.0: + resolution: {integrity: sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==} + engines: {node: '>=0.4.0'} + hasBin: true + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -954,10 +1080,6 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} - ansi-styles@5.2.0: - resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} - engines: {node: '>=10'} - ansi-styles@6.2.1: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} @@ -972,12 +1094,9 @@ packages: argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - array-union@2.1.0: - resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} - engines: {node: '>=8'} - - assertion-error@1.1.0: - resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} async-cache-dedupe@2.2.0: resolution: {integrity: sha512-jl4L6dGC+KLB/LIA1iIBiq7eWQ43K7lIcIdwbUUwRmfT209yH8Xm1uPTOxxlNQ7XD6/XHU7xhSr/NgPxlH04MQ==} @@ -999,19 +1118,19 @@ packages: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} - bumpp@9.4.1: - resolution: {integrity: sha512-kzhp/LpNX0HkUpEyLd7sU2LTN/mbAVgcxJ1Zi2cAJTE/tul6rypSKGpH8UywDpzKWItL8LVdKsIFnwmylw0+7g==} + bumpp@9.7.1: + resolution: {integrity: sha512-Z6fhD5B8POcSkP+LIHeFQ0+vF0p/C3U+aYp3Yui748VCmsHrhJ/ZshP2970FqE93ymHrJVXTTF8/HDKrRNEYvw==} engines: {node: '>=10'} hasBin: true - bundle-require@4.0.2: - resolution: {integrity: sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag==} + bundle-require@5.0.0: + resolution: {integrity: sha512-GuziW3fSSmopcx4KRymQEJVbZUfqlCqcq7dvs6TYwKRZiegK/2buMxQTPs6MGlNv50wms1699qYO54R8XfRX4w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: - esbuild: '>=0.17' + esbuild: '>=0.18' - c12@1.11.1: - resolution: {integrity: sha512-KDU0TvSvVdaYcQKQ6iPHATGz/7p/KiVjPg4vQrB6Jg/wX9R0yl5RZxWm9IoZqaIHD2+6PZd81+KMGwRr/lRIUg==} + c12@1.11.2: + resolution: {integrity: sha512-oBs8a4uvSDO9dm8b7OCFW7+dgtVrwmwnrVXYzLm43ta7ep2jCn/0MhoUFygIWtxhyy6+/MG7/agvpY0U1Iemew==} peerDependencies: magicast: ^0.3.4 peerDependenciesMeta: @@ -1025,15 +1144,25 @@ packages: call-me-maybe@1.0.2: resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} - chai@4.4.0: - resolution: {integrity: sha512-x9cHNq1uvkCdU+5xTkNh5WtgD4e4yDFCsp9jVc7N7qVeKeftv3gO/ZrviX5d+3ZfxdYnZXZYujjRInu1RogU6A==} - engines: {node: '>=4'} + ccount@2.0.1: + resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} + + chai@5.1.2: + resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} + engines: {node: '>=12'} change-case@5.4.4: resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} - check-error@1.0.3: - resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + character-entities-html4@2.1.0: + resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} + + character-entities-legacy@3.0.0: + resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} + + check-error@2.1.1: + resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} + engines: {node: '>= 16'} chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} @@ -1060,6 +1189,9 @@ packages: colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + comma-separated-tokens@2.0.3: + resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} + commander@4.1.1: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} @@ -1067,6 +1199,9 @@ packages: confbox@0.1.7: resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} + confbox@0.1.8: + resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} + consola@3.2.3: resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} engines: {node: ^14.18.0 || >=16.10.0} @@ -1094,26 +1229,34 @@ packages: supports-color: optional: true - deep-eql@4.1.3: - resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} + debug@4.3.7: + resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} defu@6.1.4: resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + dequal@2.0.3: + resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} + engines: {node: '>=6'} + destr@1.2.2: resolution: {integrity: sha512-lrbCJwD9saUQrqUfXvl6qoM+QN3W7tLV5pAOs+OqOmopCCz/JkE05MHedJR1xfk4IAnZuJXPVuN5+7jNA2ZCiA==} destr@2.0.3: resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==} - diff-sequences@29.6.3: - resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - dir-glob@3.0.1: - resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} - engines: {node: '>=8'} + devlop@1.1.0: + resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} dotenv@16.4.5: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} @@ -1149,13 +1292,13 @@ packages: engines: {node: '>=12'} hasBin: true - esbuild@0.21.5: - resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} - engines: {node: '>=12'} + esbuild@0.23.1: + resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} + engines: {node: '>=18'} hasBin: true - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} estree-walker@2.0.2: @@ -1182,6 +1325,14 @@ packages: fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} + fdir@6.4.2: + resolution: {integrity: sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} @@ -1203,9 +1354,6 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] - get-func-name@2.0.2: - resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} - get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} @@ -1227,18 +1375,23 @@ packages: engines: {node: '>=16 || 14 >=14.17'} hasBin: true - globby@11.1.0: - resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} - engines: {node: '>=10'} - gzip-size@6.0.0: resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==} engines: {node: '>=10'} + hast-util-to-html@9.0.3: + resolution: {integrity: sha512-M17uBDzMJ9RPCqLMO92gNNUDuBSq10a25SDBI08iCCxmorf4Yy6sYHK57n9WAbRAAaU+DuR4W6GN9K4DFZesYg==} + + hast-util-whitespace@3.0.0: + resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} + he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true + html-void-elements@3.0.0: + resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==} + human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} @@ -1247,10 +1400,6 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} - ignore@5.3.0: - resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} - engines: {node: '>= 4'} - is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} @@ -1282,8 +1431,8 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - isows@1.0.4: - resolution: {integrity: sha512-hEzjY+x9u9hPmBom9IIAqdJCwNLax+xrPb51vEPpERoFlIxgmZcHzsT5jKG06nvInKOBGvReAVz80Umed5CczQ==} + isows@1.0.6: + resolution: {integrity: sha512-lPHCayd40oW98/I0uvgaHKWCSvkzY27LjWLbtzOm64yQ+G3Q5npjjbdppU65iZXkK1Zt+kH9pfegli0AYfwYYw==} peerDependencies: ws: '*' @@ -1303,15 +1452,12 @@ packages: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} - js-tokens@8.0.3: - resolution: {integrity: sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==} - js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true - jsonc-parser@3.2.0: - resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} kleur@3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} @@ -1320,8 +1466,8 @@ packages: kolorist@1.8.0: resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} - lilconfig@3.0.0: - resolution: {integrity: sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==} + lilconfig@3.1.2: + resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} engines: {node: '>=14'} lines-and-columns@1.2.4: @@ -1338,10 +1484,6 @@ packages: resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} engines: {node: '>=14'} - local-pkg@0.5.0: - resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} - engines: {node: '>=14'} - locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -1349,8 +1491,8 @@ packages: lodash.sortby@4.7.0: resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} - loupe@2.3.7: - resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} + loupe@3.1.2: + resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} lru-cache@10.1.0: resolution: {integrity: sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==} @@ -1367,6 +1509,9 @@ packages: resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==} engines: {node: '>=12'} + magic-string@0.30.12: + resolution: {integrity: sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==} + magic-string@0.30.5: resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==} engines: {node: '>=12'} @@ -1375,6 +1520,9 @@ packages: resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==} hasBin: true + mdast-util-to-hast@13.2.0: + resolution: {integrity: sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==} + mdn-data@2.0.30: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} @@ -1388,6 +1536,21 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + micromark-util-character@2.1.0: + resolution: {integrity: sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==} + + micromark-util-encode@2.0.0: + resolution: {integrity: sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==} + + micromark-util-sanitize-uri@2.0.0: + resolution: {integrity: sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==} + + micromark-util-symbol@2.0.0: + resolution: {integrity: sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==} + + micromark-util-types@2.0.0: + resolution: {integrity: sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==} + micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} @@ -1404,10 +1567,6 @@ packages: resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} engines: {node: '>=16 || 14 >=14.17'} - minimatch@9.0.3: - resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} - engines: {node: '>=16 || 14 >=14.17'} - minimatch@9.0.5: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} @@ -1433,12 +1592,12 @@ packages: engines: {node: '>=10'} hasBin: true - mlly@1.4.2: - resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==} - mlly@1.7.1: resolution: {integrity: sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==} + mlly@1.7.2: + resolution: {integrity: sha512-tN3dvVHYVz4DhSXinXIk7u9syPYaJvio118uomkovAtWBT+RdbP6Lfh/5Lvo519YMmwBafwlh20IPTXIStscpA==} + mnemonist@0.39.7: resolution: {integrity: sha512-ix3FwHWZgdXUt0dHM8bCrI4r1KMeYx8bCunPCYmvKXq4tn6gbNsqrsb4q0kDbDqbpIOvEaW5Sn+dmDwGydfrwA==} @@ -1449,6 +1608,9 @@ packages: ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + muggle-string@0.2.2: resolution: {integrity: sha512-YVE1mIJ4VpUMqZObFndk9CJu6DBJR/GB13p3tXuNbwD4XExaI5EOuRl6BHeIDxIqXZVxSfAC+y6U1Z/IxCfKUg==} @@ -1509,14 +1671,13 @@ packages: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} + oniguruma-to-js@0.4.3: + resolution: {integrity: sha512-X0jWUcAlxORhOqqBREgPMgnshB7ZGYszBNspP+tS9hPD3l13CdaXcHbgImoHUHlrvGx/7AvFEkTRhAGYh+jzjQ==} + p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} - p-limit@5.0.0: - resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==} - engines: {node: '>=18'} - p-locate@5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} @@ -1537,18 +1698,15 @@ packages: resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} engines: {node: '>=16 || 14 >=14.17'} - path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} - engines: {node: '>=8'} - pathe@1.1.1: resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} - pathval@1.1.1: - resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + pathval@2.0.0: + resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} + engines: {node: '>= 14.16'} perfect-debounce@1.0.0: resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} @@ -1556,30 +1714,40 @@ packages: picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + pirates@4.0.6: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} - pkg-types@1.0.3: - resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} - - pkg-types@1.1.1: - resolution: {integrity: sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==} + pkg-types@1.2.1: + resolution: {integrity: sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==} - postcss-load-config@4.0.2: - resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} - engines: {node: '>= 14'} + postcss-load-config@6.0.1: + resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} + engines: {node: '>= 18'} peerDependencies: + jiti: '>=1.21.0' postcss: '>=8.0.9' - ts-node: '>=9.0.0' + tsx: ^4.8.1 + yaml: ^2.4.2 peerDependenciesMeta: + jiti: + optional: true postcss: optional: true - ts-node: + tsx: + optional: true + yaml: optional: true postcss@8.4.23: @@ -1590,14 +1758,13 @@ packages: resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} engines: {node: ^10 || ^12 || >=14} - pretty-format@29.7.0: - resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - prompts@2.4.2: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} + property-information@6.5.0: + resolution: {integrity: sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==} + punycode.js@2.3.1: resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} engines: {node: '>=6'} @@ -1612,13 +1779,13 @@ packages: rc9@2.1.2: resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} - react-is@18.2.0: - resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} - readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + regex@4.3.3: + resolution: {integrity: sha512-r/AadFO7owAq1QJVeZ/nq9jNS1vyZt+6t1p/E59B56Rn2GCya+gr1KSyOzNL/er+r+B7phv5jG2xU2Nz1YkmJg==} + resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} @@ -1636,6 +1803,11 @@ packages: engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true + rollup@4.24.0: + resolution: {integrity: sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + rollup@4.9.4: resolution: {integrity: sha512-2ztU7pY/lrQyXSCnnoU4ICjT/tCG9cdH3/G25ERqE3Lst6vl2BCM5hL2Nw+sslAvAf+ccKsAq1SkKQALyqhR7g==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -1653,8 +1825,8 @@ packages: engines: {node: '>=10'} hasBin: true - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} + semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} engines: {node: '>=10'} hasBin: true @@ -1666,8 +1838,8 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - shiki@1.9.1: - resolution: {integrity: sha512-8PDkgb5ja3nfujTjvC4VytL6wGOGCtFAClUb2r3QROevYXxcq+/shVJK5s6gy0HZnjaJgFxd6BpPqpRfqne5rA==} + shiki@1.22.1: + resolution: {integrity: sha512-PbJ6XxrWLMwB2rm3qdjIHNm3zq4SfFnOx0B3rEoi4AN8AUngsdyZ1tRe5slMPtn6jQkbUURLNZPpLR7Do3k78g==} siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -1690,10 +1862,6 @@ packages: sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} - slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -1702,6 +1870,9 @@ packages: resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} engines: {node: '>= 8'} + space-separated-tokens@2.0.2: + resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} + stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -1720,6 +1891,9 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} + stringify-entities@4.0.4: + resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==} + strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -1736,9 +1910,6 @@ packages: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} - strip-literal@2.0.0: - resolution: {integrity: sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==} - sucrase@3.35.0: resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} engines: {node: '>=16 || 14 >=14.17'} @@ -1755,15 +1926,26 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - tinybench@2.5.1: - resolution: {integrity: sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==} + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinypool@0.8.4: - resolution: {integrity: sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==} + tinyexec@0.3.1: + resolution: {integrity: sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==} + + tinyglobby@0.2.9: + resolution: {integrity: sha512-8or1+BGEdk1Zkkw2ii16qSS7uVrQJPre5A9o/XkWPATkk23FZh/15BKFxPnlTy6vkljZxLqYCzzBMj30ZrSvjw==} + engines: {node: '>=12.0.0'} + + tinypool@1.0.1: + resolution: {integrity: sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==} + engines: {node: ^18.0.0 || >=20.0.0} + + tinyrainbow@1.2.0: + resolution: {integrity: sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==} engines: {node: '>=14.0.0'} - tinyspy@2.2.0: - resolution: {integrity: sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==} + tinyspy@3.0.2: + resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} engines: {node: '>=14.0.0'} to-fast-properties@2.0.0: @@ -1785,11 +1967,14 @@ packages: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true + trim-lines@3.0.1: + resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} + ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - tsup@8.1.0: - resolution: {integrity: sha512-UFdfCAXukax+U6KzeTNO2kAARHcWxmKsnvSPXUcfA1D+kU05XDccCrkffCQpFaWDsZfV0jMyTsxU39VfCp6EOg==} + tsup@8.3.0: + resolution: {integrity: sha512-ALscEeyS03IomcuNdFdc0YWGVIkwH1Ws7nfTbAPuoILvEV2hpGQAY72LIOjglGo4ShWpZfpBqP/jpQVCzqYQag==} engines: {node: '>=18'} hasBin: true peerDependencies: @@ -1811,20 +1996,20 @@ packages: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} - typedoc@0.26.2: - resolution: {integrity: sha512-q/t+M+PZqhN9gPWLBZ3CCvP+KT8O1tyYkSzEYbcQ6mo89avdIrMlBEl3vfo5BgSzwC6Lbmq0W64E8RkY+eVsLA==} + typedoc@0.26.10: + resolution: {integrity: sha512-xLmVKJ8S21t+JeuQLNueebEuTVphx6IrP06CdV7+0WVflUSW3SPmR+h1fnWVdAR/FQePEgsSWCUHXqKKjzuUAw==} engines: {node: '>= 18'} hasBin: true peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x typescript@5.0.4: resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} engines: {node: '>=12.20'} hasBin: true - typescript@5.5.2: - resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} + typescript@5.6.3: + resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} engines: {node: '>=14.17'} hasBin: true @@ -1837,11 +2022,29 @@ packages: ufo@1.5.3: resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==} + ufo@1.5.4: + resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} + unconfig@0.3.9: resolution: {integrity: sha512-8yhetFd48M641mxrkWA+C/lZU4N0rCOdlo3dFsyFPnBHBjMJfjT/3eAZBRT2RxCRqeBMAKBVgikejdS6yeBjMw==} - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + + unist-util-is@6.0.0: + resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} + + unist-util-position@5.0.0: + resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==} + + unist-util-stringify-position@4.0.0: + resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} + + unist-util-visit-parents@6.0.1: + resolution: {integrity: sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==} + + unist-util-visit@5.0.0: + resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} unocss@0.52.3: resolution: {integrity: sha512-BgL3kbxwt839t0ojo/j+i8xU4qu+fyV34SJOMQuFhLu6xkPNepvr6uPeipzNDajR7EZP3Q+jXJT9AWLKLLg1jw==} @@ -1852,16 +2055,22 @@ packages: '@unocss/webpack': optional: true - viem@2.16.3: - resolution: {integrity: sha512-6ExbIpi77C1HzGSjx6W+fn39Cz1ULlVV74XHxi1kYpOAqY7/iAoynK5X2aQp2LvxstTqS1GIKEdpCAZ8dKi2Ag==} + vfile-message@4.0.2: + resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} + + vfile@6.0.3: + resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} + + viem@2.21.34: + resolution: {integrity: sha512-IR8ucya4dkVJv1jzv/qBz1TxYbSoXZuJPuqQk1/AybU9VuGdMUayittYwr0Navs97XFNml6UWGVya07apoaBmQ==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: typescript: optional: true - vite-node@1.6.0: - resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} + vite-node@2.1.3: + resolution: {integrity: sha512-I1JadzO+xYX887S39Do+paRePCKoiDrWRRjp9kkG5he0t7RXNvPAJPCQSJqbGN4uCrFFeS3Kj3sLqY8NMYBEdA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -1918,15 +2127,15 @@ packages: terser: optional: true - vitest@1.6.0: - resolution: {integrity: sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==} + vitest@2.1.3: + resolution: {integrity: sha512-Zrxbg/WiIvUP2uEzelDNTXmEMJXuzJ1kCpbDvaKByFA9MNeO95V+7r/3ti0qzJzrxdyuUw5VduN7k+D3VmVOSA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 1.6.0 - '@vitest/ui': 1.6.0 + '@vitest/browser': 2.1.3 + '@vitest/ui': 2.1.3 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -1966,6 +2175,9 @@ packages: vue@3.3.4: resolution: {integrity: sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==} + webauthn-p256@0.0.10: + resolution: {integrity: sha512-EeYD+gmIT80YkSIDb2iWq0lq2zbHo1CxHlQTeJ+KkCILWpVy3zASH3ByD4bopzfk0uCwXxLqKGLqp2W4O28VFA==} + webidl-conversions@4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} @@ -1977,8 +2189,8 @@ packages: engines: {node: '>= 8'} hasBin: true - why-is-node-running@2.2.2: - resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} engines: {node: '>=8'} hasBin: true @@ -1990,8 +2202,8 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} - ws@8.17.1: - resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} + ws@8.18.0: + resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -2005,12 +2217,8 @@ packages: yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - yaml@2.3.4: - resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==} - engines: {node: '>= 14'} - - yaml@2.4.5: - resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} + yaml@2.6.0: + resolution: {integrity: sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==} engines: {node: '>= 14'} hasBin: true @@ -2018,13 +2226,12 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - yocto-queue@1.0.0: - resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} - engines: {node: '>=12.20'} + zwitch@2.0.4: + resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} snapshots: - '@adraffy/ens-normalize@1.10.0': {} + '@adraffy/ens-normalize@1.11.0': {} '@ampproject/remapping@2.2.1': dependencies: @@ -2052,39 +2259,39 @@ snapshots: '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 - '@biomejs/biome@1.8.3': + '@biomejs/biome@1.9.4': optionalDependencies: - '@biomejs/cli-darwin-arm64': 1.8.3 - '@biomejs/cli-darwin-x64': 1.8.3 - '@biomejs/cli-linux-arm64': 1.8.3 - '@biomejs/cli-linux-arm64-musl': 1.8.3 - '@biomejs/cli-linux-x64': 1.8.3 - '@biomejs/cli-linux-x64-musl': 1.8.3 - '@biomejs/cli-win32-arm64': 1.8.3 - '@biomejs/cli-win32-x64': 1.8.3 - - '@biomejs/cli-darwin-arm64@1.8.3': + '@biomejs/cli-darwin-arm64': 1.9.4 + '@biomejs/cli-darwin-x64': 1.9.4 + '@biomejs/cli-linux-arm64': 1.9.4 + '@biomejs/cli-linux-arm64-musl': 1.9.4 + '@biomejs/cli-linux-x64': 1.9.4 + '@biomejs/cli-linux-x64-musl': 1.9.4 + '@biomejs/cli-win32-arm64': 1.9.4 + '@biomejs/cli-win32-x64': 1.9.4 + + '@biomejs/cli-darwin-arm64@1.9.4': optional: true - '@biomejs/cli-darwin-x64@1.8.3': + '@biomejs/cli-darwin-x64@1.9.4': optional: true - '@biomejs/cli-linux-arm64-musl@1.8.3': + '@biomejs/cli-linux-arm64-musl@1.9.4': optional: true - '@biomejs/cli-linux-arm64@1.8.3': + '@biomejs/cli-linux-arm64@1.9.4': optional: true - '@biomejs/cli-linux-x64-musl@1.8.3': + '@biomejs/cli-linux-x64-musl@1.9.4': optional: true - '@biomejs/cli-linux-x64@1.8.3': + '@biomejs/cli-linux-x64@1.9.4': optional: true - '@biomejs/cli-win32-arm64@1.8.3': + '@biomejs/cli-win32-arm64@1.9.4': optional: true - '@biomejs/cli-win32-x64@1.8.3': + '@biomejs/cli-win32-x64@1.9.4': optional: true '@crossbell/ipfs-fetch@0.0.21': {} @@ -2092,7 +2299,7 @@ snapshots: '@esbuild/aix-ppc64@0.19.11': optional: true - '@esbuild/aix-ppc64@0.21.5': + '@esbuild/aix-ppc64@0.23.1': optional: true '@esbuild/android-arm64@0.17.19': @@ -2101,7 +2308,7 @@ snapshots: '@esbuild/android-arm64@0.19.11': optional: true - '@esbuild/android-arm64@0.21.5': + '@esbuild/android-arm64@0.23.1': optional: true '@esbuild/android-arm@0.17.19': @@ -2110,7 +2317,7 @@ snapshots: '@esbuild/android-arm@0.19.11': optional: true - '@esbuild/android-arm@0.21.5': + '@esbuild/android-arm@0.23.1': optional: true '@esbuild/android-x64@0.17.19': @@ -2119,7 +2326,7 @@ snapshots: '@esbuild/android-x64@0.19.11': optional: true - '@esbuild/android-x64@0.21.5': + '@esbuild/android-x64@0.23.1': optional: true '@esbuild/darwin-arm64@0.17.19': @@ -2128,7 +2335,7 @@ snapshots: '@esbuild/darwin-arm64@0.19.11': optional: true - '@esbuild/darwin-arm64@0.21.5': + '@esbuild/darwin-arm64@0.23.1': optional: true '@esbuild/darwin-x64@0.17.19': @@ -2137,7 +2344,7 @@ snapshots: '@esbuild/darwin-x64@0.19.11': optional: true - '@esbuild/darwin-x64@0.21.5': + '@esbuild/darwin-x64@0.23.1': optional: true '@esbuild/freebsd-arm64@0.17.19': @@ -2146,7 +2353,7 @@ snapshots: '@esbuild/freebsd-arm64@0.19.11': optional: true - '@esbuild/freebsd-arm64@0.21.5': + '@esbuild/freebsd-arm64@0.23.1': optional: true '@esbuild/freebsd-x64@0.17.19': @@ -2155,7 +2362,7 @@ snapshots: '@esbuild/freebsd-x64@0.19.11': optional: true - '@esbuild/freebsd-x64@0.21.5': + '@esbuild/freebsd-x64@0.23.1': optional: true '@esbuild/linux-arm64@0.17.19': @@ -2164,7 +2371,7 @@ snapshots: '@esbuild/linux-arm64@0.19.11': optional: true - '@esbuild/linux-arm64@0.21.5': + '@esbuild/linux-arm64@0.23.1': optional: true '@esbuild/linux-arm@0.17.19': @@ -2173,7 +2380,7 @@ snapshots: '@esbuild/linux-arm@0.19.11': optional: true - '@esbuild/linux-arm@0.21.5': + '@esbuild/linux-arm@0.23.1': optional: true '@esbuild/linux-ia32@0.17.19': @@ -2182,7 +2389,7 @@ snapshots: '@esbuild/linux-ia32@0.19.11': optional: true - '@esbuild/linux-ia32@0.21.5': + '@esbuild/linux-ia32@0.23.1': optional: true '@esbuild/linux-loong64@0.17.19': @@ -2191,7 +2398,7 @@ snapshots: '@esbuild/linux-loong64@0.19.11': optional: true - '@esbuild/linux-loong64@0.21.5': + '@esbuild/linux-loong64@0.23.1': optional: true '@esbuild/linux-mips64el@0.17.19': @@ -2200,7 +2407,7 @@ snapshots: '@esbuild/linux-mips64el@0.19.11': optional: true - '@esbuild/linux-mips64el@0.21.5': + '@esbuild/linux-mips64el@0.23.1': optional: true '@esbuild/linux-ppc64@0.17.19': @@ -2209,7 +2416,7 @@ snapshots: '@esbuild/linux-ppc64@0.19.11': optional: true - '@esbuild/linux-ppc64@0.21.5': + '@esbuild/linux-ppc64@0.23.1': optional: true '@esbuild/linux-riscv64@0.17.19': @@ -2218,7 +2425,7 @@ snapshots: '@esbuild/linux-riscv64@0.19.11': optional: true - '@esbuild/linux-riscv64@0.21.5': + '@esbuild/linux-riscv64@0.23.1': optional: true '@esbuild/linux-s390x@0.17.19': @@ -2227,7 +2434,7 @@ snapshots: '@esbuild/linux-s390x@0.19.11': optional: true - '@esbuild/linux-s390x@0.21.5': + '@esbuild/linux-s390x@0.23.1': optional: true '@esbuild/linux-x64@0.17.19': @@ -2236,7 +2443,7 @@ snapshots: '@esbuild/linux-x64@0.19.11': optional: true - '@esbuild/linux-x64@0.21.5': + '@esbuild/linux-x64@0.23.1': optional: true '@esbuild/netbsd-x64@0.17.19': @@ -2245,7 +2452,10 @@ snapshots: '@esbuild/netbsd-x64@0.19.11': optional: true - '@esbuild/netbsd-x64@0.21.5': + '@esbuild/netbsd-x64@0.23.1': + optional: true + + '@esbuild/openbsd-arm64@0.23.1': optional: true '@esbuild/openbsd-x64@0.17.19': @@ -2254,7 +2464,7 @@ snapshots: '@esbuild/openbsd-x64@0.19.11': optional: true - '@esbuild/openbsd-x64@0.21.5': + '@esbuild/openbsd-x64@0.23.1': optional: true '@esbuild/sunos-x64@0.17.19': @@ -2263,7 +2473,7 @@ snapshots: '@esbuild/sunos-x64@0.19.11': optional: true - '@esbuild/sunos-x64@0.21.5': + '@esbuild/sunos-x64@0.23.1': optional: true '@esbuild/win32-arm64@0.17.19': @@ -2272,7 +2482,7 @@ snapshots: '@esbuild/win32-arm64@0.19.11': optional: true - '@esbuild/win32-arm64@0.21.5': + '@esbuild/win32-arm64@0.23.1': optional: true '@esbuild/win32-ia32@0.17.19': @@ -2281,7 +2491,7 @@ snapshots: '@esbuild/win32-ia32@0.19.11': optional: true - '@esbuild/win32-ia32@0.21.5': + '@esbuild/win32-ia32@0.23.1': optional: true '@esbuild/win32-x64@0.17.19': @@ -2290,7 +2500,7 @@ snapshots: '@esbuild/win32-x64@0.19.11': optional: true - '@esbuild/win32-x64@0.21.5': + '@esbuild/win32-x64@0.23.1': optional: true '@iconify/types@2.0.0': {} @@ -2315,10 +2525,6 @@ snapshots: wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 - '@jest/schemas@29.6.3': - dependencies: - '@sinclair/typebox': 0.27.8 - '@jridgewell/gen-mapping@0.3.3': dependencies: '@jridgewell/set-array': 1.1.2 @@ -2333,6 +2539,8 @@ snapshots: '@jridgewell/sourcemap-codec@1.4.15': {} + '@jridgewell/sourcemap-codec@1.5.0': {} + '@jridgewell/trace-mapping@0.3.18': dependencies: '@jridgewell/resolve-uri': 3.1.0 @@ -2345,11 +2553,11 @@ snapshots: string-argv: 0.3.2 type-detect: 4.0.8 - '@noble/curves@1.2.0': + '@noble/curves@1.6.0': dependencies: - '@noble/hashes': 1.3.2 + '@noble/hashes': 1.5.0 - '@noble/hashes@1.3.2': {} + '@noble/hashes@1.5.0': {} '@nodelib/fs.scandir@2.1.5': dependencies: @@ -2376,81 +2584,166 @@ snapshots: optionalDependencies: rollup: 3.23.0 + '@rollup/rollup-android-arm-eabi@4.24.0': + optional: true + '@rollup/rollup-android-arm-eabi@4.9.4': optional: true + '@rollup/rollup-android-arm64@4.24.0': + optional: true + '@rollup/rollup-android-arm64@4.9.4': optional: true + '@rollup/rollup-darwin-arm64@4.24.0': + optional: true + '@rollup/rollup-darwin-arm64@4.9.4': optional: true + '@rollup/rollup-darwin-x64@4.24.0': + optional: true + '@rollup/rollup-darwin-x64@4.9.4': optional: true + '@rollup/rollup-linux-arm-gnueabihf@4.24.0': + optional: true + '@rollup/rollup-linux-arm-gnueabihf@4.9.4': optional: true + '@rollup/rollup-linux-arm-musleabihf@4.24.0': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.24.0': + optional: true + '@rollup/rollup-linux-arm64-gnu@4.9.4': optional: true + '@rollup/rollup-linux-arm64-musl@4.24.0': + optional: true + '@rollup/rollup-linux-arm64-musl@4.9.4': optional: true + '@rollup/rollup-linux-powerpc64le-gnu@4.24.0': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.24.0': + optional: true + '@rollup/rollup-linux-riscv64-gnu@4.9.4': optional: true + '@rollup/rollup-linux-s390x-gnu@4.24.0': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.24.0': + optional: true + '@rollup/rollup-linux-x64-gnu@4.9.4': optional: true + '@rollup/rollup-linux-x64-musl@4.24.0': + optional: true + '@rollup/rollup-linux-x64-musl@4.9.4': optional: true + '@rollup/rollup-win32-arm64-msvc@4.24.0': + optional: true + '@rollup/rollup-win32-arm64-msvc@4.9.4': optional: true + '@rollup/rollup-win32-ia32-msvc@4.24.0': + optional: true + '@rollup/rollup-win32-ia32-msvc@4.9.4': optional: true + '@rollup/rollup-win32-x64-msvc@4.24.0': + optional: true + '@rollup/rollup-win32-x64-msvc@4.9.4': optional: true - '@scure/base@1.1.5': {} + '@scure/base@1.1.9': {} - '@scure/bip32@1.3.2': + '@scure/bip32@1.5.0': dependencies: - '@noble/curves': 1.2.0 - '@noble/hashes': 1.3.2 - '@scure/base': 1.1.5 + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 + '@scure/base': 1.1.9 - '@scure/bip39@1.2.1': + '@scure/bip39@1.4.0': dependencies: - '@noble/hashes': 1.3.2 - '@scure/base': 1.1.5 + '@noble/hashes': 1.5.0 + '@scure/base': 1.1.9 - '@shikijs/core@1.9.1': {} + '@shikijs/core@1.22.1': + dependencies: + '@shikijs/engine-javascript': 1.22.1 + '@shikijs/engine-oniguruma': 1.22.1 + '@shikijs/types': 1.22.1 + '@shikijs/vscode-textmate': 9.3.0 + '@types/hast': 3.0.4 + hast-util-to-html: 9.0.3 - '@sinclair/typebox@0.27.8': {} + '@shikijs/engine-javascript@1.22.1': + dependencies: + '@shikijs/types': 1.22.1 + '@shikijs/vscode-textmate': 9.3.0 + oniguruma-to-js: 0.4.3 - '@types/async-retry@1.4.8': + '@shikijs/engine-oniguruma@1.22.1': + dependencies: + '@shikijs/types': 1.22.1 + '@shikijs/vscode-textmate': 9.3.0 + + '@shikijs/types@1.22.1': + dependencies: + '@shikijs/vscode-textmate': 9.3.0 + '@types/hast': 3.0.4 + + '@shikijs/vscode-textmate@9.3.0': {} + + '@types/async-retry@1.4.9': dependencies: '@types/retry': 0.12.5 '@types/estree@1.0.5': {} - '@types/node@20.14.9': + '@types/estree@1.0.6': {} + + '@types/hast@3.0.4': + dependencies: + '@types/unist': 3.0.3 + + '@types/mdast@4.0.4': + dependencies: + '@types/unist': 3.0.3 + + '@types/node@20.17.0': dependencies: - undici-types: 5.26.5 + undici-types: 6.19.8 '@types/retry@0.12.5': {} + '@types/unist@3.0.3': {} + '@types/web-bluetooth@0.0.17': {} - '@unocss/astro@0.52.3(rollup@3.23.0)(vite@4.3.8(@types/node@20.14.9))': + '@ungap/structured-clone@1.2.0': {} + + '@unocss/astro@0.52.3(rollup@3.23.0)(vite@4.3.8(@types/node@20.17.0))': dependencies: '@unocss/core': 0.52.3 '@unocss/reset': 0.52.3 - '@unocss/vite': 0.52.3(rollup@3.23.0)(vite@4.3.8(@types/node@20.14.9)) + '@unocss/vite': 0.52.3(rollup@3.23.0)(vite@4.3.8(@types/node@20.17.0)) transitivePeerDependencies: - rollup - vite @@ -2565,7 +2858,7 @@ snapshots: dependencies: '@unocss/core': 0.52.3 - '@unocss/vite@0.52.3(rollup@3.23.0)(vite@4.3.8(@types/node@20.14.9))': + '@unocss/vite@0.52.3(rollup@3.23.0)(vite@4.3.8(@types/node@20.17.0))': dependencies: '@ampproject/remapping': 2.2.1 '@rollup/pluginutils': 5.0.2(rollup@3.23.0) @@ -2577,43 +2870,54 @@ snapshots: chokidar: 3.5.3 fast-glob: 3.3.2 magic-string: 0.30.5 - vite: 4.3.8(@types/node@20.14.9) + vite: 4.3.8(@types/node@20.17.0) transitivePeerDependencies: - rollup - '@vitejs/plugin-vue@4.2.3(vite@4.3.8(@types/node@20.14.9))(vue@3.3.4)': + '@vitejs/plugin-vue@4.2.3(vite@4.3.8(@types/node@20.17.0))(vue@3.3.4)': dependencies: - vite: 4.3.8(@types/node@20.14.9) + vite: 4.3.8(@types/node@20.17.0) vue: 3.3.4 - '@vitest/expect@1.6.0': + '@vitest/expect@2.1.3': dependencies: - '@vitest/spy': 1.6.0 - '@vitest/utils': 1.6.0 - chai: 4.4.0 + '@vitest/spy': 2.1.3 + '@vitest/utils': 2.1.3 + chai: 5.1.2 + tinyrainbow: 1.2.0 - '@vitest/runner@1.6.0': + '@vitest/mocker@2.1.3(@vitest/spy@2.1.3)(vite@5.0.11(@types/node@20.17.0))': dependencies: - '@vitest/utils': 1.6.0 - p-limit: 5.0.0 - pathe: 1.1.1 + '@vitest/spy': 2.1.3 + estree-walker: 3.0.3 + magic-string: 0.30.12 + optionalDependencies: + vite: 5.0.11(@types/node@20.17.0) - '@vitest/snapshot@1.6.0': + '@vitest/pretty-format@2.1.3': dependencies: - magic-string: 0.30.5 - pathe: 1.1.1 - pretty-format: 29.7.0 + tinyrainbow: 1.2.0 - '@vitest/spy@1.6.0': + '@vitest/runner@2.1.3': dependencies: - tinyspy: 2.2.0 + '@vitest/utils': 2.1.3 + pathe: 1.1.2 - '@vitest/utils@1.6.0': + '@vitest/snapshot@2.1.3': dependencies: - diff-sequences: 29.6.3 - estree-walker: 3.0.3 - loupe: 2.3.7 - pretty-format: 29.7.0 + '@vitest/pretty-format': 2.1.3 + magic-string: 0.30.12 + pathe: 1.1.2 + + '@vitest/spy@2.1.3': + dependencies: + tinyspy: 3.0.2 + + '@vitest/utils@2.1.3': + dependencies: + '@vitest/pretty-format': 2.1.3 + loupe: 3.1.2 + tinyrainbow: 1.2.0 '@volar/language-core@1.4.1': dependencies: @@ -2726,14 +3030,14 @@ snapshots: - '@vue/composition-api' - vue - abitype@1.0.4(typescript@5.5.2): + abitype@1.0.6(typescript@5.6.3): optionalDependencies: - typescript: 5.5.2 - - acorn-walk@8.3.2: {} + typescript: 5.6.3 acorn@8.11.3: {} + acorn@8.13.0: {} + ansi-regex@5.0.1: {} ansi-regex@6.0.1: {} @@ -2742,8 +3046,6 @@ snapshots: dependencies: color-convert: 2.0.1 - ansi-styles@5.2.0: {} - ansi-styles@6.2.1: {} any-promise@1.3.0: {} @@ -2755,9 +3057,7 @@ snapshots: argparse@2.0.1: {} - array-union@2.1.0: {} - - assertion-error@1.1.0: {} + assertion-error@2.0.1: {} async-cache-dedupe@2.2.0: dependencies: @@ -2780,25 +3080,26 @@ snapshots: dependencies: fill-range: 7.0.1 - bumpp@9.4.1: + bumpp@9.7.1: dependencies: '@jsdevtools/ez-spawn': 3.0.4 - c12: 1.11.1 + c12: 1.11.2 cac: 6.7.14 - escalade: 3.1.2 + escalade: 3.2.0 fast-glob: 3.3.2 js-yaml: 4.1.0 + jsonc-parser: 3.3.1 prompts: 2.4.2 - semver: 7.6.2 + semver: 7.6.3 transitivePeerDependencies: - magicast - bundle-require@4.0.2(esbuild@0.21.5): + bundle-require@5.0.0(esbuild@0.23.1): dependencies: - esbuild: 0.21.5 + esbuild: 0.23.1 load-tsconfig: 0.2.5 - c12@1.11.1: + c12@1.11.2: dependencies: chokidar: 3.6.0 confbox: 0.1.7 @@ -2810,28 +3111,30 @@ snapshots: ohash: 1.1.3 pathe: 1.1.2 perfect-debounce: 1.0.0 - pkg-types: 1.1.1 + pkg-types: 1.2.1 rc9: 2.1.2 cac@6.7.14: {} call-me-maybe@1.0.2: {} - chai@4.4.0: + ccount@2.0.1: {} + + chai@5.1.2: dependencies: - assertion-error: 1.1.0 - check-error: 1.0.3 - deep-eql: 4.1.3 - get-func-name: 2.0.2 - loupe: 2.3.7 - pathval: 1.1.1 - type-detect: 4.0.8 + assertion-error: 2.0.1 + check-error: 2.1.1 + deep-eql: 5.0.2 + loupe: 3.1.2 + pathval: 2.0.0 change-case@5.4.4: {} - check-error@1.0.3: - dependencies: - get-func-name: 2.0.2 + character-entities-html4@2.1.0: {} + + character-entities-legacy@3.0.0: {} + + check-error@2.1.1: {} chokidar@3.5.3: dependencies: @@ -2871,10 +3174,14 @@ snapshots: colorette@2.0.20: {} + comma-separated-tokens@2.0.3: {} + commander@4.1.1: {} confbox@0.1.7: {} + confbox@0.1.8: {} + consola@3.2.3: {} cross-spawn@7.0.3: @@ -2896,21 +3203,23 @@ snapshots: dependencies: ms: 2.1.2 - deep-eql@4.1.3: + debug@4.3.7: dependencies: - type-detect: 4.0.8 + ms: 2.1.3 + + deep-eql@5.0.2: {} defu@6.1.4: {} + dequal@2.0.3: {} + destr@1.2.2: {} destr@2.0.3: {} - diff-sequences@29.6.3: {} - - dir-glob@3.0.1: + devlop@1.1.0: dependencies: - path-type: 4.0.0 + dequal: 2.0.3 dotenv@16.4.5: {} @@ -2977,33 +3286,34 @@ snapshots: '@esbuild/win32-ia32': 0.19.11 '@esbuild/win32-x64': 0.19.11 - esbuild@0.21.5: + esbuild@0.23.1: optionalDependencies: - '@esbuild/aix-ppc64': 0.21.5 - '@esbuild/android-arm': 0.21.5 - '@esbuild/android-arm64': 0.21.5 - '@esbuild/android-x64': 0.21.5 - '@esbuild/darwin-arm64': 0.21.5 - '@esbuild/darwin-x64': 0.21.5 - '@esbuild/freebsd-arm64': 0.21.5 - '@esbuild/freebsd-x64': 0.21.5 - '@esbuild/linux-arm': 0.21.5 - '@esbuild/linux-arm64': 0.21.5 - '@esbuild/linux-ia32': 0.21.5 - '@esbuild/linux-loong64': 0.21.5 - '@esbuild/linux-mips64el': 0.21.5 - '@esbuild/linux-ppc64': 0.21.5 - '@esbuild/linux-riscv64': 0.21.5 - '@esbuild/linux-s390x': 0.21.5 - '@esbuild/linux-x64': 0.21.5 - '@esbuild/netbsd-x64': 0.21.5 - '@esbuild/openbsd-x64': 0.21.5 - '@esbuild/sunos-x64': 0.21.5 - '@esbuild/win32-arm64': 0.21.5 - '@esbuild/win32-ia32': 0.21.5 - '@esbuild/win32-x64': 0.21.5 - - escalade@3.1.2: {} + '@esbuild/aix-ppc64': 0.23.1 + '@esbuild/android-arm': 0.23.1 + '@esbuild/android-arm64': 0.23.1 + '@esbuild/android-x64': 0.23.1 + '@esbuild/darwin-arm64': 0.23.1 + '@esbuild/darwin-x64': 0.23.1 + '@esbuild/freebsd-arm64': 0.23.1 + '@esbuild/freebsd-x64': 0.23.1 + '@esbuild/linux-arm': 0.23.1 + '@esbuild/linux-arm64': 0.23.1 + '@esbuild/linux-ia32': 0.23.1 + '@esbuild/linux-loong64': 0.23.1 + '@esbuild/linux-mips64el': 0.23.1 + '@esbuild/linux-ppc64': 0.23.1 + '@esbuild/linux-riscv64': 0.23.1 + '@esbuild/linux-s390x': 0.23.1 + '@esbuild/linux-x64': 0.23.1 + '@esbuild/netbsd-x64': 0.23.1 + '@esbuild/openbsd-arm64': 0.23.1 + '@esbuild/openbsd-x64': 0.23.1 + '@esbuild/sunos-x64': 0.23.1 + '@esbuild/win32-arm64': 0.23.1 + '@esbuild/win32-ia32': 0.23.1 + '@esbuild/win32-x64': 0.23.1 + + escalade@3.2.0: {} estree-walker@2.0.2: {} @@ -3049,6 +3359,10 @@ snapshots: dependencies: reusify: 1.0.4 + fdir@6.4.2(picomatch@4.0.2): + optionalDependencies: + picomatch: 4.0.2 + fill-range@7.0.1: dependencies: to-regex-range: 5.0.1 @@ -3070,8 +3384,6 @@ snapshots: fsevents@2.3.3: optional: true - get-func-name@2.0.2: {} - get-stream@6.0.1: {} get-stream@8.0.1: {} @@ -3095,31 +3407,40 @@ snapshots: dependencies: foreground-child: 3.1.1 jackspeak: 2.3.6 - minimatch: 9.0.3 + minimatch: 9.0.5 minipass: 7.0.4 path-scurry: 1.10.1 - globby@11.1.0: - dependencies: - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.3.2 - ignore: 5.3.0 - merge2: 1.4.1 - slash: 3.0.0 - gzip-size@6.0.0: dependencies: duplexer: 0.1.2 + hast-util-to-html@9.0.3: + dependencies: + '@types/hast': 3.0.4 + '@types/unist': 3.0.3 + ccount: 2.0.1 + comma-separated-tokens: 2.0.3 + hast-util-whitespace: 3.0.0 + html-void-elements: 3.0.0 + mdast-util-to-hast: 13.2.0 + property-information: 6.5.0 + space-separated-tokens: 2.0.2 + stringify-entities: 4.0.4 + zwitch: 2.0.4 + + hast-util-whitespace@3.0.0: + dependencies: + '@types/hast': 3.0.4 + he@1.2.0: {} + html-void-elements@3.0.0: {} + human-signals@2.1.0: {} human-signals@5.0.0: {} - ignore@5.3.0: {} - is-binary-path@2.1.0: dependencies: binary-extensions: 2.2.0 @@ -3140,9 +3461,9 @@ snapshots: isexe@2.0.0: {} - isows@1.0.4(ws@8.17.1): + isows@1.0.6(ws@8.18.0): dependencies: - ws: 8.17.1 + ws: 8.18.0 jackspeak@2.3.6: dependencies: @@ -3156,19 +3477,17 @@ snapshots: joycon@3.1.1: {} - js-tokens@8.0.3: {} - js-yaml@4.1.0: dependencies: argparse: 2.0.1 - jsonc-parser@3.2.0: {} + jsonc-parser@3.3.1: {} kleur@3.0.3: {} kolorist@1.8.0: {} - lilconfig@3.0.0: {} + lilconfig@3.1.2: {} lines-and-columns@1.2.4: {} @@ -3180,20 +3499,13 @@ snapshots: local-pkg@0.4.3: {} - local-pkg@0.5.0: - dependencies: - mlly: 1.4.2 - pkg-types: 1.0.3 - locate-path@6.0.0: dependencies: p-locate: 5.0.0 lodash.sortby@4.7.0: {} - loupe@2.3.7: - dependencies: - get-func-name: 2.0.2 + loupe@3.1.2: {} lru-cache@10.1.0: {} @@ -3207,6 +3519,10 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 + magic-string@0.30.12: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.0 + magic-string@0.30.5: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 @@ -3220,6 +3536,18 @@ snapshots: punycode.js: 2.3.1 uc.micro: 2.1.0 + mdast-util-to-hast@13.2.0: + dependencies: + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + '@ungap/structured-clone': 1.2.0 + devlop: 1.1.0 + micromark-util-sanitize-uri: 2.0.0 + trim-lines: 3.0.1 + unist-util-position: 5.0.0 + unist-util-visit: 5.0.0 + vfile: 6.0.3 + mdn-data@2.0.30: {} mdurl@2.0.0: {} @@ -3228,6 +3556,23 @@ snapshots: merge2@1.4.1: {} + micromark-util-character@2.1.0: + dependencies: + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + + micromark-util-encode@2.0.0: {} + + micromark-util-sanitize-uri@2.0.0: + dependencies: + micromark-util-character: 2.1.0 + micromark-util-encode: 2.0.0 + micromark-util-symbol: 2.0.0 + + micromark-util-symbol@2.0.0: {} + + micromark-util-types@2.0.0: {} + micromatch@4.0.5: dependencies: braces: 3.0.2 @@ -3241,10 +3586,6 @@ snapshots: dependencies: brace-expansion: 2.0.1 - minimatch@9.0.3: - dependencies: - brace-expansion: 2.0.1 - minimatch@9.0.5: dependencies: brace-expansion: 2.0.1 @@ -3264,20 +3605,20 @@ snapshots: mkdirp@1.0.4: {} - mlly@1.4.2: - dependencies: - acorn: 8.11.3 - pathe: 1.1.1 - pkg-types: 1.0.3 - ufo: 1.3.2 - mlly@1.7.1: dependencies: acorn: 8.11.3 pathe: 1.1.2 - pkg-types: 1.1.1 + pkg-types: 1.2.1 ufo: 1.5.3 + mlly@1.7.2: + dependencies: + acorn: 8.13.0 + pathe: 1.1.2 + pkg-types: 1.2.1 + ufo: 1.5.4 + mnemonist@0.39.7: dependencies: obliterator: 2.0.4 @@ -3286,6 +3627,8 @@ snapshots: ms@2.1.2: {} + ms@2.1.3: {} + muggle-string@0.2.2: {} mz@2.7.0: @@ -3340,13 +3683,13 @@ snapshots: dependencies: mimic-fn: 4.0.0 - p-limit@3.1.0: + oniguruma-to-js@0.4.3: dependencies: - yocto-queue: 0.1.0 + regex: 4.3.3 - p-limit@5.0.0: + p-limit@3.1.0: dependencies: - yocto-queue: 1.0.0 + yocto-queue: 0.1.0 p-locate@5.0.0: dependencies: @@ -3363,40 +3706,37 @@ snapshots: lru-cache: 10.1.0 minipass: 7.0.4 - path-type@4.0.0: {} - pathe@1.1.1: {} pathe@1.1.2: {} - pathval@1.1.1: {} + pathval@2.0.0: {} perfect-debounce@1.0.0: {} picocolors@1.0.0: {} + picocolors@1.1.1: {} + picomatch@2.3.1: {} - pirates@4.0.6: {} + picomatch@4.0.2: {} - pkg-types@1.0.3: - dependencies: - jsonc-parser: 3.2.0 - mlly: 1.4.2 - pathe: 1.1.1 + pirates@4.0.6: {} - pkg-types@1.1.1: + pkg-types@1.2.1: dependencies: - confbox: 0.1.7 - mlly: 1.7.1 + confbox: 0.1.8 + mlly: 1.7.2 pathe: 1.1.2 - postcss-load-config@4.0.2(postcss@8.4.33): + postcss-load-config@6.0.1(jiti@1.21.6)(postcss@8.4.33)(yaml@2.6.0): dependencies: - lilconfig: 3.0.0 - yaml: 2.3.4 + lilconfig: 3.1.2 optionalDependencies: + jiti: 1.21.6 postcss: 8.4.33 + yaml: 2.6.0 postcss@8.4.23: dependencies: @@ -3410,17 +3750,13 @@ snapshots: picocolors: 1.0.0 source-map-js: 1.0.2 - pretty-format@29.7.0: - dependencies: - '@jest/schemas': 29.6.3 - ansi-styles: 5.2.0 - react-is: 18.2.0 - prompts@2.4.2: dependencies: kleur: 3.0.3 sisteransi: 1.0.5 + property-information@6.5.0: {} + punycode.js@2.3.1: {} punycode@2.3.1: {} @@ -3432,12 +3768,12 @@ snapshots: defu: 6.1.4 destr: 2.0.3 - react-is@18.2.0: {} - readdirp@3.6.0: dependencies: picomatch: 2.3.1 + regex@4.3.3: {} + resolve-from@5.0.0: {} retry@0.13.1: {} @@ -3448,6 +3784,28 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + rollup@4.24.0: + dependencies: + '@types/estree': 1.0.6 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.24.0 + '@rollup/rollup-android-arm64': 4.24.0 + '@rollup/rollup-darwin-arm64': 4.24.0 + '@rollup/rollup-darwin-x64': 4.24.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.24.0 + '@rollup/rollup-linux-arm-musleabihf': 4.24.0 + '@rollup/rollup-linux-arm64-gnu': 4.24.0 + '@rollup/rollup-linux-arm64-musl': 4.24.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.24.0 + '@rollup/rollup-linux-riscv64-gnu': 4.24.0 + '@rollup/rollup-linux-s390x-gnu': 4.24.0 + '@rollup/rollup-linux-x64-gnu': 4.24.0 + '@rollup/rollup-linux-x64-musl': 4.24.0 + '@rollup/rollup-win32-arm64-msvc': 4.24.0 + '@rollup/rollup-win32-ia32-msvc': 4.24.0 + '@rollup/rollup-win32-x64-msvc': 4.24.0 + fsevents: 2.3.3 + rollup@4.9.4: dependencies: '@types/estree': 1.0.5 @@ -3477,7 +3835,7 @@ snapshots: dependencies: lru-cache: 6.0.0 - semver@7.6.2: {} + semver@7.6.3: {} shebang-command@2.0.0: dependencies: @@ -3485,9 +3843,14 @@ snapshots: shebang-regex@3.0.0: {} - shiki@1.9.1: + shiki@1.22.1: dependencies: - '@shikijs/core': 1.9.1 + '@shikijs/core': 1.22.1 + '@shikijs/engine-javascript': 1.22.1 + '@shikijs/engine-oniguruma': 1.22.1 + '@shikijs/types': 1.22.1 + '@shikijs/vscode-textmate': 9.3.0 + '@types/hast': 3.0.4 siginfo@2.0.0: {} @@ -3505,14 +3868,14 @@ snapshots: sisteransi@1.0.5: {} - slash@3.0.0: {} - source-map-js@1.0.2: {} source-map@0.8.0-beta.0: dependencies: whatwg-url: 7.1.0 + space-separated-tokens@2.0.2: {} + stackback@0.0.2: {} std-env@3.7.0: {} @@ -3531,6 +3894,11 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 + stringify-entities@4.0.4: + dependencies: + character-entities-html4: 2.1.0 + character-entities-legacy: 3.0.0 + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 @@ -3543,10 +3911,6 @@ snapshots: strip-final-newline@3.0.0: {} - strip-literal@2.0.0: - dependencies: - js-tokens: 8.0.3 - sucrase@3.35.0: dependencies: '@jridgewell/gen-mapping': 0.3.3 @@ -3574,11 +3938,20 @@ snapshots: dependencies: any-promise: 1.3.0 - tinybench@2.5.1: {} + tinybench@2.9.0: {} + + tinyexec@0.3.1: {} - tinypool@0.8.4: {} + tinyglobby@0.2.9: + dependencies: + fdir: 6.4.2(picomatch@4.0.2) + picomatch: 4.0.2 - tinyspy@2.2.0: {} + tinypool@1.0.1: {} + + tinyrainbow@1.2.0: {} + + tinyspy@3.0.2: {} to-fast-properties@2.0.0: {} @@ -3594,45 +3967,51 @@ snapshots: tree-kill@1.2.2: {} + trim-lines@3.0.1: {} + ts-interface-checker@0.1.13: {} - tsup@8.1.0(postcss@8.4.33)(typescript@5.5.2): + tsup@8.3.0(jiti@1.21.6)(postcss@8.4.33)(typescript@5.6.3)(yaml@2.6.0): dependencies: - bundle-require: 4.0.2(esbuild@0.21.5) + bundle-require: 5.0.0(esbuild@0.23.1) cac: 6.7.14 - chokidar: 3.5.3 - debug: 4.3.4 - esbuild: 0.21.5 + chokidar: 3.6.0 + consola: 3.2.3 + debug: 4.3.7 + esbuild: 0.23.1 execa: 5.1.1 - globby: 11.1.0 joycon: 3.1.1 - postcss-load-config: 4.0.2(postcss@8.4.33) + picocolors: 1.1.1 + postcss-load-config: 6.0.1(jiti@1.21.6)(postcss@8.4.33)(yaml@2.6.0) resolve-from: 5.0.0 - rollup: 4.9.4 + rollup: 4.24.0 source-map: 0.8.0-beta.0 sucrase: 3.35.0 + tinyglobby: 0.2.9 tree-kill: 1.2.2 optionalDependencies: postcss: 8.4.33 - typescript: 5.5.2 + typescript: 5.6.3 transitivePeerDependencies: + - jiti - supports-color - - ts-node + - tsx + - yaml type-detect@4.0.8: {} - typedoc@0.26.2(typescript@5.5.2): + typedoc@0.26.10(typescript@5.6.3): dependencies: lunr: 2.3.9 markdown-it: 14.1.0 minimatch: 9.0.5 - shiki: 1.9.1 - typescript: 5.5.2 - yaml: 2.4.5 + shiki: 1.22.1 + typescript: 5.6.3 + yaml: 2.6.0 typescript@5.0.4: {} - typescript@5.5.2: {} + typescript@5.6.3: {} uc.micro@2.1.0: {} @@ -3640,17 +4019,42 @@ snapshots: ufo@1.5.3: {} + ufo@1.5.4: {} + unconfig@0.3.9: dependencies: '@antfu/utils': 0.7.2 defu: 6.1.4 jiti: 1.21.0 - undici-types@5.26.5: {} + undici-types@6.19.8: {} + + unist-util-is@6.0.0: + dependencies: + '@types/unist': 3.0.3 + + unist-util-position@5.0.0: + dependencies: + '@types/unist': 3.0.3 + + unist-util-stringify-position@4.0.0: + dependencies: + '@types/unist': 3.0.3 + + unist-util-visit-parents@6.0.1: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.0 + + unist-util-visit@5.0.0: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.0 + unist-util-visit-parents: 6.0.1 - unocss@0.52.3(postcss@8.4.33)(rollup@3.23.0)(vite@4.3.8(@types/node@20.14.9)): + unocss@0.52.3(postcss@8.4.33)(rollup@3.23.0)(vite@4.3.8(@types/node@20.17.0)): dependencies: - '@unocss/astro': 0.52.3(rollup@3.23.0)(vite@4.3.8(@types/node@20.14.9)) + '@unocss/astro': 0.52.3(rollup@3.23.0)(vite@4.3.8(@types/node@20.17.0)) '@unocss/cli': 0.52.3(rollup@3.23.0) '@unocss/core': 0.52.3 '@unocss/extractor-arbitrary-variants': 0.52.3 @@ -3669,37 +4073,47 @@ snapshots: '@unocss/transformer-compile-class': 0.52.3 '@unocss/transformer-directives': 0.52.3 '@unocss/transformer-variant-group': 0.52.3 - '@unocss/vite': 0.52.3(rollup@3.23.0)(vite@4.3.8(@types/node@20.14.9)) + '@unocss/vite': 0.52.3(rollup@3.23.0)(vite@4.3.8(@types/node@20.17.0)) transitivePeerDependencies: - postcss - rollup - supports-color - vite - viem@2.16.3(typescript@5.5.2): + vfile-message@4.0.2: dependencies: - '@adraffy/ens-normalize': 1.10.0 - '@noble/curves': 1.2.0 - '@noble/hashes': 1.3.2 - '@scure/bip32': 1.3.2 - '@scure/bip39': 1.2.1 - abitype: 1.0.4(typescript@5.5.2) - isows: 1.0.4(ws@8.17.1) - ws: 8.17.1 + '@types/unist': 3.0.3 + unist-util-stringify-position: 4.0.0 + + vfile@6.0.3: + dependencies: + '@types/unist': 3.0.3 + vfile-message: 4.0.2 + + viem@2.21.34(typescript@5.6.3): + dependencies: + '@adraffy/ens-normalize': 1.11.0 + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 + '@scure/bip32': 1.5.0 + '@scure/bip39': 1.4.0 + abitype: 1.0.6(typescript@5.6.3) + isows: 1.0.6(ws@8.18.0) + webauthn-p256: 0.0.10 + ws: 8.18.0 optionalDependencies: - typescript: 5.5.2 + typescript: 5.6.3 transitivePeerDependencies: - bufferutil - utf-8-validate - zod - vite-node@1.6.0(@types/node@20.14.9): + vite-node@2.1.3(@types/node@20.17.0): dependencies: cac: 6.7.14 - debug: 4.3.4 - pathe: 1.1.1 - picocolors: 1.0.0 - vite: 5.0.11(@types/node@20.14.9) + debug: 4.3.7 + pathe: 1.1.2 + vite: 5.0.11(@types/node@20.17.0) transitivePeerDependencies: - '@types/node' - less @@ -3710,51 +4124,51 @@ snapshots: - supports-color - terser - vite@4.3.8(@types/node@20.14.9): + vite@4.3.8(@types/node@20.17.0): dependencies: esbuild: 0.17.19 postcss: 8.4.23 rollup: 3.23.0 optionalDependencies: - '@types/node': 20.14.9 + '@types/node': 20.17.0 fsevents: 2.3.3 - vite@5.0.11(@types/node@20.14.9): + vite@5.0.11(@types/node@20.17.0): dependencies: esbuild: 0.19.11 postcss: 8.4.33 rollup: 4.9.4 optionalDependencies: - '@types/node': 20.14.9 + '@types/node': 20.17.0 fsevents: 2.3.3 - vitest@1.6.0(@types/node@20.14.9): - dependencies: - '@vitest/expect': 1.6.0 - '@vitest/runner': 1.6.0 - '@vitest/snapshot': 1.6.0 - '@vitest/spy': 1.6.0 - '@vitest/utils': 1.6.0 - acorn-walk: 8.3.2 - chai: 4.4.0 - debug: 4.3.4 - execa: 8.0.1 - local-pkg: 0.5.0 - magic-string: 0.30.5 - pathe: 1.1.1 - picocolors: 1.0.0 + vitest@2.1.3(@types/node@20.17.0): + dependencies: + '@vitest/expect': 2.1.3 + '@vitest/mocker': 2.1.3(@vitest/spy@2.1.3)(vite@5.0.11(@types/node@20.17.0)) + '@vitest/pretty-format': 2.1.3 + '@vitest/runner': 2.1.3 + '@vitest/snapshot': 2.1.3 + '@vitest/spy': 2.1.3 + '@vitest/utils': 2.1.3 + chai: 5.1.2 + debug: 4.3.7 + magic-string: 0.30.12 + pathe: 1.1.2 std-env: 3.7.0 - strip-literal: 2.0.0 - tinybench: 2.5.1 - tinypool: 0.8.4 - vite: 5.0.11(@types/node@20.14.9) - vite-node: 1.6.0(@types/node@20.14.9) - why-is-node-running: 2.2.2 + tinybench: 2.9.0 + tinyexec: 0.3.1 + tinypool: 1.0.1 + tinyrainbow: 1.2.0 + vite: 5.0.11(@types/node@20.17.0) + vite-node: 2.1.3(@types/node@20.17.0) + why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 20.14.9 + '@types/node': 20.17.0 transitivePeerDependencies: - less - lightningcss + - msw - sass - stylus - sugarss @@ -3785,6 +4199,11 @@ snapshots: '@vue/server-renderer': 3.3.4(vue@3.3.4) '@vue/shared': 3.3.4 + webauthn-p256@0.0.10: + dependencies: + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 + webidl-conversions@4.0.2: {} whatwg-url@7.1.0: @@ -3797,7 +4216,7 @@ snapshots: dependencies: isexe: 2.0.0 - why-is-node-running@2.2.2: + why-is-node-running@2.3.0: dependencies: siginfo: 2.0.0 stackback: 0.0.2 @@ -3814,14 +4233,12 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 - ws@8.17.1: {} + ws@8.18.0: {} yallist@4.0.0: {} - yaml@2.3.4: {} - - yaml@2.4.5: {} + yaml@2.6.0: {} yocto-queue@0.1.0: {} - yocto-queue@1.0.0: {} + zwitch@2.0.4: {} diff --git a/scripts/update-abi.mjs b/scripts/update-abi.mjs index d6204d762..c6e7b1ae3 100755 --- a/scripts/update-abi.mjs +++ b/scripts/update-abi.mjs @@ -2,30 +2,30 @@ // @ts-check -import { execSync } from 'node:child_process' -import { writeFile } from 'node:fs/promises' -import path, { dirname, resolve } from 'node:path' -import { fileURLToPath } from 'node:url' -import { camelCase, pascalCase } from 'change-case' +import { execSync } from "node:child_process"; +import { writeFile } from "node:fs/promises"; +import path, { dirname, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; +import { camelCase, pascalCase } from "change-case"; -const root = resolve(dirname(fileURLToPath(import.meta.url)), '..') -const abiDir = resolve(root, 'src/contract/abi') +const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const abiDir = resolve(root, "src/contract/abi"); main().catch((err) => { - console.error(err) - process.exit(1) -}) + console.error(err); + process.exit(1); +}); async function main() { - const abis = await getAllAbis() + const abis = await getAllAbis(); - const index = abis.map(([name]) => `export * from './${name}'\n`).join('') + const index = abis.map(([name]) => `export * from './${name}'\n`).join(""); await Promise.all([ - writeFile(path.resolve(abiDir, 'index.ts'), index, 'utf-8'), + writeFile(path.resolve(abiDir, "index.ts"), index, "utf-8"), ...abis.map(([name, abi]) => writeAbi(name, abi)), - ]) + ]); - console.log('done') + console.log("done"); } /** @@ -44,46 +44,46 @@ async function getAllAbis() { mira, { abi: linklist }, ] = await Promise.all([ - getAbi('Web3Entry'), - getAbi('Events'), - getAbi('Periphery'), - getAbi('CharacterBoundToken'), - getAbi('NewbieVilla'), - getAbi('Tips'), - getAbi('TipsWithFee'), - getAbi('TipsWithConfig'), + getAbi("Web3Entry"), + getAbi("Events"), + getAbi("Periphery"), + getAbi("CharacterBoundToken"), + getAbi("NewbieVilla"), + getAbi("Tips"), + getAbi("TipsWithFee"), + getAbi("TipsWithConfig"), getAbi( - 'https://raw.githubusercontent.com/Crossbell-Box/crossbell-bridge-contracts/main/build-info/MiraToken.abi', + "https://raw.githubusercontent.com/Crossbell-Box/crossbell-bridge-contracts/main/build-info/MiraToken.abi", ), - getAbi('Linklist'), - ]) + getAbi("Linklist"), + ]); - const abi = [...abi1, ...abi2] + const abi = [...abi1, ...abi2]; return [ - ['entry', simplifyAbi(abi)], - ['periphery', simplifyAbi(periphery)], - ['cbt', simplifyAbi(cbt)], - ['newbie-villa', simplifyAbi(newbieVilla)], - ['tips', simplifyAbi(tips)], - ['tips-with-fee', simplifyAbi(tipsWithFee)], - ['tips-with-config', simplifyAbi(tipsWithConfig)], - ['mira', simplifyAbi(mira)], - ['linklist', simplifyAbi(linklist)], - ] + ["entry", simplifyAbi(abi)], + ["periphery", simplifyAbi(periphery)], + ["cbt", simplifyAbi(cbt)], + ["newbie-villa", simplifyAbi(newbieVilla)], + ["tips", simplifyAbi(tips)], + ["tips-with-fee", simplifyAbi(tipsWithFee)], + ["tips-with-config", simplifyAbi(tipsWithConfig)], + ["mira", simplifyAbi(mira)], + ["linklist", simplifyAbi(linklist)], + ]; } /** @param name {string} */ function getAbi(name) { return fetch( - name.startsWith('https://') + name.startsWith("https://") ? name : `https://raw.githubusercontent.com/Crossbell-Box/Crossbell-Contracts/main/build-info/${name}.json`, ).then((res) => res .json() .catch(() => Promise.reject(new Error(`Failed to parse ${name} abi`))), - ) + ); } /** @@ -91,34 +91,34 @@ function getAbi(name) { * @param {import('abitype').Abi} abi */ async function writeAbi(name, abi) { - const camelName = camelCase(name) - const pascalName = pascalCase(name) + const camelName = camelCase(name); + const pascalName = pascalCase(name); const contents = `export const ${camelName} = ${JSON.stringify(abi)} as const; - export type ${pascalName} = typeof ${camelName};` - await writeFile(path.resolve(abiDir, `${name}.ts`), contents) - execSync(`biome format ${path.resolve(abiDir, `${name}.ts`)} --write`) - console.log(`updated ${name}`) + export type ${pascalName} = typeof ${camelName};`; + await writeFile(path.resolve(abiDir, `${name}.ts`), contents); + execSync(`biome format ${path.resolve(abiDir, `${name}.ts`)} --write`); + console.log(`updated ${name}`); } /** @param {import('abitype').Abi} abi */ function simplifyAbi(abi) { /** @param {import('abitype').AbiParameter} param */ function removeField(param) { - if ('internalType' in param) delete param.internalType - if ('components' in param) { - param.components = param.components.map((c) => removeField(c)) + if ("internalType" in param) delete param.internalType; + if ("components" in param) { + param.components = param.components.map((c) => removeField(c)); } - return param + return param; } return abi.map((abi) => { - if ('anonymous' in abi) delete abi.anonymous - if ('inputs' in abi && abi.inputs) { - abi.inputs = abi.inputs.map((i) => removeField(i)) + if ("anonymous" in abi) delete abi.anonymous; + if ("inputs" in abi && abi.inputs) { + abi.inputs = abi.inputs.map((i) => removeField(i)); } - if ('outputs' in abi && abi.outputs) { - abi.outputs = abi.outputs.map((i) => removeField(i)) + if ("outputs" in abi && abi.outputs) { + abi.outputs = abi.outputs.map((i) => removeField(i)); } - return abi - }) + return abi; + }); } diff --git a/src/contract/abi/cbt.ts b/src/contract/abi/cbt.ts index a982facfa..e924fcb4f 100644 --- a/src/contract/abi/cbt.ts +++ b/src/contract/abi/cbt.ts @@ -1,298 +1,298 @@ export const cbt = [ { - inputs: [{ name: 'web3Entry', type: 'address' }], - stateMutability: 'nonpayable', - type: 'constructor', + inputs: [{ name: "web3Entry", type: "address" }], + stateMutability: "nonpayable", + type: "constructor", }, { inputs: [ - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'operator', type: 'address' }, - { indexed: false, name: 'approved', type: 'bool' }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "operator", type: "address" }, + { indexed: false, name: "approved", type: "bool" }, ], - name: 'ApprovalForAll', - type: 'event', + name: "ApprovalForAll", + type: "event", }, { inputs: [ - { indexed: true, name: 'from', type: 'uint256' }, - { indexed: true, name: 'tokenId', type: 'uint256' }, - { indexed: true, name: 'amount', type: 'uint256' }, + { indexed: true, name: "from", type: "uint256" }, + { indexed: true, name: "tokenId", type: "uint256" }, + { indexed: true, name: "amount", type: "uint256" }, ], - name: 'Burn', - type: 'event', + name: "Burn", + type: "event", }, { inputs: [ - { indexed: true, name: 'to', type: 'uint256' }, - { indexed: true, name: 'tokenId', type: 'uint256' }, - { indexed: true, name: 'tokenNumber', type: 'uint256' }, + { indexed: true, name: "to", type: "uint256" }, + { indexed: true, name: "tokenId", type: "uint256" }, + { indexed: true, name: "tokenNumber", type: "uint256" }, ], - name: 'Mint', - type: 'event', + name: "Mint", + type: "event", }, { inputs: [ - { indexed: true, name: 'role', type: 'bytes32' }, - { indexed: true, name: 'previousAdminRole', type: 'bytes32' }, - { indexed: true, name: 'newAdminRole', type: 'bytes32' }, + { indexed: true, name: "role", type: "bytes32" }, + { indexed: true, name: "previousAdminRole", type: "bytes32" }, + { indexed: true, name: "newAdminRole", type: "bytes32" }, ], - name: 'RoleAdminChanged', - type: 'event', + name: "RoleAdminChanged", + type: "event", }, { inputs: [ - { indexed: true, name: 'role', type: 'bytes32' }, - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'sender', type: 'address' }, + { indexed: true, name: "role", type: "bytes32" }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "sender", type: "address" }, ], - name: 'RoleGranted', - type: 'event', + name: "RoleGranted", + type: "event", }, { inputs: [ - { indexed: true, name: 'role', type: 'bytes32' }, - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'sender', type: 'address' }, + { indexed: true, name: "role", type: "bytes32" }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "sender", type: "address" }, ], - name: 'RoleRevoked', - type: 'event', + name: "RoleRevoked", + type: "event", }, { inputs: [ - { indexed: true, name: 'operator', type: 'address' }, - { indexed: true, name: 'from', type: 'address' }, - { indexed: true, name: 'to', type: 'address' }, - { indexed: false, name: 'ids', type: 'uint256[]' }, - { indexed: false, name: 'values', type: 'uint256[]' }, + { indexed: true, name: "operator", type: "address" }, + { indexed: true, name: "from", type: "address" }, + { indexed: true, name: "to", type: "address" }, + { indexed: false, name: "ids", type: "uint256[]" }, + { indexed: false, name: "values", type: "uint256[]" }, ], - name: 'TransferBatch', - type: 'event', + name: "TransferBatch", + type: "event", }, { inputs: [ - { indexed: true, name: 'operator', type: 'address' }, - { indexed: true, name: 'from', type: 'address' }, - { indexed: true, name: 'to', type: 'address' }, - { indexed: false, name: 'id', type: 'uint256' }, - { indexed: false, name: 'value', type: 'uint256' }, + { indexed: true, name: "operator", type: "address" }, + { indexed: true, name: "from", type: "address" }, + { indexed: true, name: "to", type: "address" }, + { indexed: false, name: "id", type: "uint256" }, + { indexed: false, name: "value", type: "uint256" }, ], - name: 'TransferSingle', - type: 'event', + name: "TransferSingle", + type: "event", }, { inputs: [ - { indexed: false, name: 'value', type: 'string' }, - { indexed: true, name: 'id', type: 'uint256' }, + { indexed: false, name: "value", type: "string" }, + { indexed: true, name: "id", type: "uint256" }, ], - name: 'URI', - type: 'event', + name: "URI", + type: "event", }, { inputs: [], - name: 'DEFAULT_ADMIN_ROLE', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + name: "DEFAULT_ADMIN_ROLE", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'MINTER_ROLE', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + name: "MINTER_ROLE", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: '_web3Entry', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "_web3Entry", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'account', type: 'address' }, - { name: 'tokenId', type: 'uint256' }, + { name: "account", type: "address" }, + { name: "tokenId", type: "uint256" }, ], - name: 'balanceOf', - outputs: [{ name: 'balance', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "balanceOf", + outputs: [{ name: "balance", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'tokenId', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "tokenId", type: "uint256" }, ], - name: 'balanceOf', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "balanceOf", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'accounts', type: 'address[]' }, - { name: 'tokenIds', type: 'uint256[]' }, + { name: "accounts", type: "address[]" }, + { name: "tokenIds", type: "uint256[]" }, ], - name: 'balanceOfBatch', - outputs: [{ name: '', type: 'uint256[]' }], - stateMutability: 'view', - type: 'function', + name: "balanceOfBatch", + outputs: [{ name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'tokenId', type: 'uint256' }, - { name: 'amount', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "tokenId", type: "uint256" }, + { name: "amount", type: "uint256" }, ], - name: 'burn', + name: "burn", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'role', type: 'bytes32' }], - name: 'getRoleAdmin', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "role", type: "bytes32" }], + name: "getRoleAdmin", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'index', type: 'uint256' }, + { name: "role", type: "bytes32" }, + { name: "index", type: "uint256" }, ], - name: 'getRoleMember', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "getRoleMember", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'role', type: 'bytes32' }], - name: 'getRoleMemberCount', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "role", type: "bytes32" }], + name: "getRoleMemberCount", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'account', type: 'address' }, + { name: "role", type: "bytes32" }, + { name: "account", type: "address" }, ], - name: 'grantRole', + name: "grantRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'account', type: 'address' }, + { name: "role", type: "bytes32" }, + { name: "account", type: "address" }, ], - name: 'hasRole', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + name: "hasRole", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'account', type: 'address' }, - { name: 'operator', type: 'address' }, + { name: "account", type: "address" }, + { name: "operator", type: "address" }, ], - name: 'isApprovedForAll', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + name: "isApprovedForAll", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'tokenId', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "tokenId", type: "uint256" }, ], - name: 'mint', + name: "mint", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'account', type: 'address' }, + { name: "role", type: "bytes32" }, + { name: "account", type: "address" }, ], - name: 'renounceRole', + name: "renounceRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'account', type: 'address' }, + { name: "role", type: "bytes32" }, + { name: "account", type: "address" }, ], - name: 'revokeRole', + name: "revokeRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: '', type: 'address' }, - { name: '', type: 'address' }, - { name: '', type: 'uint256[]' }, - { name: '', type: 'uint256[]' }, - { name: '', type: 'bytes' }, + { name: "", type: "address" }, + { name: "", type: "address" }, + { name: "", type: "uint256[]" }, + { name: "", type: "uint256[]" }, + { name: "", type: "bytes" }, ], - name: 'safeBatchTransferFrom', + name: "safeBatchTransferFrom", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: '', type: 'address' }, - { name: '', type: 'address' }, - { name: '', type: 'uint256' }, - { name: '', type: 'uint256' }, - { name: '', type: 'bytes' }, + { name: "", type: "address" }, + { name: "", type: "address" }, + { name: "", type: "uint256" }, + { name: "", type: "uint256" }, + { name: "", type: "bytes" }, ], - name: 'safeTransferFrom', + name: "safeTransferFrom", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'operator', type: 'address' }, - { name: 'approved', type: 'bool' }, + { name: "operator", type: "address" }, + { name: "approved", type: "bool" }, ], - name: 'setApprovalForAll', + name: "setApprovalForAll", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'tokenURI', type: 'string' }, + { name: "tokenId", type: "uint256" }, + { name: "tokenURI", type: "string" }, ], - name: 'setTokenURI', + name: "setTokenURI", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'interfaceId', type: 'bytes4' }], - name: 'supportsInterface', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "interfaceId", type: "bytes4" }], + name: "supportsInterface", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'uri', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "uri", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, -] as const -export type Cbt = typeof cbt +] as const; +export type Cbt = typeof cbt; diff --git a/src/contract/abi/entry.ts b/src/contract/abi/entry.ts index ed40a3131..e5533a955 100644 --- a/src/contract/abi/entry.ts +++ b/src/contract/abi/entry.ts @@ -1,1414 +1,1414 @@ export const entry = [ { - inputs: [{ name: 'characterId', type: 'uint256' }], - name: 'ErrCharacterNotExists', - type: 'error', + inputs: [{ name: "characterId", type: "uint256" }], + name: "ErrCharacterNotExists", + type: "error", }, - { inputs: [], name: 'ErrHandleContainsInvalidCharacters', type: 'error' }, - { inputs: [], name: 'ErrHandleExists', type: 'error' }, - { inputs: [], name: 'ErrHandleLengthInvalid', type: 'error' }, - { inputs: [], name: 'ErrNotCharacterOwner', type: 'error' }, - { inputs: [], name: 'ErrNotEnoughPermission', type: 'error' }, - { inputs: [], name: 'ErrNotEnoughPermissionForThisNote', type: 'error' }, - { inputs: [], name: 'ErrNoteIsDeleted', type: 'error' }, - { inputs: [], name: 'ErrNoteLocked', type: 'error' }, - { inputs: [], name: 'ErrNoteNotExists', type: 'error' }, - { inputs: [], name: 'ErrSignatureExpired', type: 'error' }, - { inputs: [], name: 'ErrSignatureInvalid', type: 'error' }, - { inputs: [], name: 'ErrSocialTokenExists', type: 'error' }, - { inputs: [], name: 'ErrTokenNotExists', type: 'error' }, + { inputs: [], name: "ErrHandleContainsInvalidCharacters", type: "error" }, + { inputs: [], name: "ErrHandleExists", type: "error" }, + { inputs: [], name: "ErrHandleLengthInvalid", type: "error" }, + { inputs: [], name: "ErrNotCharacterOwner", type: "error" }, + { inputs: [], name: "ErrNotEnoughPermission", type: "error" }, + { inputs: [], name: "ErrNotEnoughPermissionForThisNote", type: "error" }, + { inputs: [], name: "ErrNoteIsDeleted", type: "error" }, + { inputs: [], name: "ErrNoteLocked", type: "error" }, + { inputs: [], name: "ErrNoteNotExists", type: "error" }, + { inputs: [], name: "ErrSignatureExpired", type: "error" }, + { inputs: [], name: "ErrSignatureInvalid", type: "error" }, + { inputs: [], name: "ErrSocialTokenExists", type: "error" }, + { inputs: [], name: "ErrTokenNotExists", type: "error" }, { inputs: [ - { indexed: true, name: 'owner', type: 'address' }, - { indexed: true, name: 'approved', type: 'address' }, - { indexed: true, name: 'tokenId', type: 'uint256' }, + { indexed: true, name: "owner", type: "address" }, + { indexed: true, name: "approved", type: "address" }, + { indexed: true, name: "tokenId", type: "uint256" }, ], - name: 'Approval', - type: 'event', + name: "Approval", + type: "event", }, { inputs: [ - { indexed: true, name: 'owner', type: 'address' }, - { indexed: true, name: 'operator', type: 'address' }, - { indexed: false, name: 'approved', type: 'bool' }, + { indexed: true, name: "owner", type: "address" }, + { indexed: true, name: "operator", type: "address" }, + { indexed: false, name: "approved", type: "bool" }, ], - name: 'ApprovalForAll', - type: 'event', + name: "ApprovalForAll", + type: "event", }, { - inputs: [{ indexed: false, name: 'version', type: 'uint8' }], - name: 'Initialized', - type: 'event', + inputs: [{ indexed: false, name: "version", type: "uint8" }], + name: "Initialized", + type: "event", }, { inputs: [ - { indexed: true, name: 'from', type: 'address' }, - { indexed: true, name: 'to', type: 'address' }, - { indexed: true, name: 'tokenId', type: 'uint256' }, + { indexed: true, name: "from", type: "address" }, + { indexed: true, name: "to", type: "address" }, + { indexed: true, name: "tokenId", type: "uint256" }, ], - name: 'Transfer', - type: 'event', + name: "Transfer", + type: "event", }, { inputs: [ - { name: 'to', type: 'address' }, - { name: 'tokenId', type: 'uint256' }, + { name: "to", type: "address" }, + { name: "tokenId", type: "uint256" }, ], - name: 'approve', + name: "approve", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'owner', type: 'address' }], - name: 'balanceOf', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "owner", type: "address" }], + name: "balanceOf", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'burn', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "burn", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'linklistId', type: 'uint256' }], - name: 'burnLinklist', + inputs: [{ name: "linklistId", type: "uint256" }], + name: "burnLinklist", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'to', type: 'address' }, - { name: 'handle', type: 'string' }, - { name: 'uri', type: 'string' }, - { name: 'linkModule', type: 'address' }, - { name: 'linkModuleInitData', type: 'bytes' }, + { name: "to", type: "address" }, + { name: "handle", type: "string" }, + { name: "uri", type: "string" }, + { name: "linkModule", type: "address" }, + { name: "linkModuleInitData", type: "bytes" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'createCharacter', - outputs: [{ name: 'characterId', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', + name: "createCharacter", + outputs: [{ name: "characterId", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'to', type: 'address' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "to", type: "address" }, + { name: "linkType", type: "bytes32" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'createThenLinkCharacter', - outputs: [{ name: 'characterId', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', + name: "createThenLinkCharacter", + outputs: [{ name: "characterId", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, ], - name: 'deleteNote', + name: "deleteNote", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getApproved', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getApproved", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'characterId', type: 'uint256' }], - name: 'getCharacter', + inputs: [{ name: "characterId", type: "uint256" }], + name: "getCharacter", outputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'handle', type: 'string' }, - { name: 'uri', type: 'string' }, - { name: 'noteCount', type: 'uint256' }, - { name: 'socialToken', type: 'address' }, - { name: 'linkModule', type: 'address' }, + { name: "characterId", type: "uint256" }, + { name: "handle", type: "string" }, + { name: "uri", type: "string" }, + { name: "noteCount", type: "uint256" }, + { name: "socialToken", type: "address" }, + { name: "linkModule", type: "address" }, ], - name: '', - type: 'tuple', + name: "", + type: "tuple", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'handle', type: 'string' }], - name: 'getCharacterByHandle', + inputs: [{ name: "handle", type: "string" }], + name: "getCharacterByHandle", outputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'handle', type: 'string' }, - { name: 'uri', type: 'string' }, - { name: 'noteCount', type: 'uint256' }, - { name: 'socialToken', type: 'address' }, - { name: 'linkModule', type: 'address' }, + { name: "characterId", type: "uint256" }, + { name: "handle", type: "string" }, + { name: "uri", type: "string" }, + { name: "noteCount", type: "uint256" }, + { name: "socialToken", type: "address" }, + { name: "linkModule", type: "address" }, ], - name: '', - type: 'tuple', + name: "", + type: "tuple", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'characterId', type: 'uint256' }], - name: 'getCharacterUri', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "characterId", type: "uint256" }], + name: "getCharacterUri", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'getDomainSeparator', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + name: "getDomainSeparator", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'characterId', type: 'uint256' }], - name: 'getHandle', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "characterId", type: "uint256" }], + name: "getHandle", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'getLinklistContract', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "getLinklistContract", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "characterId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'getLinklistId', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "getLinklistId", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'linkListId', type: 'uint256' }], - name: 'getLinklistType', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "linkListId", type: "uint256" }], + name: "getLinklistType", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinklistUri', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinklistUri", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, ], - name: 'getNote', + name: "getNote", outputs: [ { components: [ - { name: 'linkItemType', type: 'bytes32' }, - { name: 'linkKey', type: 'bytes32' }, - { name: 'contentUri', type: 'string' }, - { name: 'linkModule', type: 'address' }, - { name: 'mintModule', type: 'address' }, - { name: 'mintNFT', type: 'address' }, - { name: 'deleted', type: 'bool' }, - { name: 'locked', type: 'bool' }, + { name: "linkItemType", type: "bytes32" }, + { name: "linkKey", type: "bytes32" }, + { name: "contentUri", type: "string" }, + { name: "linkModule", type: "address" }, + { name: "mintModule", type: "address" }, + { name: "mintNFT", type: "address" }, + { name: "deleted", type: "bool" }, + { name: "locked", type: "bool" }, ], - name: '', - type: 'tuple', + name: "", + type: "tuple", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'operator', type: 'address' }, + { name: "characterId", type: "uint256" }, + { name: "operator", type: "address" }, ], - name: 'getOperatorPermissions', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "getOperatorPermissions", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'characterId', type: 'uint256' }], - name: 'getOperators', - outputs: [{ name: '', type: 'address[]' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "characterId", type: "uint256" }], + name: "getOperators", + outputs: [{ name: "", type: "address[]" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, ], - name: 'getOperators4Note', + name: "getOperators4Note", outputs: [ - { name: 'blocklist', type: 'address[]' }, - { name: 'allowlist', type: 'address[]' }, + { name: "blocklist", type: "address[]" }, + { name: "allowlist", type: "address[]" }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'account', type: 'address' }], - name: 'getPrimaryCharacterId', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "account", type: "address" }], + name: "getPrimaryCharacterId", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'getRevision', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'pure', - type: 'function', + name: "getRevision", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "pure", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'operator', type: 'address' }, - { name: 'permissionBitMap', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "operator", type: "address" }, + { name: "permissionBitMap", type: "uint256" }, ], - name: 'grantOperatorPermissions', + name: "grantOperatorPermissions", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'operator', type: 'address' }, - { name: 'permissionBitMap', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "operator", type: "address" }, + { name: "permissionBitMap", type: "uint256" }, { components: [ - { name: 'v', type: 'uint8' }, - { name: 'r', type: 'bytes32' }, - { name: 's', type: 'bytes32' }, - { name: 'deadline', type: 'uint256' }, + { name: "v", type: "uint8" }, + { name: "r", type: "bytes32" }, + { name: "s", type: "bytes32" }, + { name: "deadline", type: "uint256" }, ], - name: 'sig', - type: 'tuple', + name: "sig", + type: "tuple", }, ], - name: 'grantOperatorPermissionsWithSig', + name: "grantOperatorPermissionsWithSig", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, - { name: 'blocklist', type: 'address[]' }, - { name: 'allowlist', type: 'address[]' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, + { name: "blocklist", type: "address[]" }, + { name: "allowlist", type: "address[]" }, ], - name: 'grantOperators4Note', + name: "grantOperators4Note", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'name_', type: 'string' }, - { name: 'symbol_', type: 'string' }, - { name: 'linklist_', type: 'address' }, - { name: 'mintNFTImpl_', type: 'address' }, - { name: 'periphery_', type: 'address' }, - { name: 'newbieVilla_', type: 'address' }, + { name: "name_", type: "string" }, + { name: "symbol_", type: "string" }, + { name: "linklist_", type: "address" }, + { name: "mintNFTImpl_", type: "address" }, + { name: "periphery_", type: "address" }, + { name: "newbieVilla_", type: "address" }, ], - name: 'initialize', + name: "initialize", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'owner', type: 'address' }, - { name: 'operator', type: 'address' }, + { name: "owner", type: "address" }, + { name: "operator", type: "address" }, ], - name: 'isApprovedForAll', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + name: "isApprovedForAll", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, - { name: 'operator', type: 'address' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, + { name: "operator", type: "address" }, ], - name: 'isOperatorAllowedForNote', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + name: "isOperatorAllowedForNote", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'characterId', type: 'uint256' }], - name: 'isPrimaryCharacter', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "characterId", type: "uint256" }], + name: "isPrimaryCharacter", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'ethAddress', type: 'address' }, - { name: 'linkType', type: 'bytes32' }, - { name: 'data', type: 'bytes' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "ethAddress", type: "address" }, + { name: "linkType", type: "bytes32" }, + { name: "data", type: "bytes" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'linkAddress', + name: "linkAddress", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toUri', type: 'string' }, - { name: 'linkType', type: 'bytes32' }, - { name: 'data', type: 'bytes' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toUri", type: "string" }, + { name: "linkType", type: "bytes32" }, + { name: "data", type: "bytes" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'linkAnyUri', + name: "linkAnyUri", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, - { name: 'data', type: 'bytes' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, + { name: "data", type: "bytes" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'linkCharacter', + name: "linkCharacter", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'tokenAddress', type: 'address' }, - { name: 'tokenId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, - { name: 'data', type: 'bytes' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "tokenAddress", type: "address" }, + { name: "tokenId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, + { name: "data", type: "bytes" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'linkERC721', + name: "linkERC721", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toLinkListId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, - { name: 'data', type: 'bytes' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toLinkListId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, + { name: "data", type: "bytes" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'linkLinklist', + name: "linkLinklist", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, - { name: 'toNoteId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, - { name: 'data', type: 'bytes' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, + { name: "toNoteId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, + { name: "data", type: "bytes" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'linkNote', + name: "linkNote", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, ], - name: 'lockNote', + name: "lockNote", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, - { name: 'to', type: 'address' }, - { name: 'mintModuleData', type: 'bytes' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, + { name: "to", type: "address" }, + { name: "mintModuleData", type: "bytes" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'mintNote', - outputs: [{ name: 'tokenId', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', + name: "mintNote", + outputs: [{ name: "tokenId", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'data', type: 'bytes[]' }], - name: 'multicall', - outputs: [{ name: 'results', type: 'bytes[]' }], - stateMutability: 'nonpayable', - type: 'function', + inputs: [{ name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ name: "results", type: "bytes[]" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [], - name: 'name', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + name: "name", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'owner', type: 'address' }], - name: 'nonces', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "owner", type: "address" }], + name: "nonces", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'ownerOf', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "ownerOf", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'contentUri', type: 'string' }, - { name: 'linkModule', type: 'address' }, - { name: 'linkModuleInitData', type: 'bytes' }, - { name: 'mintModule', type: 'address' }, - { name: 'mintModuleInitData', type: 'bytes' }, - { name: 'locked', type: 'bool' }, + { name: "characterId", type: "uint256" }, + { name: "contentUri", type: "string" }, + { name: "linkModule", type: "address" }, + { name: "linkModuleInitData", type: "bytes" }, + { name: "mintModule", type: "address" }, + { name: "mintModuleInitData", type: "bytes" }, + { name: "locked", type: "bool" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'postNote', - outputs: [{ name: 'noteId', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', + name: "postNote", + outputs: [{ name: "noteId", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'contentUri', type: 'string' }, - { name: 'linkModule', type: 'address' }, - { name: 'linkModuleInitData', type: 'bytes' }, - { name: 'mintModule', type: 'address' }, - { name: 'mintModuleInitData', type: 'bytes' }, - { name: 'locked', type: 'bool' }, + { name: "characterId", type: "uint256" }, + { name: "contentUri", type: "string" }, + { name: "linkModule", type: "address" }, + { name: "linkModuleInitData", type: "bytes" }, + { name: "mintModule", type: "address" }, + { name: "mintModuleInitData", type: "bytes" }, + { name: "locked", type: "bool" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, - { name: 'ethAddress', type: 'address' }, + { name: "ethAddress", type: "address" }, ], - name: 'postNote4Address', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', + name: "postNote4Address", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'contentUri', type: 'string' }, - { name: 'linkModule', type: 'address' }, - { name: 'linkModuleInitData', type: 'bytes' }, - { name: 'mintModule', type: 'address' }, - { name: 'mintModuleInitData', type: 'bytes' }, - { name: 'locked', type: 'bool' }, + { name: "characterId", type: "uint256" }, + { name: "contentUri", type: "string" }, + { name: "linkModule", type: "address" }, + { name: "linkModuleInitData", type: "bytes" }, + { name: "mintModule", type: "address" }, + { name: "mintModuleInitData", type: "bytes" }, + { name: "locked", type: "bool" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, - { name: 'uri', type: 'string' }, + { name: "uri", type: "string" }, ], - name: 'postNote4AnyUri', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', + name: "postNote4AnyUri", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'contentUri', type: 'string' }, - { name: 'linkModule', type: 'address' }, - { name: 'linkModuleInitData', type: 'bytes' }, - { name: 'mintModule', type: 'address' }, - { name: 'mintModuleInitData', type: 'bytes' }, - { name: 'locked', type: 'bool' }, + { name: "characterId", type: "uint256" }, + { name: "contentUri", type: "string" }, + { name: "linkModule", type: "address" }, + { name: "linkModuleInitData", type: "bytes" }, + { name: "mintModule", type: "address" }, + { name: "mintModuleInitData", type: "bytes" }, + { name: "locked", type: "bool" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, - { name: 'toCharacterId', type: 'uint256' }, + { name: "toCharacterId", type: "uint256" }, ], - name: 'postNote4Character', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', + name: "postNote4Character", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'contentUri', type: 'string' }, - { name: 'linkModule', type: 'address' }, - { name: 'linkModuleInitData', type: 'bytes' }, - { name: 'mintModule', type: 'address' }, - { name: 'mintModuleInitData', type: 'bytes' }, - { name: 'locked', type: 'bool' }, + { name: "characterId", type: "uint256" }, + { name: "contentUri", type: "string" }, + { name: "linkModule", type: "address" }, + { name: "linkModuleInitData", type: "bytes" }, + { name: "mintModule", type: "address" }, + { name: "mintModuleInitData", type: "bytes" }, + { name: "locked", type: "bool" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, { components: [ - { name: 'tokenAddress', type: 'address' }, - { name: 'erc721TokenId', type: 'uint256' }, + { name: "tokenAddress", type: "address" }, + { name: "erc721TokenId", type: "uint256" }, ], - name: 'erc721', - type: 'tuple', + name: "erc721", + type: "tuple", }, ], - name: 'postNote4ERC721', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', + name: "postNote4ERC721", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'contentUri', type: 'string' }, - { name: 'linkModule', type: 'address' }, - { name: 'linkModuleInitData', type: 'bytes' }, - { name: 'mintModule', type: 'address' }, - { name: 'mintModuleInitData', type: 'bytes' }, - { name: 'locked', type: 'bool' }, + { name: "characterId", type: "uint256" }, + { name: "contentUri", type: "string" }, + { name: "linkModule", type: "address" }, + { name: "linkModuleInitData", type: "bytes" }, + { name: "mintModule", type: "address" }, + { name: "mintModuleInitData", type: "bytes" }, + { name: "locked", type: "bool" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, - { name: 'toLinklistId', type: 'uint256' }, + { name: "toLinklistId", type: "uint256" }, ], - name: 'postNote4Linklist', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', + name: "postNote4Linklist", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'contentUri', type: 'string' }, - { name: 'linkModule', type: 'address' }, - { name: 'linkModuleInitData', type: 'bytes' }, - { name: 'mintModule', type: 'address' }, - { name: 'mintModuleInitData', type: 'bytes' }, - { name: 'locked', type: 'bool' }, + { name: "characterId", type: "uint256" }, + { name: "contentUri", type: "string" }, + { name: "linkModule", type: "address" }, + { name: "linkModuleInitData", type: "bytes" }, + { name: "mintModule", type: "address" }, + { name: "mintModuleInitData", type: "bytes" }, + { name: "locked", type: "bool" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, ], - name: 'note', - type: 'tuple', + name: "note", + type: "tuple", }, ], - name: 'postNote4Note', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', + name: "postNote4Note", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [], - name: 'resolver', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "resolver", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'from', type: 'address' }, - { name: 'to', type: 'address' }, - { name: 'tokenId', type: 'uint256' }, + { name: "from", type: "address" }, + { name: "to", type: "address" }, + { name: "tokenId", type: "uint256" }, ], - name: 'safeTransferFrom', + name: "safeTransferFrom", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'from', type: 'address' }, - { name: 'to', type: 'address' }, - { name: 'tokenId', type: 'uint256' }, - { name: '_data', type: 'bytes' }, + { name: "from", type: "address" }, + { name: "to", type: "address" }, + { name: "tokenId", type: "uint256" }, + { name: "_data", type: "bytes" }, ], - name: 'safeTransferFrom', + name: "safeTransferFrom", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'operator', type: 'address' }, - { name: 'approved', type: 'bool' }, + { name: "operator", type: "address" }, + { name: "approved", type: "bool" }, ], - name: 'setApprovalForAll', + name: "setApprovalForAll", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'newUri', type: 'string' }, + { name: "characterId", type: "uint256" }, + { name: "newUri", type: "string" }, ], - name: 'setCharacterUri', + name: "setCharacterUri", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'newHandle', type: 'string' }, + { name: "characterId", type: "uint256" }, + { name: "newHandle", type: "string" }, ], - name: 'setHandle', + name: "setHandle", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'linkModule', type: 'address' }, - { name: 'linkModuleInitData', type: 'bytes' }, + { name: "characterId", type: "uint256" }, + { name: "linkModule", type: "address" }, + { name: "linkModuleInitData", type: "bytes" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'setLinkModule4Character', + name: "setLinkModule4Character", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, - { name: 'linkModule', type: 'address' }, - { name: 'linkModuleInitData', type: 'bytes' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, + { name: "linkModule", type: "address" }, + { name: "linkModuleInitData", type: "bytes" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'setLinkModule4Note', + name: "setLinkModule4Note", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'linklistId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "linklistId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'setLinklistType', + name: "setLinklistType", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'linklistId', type: 'uint256' }, - { name: 'uri', type: 'string' }, + { name: "linklistId", type: "uint256" }, + { name: "uri", type: "string" }, ], - name: 'setLinklistUri', + name: "setLinklistUri", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, - { name: 'mintModule', type: 'address' }, - { name: 'mintModuleInitData', type: 'bytes' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, + { name: "mintModule", type: "address" }, + { name: "mintModuleInitData", type: "bytes" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'setMintModule4Note', + name: "setMintModule4Note", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, - { name: 'newUri', type: 'string' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, + { name: "newUri", type: "string" }, ], - name: 'setNoteUri', + name: "setNoteUri", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'characterId', type: 'uint256' }], - name: 'setPrimaryCharacterId', + inputs: [{ name: "characterId", type: "uint256" }], + name: "setPrimaryCharacterId", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'tokenAddress', type: 'address' }, + { name: "characterId", type: "uint256" }, + { name: "tokenAddress", type: "address" }, ], - name: 'setSocialToken', + name: "setSocialToken", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'interfaceId', type: 'bytes4' }], - name: 'supportsInterface', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "interfaceId", type: "bytes4" }], + name: "supportsInterface", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'symbol', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + name: "symbol", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'index', type: 'uint256' }], - name: 'tokenByIndex', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "index", type: "uint256" }], + name: "tokenByIndex", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'owner', type: 'address' }, - { name: 'index', type: 'uint256' }, + { name: "owner", type: "address" }, + { name: "index", type: "uint256" }, ], - name: 'tokenOfOwnerByIndex', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "tokenOfOwnerByIndex", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'characterId', type: 'uint256' }], - name: 'tokenURI', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "characterId", type: "uint256" }], + name: "tokenURI", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'totalSupply', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "totalSupply", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'from', type: 'address' }, - { name: 'to', type: 'address' }, - { name: 'tokenId', type: 'uint256' }, + { name: "from", type: "address" }, + { name: "to", type: "address" }, + { name: "tokenId", type: "uint256" }, ], - name: 'transferFrom', + name: "transferFrom", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'ethAddress', type: 'address' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "ethAddress", type: "address" }, + { name: "linkType", type: "bytes32" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'unlinkAddress', + name: "unlinkAddress", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toUri', type: 'string' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toUri", type: "string" }, + { name: "linkType", type: "bytes32" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'unlinkAnyUri', + name: "unlinkAnyUri", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'unlinkCharacter', + name: "unlinkCharacter", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'tokenAddress', type: 'address' }, - { name: 'tokenId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "tokenAddress", type: "address" }, + { name: "tokenId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'unlinkERC721', + name: "unlinkERC721", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toLinkListId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toLinkListId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'unlinkLinklist', + name: "unlinkLinklist", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, - { name: 'toNoteId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, + { name: "toNoteId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'unlinkNote', + name: "unlinkNote", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { indexed: true, name: 'linklistId', type: 'uint256' }, - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'linkType', type: 'bytes32' }, + { indexed: true, name: "linklistId", type: "uint256" }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "linkType", type: "bytes32" }, ], - name: 'AttachLinklist', - type: 'event', + name: "AttachLinklist", + type: "event", }, { inputs: [ - { indexed: false, name: 'name', type: 'string' }, - { indexed: false, name: 'symbol', type: 'string' }, - { indexed: false, name: 'timestamp', type: 'uint256' }, + { indexed: false, name: "name", type: "string" }, + { indexed: false, name: "symbol", type: "string" }, + { indexed: false, name: "timestamp", type: "uint256" }, ], - name: 'BaseInitialized', - type: 'event', + name: "BaseInitialized", + type: "event", }, { inputs: [ - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'creator', type: 'address' }, - { indexed: true, name: 'to', type: 'address' }, - { indexed: false, name: 'handle', type: 'string' }, - { indexed: false, name: 'timestamp', type: 'uint256' }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "creator", type: "address" }, + { indexed: true, name: "to", type: "address" }, + { indexed: false, name: "handle", type: "string" }, + { indexed: false, name: "timestamp", type: "uint256" }, ], - name: 'CharacterCreated', - type: 'event', + name: "CharacterCreated", + type: "event", }, { inputs: [ - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: false, name: 'noteId', type: 'uint256' }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: false, name: "noteId", type: "uint256" }, ], - name: 'DeleteNote', - type: 'event', + name: "DeleteNote", + type: "event", }, { inputs: [ - { indexed: true, name: 'linklistId', type: 'uint256' }, - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'linkType', type: 'bytes32' }, + { indexed: true, name: "linklistId", type: "uint256" }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "linkType", type: "bytes32" }, ], - name: 'DetachLinklist', - type: 'event', + name: "DetachLinklist", + type: "event", }, { inputs: [ - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'operator', type: 'address' }, - { indexed: false, name: 'permissionBitMap', type: 'uint256' }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "operator", type: "address" }, + { indexed: false, name: "permissionBitMap", type: "uint256" }, ], - name: 'GrantOperatorPermissions', - type: 'event', + name: "GrantOperatorPermissions", + type: "event", }, { inputs: [ - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'noteId', type: 'uint256' }, - { indexed: false, name: 'blocklist', type: 'address[]' }, - { indexed: false, name: 'allowlist', type: 'address[]' }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "noteId", type: "uint256" }, + { indexed: false, name: "blocklist", type: "address[]" }, + { indexed: false, name: "allowlist", type: "address[]" }, ], - name: 'GrantOperators4Note', - type: 'event', + name: "GrantOperators4Note", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'ethAddress', type: 'address' }, - { indexed: false, name: 'linkType', type: 'bytes32' }, - { indexed: false, name: 'linklistId', type: 'uint256' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "ethAddress", type: "address" }, + { indexed: false, name: "linkType", type: "bytes32" }, + { indexed: false, name: "linklistId", type: "uint256" }, ], - name: 'LinkAddress', - type: 'event', + name: "LinkAddress", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: false, name: 'toUri', type: 'string' }, - { indexed: false, name: 'linkType', type: 'bytes32' }, - { indexed: false, name: 'linklistId', type: 'uint256' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: false, name: "toUri", type: "string" }, + { indexed: false, name: "linkType", type: "bytes32" }, + { indexed: false, name: "linklistId", type: "uint256" }, ], - name: 'LinkAnyUri', - type: 'event', + name: "LinkAnyUri", + type: "event", }, { inputs: [ - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'toCharacterId', type: 'uint256' }, - { indexed: false, name: 'linkType', type: 'bytes32' }, - { indexed: false, name: 'linklistId', type: 'uint256' }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "toCharacterId", type: "uint256" }, + { indexed: false, name: "linkType", type: "bytes32" }, + { indexed: false, name: "linklistId", type: "uint256" }, ], - name: 'LinkCharacter', - type: 'event', + name: "LinkCharacter", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'linkType', type: 'bytes32' }, - { indexed: false, name: 'clFromCharacterId', type: 'uint256' }, - { indexed: false, name: 'clToCharacterId', type: 'uint256' }, - { indexed: false, name: 'clLinkType', type: 'bytes32' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "linkType", type: "bytes32" }, + { indexed: false, name: "clFromCharacterId", type: "uint256" }, + { indexed: false, name: "clToCharacterId", type: "uint256" }, + { indexed: false, name: "clLinkType", type: "bytes32" }, ], - name: 'LinkCharacterLink', - type: 'event', + name: "LinkCharacterLink", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'tokenAddress', type: 'address' }, - { indexed: true, name: 'toNoteId', type: 'uint256' }, - { indexed: false, name: 'linkType', type: 'bytes32' }, - { indexed: false, name: 'linklistId', type: 'uint256' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "tokenAddress", type: "address" }, + { indexed: true, name: "toNoteId", type: "uint256" }, + { indexed: false, name: "linkType", type: "bytes32" }, + { indexed: false, name: "linklistId", type: "uint256" }, ], - name: 'LinkERC721', - type: 'event', + name: "LinkERC721", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'toLinklistId', type: 'uint256' }, - { indexed: false, name: 'linkType', type: 'bytes32' }, - { indexed: true, name: 'linklistId', type: 'uint256' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "toLinklistId", type: "uint256" }, + { indexed: false, name: "linkType", type: "bytes32" }, + { indexed: true, name: "linklistId", type: "uint256" }, ], - name: 'LinkLinklist', - type: 'event', + name: "LinkLinklist", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'toCharacterId', type: 'uint256' }, - { indexed: true, name: 'toNoteId', type: 'uint256' }, - { indexed: false, name: 'linkType', type: 'bytes32' }, - { indexed: false, name: 'linklistId', type: 'uint256' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "toCharacterId", type: "uint256" }, + { indexed: true, name: "toNoteId", type: "uint256" }, + { indexed: false, name: "linkType", type: "bytes32" }, + { indexed: false, name: "linklistId", type: "uint256" }, ], - name: 'LinkNote', - type: 'event', + name: "LinkNote", + type: "event", }, { - inputs: [{ indexed: false, name: 'timestamp', type: 'uint256' }], - name: 'LinklistNFTInitialized', - type: 'event', + inputs: [{ indexed: false, name: "timestamp", type: "uint256" }], + name: "LinklistNFTInitialized", + type: "event", }, { inputs: [ - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: false, name: 'noteId', type: 'uint256' }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: false, name: "noteId", type: "uint256" }, ], - name: 'LockNote', - type: 'event', + name: "LockNote", + type: "event", }, { inputs: [ - { indexed: false, name: 'characterId', type: 'uint256' }, - { indexed: false, name: 'noteId', type: 'uint256' }, - { indexed: false, name: 'timestamp', type: 'uint256' }, + { indexed: false, name: "characterId", type: "uint256" }, + { indexed: false, name: "noteId", type: "uint256" }, + { indexed: false, name: "timestamp", type: "uint256" }, ], - name: 'MintNFTInitialized', - type: 'event', + name: "MintNFTInitialized", + type: "event", }, { inputs: [ - { indexed: true, name: 'to', type: 'address' }, - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'noteId', type: 'uint256' }, - { indexed: false, name: 'tokenAddress', type: 'address' }, - { indexed: false, name: 'tokenId', type: 'uint256' }, + { indexed: true, name: "to", type: "address" }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "noteId", type: "uint256" }, + { indexed: false, name: "tokenAddress", type: "address" }, + { indexed: false, name: "tokenId", type: "uint256" }, ], - name: 'MintNote', - type: 'event', + name: "MintNote", + type: "event", }, { inputs: [ - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'noteId', type: 'uint256' }, - { indexed: true, name: 'linkKey', type: 'bytes32' }, - { indexed: false, name: 'linkItemType', type: 'bytes32' }, - { indexed: false, name: 'data', type: 'bytes' }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "noteId", type: "uint256" }, + { indexed: true, name: "linkKey", type: "bytes32" }, + { indexed: false, name: "linkItemType", type: "bytes32" }, + { indexed: false, name: "data", type: "bytes" }, ], - name: 'PostNote', - type: 'event', + name: "PostNote", + type: "event", }, { inputs: [ - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'noteId', type: 'uint256' }, - { indexed: true, name: 'amount', type: 'uint256' }, - { indexed: false, name: 'approvedAddresses', type: 'address[]' }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "noteId", type: "uint256" }, + { indexed: true, name: "amount", type: "uint256" }, + { indexed: false, name: "approvedAddresses", type: "address[]" }, ], - name: 'SetApprovedMintAmount4Addresses', - type: 'event', + name: "SetApprovedMintAmount4Addresses", + type: "event", }, { inputs: [ - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: false, name: 'newUri', type: 'string' }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: false, name: "newUri", type: "string" }, ], - name: 'SetCharacterUri', - type: 'event', + name: "SetCharacterUri", + type: "event", }, { inputs: [ - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: false, name: 'newHandle', type: 'string' }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: false, name: "newHandle", type: "string" }, ], - name: 'SetHandle', - type: 'event', + name: "SetHandle", + type: "event", }, { inputs: [ - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'linkModule', type: 'address' }, - { indexed: false, name: 'linkModuleInitData', type: 'bytes' }, - { indexed: false, name: 'returnData', type: 'bytes' }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "linkModule", type: "address" }, + { indexed: false, name: "linkModuleInitData", type: "bytes" }, + { indexed: false, name: "returnData", type: "bytes" }, ], - name: 'SetLinkModule4Address', - type: 'event', + name: "SetLinkModule4Address", + type: "event", }, { inputs: [ - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'linkModule', type: 'address' }, - { indexed: false, name: 'linkModuleInitData', type: 'bytes' }, - { indexed: false, name: 'returnData', type: 'bytes' }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "linkModule", type: "address" }, + { indexed: false, name: "linkModuleInitData", type: "bytes" }, + { indexed: false, name: "returnData", type: "bytes" }, ], - name: 'SetLinkModule4Character', - type: 'event', + name: "SetLinkModule4Character", + type: "event", }, { inputs: [ - { indexed: true, name: 'tokenAddress', type: 'address' }, - { indexed: true, name: 'tokenId', type: 'uint256' }, - { indexed: true, name: 'linkModule', type: 'address' }, - { indexed: false, name: 'linkModuleInitData', type: 'bytes' }, - { indexed: false, name: 'returnData', type: 'bytes' }, + { indexed: true, name: "tokenAddress", type: "address" }, + { indexed: true, name: "tokenId", type: "uint256" }, + { indexed: true, name: "linkModule", type: "address" }, + { indexed: false, name: "linkModuleInitData", type: "bytes" }, + { indexed: false, name: "returnData", type: "bytes" }, ], - name: 'SetLinkModule4ERC721', - type: 'event', + name: "SetLinkModule4ERC721", + type: "event", }, { inputs: [ - { indexed: true, name: 'linklistId', type: 'uint256' }, - { indexed: true, name: 'linkModule', type: 'address' }, - { indexed: false, name: 'linkModuleInitData', type: 'bytes' }, - { indexed: false, name: 'returnData', type: 'bytes' }, + { indexed: true, name: "linklistId", type: "uint256" }, + { indexed: true, name: "linkModule", type: "address" }, + { indexed: false, name: "linkModuleInitData", type: "bytes" }, + { indexed: false, name: "returnData", type: "bytes" }, ], - name: 'SetLinkModule4Linklist', - type: 'event', + name: "SetLinkModule4Linklist", + type: "event", }, { inputs: [ - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'noteId', type: 'uint256' }, - { indexed: true, name: 'linkModule', type: 'address' }, - { indexed: false, name: 'linkModuleInitData', type: 'bytes' }, - { indexed: false, name: 'returnData', type: 'bytes' }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "noteId", type: "uint256" }, + { indexed: true, name: "linkModule", type: "address" }, + { indexed: false, name: "linkModuleInitData", type: "bytes" }, + { indexed: false, name: "returnData", type: "bytes" }, ], - name: 'SetLinkModule4Note', - type: 'event', + name: "SetLinkModule4Note", + type: "event", }, { inputs: [ - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'noteId', type: 'uint256' }, - { indexed: true, name: 'mintModule', type: 'address' }, - { indexed: false, name: 'mintModuleInitData', type: 'bytes' }, - { indexed: false, name: 'returnData', type: 'bytes' }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "noteId", type: "uint256" }, + { indexed: true, name: "mintModule", type: "address" }, + { indexed: false, name: "mintModuleInitData", type: "bytes" }, + { indexed: false, name: "returnData", type: "bytes" }, ], - name: 'SetMintModule4Note', - type: 'event', + name: "SetMintModule4Note", + type: "event", }, { inputs: [ - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: false, name: 'noteId', type: 'uint256' }, - { indexed: false, name: 'newUri', type: 'string' }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: false, name: "noteId", type: "uint256" }, + { indexed: false, name: "newUri", type: "string" }, ], - name: 'SetNoteUri', - type: 'event', + name: "SetNoteUri", + type: "event", }, { inputs: [ - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'oldCharacterId', type: 'uint256' }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "oldCharacterId", type: "uint256" }, ], - name: 'SetPrimaryCharacterId', - type: 'event', + name: "SetPrimaryCharacterId", + type: "event", }, { inputs: [ - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'tokenAddress', type: 'address' }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "tokenAddress", type: "address" }, ], - name: 'SetSocialToken', - type: 'event', + name: "SetSocialToken", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'ethAddress', type: 'address' }, - { indexed: false, name: 'linkType', type: 'bytes32' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "ethAddress", type: "address" }, + { indexed: false, name: "linkType", type: "bytes32" }, ], - name: 'UnlinkAddress', - type: 'event', + name: "UnlinkAddress", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: false, name: 'toUri', type: 'string' }, - { indexed: false, name: 'linkType', type: 'bytes32' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: false, name: "toUri", type: "string" }, + { indexed: false, name: "linkType", type: "bytes32" }, ], - name: 'UnlinkAnyUri', - type: 'event', + name: "UnlinkAnyUri", + type: "event", }, { inputs: [ - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'toCharacterId', type: 'uint256' }, - { indexed: false, name: 'linkType', type: 'bytes32' }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "toCharacterId", type: "uint256" }, + { indexed: false, name: "linkType", type: "bytes32" }, ], - name: 'UnlinkCharacter', - type: 'event', + name: "UnlinkCharacter", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'linkType', type: 'bytes32' }, - { indexed: false, name: 'clFromCharactereId', type: 'uint256' }, - { indexed: false, name: 'clToCharacterId', type: 'uint256' }, - { indexed: false, name: 'clLinkType', type: 'bytes32' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "linkType", type: "bytes32" }, + { indexed: false, name: "clFromCharactereId", type: "uint256" }, + { indexed: false, name: "clToCharacterId", type: "uint256" }, + { indexed: false, name: "clLinkType", type: "bytes32" }, ], - name: 'UnlinkCharacterLink', - type: 'event', + name: "UnlinkCharacterLink", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'tokenAddress', type: 'address' }, - { indexed: true, name: 'toNoteId', type: 'uint256' }, - { indexed: false, name: 'linkType', type: 'bytes32' }, - { indexed: false, name: 'linklistId', type: 'uint256' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "tokenAddress", type: "address" }, + { indexed: true, name: "toNoteId", type: "uint256" }, + { indexed: false, name: "linkType", type: "bytes32" }, + { indexed: false, name: "linklistId", type: "uint256" }, ], - name: 'UnlinkERC721', - type: 'event', + name: "UnlinkERC721", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'toLinklistId', type: 'uint256' }, - { indexed: false, name: 'linkType', type: 'bytes32' }, - { indexed: true, name: 'linklistId', type: 'uint256' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "toLinklistId", type: "uint256" }, + { indexed: false, name: "linkType", type: "bytes32" }, + { indexed: true, name: "linklistId", type: "uint256" }, ], - name: 'UnlinkLinklist', - type: 'event', + name: "UnlinkLinklist", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'toCharacterId', type: 'uint256' }, - { indexed: true, name: 'toNoteId', type: 'uint256' }, - { indexed: false, name: 'linkType', type: 'bytes32' }, - { indexed: false, name: 'linklistId', type: 'uint256' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "toCharacterId", type: "uint256" }, + { indexed: true, name: "toNoteId", type: "uint256" }, + { indexed: false, name: "linkType", type: "bytes32" }, + { indexed: false, name: "linklistId", type: "uint256" }, ], - name: 'UnlinkNote', - type: 'event', + name: "UnlinkNote", + type: "event", }, { - inputs: [{ indexed: false, name: 'timestamp', type: 'uint256' }], - name: 'Web3EntryInitialized', - type: 'event', + inputs: [{ indexed: false, name: "timestamp", type: "uint256" }], + name: "Web3EntryInitialized", + type: "event", }, -] as const -export type Entry = typeof entry +] as const; +export type Entry = typeof entry; diff --git a/src/contract/abi/index.ts b/src/contract/abi/index.ts index 289190cc7..4aa5669db 100644 --- a/src/contract/abi/index.ts +++ b/src/contract/abi/index.ts @@ -1,9 +1,9 @@ -export * from './entry' -export * from './periphery' -export * from './cbt' -export * from './newbie-villa' -export * from './tips' -export * from './tips-with-fee' -export * from './tips-with-config' -export * from './mira' -export * from './linklist' +export * from "./entry"; +export * from "./periphery"; +export * from "./cbt"; +export * from "./newbie-villa"; +export * from "./tips"; +export * from "./tips-with-fee"; +export * from "./tips-with-config"; +export * from "./mira"; +export * from "./linklist"; diff --git a/src/contract/abi/linklist.ts b/src/contract/abi/linklist.ts index 16b5d7f60..10f682861 100644 --- a/src/contract/abi/linklist.ts +++ b/src/contract/abi/linklist.ts @@ -1,455 +1,455 @@ export const linklist = [ - { inputs: [], name: 'ErrCallerNotWeb3Entry', type: 'error' }, - { inputs: [], name: 'ErrCallerNotWeb3EntryOrNotOwner', type: 'error' }, - { inputs: [], name: 'ErrTokenNotExists', type: 'error' }, + { inputs: [], name: "ErrCallerNotWeb3Entry", type: "error" }, + { inputs: [], name: "ErrCallerNotWeb3EntryOrNotOwner", type: "error" }, + { inputs: [], name: "ErrTokenNotExists", type: "error" }, { inputs: [ - { indexed: true, name: 'from', type: 'uint256' }, - { indexed: true, name: 'tokenId', type: 'uint256' }, + { indexed: true, name: "from", type: "uint256" }, + { indexed: true, name: "tokenId", type: "uint256" }, ], - name: 'Burn', - type: 'event', + name: "Burn", + type: "event", }, { - inputs: [{ indexed: false, name: 'version', type: 'uint8' }], - name: 'Initialized', - type: 'event', + inputs: [{ indexed: false, name: "version", type: "uint8" }], + name: "Initialized", + type: "event", }, { inputs: [ - { indexed: true, name: 'tokenId', type: 'uint256' }, - { indexed: true, name: 'newlinkType', type: 'bytes32' }, + { indexed: true, name: "tokenId", type: "uint256" }, + { indexed: true, name: "newlinkType", type: "bytes32" }, ], - name: 'LinkTypeSet', - type: 'event', + name: "LinkTypeSet", + type: "event", }, { inputs: [ - { indexed: true, name: 'from', type: 'address' }, - { indexed: true, name: 'characterId', type: 'uint256' }, - { indexed: true, name: 'tokenId', type: 'uint256' }, + { indexed: true, name: "from", type: "address" }, + { indexed: true, name: "characterId", type: "uint256" }, + { indexed: true, name: "tokenId", type: "uint256" }, ], - name: 'Transfer', - type: 'event', + name: "Transfer", + type: "event", }, { inputs: [ - { indexed: true, name: 'tokenId', type: 'uint256' }, - { indexed: false, name: 'uri', type: 'string' }, + { indexed: true, name: "tokenId", type: "uint256" }, + { indexed: false, name: "uri", type: "string" }, ], - name: 'UriSet', - type: 'event', + name: "UriSet", + type: "event", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'Uri', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "Uri", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'Web3Entry', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "Web3Entry", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'ethAddress', type: 'address' }, + { name: "tokenId", type: "uint256" }, + { name: "ethAddress", type: "address" }, ], - name: 'addLinkingAddress', + name: "addLinkingAddress", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'toUri', type: 'string' }, + { name: "tokenId", type: "uint256" }, + { name: "toUri", type: "string" }, ], - name: 'addLinkingAnyUri', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'nonpayable', - type: 'function', + name: "addLinkingAnyUri", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, + { name: "tokenId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, ], - name: 'addLinkingCharacterId', + name: "addLinkingCharacterId", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'tokenAddress', type: 'address' }, - { name: 'erc721TokenId', type: 'uint256' }, + { name: "tokenId", type: "uint256" }, + { name: "tokenAddress", type: "address" }, + { name: "erc721TokenId", type: "uint256" }, ], - name: 'addLinkingERC721', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'nonpayable', - type: 'function', + name: "addLinkingERC721", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'linklistId', type: 'uint256' }, + { name: "tokenId", type: "uint256" }, + { name: "linklistId", type: "uint256" }, ], - name: 'addLinkingLinklistId', + name: "addLinkingLinklistId", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, - { name: 'toNoteId', type: 'uint256' }, + { name: "tokenId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, + { name: "toNoteId", type: "uint256" }, ], - name: 'addLinkingNote', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'nonpayable', - type: 'function', + name: "addLinkingNote", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'account', type: 'address' }], - name: 'balanceOf', - outputs: [{ name: 'balance', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "account", type: "address" }], + name: "balanceOf", + outputs: [{ name: "balance", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'characterId', type: 'uint256' }], - name: 'balanceOf', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "characterId", type: "uint256" }], + name: "balanceOf", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'burn', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "burn", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'characterOwnerOf', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "characterOwnerOf", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getCurrentTakeOver', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getCurrentTakeOver", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkType', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkType", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingAddressListLength', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingAddressListLength", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingAddresses', - outputs: [{ name: '', type: 'address[]' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingAddresses", + outputs: [{ name: "", type: "address[]" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingAnyListLength', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingAnyListLength", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'linkKey', type: 'bytes32' }], - name: 'getLinkingAnyUri', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "linkKey", type: "bytes32" }], + name: "getLinkingAnyUri", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingAnyUriKeys', - outputs: [{ name: '', type: 'bytes32[]' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingAnyUriKeys", + outputs: [{ name: "", type: "bytes32[]" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingAnyUris', - outputs: [{ name: 'results', type: 'string[]' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingAnyUris", + outputs: [{ name: "results", type: "string[]" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingCharacterIds', - outputs: [{ name: '', type: 'uint256[]' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingCharacterIds", + outputs: [{ name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingCharacterListLength', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingCharacterListLength", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'linkKey', type: 'bytes32' }], - name: 'getLinkingERC721', + inputs: [{ name: "linkKey", type: "bytes32" }], + name: "getLinkingERC721", outputs: [ { components: [ - { name: 'tokenAddress', type: 'address' }, - { name: 'erc721TokenId', type: 'uint256' }, + { name: "tokenAddress", type: "address" }, + { name: "erc721TokenId", type: "uint256" }, ], - name: '', - type: 'tuple', + name: "", + type: "tuple", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingERC721ListLength', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingERC721ListLength", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingERC721s', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingERC721s", outputs: [ { components: [ - { name: 'tokenAddress', type: 'address' }, - { name: 'erc721TokenId', type: 'uint256' }, + { name: "tokenAddress", type: "address" }, + { name: "erc721TokenId", type: "uint256" }, ], - name: 'results', - type: 'tuple[]', + name: "results", + type: "tuple[]", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingLinklistIds', - outputs: [{ name: '', type: 'uint256[]' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingLinklistIds", + outputs: [{ name: "", type: "uint256[]" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingLinklistLength', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingLinklistLength", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'linkKey', type: 'bytes32' }], - name: 'getLinkingNote', + inputs: [{ name: "linkKey", type: "bytes32" }], + name: "getLinkingNote", outputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, ], - name: '', - type: 'tuple', + name: "", + type: "tuple", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingNoteListLength', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingNoteListLength", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getLinkingNotes', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getLinkingNotes", outputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, ], - name: 'results', - type: 'tuple[]', + name: "results", + type: "tuple[]", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'getOwnerCharacterId', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "getOwnerCharacterId", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'name_', type: 'string' }, - { name: 'symbol_', type: 'string' }, - { name: 'web3Entry_', type: 'address' }, + { name: "name_", type: "string" }, + { name: "symbol_", type: "string" }, + { name: "web3Entry_", type: "address" }, ], - name: 'initialize', + name: "initialize", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "characterId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'mint', - outputs: [{ name: 'tokenId', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', + name: "mint", + outputs: [{ name: "tokenId", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [], - name: 'name', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + name: "name", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tokenId', type: 'uint256' }], - name: 'ownerOf', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenId", type: "uint256" }], + name: "ownerOf", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'ethAddress', type: 'address' }, + { name: "tokenId", type: "uint256" }, + { name: "ethAddress", type: "address" }, ], - name: 'removeLinkingAddress', + name: "removeLinkingAddress", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'toUri', type: 'string' }, + { name: "tokenId", type: "uint256" }, + { name: "toUri", type: "string" }, ], - name: 'removeLinkingAnyUri', + name: "removeLinkingAnyUri", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, + { name: "tokenId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, ], - name: 'removeLinkingCharacterId', + name: "removeLinkingCharacterId", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'tokenAddress', type: 'address' }, - { name: 'erc721TokenId', type: 'uint256' }, + { name: "tokenId", type: "uint256" }, + { name: "tokenAddress", type: "address" }, + { name: "erc721TokenId", type: "uint256" }, ], - name: 'removeLinkingERC721', + name: "removeLinkingERC721", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'linklistId', type: 'uint256' }, + { name: "tokenId", type: "uint256" }, + { name: "linklistId", type: "uint256" }, ], - name: 'removeLinkingLinklistId', + name: "removeLinkingLinklistId", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, - { name: 'toNoteId', type: 'uint256' }, + { name: "tokenId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, + { name: "toNoteId", type: "uint256" }, ], - name: 'removeLinkingNote', + name: "removeLinkingNote", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "tokenId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'setLinkType', + name: "setLinkType", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'tokenId', type: 'uint256' }, - { name: 'uri', type: 'string' }, + { name: "tokenId", type: "uint256" }, + { name: "uri", type: "string" }, ], - name: 'setUri', + name: "setUri", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'interfaceId', type: 'bytes4' }], - name: 'supportsInterface', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "interfaceId", type: "bytes4" }], + name: "supportsInterface", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'symbol', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + name: "symbol", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'totalSupply', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "totalSupply", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, -] as const -export type Linklist = typeof linklist +] as const; +export type Linklist = typeof linklist; diff --git a/src/contract/abi/mira.ts b/src/contract/abi/mira.ts index f1e70e685..1e30811f4 100644 --- a/src/contract/abi/mira.ts +++ b/src/contract/abi/mira.ts @@ -1,362 +1,362 @@ export const mira = [ { inputs: [ - { name: 'name_', type: 'string' }, - { name: 'symbol_', type: 'string' }, - { name: 'admin', type: 'address' }, + { name: "name_", type: "string" }, + { name: "symbol_", type: "string" }, + { name: "admin", type: "address" }, ], - stateMutability: 'nonpayable', - type: 'constructor', + stateMutability: "nonpayable", + type: "constructor", }, { inputs: [ - { indexed: true, name: 'owner', type: 'address' }, - { indexed: true, name: 'spender', type: 'address' }, - { indexed: false, name: 'value', type: 'uint256' }, + { indexed: true, name: "owner", type: "address" }, + { indexed: true, name: "spender", type: "address" }, + { indexed: false, name: "value", type: "uint256" }, ], - name: 'Approval', - type: 'event', + name: "Approval", + type: "event", }, { inputs: [ - { indexed: true, name: 'operator', type: 'address' }, - { indexed: true, name: 'tokenHolder', type: 'address' }, + { indexed: true, name: "operator", type: "address" }, + { indexed: true, name: "tokenHolder", type: "address" }, ], - name: 'AuthorizedOperator', - type: 'event', + name: "AuthorizedOperator", + type: "event", }, { inputs: [ - { indexed: true, name: 'operator', type: 'address' }, - { indexed: true, name: 'from', type: 'address' }, - { indexed: false, name: 'amount', type: 'uint256' }, - { indexed: false, name: 'data', type: 'bytes' }, - { indexed: false, name: 'operatorData', type: 'bytes' }, + { indexed: true, name: "operator", type: "address" }, + { indexed: true, name: "from", type: "address" }, + { indexed: false, name: "amount", type: "uint256" }, + { indexed: false, name: "data", type: "bytes" }, + { indexed: false, name: "operatorData", type: "bytes" }, ], - name: 'Burned', - type: 'event', + name: "Burned", + type: "event", }, { inputs: [ - { indexed: true, name: 'operator', type: 'address' }, - { indexed: true, name: 'to', type: 'address' }, - { indexed: false, name: 'amount', type: 'uint256' }, - { indexed: false, name: 'data', type: 'bytes' }, - { indexed: false, name: 'operatorData', type: 'bytes' }, + { indexed: true, name: "operator", type: "address" }, + { indexed: true, name: "to", type: "address" }, + { indexed: false, name: "amount", type: "uint256" }, + { indexed: false, name: "data", type: "bytes" }, + { indexed: false, name: "operatorData", type: "bytes" }, ], - name: 'Minted', - type: 'event', + name: "Minted", + type: "event", }, { inputs: [ - { indexed: true, name: 'operator', type: 'address' }, - { indexed: true, name: 'tokenHolder', type: 'address' }, + { indexed: true, name: "operator", type: "address" }, + { indexed: true, name: "tokenHolder", type: "address" }, ], - name: 'RevokedOperator', - type: 'event', + name: "RevokedOperator", + type: "event", }, { inputs: [ - { indexed: true, name: 'role', type: 'bytes32' }, - { indexed: true, name: 'previousAdminRole', type: 'bytes32' }, - { indexed: true, name: 'newAdminRole', type: 'bytes32' }, + { indexed: true, name: "role", type: "bytes32" }, + { indexed: true, name: "previousAdminRole", type: "bytes32" }, + { indexed: true, name: "newAdminRole", type: "bytes32" }, ], - name: 'RoleAdminChanged', - type: 'event', + name: "RoleAdminChanged", + type: "event", }, { inputs: [ - { indexed: true, name: 'role', type: 'bytes32' }, - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'sender', type: 'address' }, + { indexed: true, name: "role", type: "bytes32" }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "sender", type: "address" }, ], - name: 'RoleGranted', - type: 'event', + name: "RoleGranted", + type: "event", }, { inputs: [ - { indexed: true, name: 'role', type: 'bytes32' }, - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'sender', type: 'address' }, + { indexed: true, name: "role", type: "bytes32" }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "sender", type: "address" }, ], - name: 'RoleRevoked', - type: 'event', + name: "RoleRevoked", + type: "event", }, { inputs: [ - { indexed: true, name: 'operator', type: 'address' }, - { indexed: true, name: 'from', type: 'address' }, - { indexed: true, name: 'to', type: 'address' }, - { indexed: false, name: 'amount', type: 'uint256' }, - { indexed: false, name: 'data', type: 'bytes' }, - { indexed: false, name: 'operatorData', type: 'bytes' }, + { indexed: true, name: "operator", type: "address" }, + { indexed: true, name: "from", type: "address" }, + { indexed: true, name: "to", type: "address" }, + { indexed: false, name: "amount", type: "uint256" }, + { indexed: false, name: "data", type: "bytes" }, + { indexed: false, name: "operatorData", type: "bytes" }, ], - name: 'Sent', - type: 'event', + name: "Sent", + type: "event", }, { inputs: [ - { indexed: true, name: 'from', type: 'address' }, - { indexed: true, name: 'to', type: 'address' }, - { indexed: false, name: 'value', type: 'uint256' }, + { indexed: true, name: "from", type: "address" }, + { indexed: true, name: "to", type: "address" }, + { indexed: false, name: "value", type: "uint256" }, ], - name: 'Transfer', - type: 'event', + name: "Transfer", + type: "event", }, { inputs: [], - name: 'BLOCK_ROLE', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + name: "BLOCK_ROLE", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'DEFAULT_ADMIN_ROLE', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + name: "DEFAULT_ADMIN_ROLE", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'holder', type: 'address' }, - { name: 'spender', type: 'address' }, + { name: "holder", type: "address" }, + { name: "spender", type: "address" }, ], - name: 'allowance', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "allowance", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'spender', type: 'address' }, - { name: 'value', type: 'uint256' }, + { name: "spender", type: "address" }, + { name: "value", type: "uint256" }, ], - name: 'approve', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'nonpayable', - type: 'function', + name: "approve", + outputs: [{ name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'operator', type: 'address' }], - name: 'authorizeOperator', + inputs: [{ name: "operator", type: "address" }], + name: "authorizeOperator", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'tokenHolder', type: 'address' }], - name: 'balanceOf', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "tokenHolder", type: "address" }], + name: "balanceOf", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'amount', type: 'uint256' }, - { name: 'data', type: 'bytes' }, + { name: "amount", type: "uint256" }, + { name: "data", type: "bytes" }, ], - name: 'burn', + name: "burn", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [], - name: 'decimals', - outputs: [{ name: '', type: 'uint8' }], - stateMutability: 'pure', - type: 'function', + name: "decimals", + outputs: [{ name: "", type: "uint8" }], + stateMutability: "pure", + type: "function", }, { inputs: [], - name: 'defaultOperators', - outputs: [{ name: '', type: 'address[]' }], - stateMutability: 'view', - type: 'function', + name: "defaultOperators", + outputs: [{ name: "", type: "address[]" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'role', type: 'bytes32' }], - name: 'getRoleAdmin', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "role", type: "bytes32" }], + name: "getRoleAdmin", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'index', type: 'uint256' }, + { name: "role", type: "bytes32" }, + { name: "index", type: "uint256" }, ], - name: 'getRoleMember', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "getRoleMember", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'role', type: 'bytes32' }], - name: 'getRoleMemberCount', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "role", type: "bytes32" }], + name: "getRoleMemberCount", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'account', type: 'address' }, + { name: "role", type: "bytes32" }, + { name: "account", type: "address" }, ], - name: 'grantRole', + name: "grantRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [], - name: 'granularity', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "granularity", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'account', type: 'address' }, + { name: "role", type: "bytes32" }, + { name: "account", type: "address" }, ], - name: 'hasRole', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + name: "hasRole", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'operator', type: 'address' }, - { name: 'tokenHolder', type: 'address' }, + { name: "operator", type: "address" }, + { name: "tokenHolder", type: "address" }, ], - name: 'isOperatorFor', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + name: "isOperatorFor", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'to', type: 'address' }, - { name: 'amount', type: 'uint256' }, + { name: "to", type: "address" }, + { name: "amount", type: "uint256" }, ], - name: 'mint', + name: "mint", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [], - name: 'name', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + name: "name", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'account', type: 'address' }, - { name: 'amount', type: 'uint256' }, - { name: 'data', type: 'bytes' }, - { name: 'operatorData', type: 'bytes' }, + { name: "account", type: "address" }, + { name: "amount", type: "uint256" }, + { name: "data", type: "bytes" }, + { name: "operatorData", type: "bytes" }, ], - name: 'operatorBurn', + name: "operatorBurn", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'sender', type: 'address' }, - { name: 'recipient', type: 'address' }, - { name: 'amount', type: 'uint256' }, - { name: 'data', type: 'bytes' }, - { name: 'operatorData', type: 'bytes' }, + { name: "sender", type: "address" }, + { name: "recipient", type: "address" }, + { name: "amount", type: "uint256" }, + { name: "data", type: "bytes" }, + { name: "operatorData", type: "bytes" }, ], - name: 'operatorSend', + name: "operatorSend", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'account', type: 'address' }, + { name: "role", type: "bytes32" }, + { name: "account", type: "address" }, ], - name: 'renounceRole', + name: "renounceRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'operator', type: 'address' }], - name: 'revokeOperator', + inputs: [{ name: "operator", type: "address" }], + name: "revokeOperator", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'account', type: 'address' }, + { name: "role", type: "bytes32" }, + { name: "account", type: "address" }, ], - name: 'revokeRole', + name: "revokeRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'recipient', type: 'address' }, - { name: 'amount', type: 'uint256' }, - { name: 'data', type: 'bytes' }, + { name: "recipient", type: "address" }, + { name: "amount", type: "uint256" }, + { name: "data", type: "bytes" }, ], - name: 'send', + name: "send", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'interfaceId', type: 'bytes4' }], - name: 'supportsInterface', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "interfaceId", type: "bytes4" }], + name: "supportsInterface", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'symbol', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + name: "symbol", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'totalSupply', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "totalSupply", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'recipient', type: 'address' }, - { name: 'amount', type: 'uint256' }, + { name: "recipient", type: "address" }, + { name: "amount", type: "uint256" }, ], - name: 'transfer', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'nonpayable', - type: 'function', + name: "transfer", + outputs: [{ name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'holder', type: 'address' }, - { name: 'recipient', type: 'address' }, - { name: 'amount', type: 'uint256' }, + { name: "holder", type: "address" }, + { name: "recipient", type: "address" }, + { name: "amount", type: "uint256" }, ], - name: 'transferFrom', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'nonpayable', - type: 'function', + name: "transferFrom", + outputs: [{ name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", }, -] as const -export type Mira = typeof mira +] as const; +export type Mira = typeof mira; diff --git a/src/contract/abi/newbie-villa.ts b/src/contract/abi/newbie-villa.ts index b86f5a041..744c9ace1 100644 --- a/src/contract/abi/newbie-villa.ts +++ b/src/contract/abi/newbie-villa.ts @@ -1,247 +1,247 @@ export const newbieVilla = [ { - inputs: [{ indexed: false, name: 'version', type: 'uint8' }], - name: 'Initialized', - type: 'event', + inputs: [{ indexed: false, name: "version", type: "uint8" }], + name: "Initialized", + type: "event", }, { inputs: [ - { indexed: true, name: 'role', type: 'bytes32' }, - { indexed: true, name: 'previousAdminRole', type: 'bytes32' }, - { indexed: true, name: 'newAdminRole', type: 'bytes32' }, + { indexed: true, name: "role", type: "bytes32" }, + { indexed: true, name: "previousAdminRole", type: "bytes32" }, + { indexed: true, name: "newAdminRole", type: "bytes32" }, ], - name: 'RoleAdminChanged', - type: 'event', + name: "RoleAdminChanged", + type: "event", }, { inputs: [ - { indexed: true, name: 'role', type: 'bytes32' }, - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'sender', type: 'address' }, + { indexed: true, name: "role", type: "bytes32" }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "sender", type: "address" }, ], - name: 'RoleGranted', - type: 'event', + name: "RoleGranted", + type: "event", }, { inputs: [ - { indexed: true, name: 'role', type: 'bytes32' }, - { indexed: true, name: 'account', type: 'address' }, - { indexed: true, name: 'sender', type: 'address' }, + { indexed: true, name: "role", type: "bytes32" }, + { indexed: true, name: "account", type: "address" }, + { indexed: true, name: "sender", type: "address" }, ], - name: 'RoleRevoked', - type: 'event', + name: "RoleRevoked", + type: "event", }, { inputs: [ - { indexed: false, name: 'to', type: 'address' }, - { indexed: false, name: 'characterId', type: 'uint256' }, - { indexed: false, name: 'token', type: 'address' }, - { indexed: false, name: 'amount', type: 'uint256' }, + { indexed: false, name: "to", type: "address" }, + { indexed: false, name: "characterId", type: "uint256" }, + { indexed: false, name: "token", type: "address" }, + { indexed: false, name: "amount", type: "uint256" }, ], - name: 'Withdraw', - type: 'event', + name: "Withdraw", + type: "event", }, { inputs: [], - name: 'ADMIN_ROLE', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + name: "ADMIN_ROLE", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'DEFAULT_ADMIN_ROLE', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + name: "DEFAULT_ADMIN_ROLE", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'ERC1820_REGISTRY', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "ERC1820_REGISTRY", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'TOKENS_RECIPIENT_INTERFACE_HASH', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + name: "TOKENS_RECIPIENT_INTERFACE_HASH", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'characterId', type: 'uint256' }], - name: 'balanceOf', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "characterId", type: "uint256" }], + name: "balanceOf", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'role', type: 'bytes32' }], - name: 'getRoleAdmin', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "role", type: "bytes32" }], + name: "getRoleAdmin", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'index', type: 'uint256' }, + { name: "role", type: "bytes32" }, + { name: "index", type: "uint256" }, ], - name: 'getRoleMember', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "getRoleMember", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'role', type: 'bytes32' }], - name: 'getRoleMemberCount', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "role", type: "bytes32" }], + name: "getRoleMemberCount", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'getToken', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "getToken", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'account', type: 'address' }, + { name: "role", type: "bytes32" }, + { name: "account", type: "address" }, ], - name: 'grantRole', + name: "grantRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'account', type: 'address' }, + { name: "role", type: "bytes32" }, + { name: "account", type: "address" }, ], - name: 'hasRole', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + name: "hasRole", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'web3Entry_', type: 'address' }, - { name: 'xsyncOperator_', type: 'address' }, - { name: 'token_', type: 'address' }, - { name: 'admin_', type: 'address' }, - { name: 'tips_', type: 'address' }, + { name: "web3Entry_", type: "address" }, + { name: "xsyncOperator_", type: "address" }, + { name: "token_", type: "address" }, + { name: "admin_", type: "address" }, + { name: "tips_", type: "address" }, ], - name: 'initialize', + name: "initialize", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'operator', type: 'address' }, - { name: '', type: 'address' }, - { name: 'tokenId', type: 'uint256' }, - { name: 'data', type: 'bytes' }, + { name: "operator", type: "address" }, + { name: "", type: "address" }, + { name: "tokenId", type: "uint256" }, + { name: "data", type: "bytes" }, ], - name: 'onERC721Received', - outputs: [{ name: '', type: 'bytes4' }], - stateMutability: 'nonpayable', - type: 'function', + name: "onERC721Received", + outputs: [{ name: "", type: "bytes4" }], + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'account', type: 'address' }, + { name: "role", type: "bytes32" }, + { name: "account", type: "address" }, ], - name: 'renounceRole', + name: "renounceRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'role', type: 'bytes32' }, - { name: 'account', type: 'address' }, + { name: "role", type: "bytes32" }, + { name: "account", type: "address" }, ], - name: 'revokeRole', + name: "revokeRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'interfaceId', type: 'bytes4' }], - name: 'supportsInterface', - outputs: [{ name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "interfaceId", type: "bytes4" }], + name: "supportsInterface", + outputs: [{ name: "", type: "bool" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, - { name: 'amount', type: 'uint256' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, + { name: "amount", type: "uint256" }, ], - name: 'tipCharacter', + name: "tipCharacter", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, - { name: 'toNoteId', type: 'uint256' }, - { name: 'amount', type: 'uint256' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, + { name: "toNoteId", type: "uint256" }, + { name: "amount", type: "uint256" }, ], - name: 'tipCharacterForNote', + name: "tipCharacterForNote", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: '', type: 'address' }, - { name: '', type: 'address' }, - { name: 'to', type: 'address' }, - { name: 'amount', type: 'uint256' }, - { name: 'userData', type: 'bytes' }, - { name: 'operatorData', type: 'bytes' }, + { name: "", type: "address" }, + { name: "", type: "address" }, + { name: "to", type: "address" }, + { name: "amount", type: "uint256" }, + { name: "userData", type: "bytes" }, + { name: "operatorData", type: "bytes" }, ], - name: 'tokensReceived', + name: "tokensReceived", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [], - name: 'web3Entry', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "web3Entry", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'to', type: 'address' }, - { name: 'characterId', type: 'uint256' }, - { name: 'nonce', type: 'uint256' }, - { name: 'expires', type: 'uint256' }, - { name: 'proof', type: 'bytes' }, + { name: "to", type: "address" }, + { name: "characterId", type: "uint256" }, + { name: "nonce", type: "uint256" }, + { name: "expires", type: "uint256" }, + { name: "proof", type: "bytes" }, ], - name: 'withdraw', + name: "withdraw", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [], - name: 'xsyncOperator', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "xsyncOperator", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, -] as const -export type NewbieVilla = typeof newbieVilla +] as const; +export type NewbieVilla = typeof newbieVilla; diff --git a/src/contract/abi/periphery.ts b/src/contract/abi/periphery.ts index ca0a2f084..57d0cd36c 100644 --- a/src/contract/abi/periphery.ts +++ b/src/contract/abi/periphery.ts @@ -1,235 +1,235 @@ export const periphery = [ { - inputs: [{ name: 'linkKey', type: 'bytes32' }], - name: 'getLinkingAddress', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "linkKey", type: "bytes32" }], + name: "getLinkingAddress", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'getLinkingAddresses', - outputs: [{ name: '', type: 'address[]' }], - stateMutability: 'view', - type: 'function', + name: "getLinkingAddresses", + outputs: [{ name: "", type: "address[]" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'linkKey', type: 'bytes32' }], - name: 'getLinkingAnyUri', - outputs: [{ name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "linkKey", type: "bytes32" }], + name: "getLinkingAnyUri", + outputs: [{ name: "", type: "string" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'getLinkingAnyUris', - outputs: [{ name: 'results', type: 'string[]' }], - stateMutability: 'view', - type: 'function', + name: "getLinkingAnyUris", + outputs: [{ name: "results", type: "string[]" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'linkKey', type: 'bytes32' }], - name: 'getLinkingCharacterId', - outputs: [{ name: 'characterId', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "linkKey", type: "bytes32" }], + name: "getLinkingCharacterId", + outputs: [{ name: "characterId", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'getLinkingCharacterIds', - outputs: [{ name: 'results', type: 'uint256[]' }], - stateMutability: 'view', - type: 'function', + name: "getLinkingCharacterIds", + outputs: [{ name: "results", type: "uint256[]" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'linkKey', type: 'bytes32' }], - name: 'getLinkingERC721', + inputs: [{ name: "linkKey", type: "bytes32" }], + name: "getLinkingERC721", outputs: [ { components: [ - { name: 'tokenAddress', type: 'address' }, - { name: 'erc721TokenId', type: 'uint256' }, + { name: "tokenAddress", type: "address" }, + { name: "erc721TokenId", type: "uint256" }, ], - name: '', - type: 'tuple', + name: "", + type: "tuple", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'getLinkingERC721s', + name: "getLinkingERC721s", outputs: [ { components: [ - { name: 'tokenAddress', type: 'address' }, - { name: 'erc721TokenId', type: 'uint256' }, + { name: "tokenAddress", type: "address" }, + { name: "erc721TokenId", type: "uint256" }, ], - name: 'results', - type: 'tuple[]', + name: "results", + type: "tuple[]", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'linkKey', type: 'bytes32' }], - name: 'getLinkingLinklistId', - outputs: [{ name: 'linklistId', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + inputs: [{ name: "linkKey", type: "bytes32" }], + name: "getLinkingLinklistId", + outputs: [{ name: "linklistId", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'getLinkingLinklistIds', - outputs: [{ name: 'linklistIds', type: 'uint256[]' }], - stateMutability: 'view', - type: 'function', + name: "getLinkingLinklistIds", + outputs: [{ name: "linklistIds", type: "uint256[]" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'linkKey', type: 'bytes32' }], - name: 'getLinkingNote', + inputs: [{ name: "linkKey", type: "bytes32" }], + name: "getLinkingNote", outputs: [ { components: [ - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, ], - name: '', - type: 'tuple', + name: "", + type: "tuple", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "linkType", type: "bytes32" }, ], - name: 'getLinkingNotes', + name: "getLinkingNotes", outputs: [ { components: [ - { name: 'linkItemType', type: 'bytes32' }, - { name: 'linkKey', type: 'bytes32' }, - { name: 'contentUri', type: 'string' }, - { name: 'linkModule', type: 'address' }, - { name: 'mintModule', type: 'address' }, - { name: 'mintNFT', type: 'address' }, - { name: 'deleted', type: 'bool' }, - { name: 'locked', type: 'bool' }, + { name: "linkItemType", type: "bytes32" }, + { name: "linkKey", type: "bytes32" }, + { name: "contentUri", type: "string" }, + { name: "linkModule", type: "address" }, + { name: "mintModule", type: "address" }, + { name: "mintNFT", type: "address" }, + { name: "deleted", type: "bool" }, + { name: "locked", type: "bool" }, ], - name: 'results', - type: 'tuple[]', + name: "results", + type: "tuple[]", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'characterId', type: 'uint256' }, - { name: 'offset', type: 'uint256' }, - { name: 'limit', type: 'uint256' }, + { name: "characterId", type: "uint256" }, + { name: "offset", type: "uint256" }, + { name: "limit", type: "uint256" }, ], - name: 'getNotesByCharacterId', + name: "getNotesByCharacterId", outputs: [ { components: [ - { name: 'linkItemType', type: 'bytes32' }, - { name: 'linkKey', type: 'bytes32' }, - { name: 'contentUri', type: 'string' }, - { name: 'linkModule', type: 'address' }, - { name: 'mintModule', type: 'address' }, - { name: 'mintNFT', type: 'address' }, - { name: 'deleted', type: 'bool' }, - { name: 'locked', type: 'bool' }, + { name: "linkItemType", type: "bytes32" }, + { name: "linkKey", type: "bytes32" }, + { name: "contentUri", type: "string" }, + { name: "linkModule", type: "address" }, + { name: "mintModule", type: "address" }, + { name: "mintNFT", type: "address" }, + { name: "deleted", type: "bool" }, + { name: "locked", type: "bool" }, ], - name: 'results', - type: 'tuple[]', + name: "results", + type: "tuple[]", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { inputs: [ - { name: '_web3Entry', type: 'address' }, - { name: '_linklist', type: 'address' }, + { name: "_web3Entry", type: "address" }, + { name: "_linklist", type: "address" }, ], - name: 'initialize', + name: "initialize", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { components: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toCharacterIds', type: 'uint256[]' }, - { name: 'data', type: 'bytes[]' }, - { name: 'toAddresses', type: 'address[]' }, - { name: 'linkType', type: 'bytes32' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toCharacterIds", type: "uint256[]" }, + { name: "data", type: "bytes[]" }, + { name: "toAddresses", type: "address[]" }, + { name: "linkType", type: "bytes32" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'linkCharactersInBatch', + name: "linkCharactersInBatch", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [], - name: 'linklist', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "linklist", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [ { components: [ - { name: 'account', type: 'address' }, - { name: 'handle', type: 'string' }, - { name: 'uri', type: 'string' }, - { name: 'toAddresses', type: 'address[]' }, - { name: 'linkType', type: 'bytes32' }, + { name: "account", type: "address" }, + { name: "handle", type: "string" }, + { name: "uri", type: "string" }, + { name: "toAddresses", type: "address[]" }, + { name: "linkType", type: "bytes32" }, ], - name: 'vars', - type: 'tuple', + name: "vars", + type: "tuple", }, ], - name: 'migrate', + name: "migrate", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [], - name: 'web3Entry', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "web3Entry", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, -] as const -export type Periphery = typeof periphery +] as const; +export type Periphery = typeof periphery; diff --git a/src/contract/abi/tips-with-config.ts b/src/contract/abi/tips-with-config.ts index bd7ace675..04b24020e 100644 --- a/src/contract/abi/tips-with-config.ts +++ b/src/contract/abi/tips-with-config.ts @@ -1,164 +1,164 @@ export const tipsWithConfig = [ { - inputs: [{ indexed: true, name: 'tipConfigId', type: 'uint256' }], - name: 'CancelTips4Character', - type: 'event', + inputs: [{ indexed: true, name: "tipConfigId", type: "uint256" }], + name: "CancelTips4Character", + type: "event", }, { inputs: [ - { indexed: true, name: 'tipConfigId', type: 'uint256' }, - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'toCharacterId', type: 'uint256' }, - { indexed: false, name: 'token', type: 'address' }, - { indexed: false, name: 'amount', type: 'uint256' }, - { indexed: false, name: 'fee', type: 'uint256' }, - { indexed: false, name: 'feeReceiver', type: 'address' }, - { indexed: false, name: 'currentRound', type: 'uint256' }, + { indexed: true, name: "tipConfigId", type: "uint256" }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "toCharacterId", type: "uint256" }, + { indexed: false, name: "token", type: "address" }, + { indexed: false, name: "amount", type: "uint256" }, + { indexed: false, name: "fee", type: "uint256" }, + { indexed: false, name: "feeReceiver", type: "address" }, + { indexed: false, name: "currentRound", type: "uint256" }, ], - name: 'CollectTips4Character', - type: 'event', + name: "CollectTips4Character", + type: "event", }, { - inputs: [{ indexed: false, name: 'version', type: 'uint8' }], - name: 'Initialized', - type: 'event', + inputs: [{ indexed: false, name: "version", type: "uint8" }], + name: "Initialized", + type: "event", }, { inputs: [ - { indexed: true, name: 'tipConfigId', type: 'uint256' }, - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'toCharacterId', type: 'uint256' }, - { indexed: false, name: 'token', type: 'address' }, - { indexed: false, name: 'amount', type: 'uint256' }, - { indexed: false, name: 'startTime', type: 'uint256' }, - { indexed: false, name: 'endTime', type: 'uint256' }, - { indexed: false, name: 'interval', type: 'uint256' }, - { indexed: false, name: 'feeReceiver', type: 'address' }, - { indexed: false, name: 'totalRound', type: 'uint256' }, + { indexed: true, name: "tipConfigId", type: "uint256" }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "toCharacterId", type: "uint256" }, + { indexed: false, name: "token", type: "address" }, + { indexed: false, name: "amount", type: "uint256" }, + { indexed: false, name: "startTime", type: "uint256" }, + { indexed: false, name: "endTime", type: "uint256" }, + { indexed: false, name: "interval", type: "uint256" }, + { indexed: false, name: "feeReceiver", type: "address" }, + { indexed: false, name: "totalRound", type: "uint256" }, ], - name: 'SetTipsConfig4Character', - type: 'event', + name: "SetTipsConfig4Character", + type: "event", }, { - inputs: [{ name: 'tipConfigId', type: 'uint256' }], - name: 'cancelTips4Character', + inputs: [{ name: "tipConfigId", type: "uint256" }], + name: "cancelTips4Character", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { - inputs: [{ name: 'tipConfigId', type: 'uint256' }], - name: 'collectTips4Character', + inputs: [{ name: "tipConfigId", type: "uint256" }], + name: "collectTips4Character", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'feeReceiver', type: 'address' }, - { name: 'characterId', type: 'uint256' }, - { name: 'tipAmount', type: 'uint256' }, + { name: "feeReceiver", type: "address" }, + { name: "characterId", type: "uint256" }, + { name: "tipAmount", type: "uint256" }, ], - name: 'getFeeAmount', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "getFeeAmount", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'feeReceiver', type: 'address' }, - { name: 'characterId', type: 'uint256' }, + { name: "feeReceiver", type: "address" }, + { name: "characterId", type: "uint256" }, ], - name: 'getFeeFraction', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "getFeeFraction", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'tipConfigId', type: 'uint256' }], - name: 'getTipsConfig', + inputs: [{ name: "tipConfigId", type: "uint256" }], + name: "getTipsConfig", outputs: [ { components: [ - { name: 'id', type: 'uint256' }, - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, - { name: 'token', type: 'address' }, - { name: 'amount', type: 'uint256' }, - { name: 'startTime', type: 'uint256' }, - { name: 'endTime', type: 'uint256' }, - { name: 'interval', type: 'uint256' }, - { name: 'feeReceiver', type: 'address' }, - { name: 'totalRound', type: 'uint256' }, - { name: 'currentRound', type: 'uint256' }, + { name: "id", type: "uint256" }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, + { name: "token", type: "address" }, + { name: "amount", type: "uint256" }, + { name: "startTime", type: "uint256" }, + { name: "endTime", type: "uint256" }, + { name: "interval", type: "uint256" }, + { name: "feeReceiver", type: "address" }, + { name: "totalRound", type: "uint256" }, + { name: "currentRound", type: "uint256" }, ], - name: 'config', - type: 'tuple', + name: "config", + type: "tuple", }, ], - stateMutability: 'view', - type: 'function', + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, ], - name: 'getTipsConfigId', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "getTipsConfigId", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'getWeb3Entry', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "getWeb3Entry", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { - inputs: [{ name: 'web3Entry_', type: 'address' }], - name: 'initialize', + inputs: [{ name: "web3Entry_", type: "address" }], + name: "initialize", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'feeReceiver', type: 'address' }, - { name: 'fraction', type: 'uint256' }, + { name: "feeReceiver", type: "address" }, + { name: "fraction", type: "uint256" }, ], - name: 'setDefaultFeeFraction', + name: "setDefaultFeeFraction", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'feeReceiver', type: 'address' }, - { name: 'characterId', type: 'uint256' }, - { name: 'fraction', type: 'uint256' }, + { name: "feeReceiver", type: "address" }, + { name: "characterId", type: "uint256" }, + { name: "fraction", type: "uint256" }, ], - name: 'setFeeFraction4Character', + name: "setFeeFraction4Character", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'fromCharacterId', type: 'uint256' }, - { name: 'toCharacterId', type: 'uint256' }, - { name: 'token', type: 'address' }, - { name: 'amount', type: 'uint256' }, - { name: 'startTime', type: 'uint256' }, - { name: 'endTime', type: 'uint256' }, - { name: 'interval', type: 'uint256' }, - { name: 'feeReceiver', type: 'address' }, + { name: "fromCharacterId", type: "uint256" }, + { name: "toCharacterId", type: "uint256" }, + { name: "token", type: "address" }, + { name: "amount", type: "uint256" }, + { name: "startTime", type: "uint256" }, + { name: "endTime", type: "uint256" }, + { name: "interval", type: "uint256" }, + { name: "feeReceiver", type: "address" }, ], - name: 'setTipsConfig4Character', + name: "setTipsConfig4Character", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, -] as const -export type TipsWithConfig = typeof tipsWithConfig +] as const; +export type TipsWithConfig = typeof tipsWithConfig; diff --git a/src/contract/abi/tips-with-fee.ts b/src/contract/abi/tips-with-fee.ts index cbca93c01..eb971c2c7 100644 --- a/src/contract/abi/tips-with-fee.ts +++ b/src/contract/abi/tips-with-fee.ts @@ -1,141 +1,141 @@ export const tipsWithFee = [ { - inputs: [{ indexed: false, name: 'version', type: 'uint8' }], - name: 'Initialized', - type: 'event', + inputs: [{ indexed: false, name: "version", type: "uint8" }], + name: "Initialized", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'toCharacterId', type: 'uint256' }, - { indexed: false, name: 'token', type: 'address' }, - { indexed: false, name: 'amount', type: 'uint256' }, - { indexed: false, name: 'fee', type: 'uint256' }, - { indexed: false, name: 'feeReceiver', type: 'address' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "toCharacterId", type: "uint256" }, + { indexed: false, name: "token", type: "address" }, + { indexed: false, name: "amount", type: "uint256" }, + { indexed: false, name: "fee", type: "uint256" }, + { indexed: false, name: "feeReceiver", type: "address" }, ], - name: 'TipCharacter', - type: 'event', + name: "TipCharacter", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'toCharacterId', type: 'uint256' }, - { indexed: true, name: 'toNoteId', type: 'uint256' }, - { indexed: false, name: 'token', type: 'address' }, - { indexed: false, name: 'amount', type: 'uint256' }, - { indexed: false, name: 'fee', type: 'uint256' }, - { indexed: false, name: 'feeReceiver', type: 'address' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "toCharacterId", type: "uint256" }, + { indexed: true, name: "toNoteId", type: "uint256" }, + { indexed: false, name: "token", type: "address" }, + { indexed: false, name: "amount", type: "uint256" }, + { indexed: false, name: "fee", type: "uint256" }, + { indexed: false, name: "feeReceiver", type: "address" }, ], - name: 'TipCharacterForNote', - type: 'event', + name: "TipCharacterForNote", + type: "event", }, { inputs: [], - name: 'ERC1820_REGISTRY', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "ERC1820_REGISTRY", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'TOKENS_RECIPIENT_INTERFACE_HASH', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + name: "TOKENS_RECIPIENT_INTERFACE_HASH", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'feeReceiver', type: 'address' }, - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, - { name: 'tipAmount', type: 'uint256' }, + { name: "feeReceiver", type: "address" }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, + { name: "tipAmount", type: "uint256" }, ], - name: 'getFeeAmount', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "getFeeAmount", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'feeReceiver', type: 'address' }, - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, + { name: "feeReceiver", type: "address" }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, ], - name: 'getFeeFraction', - outputs: [{ name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', + name: "getFeeFraction", + outputs: [{ name: "", type: "uint256" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'getToken', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "getToken", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'getWeb3Entry', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "getWeb3Entry", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'web3Entry_', type: 'address' }, - { name: 'token_', type: 'address' }, + { name: "web3Entry_", type: "address" }, + { name: "token_", type: "address" }, ], - name: 'initialize', + name: "initialize", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'feeReceiver', type: 'address' }, - { name: 'fraction', type: 'uint256' }, + { name: "feeReceiver", type: "address" }, + { name: "fraction", type: "uint256" }, ], - name: 'setDefaultFeeFraction', + name: "setDefaultFeeFraction", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'feeReceiver', type: 'address' }, - { name: 'characterId', type: 'uint256' }, - { name: 'fraction', type: 'uint256' }, + { name: "feeReceiver", type: "address" }, + { name: "characterId", type: "uint256" }, + { name: "fraction", type: "uint256" }, ], - name: 'setFeeFraction4Character', + name: "setFeeFraction4Character", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: 'feeReceiver', type: 'address' }, - { name: 'characterId', type: 'uint256' }, - { name: 'noteId', type: 'uint256' }, - { name: 'fraction', type: 'uint256' }, + { name: "feeReceiver", type: "address" }, + { name: "characterId", type: "uint256" }, + { name: "noteId", type: "uint256" }, + { name: "fraction", type: "uint256" }, ], - name: 'setFeeFraction4Note', + name: "setFeeFraction4Note", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: '', type: 'address' }, - { name: 'from', type: 'address' }, - { name: 'to', type: 'address' }, - { name: 'amount', type: 'uint256' }, - { name: 'userData', type: 'bytes' }, - { name: 'operatorData', type: 'bytes' }, + { name: "", type: "address" }, + { name: "from", type: "address" }, + { name: "to", type: "address" }, + { name: "amount", type: "uint256" }, + { name: "userData", type: "bytes" }, + { name: "operatorData", type: "bytes" }, ], - name: 'tokensReceived', + name: "tokensReceived", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, -] as const -export type TipsWithFee = typeof tipsWithFee +] as const; +export type TipsWithFee = typeof tipsWithFee; diff --git a/src/contract/abi/tips.ts b/src/contract/abi/tips.ts index 46e21e18d..c00ff09fc 100644 --- a/src/contract/abi/tips.ts +++ b/src/contract/abi/tips.ts @@ -1,82 +1,82 @@ export const tips = [ - { inputs: [], name: 'ErrCallerNotCharacterOwner', type: 'error' }, + { inputs: [], name: "ErrCallerNotCharacterOwner", type: "error" }, { - inputs: [{ indexed: false, name: 'version', type: 'uint8' }], - name: 'Initialized', - type: 'event', + inputs: [{ indexed: false, name: "version", type: "uint8" }], + name: "Initialized", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'toCharacterId', type: 'uint256' }, - { indexed: false, name: 'token', type: 'address' }, - { indexed: false, name: 'amount', type: 'uint256' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "toCharacterId", type: "uint256" }, + { indexed: false, name: "token", type: "address" }, + { indexed: false, name: "amount", type: "uint256" }, ], - name: 'TipCharacter', - type: 'event', + name: "TipCharacter", + type: "event", }, { inputs: [ - { indexed: true, name: 'fromCharacterId', type: 'uint256' }, - { indexed: true, name: 'toCharacterId', type: 'uint256' }, - { indexed: true, name: 'toNoteId', type: 'uint256' }, - { indexed: false, name: 'token', type: 'address' }, - { indexed: false, name: 'amount', type: 'uint256' }, + { indexed: true, name: "fromCharacterId", type: "uint256" }, + { indexed: true, name: "toCharacterId", type: "uint256" }, + { indexed: true, name: "toNoteId", type: "uint256" }, + { indexed: false, name: "token", type: "address" }, + { indexed: false, name: "amount", type: "uint256" }, ], - name: 'TipCharacterForNote', - type: 'event', + name: "TipCharacterForNote", + type: "event", }, { inputs: [], - name: 'ERC1820_REGISTRY', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "ERC1820_REGISTRY", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'TOKENS_RECIPIENT_INTERFACE_HASH', - outputs: [{ name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', + name: "TOKENS_RECIPIENT_INTERFACE_HASH", + outputs: [{ name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'getToken', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "getToken", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [], - name: 'getWeb3Entry', - outputs: [{ name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', + name: "getWeb3Entry", + outputs: [{ name: "", type: "address" }], + stateMutability: "view", + type: "function", }, { inputs: [ - { name: 'web3Entry_', type: 'address' }, - { name: 'token_', type: 'address' }, + { name: "web3Entry_", type: "address" }, + { name: "token_", type: "address" }, ], - name: 'initialize', + name: "initialize", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, { inputs: [ - { name: '', type: 'address' }, - { name: 'from', type: 'address' }, - { name: 'to', type: 'address' }, - { name: 'amount', type: 'uint256' }, - { name: 'userData', type: 'bytes' }, - { name: 'operatorData', type: 'bytes' }, + { name: "", type: "address" }, + { name: "from", type: "address" }, + { name: "to", type: "address" }, + { name: "amount", type: "uint256" }, + { name: "userData", type: "bytes" }, + { name: "operatorData", type: "bytes" }, ], - name: 'tokensReceived', + name: "tokensReceived", outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: "nonpayable", + type: "function", }, -] as const -export type Tips = typeof tips +] as const; +export type Tips = typeof tips; diff --git a/src/contract/contract.ts b/src/contract/contract.ts index 0789c228a..47ff14fb0 100644 --- a/src/contract/contract.ts +++ b/src/contract/contract.ts @@ -1,5 +1,5 @@ -import { type EIP1193Provider } from 'eip1193-types' -import { type Hex } from 'viem' +import type { EIP1193Provider } from "eip1193-types"; +import type { Hex } from "viem"; import { BaseContract, CbtContract, @@ -13,8 +13,8 @@ import { OperatorContract, RevisionContract, TipsContract, -} from './subcontracts' -import { TipsWithFeeContract } from './subcontracts/tips_with_fee' +} from "./subcontracts"; +import { TipsWithFeeContract } from "./subcontracts/tips_with_fee"; /** * This class is used to interact with the contract. @@ -42,17 +42,17 @@ import { TipsWithFeeContract } from './subcontracts/tips_with_fee' * ``` */ export class Contract extends BaseContract { - csb = new CsbContract(this) - character = new CharacterContract(this) - link = new LinkContract(this) - cbt = new CbtContract(this) - note = new NoteContract(this) - operator = new OperatorContract(this) - tips = new TipsContract(this) - tipsWithFee = new TipsWithFeeContract(this) - revision = new RevisionContract(this) - linkModule = new LinkModuleContract(this) - mintModule = new MintModuleContract(this) + csb = new CsbContract(this); + character = new CharacterContract(this); + link = new LinkContract(this); + cbt = new CbtContract(this); + note = new NoteContract(this); + operator = new OperatorContract(this); + tips = new TipsContract(this); + tipsWithFee = new TipsWithFeeContract(this); + revision = new RevisionContract(this); + linkModule = new LinkModuleContract(this); + mintModule = new MintModuleContract(this); } /** @@ -84,5 +84,5 @@ export function createContract( providerOrPrivateKey?: Hex | EIP1193Provider, options?: Partial, ) { - return new Contract(providerOrPrivateKey, options) + return new Contract(providerOrPrivateKey, options); } diff --git a/src/contract/decorators/index.ts b/src/contract/decorators/index.ts index a2ad20ab3..61249c936 100644 --- a/src/contract/decorators/index.ts +++ b/src/contract/decorators/index.ts @@ -1,5 +1,5 @@ -import type { BaseContract } from '../../contract/subcontracts/base' -import { warn } from '../../utils/logger' +import type { BaseContract } from "../../contract/subcontracts/base"; +import { warn } from "../../utils/logger"; // TODO: refactor this to ES standard decorator // Wait for esbuild @@ -11,33 +11,33 @@ export function autoSwitchMainnet() { (this: { base: BaseContract }, ...args: any[]) => Promise >, ) => { - const originalMethod = descriptor.value + const originalMethod = descriptor.value; descriptor.value = async function (...args: any[]) { const checkAndSwitch = async () => { - const walletClient = this.base.walletClient - if (!walletClient) return - const currentChainId = await walletClient.getChainId() - const targetChainId = this.base.walletClient.chain.id - const isCorrectChain = currentChainId === targetChainId + const walletClient = this.base.walletClient; + if (!walletClient) return; + const currentChainId = await walletClient.getChainId(); + const targetChainId = this.base.walletClient.chain.id; + const isCorrectChain = currentChainId === targetChainId; if (!isCorrectChain) { warn( "You're not on the crossbell chain. Switching to crossbell chain.", - ) - await walletClient.switchChain({ id: targetChainId }) + ); + await walletClient.switchChain({ id: targetChainId }); } - } + }; try { - await checkAndSwitch() + await checkAndSwitch(); } catch { // we may need to connect again if the user switch network on the halfway - await checkAndSwitch() + await checkAndSwitch(); } - return originalMethod?.apply(this, args) - } + return originalMethod?.apply(this, args); + }; - return descriptor - } + return descriptor; + }; } diff --git a/src/contract/index.ts b/src/contract/index.ts index 9d14bd2e8..8e95389a7 100644 --- a/src/contract/index.ts +++ b/src/contract/index.ts @@ -1,5 +1,5 @@ -export * from './contract' +export * from "./contract"; export type { ContractOptions, ResolvedContractOptions, -} from './subcontracts/base' +} from "./subcontracts/base"; diff --git a/src/contract/subcontracts/base.ts b/src/contract/subcontracts/base.ts index ae125ab37..de9bd7788 100644 --- a/src/contract/subcontracts/base.ts +++ b/src/contract/subcontracts/base.ts @@ -1,4 +1,4 @@ -import type { EIP1193Provider } from 'eip1193-types' +import type { EIP1193Provider } from "eip1193-types"; import { type Account, type Address, @@ -10,31 +10,31 @@ import { type WalletClient, erc20Abi, getContract, -} from 'viem' -import { privateKeyToAccount } from 'viem/accounts' -import { CONTRACT_ADDRESS, crossbell, crossbellTestnet } from '../../network' -import type { Overwrite } from '../../types' -import { nonceManager } from '../../utils/nonce-manager' +} from "viem"; +import { privateKeyToAccount } from "viem/accounts"; +import { CONTRACT_ADDRESS, crossbell, crossbellTestnet } from "../../network"; +import type { Overwrite } from "../../types"; +import { nonceManager } from "../../utils/nonce-manager"; import { addressToAccount, createPublicClientFromChain, createWalletClientFromPrivateKeyAccount, createWalletClientFromProvider, getProviderAccount, -} from '../../utils/viem' -import * as Abi from '../abi' +} from "../../utils/viem"; +import * as Abi from "../abi"; export interface AddressOptions { - entry: Address - periphery: Address - cbt: Address - newbieVilla: Address - tips: Address - tipsWithConfig: Address - tipsWithFee: Address - mira: Address - linklist: Address - gcsb: Address + entry: Address; + periphery: Address; + cbt: Address; + newbieVilla: Address; + tips: Address; + tipsWithConfig: Address; + tipsWithFee: Address; + mira: Address; + linklist: Address; + gcsb: Address; } export interface ContractOptions { @@ -46,7 +46,7 @@ export interface ContractOptions { * - If the `providerOrPrivateKey` is a provider, the account is the first account in the provider. * **The change of this option will only affect in this case**. */ - account?: Account | Address + account?: Account | Address; /** * The contract addresses. @@ -67,7 +67,7 @@ export interface ContractOptions { * gcsb: '0x4200000000000000000000000000000000000301', *} */ - contractAddresses?: Partial + contractAddresses?: Partial; /** * Gas price for transaction costs. @@ -84,7 +84,7 @@ export interface ContractOptions { * @default 10n ** 9n * */ - gasPrice?: 'estimate' | bigint + gasPrice?: "estimate" | bigint; /** * Whether to use $gCSB as gas. @@ -102,7 +102,7 @@ export interface ContractOptions { * * @default 'asDefault' */ - gCsbAsGas?: boolean | 'asDefault' + gCsbAsGas?: boolean | "asDefault"; /** * The chain to connect to. @@ -114,7 +114,7 @@ export interface ContractOptions { * * @default 'mainnet' */ - chain?: 'mainnet' | 'testnet' | Chain + chain?: "mainnet" | "testnet" | Chain; /** * The RPC URL to connect to. @@ -123,92 +123,92 @@ export interface ContractOptions { * * @default chain.rpcUrls.default.http[0] */ - rpcUrl?: string + rpcUrl?: string; } export type ResolvedContractOptions = Overwrite< Required, { contractAddresses: AddressOptions; chain: Chain } -> +>; export class BaseContract { - publicClient!: PublicClient - walletClient!: WalletClient - #account: Account | undefined + publicClient!: PublicClient; + walletClient!: WalletClient; + #account: Account | undefined; get account(): Account { - return this.#account as Account + return this.#account as Account; } set account(value: Address | Account) { - this.#account = typeof value === 'string' ? addressToAccount(value) : value - if (this.walletClient) this.walletClient.account = this.#account + this.#account = typeof value === "string" ? addressToAccount(value) : value; + if (this.walletClient) this.walletClient.account = this.#account; } - options: ResolvedContractOptions + options: ResolvedContractOptions; contract!: GetContractReturnType< Abi.Entry, { - public: typeof BaseContract.prototype.publicClient - wallet: typeof BaseContract.prototype.walletClient + public: typeof BaseContract.prototype.publicClient; + wallet: typeof BaseContract.prototype.walletClient; } - > + >; linklistContract!: GetContractReturnType< Abi.Linklist, { - public: typeof BaseContract.prototype.publicClient - wallet: typeof BaseContract.prototype.walletClient + public: typeof BaseContract.prototype.publicClient; + wallet: typeof BaseContract.prototype.walletClient; } - > + >; newbieVillaContract!: GetContractReturnType< Abi.NewbieVilla, { - public: typeof BaseContract.prototype.publicClient - wallet: typeof BaseContract.prototype.walletClient + public: typeof BaseContract.prototype.publicClient; + wallet: typeof BaseContract.prototype.walletClient; } - > + >; peripheryContract!: GetContractReturnType< Abi.Periphery, { - public: typeof BaseContract.prototype.publicClient - wallet: typeof BaseContract.prototype.walletClient + public: typeof BaseContract.prototype.publicClient; + wallet: typeof BaseContract.prototype.walletClient; } - > + >; cbtContract!: GetContractReturnType< Abi.Cbt, { - public: typeof BaseContract.prototype.publicClient - wallet: typeof BaseContract.prototype.walletClient + public: typeof BaseContract.prototype.publicClient; + wallet: typeof BaseContract.prototype.walletClient; } - > + >; miraContract!: GetContractReturnType< Abi.Mira, { - public: typeof BaseContract.prototype.publicClient - wallet: typeof BaseContract.prototype.walletClient + public: typeof BaseContract.prototype.publicClient; + wallet: typeof BaseContract.prototype.walletClient; } - > + >; tipsContract!: GetContractReturnType< Abi.Tips, { - public: typeof BaseContract.prototype.publicClient - wallet: typeof BaseContract.prototype.walletClient + public: typeof BaseContract.prototype.publicClient; + wallet: typeof BaseContract.prototype.walletClient; } - > + >; tipsWithConfigContract!: GetContractReturnType< Abi.TipsWithConfig, { - public: typeof BaseContract.prototype.publicClient - wallet: typeof BaseContract.prototype.walletClient + public: typeof BaseContract.prototype.publicClient; + wallet: typeof BaseContract.prototype.walletClient; } - > + >; tipsWithFeeContract!: GetContractReturnType< Abi.TipsWithFee, { - public: typeof BaseContract.prototype.publicClient - wallet: typeof BaseContract.prototype.walletClient + public: typeof BaseContract.prototype.publicClient; + wallet: typeof BaseContract.prototype.walletClient; } - > + >; /** * This creates a new Contract instance to interact with. @@ -239,25 +239,25 @@ export class BaseContract { providerOrPrivateKey: Hex | EIP1193Provider | undefined, options?: Partial, ) { - this.options = this.#resolveOptions(options) + this.options = this.#resolveOptions(options); - this.#initPublicClient() - this.#initWalletClient(providerOrPrivateKey) + this.#initPublicClient(); + this.#initWalletClient(providerOrPrivateKey); - this.#initContract() + this.#initContract(); } #resolveOptions(options?: ContractOptions): ResolvedContractOptions { const chain = - options?.chain === 'mainnet' + options?.chain === "mainnet" ? crossbell - : options?.chain === 'testnet' + : options?.chain === "testnet" ? crossbellTestnet - : options?.chain ?? crossbell + : (options?.chain ?? crossbell); return { account: this.account, gasPrice: options?.gasPrice ?? 10n ** 9n, - gCsbAsGas: options?.gCsbAsGas ?? 'asDefault', + gCsbAsGas: options?.gCsbAsGas ?? "asDefault", contractAddresses: { entry: CONTRACT_ADDRESS.ENTRY, periphery: CONTRACT_ADDRESS.PERIPHERY, @@ -273,47 +273,47 @@ export class BaseContract { }, chain, rpcUrl: options?.rpcUrl ?? chain.rpcUrls.default.http[0], - } + }; } #initPublicClient() { this.publicClient = createPublicClientFromChain( this.options.chain, this.options.rpcUrl, - ) + ); } #initWalletClient(providerOrPrivateKey: Hex | EIP1193Provider | undefined) { - if (typeof providerOrPrivateKey === 'string') { + if (typeof providerOrPrivateKey === "string") { // private key const privateKeyAccount = privateKeyToAccount(providerOrPrivateKey, { nonceManager: nonceManager, - }) - this.#account = privateKeyAccount + }); + this.#account = privateKeyAccount; this.walletClient = createWalletClientFromPrivateKeyAccount( privateKeyAccount, this.options.chain, this.options.rpcUrl, - ) + ); } else if ( providerOrPrivateKey && - typeof providerOrPrivateKey === 'object' + typeof providerOrPrivateKey === "object" ) { // provider - const provider = providerOrPrivateKey + const provider = providerOrPrivateKey; this.#account = this.options.account ? addressToAccount(this.options.account) - : getProviderAccount(provider) + : getProviderAccount(provider); if (!this.options?.account) { - provider.on('accountsChanged', (accounts) => { - this.account = accounts[0] - }) + provider.on("accountsChanged", (accounts) => { + this.account = accounts[0]; + }); } this.walletClient = createWalletClientFromProvider( provider, this.account, this.options.chain, - ) + ); } } @@ -327,7 +327,7 @@ export class BaseContract { wallet: this.walletClient, }, }), - ) + ); this.linklistContract = this.#proxyContract( getContract({ address: this.options.contractAddresses.linklist, @@ -337,7 +337,7 @@ export class BaseContract { wallet: this.walletClient, }, }), - ) + ); this.newbieVillaContract = this.#proxyContract( getContract({ address: this.options.contractAddresses.newbieVilla, @@ -347,7 +347,7 @@ export class BaseContract { wallet: this.walletClient, }, }), - ) + ); this.peripheryContract = this.#proxyContract( getContract({ address: this.options.contractAddresses.periphery, @@ -357,7 +357,7 @@ export class BaseContract { wallet: this.walletClient, }, }), - ) + ); this.cbtContract = this.#proxyContract( getContract({ address: this.options.contractAddresses.cbt, @@ -367,7 +367,7 @@ export class BaseContract { wallet: this.walletClient, }, }), - ) + ); this.miraContract = this.#proxyContract( getContract({ address: this.options.contractAddresses.mira, @@ -377,7 +377,7 @@ export class BaseContract { wallet: this.walletClient, }, }), - ) + ); this.tipsContract = this.#proxyContract( getContract({ address: this.options.contractAddresses.tips, @@ -387,7 +387,7 @@ export class BaseContract { wallet: this.walletClient, }, }), - ) + ); this.tipsWithConfigContract = this.#proxyContract( getContract({ address: this.options.contractAddresses.tipsWithConfig, @@ -397,7 +397,7 @@ export class BaseContract { wallet: this.walletClient, }, }), - ) + ); this.tipsWithFeeContract = this.#proxyContract( getContract({ address: this.options.contractAddresses.tipsWithFee, @@ -407,18 +407,18 @@ export class BaseContract { wallet: this.walletClient, }, }), - ) + ); } async #hasEnoughGCsb() { const balance = await this.publicClient.readContract({ abi: erc20Abi, - functionName: 'balanceOf', + functionName: "balanceOf", args: [this.account.address], address: this.options.contractAddresses.gcsb, - }) + }); - return balance >= 10n ** 18n + return balance >= 10n ** 18n; } #proxyContract(contract: T): T { @@ -427,42 +427,42 @@ export class BaseContract { get: (...args) => { return new Proxy(Reflect.get(...args), { apply: async (target, thisArg, argArray) => { - const hasArgs = argArray.length > 0 && Array.isArray(argArray[0]) + const hasArgs = argArray.length > 0 && Array.isArray(argArray[0]); const options = { ...((hasArgs ? argArray[1] : argArray[0]) ?? {}), - } + }; if (this.options.chain.id === crossbellTestnet.id) { // calculate L2 gas price if (!options.gasPrice) { - if (typeof this.options.gasPrice === 'bigint') { - options.gasPrice = this.options.gasPrice + if (typeof this.options.gasPrice === "bigint") { + options.gasPrice = this.options.gasPrice; } if (this.options.gCsbAsGas === true) { - options.gasPrice = 0n + options.gasPrice = 0n; } else if (this.options.gCsbAsGas === false) { // do nothing - } else if (this.options.gCsbAsGas === 'asDefault') { + } else if (this.options.gCsbAsGas === "asDefault") { if (await this.#hasEnoughGCsb()) { - options.gasPrice = 0n + options.gasPrice = 0n; } } } } else { // mainnet // TODO: remove this once our mainnet is on L2 - if (typeof this.options.gasPrice === 'bigint') { - options.gasPrice = this.options.gasPrice + if (typeof this.options.gasPrice === "bigint") { + options.gasPrice = this.options.gasPrice; } } - argArray[hasArgs ? 1 : 0] = options + argArray[hasArgs ? 1 : 0] = options; - return Reflect.apply(target, thisArg, argArray) + return Reflect.apply(target, thisArg, argArray); }, - }) + }); }, - }) - return contract + }); + return contract; } } diff --git a/src/contract/subcontracts/cbt.ts b/src/contract/subcontracts/cbt.ts index d184cd8b9..5414df11a 100644 --- a/src/contract/subcontracts/cbt.ts +++ b/src/contract/subcontracts/cbt.ts @@ -1,13 +1,13 @@ -import { - type Numberish, - type ReadOverrides, - type Result, - type WriteOverrides, -} from '../../types' -import { waitForTransactionReceiptWithRetry } from '../../utils/viem' -import { type Cbt } from '../abi' -import { autoSwitchMainnet } from '../decorators' -import { type BaseContract } from './base' +import type { + Numberish, + ReadOverrides, + Result, + WriteOverrides, +} from "../../types"; +import { waitForTransactionReceiptWithRetry } from "../../utils/viem"; +import type { Cbt } from "../abi"; +import { autoSwitchMainnet } from "../decorators"; +import type { BaseContract } from "./base"; export class CbtContract { constructor(private base: BaseContract) {} @@ -25,26 +25,26 @@ export class CbtContract { tokenId, }: { /** The id of the character. */ - characterId: Numberish + characterId: Numberish; /** The id of the token. */ - tokenId: Numberish + tokenId: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.cbtContract.write.mint( [BigInt(characterId), BigInt(tokenId)], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -60,26 +60,26 @@ export class CbtContract { uri, }: { /** The id of the token.*/ - tokenId: Numberish + tokenId: Numberish; /** The URI of the token. */ - uri: string + uri: string; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.cbtContract.write.setTokenURI( [BigInt(tokenId), uri], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -92,17 +92,17 @@ export class CbtContract { tokenId, }: { /** The id of the token. */ - tokenId: Numberish + tokenId: Numberish; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const uri = await this.base.cbtContract.read.uri( [BigInt(tokenId)], overrides, - ) + ); return { data: uri, - } + }; } } diff --git a/src/contract/subcontracts/character.ts b/src/contract/subcontracts/character.ts index e89f02e1e..5bdf497d7 100644 --- a/src/contract/subcontracts/character.ts +++ b/src/contract/subcontracts/character.ts @@ -1,22 +1,22 @@ -import { type Address } from 'viem' -import { ipfsParseMetadataOrUri, ipfsUriToMetadata } from '../../ipfs' -import { - type Character, - type CharacterMetadata, - type MintOrLinkModuleConfig, - type Numberish, - type ReadOverrides, - type Result, - type WriteOverrides, -} from '../../types' -import { validateAddress } from '../../utils/address' -import { getModuleConfig } from '../../utils/module' -import { normalizeCharacterMetadata } from '../../utils/normalize-character-metadata' -import { validateHandleFormat } from '../../utils/validate-handle' -import { parseLog, waitForTransactionReceiptWithRetry } from '../../utils/viem' -import { type Entry, type NewbieVilla } from '../abi' -import { autoSwitchMainnet } from '../decorators' -import { type BaseContract } from './base' +import type { Address } from "viem"; +import { ipfsParseMetadataOrUri, ipfsUriToMetadata } from "../../ipfs"; +import type { + Character, + CharacterMetadata, + MintOrLinkModuleConfig, + Numberish, + ReadOverrides, + Result, + WriteOverrides, +} from "../../types"; +import { validateAddress } from "../../utils/address"; +import { getModuleConfig } from "../../utils/module"; +import { normalizeCharacterMetadata } from "../../utils/normalize-character-metadata"; +import { validateHandleFormat } from "../../utils/validate-handle"; +import { parseLog, waitForTransactionReceiptWithRetry } from "../../utils/viem"; +import type { Entry, NewbieVilla } from "../abi"; +import { autoSwitchMainnet } from "../decorators"; +import type { BaseContract } from "./base"; export class CharacterContract { constructor(private base: BaseContract) {} @@ -36,26 +36,26 @@ export class CharacterContract { linkModule, }: { /** The Ethereum address of the character owner. */ - owner: Address + owner: Address; /** The handle of the character you want to create. */ - handle: string + handle: string; /** The metadata or URI of the character. */ - metadataOrUri: CharacterMetadata | string - linkModule?: MintOrLinkModuleConfig + metadataOrUri: CharacterMetadata | string; + linkModule?: MintOrLinkModuleConfig; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - validateAddress(owner) + validateAddress(owner); const { valid, message } = validateHandleFormat(handle, { disallowAddress: true, - }) + }); if (!valid) { - throw new TypeError(message) + throw new TypeError(message); } - const { uri } = await ipfsParseMetadataOrUri('character', metadataOrUri) + const { uri } = await ipfsParseMetadataOrUri("character", metadataOrUri); - const moduleConfig = await getModuleConfig(linkModule) + const moduleConfig = await getModuleConfig(linkModule); const hash = await this.base.contract.write.createCharacter( [ @@ -68,19 +68,19 @@ export class CharacterContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const parser = parseLog(receipt.logs, 'CharacterCreated') + const parser = parseLog(receipt.logs, "CharacterCreated"); return { data: parser.args.characterId, transactionHash: receipt.transactionHash, - } + }; } /** @@ -95,31 +95,31 @@ export class CharacterContract { handle, }: { /** The character ID of the user you want to set the handle for. */ - characterId: Numberish + characterId: Numberish; /** The handle you want to set. */ - handle: string + handle: string; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const { valid, message } = validateHandleFormat(handle, { disallowAddress: true, - }) + }); if (!valid) { - throw new TypeError(message) + throw new TypeError(message); } const hash = await this.base.contract.write.setHandle( [BigInt(characterId), handle], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -134,26 +134,26 @@ export class CharacterContract { metadataOrUri, }: { /** The character ID of the user you want to set the URI for. */ - characterId: Numberish + characterId: Numberish; /** The metadata or URI you want to set. */ - metadataOrUri: CharacterMetadata | string + metadataOrUri: CharacterMetadata | string; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const { uri, metadata } = await ipfsParseMetadataOrUri( - 'character', + "character", metadataOrUri, true, - ) + ); const hash = await this.base.contract.write.setCharacterUri( [BigInt(characterId), uri], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: { @@ -161,7 +161,7 @@ export class CharacterContract { metadata, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -173,12 +173,12 @@ export class CharacterContract { characterId, metadata, }: { - characterId: Numberish - metadata: CharacterMetadata + characterId: Numberish; + metadata: CharacterMetadata; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ) { - return this.setUri({ characterId, metadataOrUri: metadata }, overrides) + return this.setUri({ characterId, metadataOrUri: metadata }, overrides); } /** @@ -223,25 +223,25 @@ export class CharacterContract { characterId, modifier, }: { - characterId: Numberish - modifier: (metadata?: CharacterMetadata) => CharacterMetadata + characterId: Numberish; + modifier: (metadata?: CharacterMetadata) => CharacterMetadata; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ) { - const character = await this.get({ characterId }) + const character = await this.get({ characterId }); - const metadata = modifier(character.data.metadata) - if (typeof metadata === 'undefined') { + const metadata = modifier(character.data.metadata); + if (typeof metadata === "undefined") { throw new TypeError( - 'The modified metadata is undefined. Did you return it?', - ) + "The modified metadata is undefined. Did you return it?", + ); } if (!metadata.type) { - metadata.type = 'character' + metadata.type = "character"; } - return this.setMetadata({ characterId, metadata }, overrides) + return this.setMetadata({ characterId, metadata }, overrides); } /** @@ -256,24 +256,24 @@ export class CharacterContract { socialToken, }: { /** The character ID of the user you want to set the social token for. */ - characterId: Numberish + characterId: Numberish; /** The token address you want to set for the character. */ - socialToken: Address + socialToken: Address; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.setSocialToken( [BigInt(characterId), socialToken], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -287,22 +287,22 @@ export class CharacterContract { characterId, }: { /** The character ID of the character you want to set as primary. */ - characterId: Numberish + characterId: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.setPrimaryCharacterId( [BigInt(characterId)], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -316,24 +316,24 @@ export class CharacterContract { characterId, }: { /** The character ID of the character you want to burn. */ - characterId: Numberish + characterId: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.burn( [BigInt(characterId)], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -353,34 +353,34 @@ export class CharacterContract { * * Default is The address of the current wallet. **/ - fromAddress?: Address + fromAddress?: Address; /** The address of the user that will receive the character. */ - toAddress: Address + toAddress: Address; /** The character ID of the character you want to transfer. */ - characterId: Numberish + characterId: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - validateAddress(toAddress) + validateAddress(toAddress); - const owner = fromAddress ?? this.base.walletClient.account.address + const owner = fromAddress ?? this.base.walletClient.account.address; - validateAddress(owner) + validateAddress(owner); const hash = await this.base.contract.write.safeTransferFrom( [owner, toAddress, BigInt(characterId)], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -393,20 +393,20 @@ export class CharacterContract { address, }: { /** The address of the user you want to get the primary character ID for. */ - address: Address + address: Address; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { - validateAddress(address) + validateAddress(address); const characterId = await this.base.contract.read.getPrimaryCharacterId( [address], overrides, - ) + ); return { data: characterId, - } + }; } /** @@ -419,17 +419,17 @@ export class CharacterContract { /** The character ID of the character you want to check. */ characterId, }: { - characterId: Numberish + characterId: Numberish; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const isPrimary = await this.base.contract.read.isPrimaryCharacter( [BigInt(characterId)], overrides, - ) + ); return { data: isPrimary, - } + }; } /** @@ -442,27 +442,27 @@ export class CharacterContract { handle, }: { /** The handle of the character you want to get the content of. */ - handle: string + handle: string; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { - const validates = validateHandleFormat(handle) + const validates = validateHandleFormat(handle); if (!validates.valid) { - throw new TypeError(validates.message) + throw new TypeError(validates.message); } - handle = handle.toLowerCase() + handle = handle.toLowerCase(); const character = await this.base.contract.read.getCharacterByHandle( [handle], overrides, - ) + ); const metadata = normalizeCharacterMetadata( character.uri ? await ipfsUriToMetadata(character.uri) : undefined, - ) + ); return { data: { @@ -473,7 +473,7 @@ export class CharacterContract { socialToken: character.socialToken, noteCount: character.noteCount, }, - } + }; } /** @@ -486,20 +486,20 @@ export class CharacterContract { characterId, }: { /** The character ID of the character you want to get. */ - characterId: Numberish + characterId: Numberish; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const character = await this.base.contract.read.getCharacter( [BigInt(characterId)], overrides, - ) + ); const { metadata } = await ipfsParseMetadataOrUri( - 'character', + "character", character.uri, true, - ) + ); return { data: { @@ -510,7 +510,7 @@ export class CharacterContract { noteCount: character.noteCount, metadata, }, - } + }; } /** @@ -523,17 +523,17 @@ export class CharacterContract { characterId, }: { /** The characterId of the character you want to get the handle for. */ - characterId: Numberish + characterId: Numberish; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const handle = await this.base.contract.read.getHandle( [BigInt(characterId)], overrides, - ) + ); return { data: handle, - } + }; } /** @@ -546,17 +546,17 @@ export class CharacterContract { characterId, }: { /** The character ID of the character you want to get the URI for. */ - characterId: Numberish + characterId: Numberish; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const uri = await this.base.contract.read.getCharacterUri( [BigInt(characterId)], overrides, - ) + ); return { data: uri, - } + }; } /** @@ -569,22 +569,22 @@ export class CharacterContract { txHash, }: { /** The transaction hash of the {@link create} transaction. */ - txHash: Address + txHash: Address; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, txHash, - ) + ); - const parser = parseLog(receipt.logs, 'CharacterCreated') + const parser = parseLog(receipt.logs, "CharacterCreated"); const result = await this.get( { characterId: parser.args.characterId }, overrides, - ) + ); - return result + return result; } /** @@ -597,20 +597,20 @@ export class CharacterContract { address, }: { /** The address of a user. */ - address: Address + address: Address; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { - validateAddress(address) + validateAddress(address); const characterId = await this.base.contract.read.getPrimaryCharacterId( [address], overrides, - ) + ); - const exists = characterId !== 0n + const exists = characterId !== 0n; return { data: exists, - } + }; } /** @@ -623,18 +623,18 @@ export class CharacterContract { handle, }: { /** The handle of a character. */ - handle: string + handle: string; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const data = await this.base.contract.read.getCharacterByHandle( [handle], overrides, - ) - const exists = data.handle !== '' + ); + const exists = data.handle !== ""; return { data: exists, - } + }; } /** @@ -652,43 +652,43 @@ export class CharacterContract { proof, }: { /** The address of the user that will receive the character. */ - toAddress: Address + toAddress: Address; /** The character ID of the character you want to withdraw. */ - characterId: Numberish + characterId: Numberish; /** The nonce given from the server. */ - nonce: Numberish + nonce: Numberish; /** The expiration time given from the server. */ - expires: Numberish + expires: Numberish; /** The proof given from the server. */ - proof: Address + proof: Address; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - validateAddress(toAddress) + validateAddress(toAddress); const hash = await this.base.newbieVillaContract.write.withdraw( [toAddress, BigInt(characterId), BigInt(nonce), BigInt(expires), proof], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } balanceOfNewbie( { characterId }: { characterId: Numberish }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ) { return this.base.newbieVillaContract.read.balanceOf( [BigInt(characterId)], overrides, - ) + ); } } diff --git a/src/contract/subcontracts/csb.ts b/src/contract/subcontracts/csb.ts index c031b7e9c..2012272de 100644 --- a/src/contract/subcontracts/csb.ts +++ b/src/contract/subcontracts/csb.ts @@ -1,9 +1,9 @@ -import { type Address, type Hex } from 'viem' -import { type Numberish, type Result } from '../../types' -import { validateAddress } from '../../utils/address' -import { waitForTransactionReceiptWithRetry } from '../../utils/viem' -import { autoSwitchMainnet } from '../decorators' -import { type BaseContract } from './base' +import type { Address, Hex } from "viem"; +import type { Numberish, Result } from "../../types"; +import { validateAddress } from "../../utils/address"; +import { waitForTransactionReceiptWithRetry } from "../../utils/viem"; +import { autoSwitchMainnet } from "../decorators"; +import type { BaseContract } from "./base"; export class CsbContract { constructor(private base: BaseContract) {} @@ -17,15 +17,15 @@ export class CsbContract { owner, }: { /** The address of the account to get the $CSB balance of. */ - owner: Address + owner: Address; }): Promise> { - validateAddress(owner) + validateAddress(owner); const balance = await this.base.publicClient.getBalance({ address: owner, - }) + }); return { data: balance, - } + }; } /** @@ -39,31 +39,31 @@ export class CsbContract { amount, }: { /** The address to send $CSB to. */ - toAddress: Hex + toAddress: Hex; /** The amount of $CSB to send. (in wei) */ - amount: Numberish + amount: Numberish; }): Promise, true>> { - validateAddress(toAddress) + validateAddress(toAddress); if (!this.base.walletClient) { throw new Error( - 'No walletClient found. You must be connected to a wallet to transfer $CSB. Currently You might be using a read-only provider.', - ) + "No walletClient found. You must be connected to a wallet to transfer $CSB. Currently You might be using a read-only provider.", + ); } const hash = await this.base.walletClient.sendTransaction({ account: this.base.account, to: toAddress, value: BigInt(amount), - }) + }); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: {}, transactionHash: receipt.transactionHash, - } + }; } } diff --git a/src/contract/subcontracts/index.ts b/src/contract/subcontracts/index.ts index 4e44109f5..407212ca8 100644 --- a/src/contract/subcontracts/index.ts +++ b/src/contract/subcontracts/index.ts @@ -1,11 +1,11 @@ -export * from './base' -export * from './csb' -export * from './link' -export * from './note' -export * from './character' -export * from './operator' -export * from './cbt' -export * from './tips' -export * from './revision' -export * from './link_module' -export * from './mint_module' +export * from "./base"; +export * from "./csb"; +export * from "./link"; +export * from "./note"; +export * from "./character"; +export * from "./operator"; +export * from "./cbt"; +export * from "./tips"; +export * from "./revision"; +export * from "./link_module"; +export * from "./mint_module"; diff --git a/src/contract/subcontracts/link.ts b/src/contract/subcontracts/link.ts index 3283f4b41..d1f392139 100644 --- a/src/contract/subcontracts/link.ts +++ b/src/contract/subcontracts/link.ts @@ -1,17 +1,17 @@ -import { type Address, type Hex, stringToHex } from 'viem' -import { - type Character, - type Numberish, - type ReadOverrides, - type Result, - type WriteOverrides, -} from '../../types' -import { NIL_ADDRESS, validateAddress } from '../../utils/address' -import { parseLog, waitForTransactionReceiptWithRetry } from '../../utils/viem' -import { type Entry, type Linklist, type Periphery } from '../abi' -import { autoSwitchMainnet } from '../decorators' -import { type BaseContract } from './base' -import { type CharacterContract } from './character' +import { type Address, type Hex, stringToHex } from "viem"; +import type { + Character, + Numberish, + ReadOverrides, + Result, + WriteOverrides, +} from "../../types"; +import { NIL_ADDRESS, validateAddress } from "../../utils/address"; +import { parseLog, waitForTransactionReceiptWithRetry } from "../../utils/viem"; +import type { Entry, Linklist, Periphery } from "../abi"; +import { autoSwitchMainnet } from "../decorators"; +import type { BaseContract } from "./base"; +import type { CharacterContract } from "./character"; export class LinkContract { constructor(private base: BaseContract & { character: CharacterContract }) {} @@ -30,15 +30,15 @@ export class LinkContract { data, }: { /** The character ID of the character that is linking to another character. Must be your own character, otherwise it will be rejected. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The character ID of the character you want to link to. */ - toCharacterId: Numberish + toCharacterId: Numberish; /** The type of link. */ - linkType: string + linkType: string; /** The data to be passed to the link module if the character has one. */ - data?: Hex + data?: Hex; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.linkCharacter( [ @@ -50,19 +50,19 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const parser = parseLog(receipt.logs, 'LinkCharacter') + const parser = parseLog(receipt.logs, "LinkCharacter"); return { data: parser.args.linklistId, transactionHash: receipt.transactionHash, - } + }; } /** @@ -83,19 +83,19 @@ export class LinkContract { data, }: { /** The character ID of the character that is linking to another character. Must be your own character, otherwise it will be rejected. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The character IDs of the character you want to link to. */ - toCharacterIds: Numberish[] + toCharacterIds: Numberish[]; /** The addresses of the characters you want to link to (who don't have a character). See more on {@link createThenLinkCharacter} */ - toAddresses: Address[] + toAddresses: Address[]; /** The type of link. */ - linkType: string + linkType: string; /** The data to be passed to the link module if the character has one. It should has the same length as `toCharacterIds`. */ - data?: Address[] + data?: Address[]; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - validateAddress(toAddresses) + validateAddress(toAddresses); const hash = await this.base.peripheryContract.write.linkCharactersInBatch( [ @@ -108,21 +108,21 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const log = parseLog(receipt.logs, 'LinkCharacter', { + const log = parseLog(receipt.logs, "LinkCharacter", { throwOnMultipleLogsFound: false, - }) + }); return { data: log.args.linklistId, transactionHash: receipt.transactionHash, - } + }; } /** @@ -134,14 +134,16 @@ export class LinkContract { hash, }: { /** The transaction hash of the transaction you want to get the linklist id of. */ - hash: Address + hash: Address; }): Promise> { - const receipt = await this.base.publicClient.getTransactionReceipt({ hash }) - const parser = parseLog(receipt.logs, 'LinkCharacter') + const receipt = await this.base.publicClient.getTransactionReceipt({ + hash, + }); + const parser = parseLog(receipt.logs, "LinkCharacter"); return { data: parser.args.linklistId, - } + }; } /** @@ -164,15 +166,15 @@ export class LinkContract { linkType, }: { /** The character ID of the character that is creating the new character. Must be your own character, otherwise it will be rejected. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The address of the character you want to link to. */ - toAddress: Address + toAddress: Address; /** The type of link you want to create. This is a string. */ - linkType: string + linkType: string; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - validateAddress(toAddress) + validateAddress(toAddress); const hash = await this.base.contract.write.createThenLinkCharacter( [ @@ -183,15 +185,15 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const createCharacterParser = parseLog(receipt.logs, 'CharacterCreated') - const linkCharacterParser = parseLog(receipt.logs, 'LinkCharacter') + const createCharacterParser = parseLog(receipt.logs, "CharacterCreated"); + const linkCharacterParser = parseLog(receipt.logs, "LinkCharacter"); return { data: { @@ -199,7 +201,7 @@ export class LinkContract { linklistId: linkCharacterParser.args.linklistId, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -215,13 +217,13 @@ export class LinkContract { linkType, }: { /** The character ID of the character that is linking to another character. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The character you want to link to. */ - toCharacterId: Numberish + toCharacterId: Numberish; /** The type of link. */ - linkType: string + linkType: string; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.unlinkCharacter( [ @@ -232,15 +234,15 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -272,22 +274,22 @@ export class LinkContract { linklistId, }: { /** The linklist ID of the linklist you want to get the linked characters from. */ - linklistId: Numberish + linklistId: Numberish; }, - overrides?: ReadOverrides, - ): Promise> + overrides?: ReadOverrides, + ): Promise>; async getLinkingCharacterIds( { fromCharacterId, linkType, }: { /** The character ID of the character you want to get the linked characters from. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The type of link you want to get. */ - linkType: string + linkType: string; }, - overrides?: ReadOverrides, - ): Promise> + overrides?: ReadOverrides, + ): Promise>; async getLinkingCharacterIds( { linklistId, @@ -295,38 +297,38 @@ export class LinkContract { linkType, }: | { - linklistId: never - fromCharacterId: Numberish - linkType: string + linklistId: never; + fromCharacterId: Numberish; + linkType: string; } | { - linklistId: Numberish - fromCharacterId: never - linkType: never + linklistId: Numberish; + fromCharacterId: never; + linkType: never; }, overrides: - | ReadOverrides - | ReadOverrides = {}, + | ReadOverrides + | ReadOverrides = {}, ): Promise> { if (linklistId) { const linklist = await this.base.linklistContract.read.getLinkingCharacterIds( [BigInt(linklistId)], overrides, - ) + ); return { data: linklist.map((link) => link), - } + }; } const linklist = await this.base.peripheryContract.read.getLinkingCharacterIds( [BigInt(fromCharacterId), stringToHex(linkType, { size: 32 })], overrides, - ) + ); return { data: linklist.map((link) => link), - } + }; } /** @@ -340,22 +342,22 @@ export class LinkContract { linkType, }: { /** The character ID of the character you want to get the linked characters from. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The type of link you want to get. */ - linkType: string + linkType: string; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const ids = await this.base.peripheryContract.read.getLinkingCharacterIds( [BigInt(fromCharacterId), stringToHex(linkType, { size: 32 })], overrides, - ) + ); const characters = await Promise.all( ids.map((ids) => this.base.character.get({ characterId: ids })), - ) + ); return { data: characters.map((character) => character.data), - } + }; } /** link address */ @@ -374,15 +376,15 @@ export class LinkContract { data = NIL_ADDRESS, }: { /** The character ID of the character that is linking to the address. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The address of the character you want to link to. */ - toAddress: Address + toAddress: Address; /** The type of link. */ - linkType: string + linkType: string; /** The data to be passed to the link module if the address has one. */ - data: Address + data: Address; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.linkAddress( [ @@ -394,19 +396,19 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const parser = parseLog(receipt.logs, 'LinkAddress') + const parser = parseLog(receipt.logs, "LinkAddress"); return { data: parser.args.linklistId, transactionHash: receipt.transactionHash, - } + }; } /** @@ -422,13 +424,13 @@ export class LinkContract { linkType, }: { /** The character ID of the character that is linking to another character. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The address you want to unlink from. */ - toAddress: Address + toAddress: Address; /** The type of link. */ - linkType: string + linkType: string; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.unlinkAddress( [ @@ -439,15 +441,15 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** link any */ @@ -466,15 +468,15 @@ export class LinkContract { data = NIL_ADDRESS, }: { /** The character ID of the character that is linking to the address. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The uri of the character you want to link to. */ - toUri: string + toUri: string; /** The type of link. */ - linkType: string + linkType: string; /** The data to be passed to the link module if the address has one. */ - data: Address + data: Address; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.linkAnyUri( [ @@ -486,19 +488,19 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const parser = parseLog(receipt.logs, 'LinkAnyUri') + const parser = parseLog(receipt.logs, "LinkAnyUri"); return { data: parser.args.linklistId, transactionHash: receipt.transactionHash, - } + }; } /** @@ -514,13 +516,13 @@ export class LinkContract { linkType, }: { /** The character ID of the character that is linking to another character. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The uri you want to unlink from. */ - toUri: string + toUri: string; /** The type of link. */ - linkType: string + linkType: string; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.unlinkAnyUri( [ @@ -531,15 +533,15 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** link ERC721 token */ @@ -559,17 +561,17 @@ export class LinkContract { data = NIL_ADDRESS, }: { /** The character ID of the character that is linking to the address. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The address of the ERC721 contract. */ - toContractAddress: Address + toContractAddress: Address; /** The token id of the ERC721 token. */ - toTokenId: Numberish + toTokenId: Numberish; /** The type of link. */ - linkType: string + linkType: string; /** The data to be passed to the link module if the address has one. */ - data: Address + data: Address; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.linkERC721( [ @@ -582,19 +584,19 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const parser = parseLog(receipt.logs, 'LinkAnyUri') + const parser = parseLog(receipt.logs, "LinkAnyUri"); return { data: parser.args.linklistId, transactionHash: receipt.transactionHash, - } + }; } /** @@ -611,15 +613,15 @@ export class LinkContract { linkType, }: { /** The character ID of the character that is linking to another character. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The address of the ERC721 contract. */ - toContractAddress: Address + toContractAddress: Address; /** The token id of the ERC721 token. */ - toTokenId: Numberish + toTokenId: Numberish; /** The type of link. */ - linkType: string + linkType: string; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.unlinkERC721( [ @@ -631,15 +633,15 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** link note */ @@ -659,17 +661,17 @@ export class LinkContract { data, }: { /** The character ID of the character that is linking to another note. Must be your own character, otherwise it will be rejected. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The character ID of the character you want to link to. */ - toCharacterId: Numberish + toCharacterId: Numberish; /** The note ID of the note you want to link to. */ - toNoteId: Numberish + toNoteId: Numberish; /** The type of link. */ - linkType: string + linkType: string; /** The data to be passed to the link module if the character has one. */ - data?: Address + data?: Address; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.linkNote( [ @@ -682,19 +684,19 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const parser = parseLog(receipt.logs, 'LinkNote') + const parser = parseLog(receipt.logs, "LinkNote"); return { data: parser.args.linklistId, transactionHash: receipt.transactionHash, - } + }; } /** @@ -711,15 +713,15 @@ export class LinkContract { linkType, }: { /** The character ID of the character that is linking to another note. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The character you want to unlink to. */ - toCharacterId: Numberish + toCharacterId: Numberish; /** The note ID of the note you want to unlink to. */ - toNoteId: Numberish + toNoteId: Numberish; /** The type of link. */ - linkType: string + linkType: string; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.unlinkNote( [ @@ -731,17 +733,17 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** link linklist */ @@ -760,15 +762,15 @@ export class LinkContract { data = NIL_ADDRESS, }: { /** The character ID of the character that is linking to another note. Must be your own character, otherwise it will be rejected. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The linklist ID of the linklist you want to link to. */ - toLinkListId: Numberish + toLinkListId: Numberish; /** The type of link. */ - linkType: string + linkType: string; /** The data to be passed to the link module if the character has one. */ - data: Address + data: Address; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.linkLinklist( [ @@ -780,19 +782,19 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const parser = parseLog(receipt.logs, 'LinkNote') + const parser = parseLog(receipt.logs, "LinkNote"); return { data: parser.args.linklistId, transactionHash: receipt.transactionHash, - } + }; } /** @@ -808,13 +810,13 @@ export class LinkContract { linkType, }: { /** The character ID of the character that is linking to another note. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The linklist ID of the linklist you want to unlink to. */ - toLinklistId: Numberish + toLinklistId: Numberish; /** The type of link. */ - linkType: string + linkType: string; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.unlinkLinklist( [ @@ -825,17 +827,17 @@ export class LinkContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -844,20 +846,20 @@ export class LinkContract { */ async setLinklistUri( { linklistId, uri }: { linklistId: Numberish; uri: string }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.setLinklistUri( [BigInt(linklistId), uri], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -866,15 +868,15 @@ export class LinkContract { */ async getLinklistUri( { linklistId }: { linklistId: string }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const uri = await this.base.contract.read.getLinklistUri( [BigInt(linklistId)], overrides, - ) + ); return { data: uri, - } + }; } /** @@ -883,20 +885,20 @@ export class LinkContract { */ async setLinklistType( { linklistId, linkType }: { linklistId: Numberish; linkType: string }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ) { const hash = await this.base.contract.write.setLinklistType( [BigInt(linklistId), stringToHex(linkType, { size: 32 })], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -909,21 +911,21 @@ export class LinkContract { linklistId, }: { /** The linklist ID of the linklist to burn. */ - linklistId: Numberish + linklistId: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.burnLinklist( [BigInt(linklistId)], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } } diff --git a/src/contract/subcontracts/link_module.ts b/src/contract/subcontracts/link_module.ts index f33d5f171..9f1959f28 100644 --- a/src/contract/subcontracts/link_module.ts +++ b/src/contract/subcontracts/link_module.ts @@ -1,14 +1,14 @@ -import { - type MintOrLinkModuleConfig, - type Numberish, - type Result, - type WriteOverrides, -} from '../../types' -import { getModuleConfig } from '../../utils/module' -import { waitForTransactionReceiptWithRetry } from '../../utils/viem' -import { type Entry } from '../abi' -import { autoSwitchMainnet } from '../decorators' -import { type BaseContract } from './base' +import type { + MintOrLinkModuleConfig, + Numberish, + Result, + WriteOverrides, +} from "../../types"; +import { getModuleConfig } from "../../utils/module"; +import { waitForTransactionReceiptWithRetry } from "../../utils/viem"; +import type { Entry } from "../abi"; +import { autoSwitchMainnet } from "../decorators"; +import type { BaseContract } from "./base"; export class LinkModuleContract { constructor(private base: BaseContract) {} @@ -25,13 +25,13 @@ export class LinkModuleContract { linkModule, }: { /** The character ID to set the link module for. */ - characterId: Numberish + characterId: Numberish; /** The link module to set. */ - linkModule: MintOrLinkModuleConfig + linkModule: MintOrLinkModuleConfig; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - const moduleConfig = await getModuleConfig(linkModule) + const moduleConfig = await getModuleConfig(linkModule); const hash = await this.base.contract.write.setLinkModule4Character( [ @@ -42,17 +42,17 @@ export class LinkModuleContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -68,15 +68,15 @@ export class LinkModuleContract { linkModule, }: { /** The character ID to set the link module for. */ - characterId: Numberish + characterId: Numberish; /** The note ID to set the link module for. */ - noteId: Numberish + noteId: Numberish; /** The link module to set. */ - linkModule: MintOrLinkModuleConfig + linkModule: MintOrLinkModuleConfig; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - const moduleConfig = await getModuleConfig(linkModule) + const moduleConfig = await getModuleConfig(linkModule); const hash = await this.base.contract.write.setLinkModule4Note( [ @@ -88,17 +88,17 @@ export class LinkModuleContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** diff --git a/src/contract/subcontracts/mint_module.ts b/src/contract/subcontracts/mint_module.ts index 5cb33e138..6c82e5b4d 100644 --- a/src/contract/subcontracts/mint_module.ts +++ b/src/contract/subcontracts/mint_module.ts @@ -1,14 +1,14 @@ -import { - type MintOrLinkModuleConfig, - type Numberish, - type Result, - type WriteOverrides, -} from '../../types' -import { getModuleConfig } from '../../utils/module' -import { waitForTransactionReceiptWithRetry } from '../../utils/viem' -import { type Entry } from '../abi' -import { autoSwitchMainnet } from '../decorators' -import { type BaseContract } from './base' +import type { + MintOrLinkModuleConfig, + Numberish, + Result, + WriteOverrides, +} from "../../types"; +import { getModuleConfig } from "../../utils/module"; +import { waitForTransactionReceiptWithRetry } from "../../utils/viem"; +import type { Entry } from "../abi"; +import { autoSwitchMainnet } from "../decorators"; +import type { BaseContract } from "./base"; export class MintModuleContract { constructor(private base: BaseContract) {} @@ -28,13 +28,13 @@ export class MintModuleContract { noteId, mintModule, }: { - characterId: Numberish - noteId: Numberish - mintModule: MintOrLinkModuleConfig + characterId: Numberish; + noteId: Numberish; + mintModule: MintOrLinkModuleConfig; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - const moduleConfig = await getModuleConfig(mintModule) + const moduleConfig = await getModuleConfig(mintModule); const hash = await this.base.contract.write.setMintModule4Note( [ @@ -46,16 +46,16 @@ export class MintModuleContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } } diff --git a/src/contract/subcontracts/note.ts b/src/contract/subcontracts/note.ts index 4079684ec..1b6ac009b 100644 --- a/src/contract/subcontracts/note.ts +++ b/src/contract/subcontracts/note.ts @@ -1,29 +1,29 @@ -import pLimit from 'p-limit' +import pLimit from "p-limit"; import { type Address, encodeFunctionData, encodePacked, hexToString, keccak256, -} from 'viem' -import { ipfsParseMetadataOrUri, ipfsUriToMetadata } from '../../ipfs' -import { - type LinkItemMap, - type LinkItemType, - type Note, - type NoteMetadata, - type Numberish, - type PostNoteOptions, - type ReadOverrides, - type Result, - type WriteOverrides, -} from '../../types' -import { NIL_ADDRESS, validateAddress } from '../../utils/address' -import { getModuleConfig } from '../../utils/module' -import { parseLog, waitForTransactionReceiptWithRetry } from '../../utils/viem' -import { type Entry, entry } from '../abi' -import { autoSwitchMainnet } from '../decorators' -import { type BaseContract } from './base' +} from "viem"; +import { ipfsParseMetadataOrUri, ipfsUriToMetadata } from "../../ipfs"; +import type { + LinkItemMap, + LinkItemType, + Note, + NoteMetadata, + Numberish, + PostNoteOptions, + ReadOverrides, + Result, + WriteOverrides, +} from "../../types"; +import { NIL_ADDRESS, validateAddress } from "../../utils/address"; +import { getModuleConfig } from "../../utils/module"; +import { parseLog, waitForTransactionReceiptWithRetry } from "../../utils/viem"; +import { type Entry, entry } from "../abi"; +import { autoSwitchMainnet } from "../decorators"; +import type { BaseContract } from "./base"; async function buildPostNoteData({ linkModule, @@ -32,9 +32,9 @@ async function buildPostNoteData({ metadataOrUri, locked = false, }: PostNoteOptions) { - const { uri } = await ipfsParseMetadataOrUri('note', metadataOrUri) - const linkModuleConfig = await getModuleConfig(linkModule) - const mintModuleConfig = await getModuleConfig(mintModule) + const { uri } = await ipfsParseMetadataOrUri("note", metadataOrUri); + const linkModuleConfig = await getModuleConfig(linkModule); + const mintModuleConfig = await getModuleConfig(mintModule); return { characterId: BigInt(characterId), @@ -44,7 +44,7 @@ async function buildPostNoteData({ mintModule: mintModuleConfig.address, mintModuleInitData: mintModuleConfig.initData, locked, - } + }; } export class NoteContract { @@ -58,24 +58,24 @@ export class NoteContract { @autoSwitchMainnet() async post( options: PostNoteOptions, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - const data = await buildPostNoteData(options) - const hash = await this.base.contract.write.postNote([data], overrides) + const data = await buildPostNoteData(options); + const hash = await this.base.contract.write.postNote([data], overrides); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const log = parseLog(receipt.logs, 'PostNote') + const log = parseLog(receipt.logs, "PostNote"); return { data: { noteId: log.args.noteId, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -91,15 +91,15 @@ export class NoteContract { notes: { // TODO: move to options /** The character ID of the owner who post this note. Must be your own character, otherwise it will be rejected. */ - characterId: Numberish + characterId: Numberish; /** The metadata or URI of the content you want to post. */ - metadataOrUri: NoteMetadata | string - options?: PostNoteOptions - }[] + metadataOrUri: NoteMetadata | string; + options?: PostNoteOptions; + }[]; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - const limitedPromise = pLimit(10) + const limitedPromise = pLimit(10); const encodedDataArr = await Promise.all( notes.map(({ options, characterId, metadataOrUri }) => { return limitedPromise(async () => { @@ -107,40 +107,40 @@ export class NoteContract { ...options, characterId, metadataOrUri, - }) + }); return encodeFunctionData({ abi: entry, - functionName: 'postNote', + functionName: "postNote", args: [data], - }) - }) + }); + }); }), - ) + ); const hash = await this.base.contract.write.multicall( [encodedDataArr], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const logs = parseLog(receipt.logs, 'PostNote', { + const logs = parseLog(receipt.logs, "PostNote", { throwOnMultipleLogsFound: false, returnMultipleLogs: true, - }) + }); - const noteIds = logs.map((log) => log.args.noteId) + const noteIds = logs.map((log) => log.args.noteId); return { data: { noteIds, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -155,30 +155,30 @@ export class NoteContract { ...options }: PostNoteOptions & { /** The target uri of the note. */ - targetUri: string + targetUri: string; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - const data = await buildPostNoteData(options) + const data = await buildPostNoteData(options); const hash = await this.base.contract.write.postNote4AnyUri( [data, targetUri], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const log = parseLog(receipt.logs, 'PostNote') + const log = parseLog(receipt.logs, "PostNote"); return { data: { noteId: log.args.noteId, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -194,12 +194,12 @@ export class NoteContract { ...options }: PostNoteOptions & { /** The target uri of the note. */ - targetCharacterId: Numberish - targetNoteId: Numberish + targetCharacterId: Numberish; + targetNoteId: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - const data = await buildPostNoteData(options) + const data = await buildPostNoteData(options); const hash = await this.base.contract.write.postNote4Note( [ data, @@ -209,21 +209,21 @@ export class NoteContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const log = parseLog(receipt.logs, 'PostNote') + const log = parseLog(receipt.logs, "PostNote"); return { data: { noteId: log.args.noteId, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -238,29 +238,29 @@ export class NoteContract { ...options }: PostNoteOptions & { /** The target characterId. */ - toCharacterId: Numberish + toCharacterId: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - const data = await buildPostNoteData(options) + const data = await buildPostNoteData(options); const hash = await this.base.contract.write.postNote4Character( [data, BigInt(toCharacterId)], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const log = parseLog(receipt.logs, 'PostNote') + const log = parseLog(receipt.logs, "PostNote"); return { data: { noteId: log.args.noteId, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -275,29 +275,29 @@ export class NoteContract { ...options }: PostNoteOptions & { /** The target linklistId. */ - toLinklistId: Numberish + toLinklistId: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - const data = await buildPostNoteData(options) + const data = await buildPostNoteData(options); const hash = await this.base.contract.write.postNote4Linklist( [data, BigInt(toLinklistId)], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const log = parseLog(receipt.logs, 'PostNote') + const log = parseLog(receipt.logs, "PostNote"); return { data: { noteId: log.args.noteId, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -312,30 +312,30 @@ export class NoteContract { ...options }: PostNoteOptions & { /** The target address. */ - toAddress: Address + toAddress: Address; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - const data = await buildPostNoteData(options) + const data = await buildPostNoteData(options); const hash = await this.base.contract.write.postNote4Address( [data, toAddress], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const log = parseLog(receipt.logs, 'PostNote') + const log = parseLog(receipt.logs, "PostNote"); return { data: { noteId: log.args.noteId, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -350,31 +350,31 @@ export class NoteContract { tokenId, ...options }: PostNoteOptions & { - tokenAddress: Address - tokenId: Numberish + tokenAddress: Address; + tokenId: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - const data = await buildPostNoteData(options) + const data = await buildPostNoteData(options); const hash = await this.base.contract.write.postNote4ERC721( [data, { tokenAddress, erc721TokenId: BigInt(tokenId) }], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const log = parseLog(receipt.logs, 'PostNote') + const log = parseLog(receipt.logs, "PostNote"); return { data: { noteId: log.args.noteId, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -390,29 +390,29 @@ export class NoteContract { metadataOrUri, }: { /** The character ID of the owner who post this note. Must be your own character, otherwise it will be rejected. */ - characterId: Numberish + characterId: Numberish; /** The id of the note you want to set the metadata. */ - noteId: Numberish + noteId: Numberish; /** The metadata or URI of the content you want to post. */ - metadataOrUri: NoteMetadata | string + metadataOrUri: NoteMetadata | string; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const { uri, metadata } = await ipfsParseMetadataOrUri( - 'note', + "note", metadataOrUri, true, - ) + ); const hash = await this.base.contract.write.setNoteUri( [BigInt(characterId), BigInt(noteId), uri], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: { @@ -420,7 +420,7 @@ export class NoteContract { metadata, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -465,28 +465,28 @@ export class NoteContract { modifier, }: { /** The character ID of the user you want to set the URI for. */ - characterId: Numberish + characterId: Numberish; /** The id of the note you want to set the URI for. */ - noteId: Numberish + noteId: Numberish; /** The callback function that modifies the metadata. */ - modifier: (metadata?: NoteMetadata) => NoteMetadata + modifier: (metadata?: NoteMetadata) => NoteMetadata; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ) { - const note = await this.get({ characterId, noteId }) + const note = await this.get({ characterId, noteId }); - const metadata = modifier(note.data.metadata) - if (typeof metadata === 'undefined') { + const metadata = modifier(note.data.metadata); + if (typeof metadata === "undefined") { throw new TypeError( - 'The modified metadata is undefined. Did you return it?', - ) + "The modified metadata is undefined. Did you return it?", + ); } if (!metadata.type) { - metadata.type = 'note' + metadata.type = "note"; } - return this.setMetadata({ characterId, noteId, metadata }, overrides) + return this.setMetadata({ characterId, noteId, metadata }, overrides); } /** @@ -499,16 +499,16 @@ export class NoteContract { noteId, metadata, }: { - characterId: Numberish - noteId: Numberish - metadata: NoteMetadata + characterId: Numberish; + noteId: Numberish; + metadata: NoteMetadata; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ) { return this.setUri( { characterId, noteId, metadataOrUri: metadata }, overrides, - ) + ); } /** @@ -523,59 +523,59 @@ export class NoteContract { linkItemType, }: { /** The character ID of the address who owns the note. */ - characterId: Numberish + characterId: Numberish; /** The id of the note you want to get the info for. */ - noteId: Numberish - linkItemType?: T + noteId: Numberish; + linkItemType?: T; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise>> { const data = await this.base.contract.read.getNote( [BigInt(characterId), BigInt(noteId)], overrides, - ) + ); const linkItemTypeString: LinkItemType | undefined = (hexToString(data.linkItemType, { size: 32 }) as LinkItemType) || - undefined + undefined; const metadata = data.contentUri ? await ipfsUriToMetadata(data.contentUri) - : undefined - - let linkItem: LinkItemMap[T] - const pc = this.base.peripheryContract.read - if (linkItemType === 'AnyUri') { - const uri = await pc.getLinkingAnyUri([data.linkKey]) - linkItem = { uri } satisfies LinkItemMap['AnyUri'] as LinkItemMap[T] - } else if (linkItemType === 'ERC721') { - const erc721 = await pc.getLinkingERC721([data.linkKey]) + : undefined; + + let linkItem: LinkItemMap[T]; + const pc = this.base.peripheryContract.read; + if (linkItemType === "AnyUri") { + const uri = await pc.getLinkingAnyUri([data.linkKey]); + linkItem = { uri } satisfies LinkItemMap["AnyUri"] as LinkItemMap[T]; + } else if (linkItemType === "ERC721") { + const erc721 = await pc.getLinkingERC721([data.linkKey]); linkItem = { contractAddress: erc721.tokenAddress, tokenId: erc721.erc721TokenId.toString(), - } satisfies LinkItemMap['ERC721'] as LinkItemMap[T] - } else if (linkItemType === 'Address') { - const address = await pc.getLinkingAddress([data.linkKey]) + } satisfies LinkItemMap["ERC721"] as LinkItemMap[T]; + } else if (linkItemType === "Address") { + const address = await pc.getLinkingAddress([data.linkKey]); linkItem = { address, - } satisfies LinkItemMap['Address'] as LinkItemMap[T] - } else if (linkItemType === 'Character') { - const characterId = await pc.getLinkingCharacterId([data.linkKey]) + } satisfies LinkItemMap["Address"] as LinkItemMap[T]; + } else if (linkItemType === "Character") { + const characterId = await pc.getLinkingCharacterId([data.linkKey]); linkItem = { characterId, - } satisfies LinkItemMap['Character'] as LinkItemMap[T] - } else if (linkItemType === 'Note') { - const ret = await pc.getLinkingNote([data.linkKey]) + } satisfies LinkItemMap["Character"] as LinkItemMap[T]; + } else if (linkItemType === "Note") { + const ret = await pc.getLinkingNote([data.linkKey]); linkItem = { characterId: ret.characterId, noteId: ret.noteId, - } satisfies LinkItemMap['Note'] as LinkItemMap[T] - } else if (linkItemType === 'Linklist') { - const linklistId = await pc.getLinkingLinklistId([data.linkKey]) + } satisfies LinkItemMap["Note"] as LinkItemMap[T]; + } else if (linkItemType === "Linklist") { + const linklistId = await pc.getLinkingLinklistId([data.linkKey]); linkItem = { linklistId, - } satisfies LinkItemMap['Linklist'] as LinkItemMap[T] + } satisfies LinkItemMap["Linklist"] as LinkItemMap[T]; } else { - linkItem = undefined as unknown as LinkItemMap[T] + linkItem = undefined as unknown as LinkItemMap[T]; } return { @@ -594,7 +594,7 @@ export class NoteContract { deleted: data.deleted, locked: data.locked, }, - } + }; } /** @@ -612,26 +612,26 @@ export class NoteContract { noteId, }: { /** The character ID of the owner who post this note. Must be your own character, otherwise it will be rejected. */ - characterId: Numberish + characterId: Numberish; /** The id of the note you want to delete. */ - noteId: Numberish + noteId: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.deleteNote( [BigInt(characterId), BigInt(noteId)], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -652,26 +652,26 @@ export class NoteContract { noteId, }: { /** The character ID of the owner who post this note. Must be your own character, otherwise it will be rejected. */ - characterId: Numberish + characterId: Numberish; /** The id of the note you want to lock. */ - noteId: Numberish + noteId: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const hash = await this.base.contract.write.lockNote( [BigInt(characterId), BigInt(noteId)], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -687,15 +687,15 @@ export class NoteContract { toAddress, }: { /** The character ID of the address who owns the note. */ - characterId: Numberish + characterId: Numberish; /** The id of the note you want to get the info for. */ - noteId: Numberish + noteId: Numberish; /** The address you want to mint the note to. */ - toAddress: Address + toAddress: Address; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - validateAddress(toAddress) + validateAddress(toAddress); const hash = await this.base.contract.write.mintNote( [ @@ -707,14 +707,14 @@ export class NoteContract { }, ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const log = parseLog(receipt.logs, 'MintNote') + const log = parseLog(receipt.logs, "MintNote"); return { data: { @@ -722,7 +722,7 @@ export class NoteContract { tokenId: log.args.tokenId, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -734,11 +734,11 @@ export class NoteContract { toCharacterId, }: { /** The character ID of the character you want to get the linkKey of. */ - toCharacterId: Numberish + toCharacterId: Numberish; }): string { return keccak256( - encodePacked(['string', 'uint'], ['Character', BigInt(toCharacterId)]), - ) + encodePacked(["string", "uint"], ["Character", BigInt(toCharacterId)]), + ); } /** @@ -750,13 +750,13 @@ export class NoteContract { toAddress, }: { /** The address you want to get the linkKey of. */ - toAddress: Address + toAddress: Address; }): string { - validateAddress(toAddress) + validateAddress(toAddress); return keccak256( - encodePacked(['string', 'address'], ['Address', toAddress]), - ) + encodePacked(["string", "address"], ["Address", toAddress]), + ); } /** @@ -769,16 +769,16 @@ export class NoteContract { toNoteId, }: { /** The character ID of the character you want to get the linkKey of. */ - toCharacterId: Numberish + toCharacterId: Numberish; /** The id of the note you want to get the linkKey of. */ - toNoteId: Numberish + toNoteId: Numberish; }): string { return keccak256( encodePacked( - ['string', 'uint', 'uint'], - ['Note', BigInt(toCharacterId), BigInt(toNoteId)], + ["string", "uint", "uint"], + ["Note", BigInt(toCharacterId), BigInt(toNoteId)], ), - ) + ); } /** @@ -791,16 +791,16 @@ export class NoteContract { toTokenId, }: { /** The address of the ERC721 token you want to get the linkKey of. */ - toContractAddress: Address + toContractAddress: Address; /** The id of the ERC721 token you want to get the linkKey of. */ - toTokenId: Numberish + toTokenId: Numberish; }): string { return keccak256( encodePacked( - ['string', 'address', 'uint'], - ['ERC721', toContractAddress, BigInt(toTokenId)], + ["string", "address", "uint"], + ["ERC721", toContractAddress, BigInt(toTokenId)], ), - ) + ); } /** @@ -812,11 +812,11 @@ export class NoteContract { toLinkListId, }: { /** The id of the linklist you want to get the linkKey of. */ - toLinkListId: Numberish + toLinkListId: Numberish; }): string { return keccak256( - encodePacked(['string', 'uint'], ['Linklist', BigInt(toLinkListId)]), - ) + encodePacked(["string", "uint"], ["Linklist", BigInt(toLinkListId)]), + ); } /** @@ -828,8 +828,8 @@ export class NoteContract { toUri, }: { /** The uri you want to get the linkKey of. */ - toUri: string + toUri: string; }): string { - return keccak256(encodePacked(['string', 'string'], ['AnyUri', toUri])) + return keccak256(encodePacked(["string", "string"], ["AnyUri", toUri])); } } diff --git a/src/contract/subcontracts/operator.ts b/src/contract/subcontracts/operator.ts index bd13ef628..68fec6254 100644 --- a/src/contract/subcontracts/operator.ts +++ b/src/contract/subcontracts/operator.ts @@ -1,17 +1,17 @@ -import { type Address } from 'viem' -import { - type CharacterPermissionKey, - type Numberish, - type ReadOverrides, - type Result, - type WriteOverrides, -} from '../../types' -import { validateAddress } from '../../utils/address' -import { warn } from '../../utils/logger' -import { parseLog, waitForTransactionReceiptWithRetry } from '../../utils/viem' -import { type Entry } from '../abi' -import { autoSwitchMainnet } from '../decorators' -import { type BaseContract } from './base' +import type { Address } from "viem"; +import type { + CharacterPermissionKey, + Numberish, + ReadOverrides, + Result, + WriteOverrides, +} from "../../types"; +import { validateAddress } from "../../utils/address"; +import { warn } from "../../utils/logger"; +import { parseLog, waitForTransactionReceiptWithRetry } from "../../utils/viem"; +import type { Entry } from "../abi"; +import { autoSwitchMainnet } from "../decorators"; +import type { BaseContract } from "./base"; // https://github.com/Crossbell-Box/CIPs/blob/main/CIPs/CIP-7.md @@ -40,37 +40,37 @@ export class OperatorContract { permissions, }: { /** The id of the character. */ - characterId: Numberish + characterId: Numberish; /** The address of the operator. */ - operator: Address + operator: Address; /** The permissions of the operator. */ - permissions: CharacterPermissionKey[] + permissions: CharacterPermissionKey[]; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { - validateAddress(operator) + validateAddress(operator); const permissionUint256 = - this.convertPermissionsToUint256ForCharacter(permissions) + this.convertPermissionsToUint256ForCharacter(permissions); const hash = await this.base.contract.write.grantOperatorPermissions( [BigInt(characterId), operator, permissionUint256], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); - const log = parseLog(receipt.logs, 'GrantOperatorPermissions') + const log = parseLog(receipt.logs, "GrantOperatorPermissions"); return { data: { bitmapUint256: log.args.permissionBitMap, }, transactionHash: receipt.transactionHash, - } + }; } /** @@ -96,38 +96,38 @@ export class OperatorContract { blocklist = [], }: { /** The id of the character. */ - characterId: Numberish + characterId: Numberish; /** The id of the note. */ - noteId: Numberish + noteId: Numberish; /** Operators that are allowed to operate the note. */ - allowlist: Address[] + allowlist: Address[]; /** * Operators that are not allowed to operate the note. * (Used to override the character permission and allowlist.) */ - blocklist: Address[] + blocklist: Address[]; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise, true>> { - validateAddress(allowlist) - validateAddress(blocklist) + validateAddress(allowlist); + validateAddress(blocklist); const hash = await this.base.contract.write.grantOperators4Note( [BigInt(characterId), BigInt(noteId), blocklist, allowlist], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); // const log = parseLog(receipt.logs, 'grantOperators4Note') return { data: {}, transactionHash: receipt.transactionHash, - } + }; } /** @@ -141,17 +141,17 @@ export class OperatorContract { characterId, }: { /** The id of the character. */ - characterId: Numberish + characterId: Numberish; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const operators = await this.base.contract.read.getOperators( [BigInt(characterId)], overrides, - ) + ); return { data: operators, - } + }; } /** @@ -165,11 +165,11 @@ export class OperatorContract { noteId, }: { /** The id of the character. */ - characterId: Numberish + characterId: Numberish; /** The id of the note. */ - noteId: Numberish + noteId: Numberish; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise< Result< { allowlist: readonly Address[]; blocklist: readonly Address[] }, @@ -180,13 +180,13 @@ export class OperatorContract { await this.base.contract.read.getOperators4Note( [BigInt(characterId), BigInt(noteId)], overrides, - ) + ); return { data: { allowlist, blocklist, }, - } + }; } /** @@ -202,21 +202,21 @@ export class OperatorContract { operator, }: { /** The id of the character. */ - characterId: Numberish + characterId: Numberish; /** The id of the note. */ - noteId: Numberish + noteId: Numberish; /** The address of the operator. */ - operator: Address + operator: Address; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const isAllowed = await this.base.contract.read.isOperatorAllowedForNote( [BigInt(characterId), BigInt(noteId), operator], overrides, - ) + ); return { data: isAllowed, - } + }; } /** @@ -231,24 +231,24 @@ export class OperatorContract { operator, }: { /** The id of the character. */ - characterId: Numberish + characterId: Numberish; /** The address of the operator. */ - operator: Address + operator: Address; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const permissionUint256 = await this.base.contract.read.getOperatorPermissions( [BigInt(characterId), operator], overrides, - ) + ); const permissions = - this.convertUint256ToPermissionsForCharacter(permissionUint256) + this.convertUint256ToPermissionsForCharacter(permissionUint256); return { data: permissions, - } + }; } /** @@ -263,24 +263,24 @@ export class OperatorContract { const bits = permissions.map((permission) => { const bit = Object.entries(CHARACTER_PERMISSION_BITMAP).find( ([, value]) => value === permission, - )?.[0] + )?.[0]; if (!bit) { - throw new Error(`Found invalid permission: ${permission}.`) + throw new Error(`Found invalid permission: ${permission}.`); } - return Number.parseInt(bit) - }) + return Number.parseInt(bit); + }); - const uint256Array = Array.from({ length: 256 }).fill(0) + const uint256Array = Array.from({ length: 256 }).fill(0); for (const bit of bits) { - uint256Array[bit] = 1 + uint256Array[bit] = 1; } - uint256Array.reverse() + uint256Array.reverse(); - const uint256Decimal = this.#convertBinaryBitsToUint256(uint256Array) + const uint256Decimal = this.#convertBinaryBitsToUint256(uint256Array); - return uint256Decimal + return uint256Decimal; } /** @@ -293,22 +293,22 @@ export class OperatorContract { convertUint256ToPermissionsForCharacter( permissionUint256: bigint, ): CharacterPermissionKey[] { - const binaryBits = this.#convertUint256ToBinaryBits(permissionUint256) + const binaryBits = this.#convertUint256ToBinaryBits(permissionUint256); const permissions = binaryBits .reverse() .map((bit, index) => { if (bit === 1) { if (this.#isPermissionBitForCharacter(index)) { - return CHARACTER_PERMISSION_BITMAP[index] + return CHARACTER_PERMISSION_BITMAP[index]; } - warn('Found invalid permission bit.', index) + warn("Found invalid permission bit.", index); } - return undefined + return undefined; }) - .filter(Boolean) as CharacterPermissionKey[] + .filter(Boolean) as CharacterPermissionKey[]; - return permissions + return permissions; } /** @@ -320,18 +320,18 @@ export class OperatorContract { */ #convertBinaryBitsToUint256(bits: number[]): bigint { const n = bits - .join('') - .replace(/^0+/, '') - .split('') + .join("") + .replace(/^0+/, "") + .split("") .reverse() .reduce((acc, bit, index) => { - if (bit === '1') { - return acc + 2n ** BigInt(index) + if (bit === "1") { + return acc + 2n ** BigInt(index); } - return acc - }, 0n) + return acc; + }, 0n); - return n + return n; } /** @@ -344,9 +344,9 @@ export class OperatorContract { #convertUint256ToBinaryBits(uint256: bigint) { return uint256 .toString(2) - .padStart(256, '0') - .split('') - .map((bit) => Number.parseInt(bit) as 0 | 1) + .padStart(256, "0") + .split("") + .map((bit) => Number.parseInt(bit) as 0 | 1); } /** @@ -359,42 +359,42 @@ export class OperatorContract { #isPermissionBitForCharacter( bit: number, ): bit is keyof typeof CHARACTER_PERMISSION_BITMAP { - return Object.keys(CHARACTER_PERMISSION_BITMAP).includes(bit.toString()) + return Object.keys(CHARACTER_PERMISSION_BITMAP).includes(bit.toString()); } } const CHARACTER_PERMISSION_BITMAP = { - 0: 'SET_HANDLE', - 1: 'SET_SOCIAL_TOKEN', - 2: 'GRANT_OPERATOR_PERMISSIONS', - 3: 'GRANT_OPERATORS_FOR_NOTE', - 176: 'SET_CHARACTER_URI', - 177: 'SET_LINKLIST_URI', - 178: 'LINK_CHARACTER', - 179: 'UNLINK_CHARACTER', - 180: 'CREATE_THEN_LINK_CHARACTER', - 181: 'LINK_NOTE', - 182: 'UNLINK_NOTE', - 183: 'LINK_ERC721', - 184: 'UNLINK_ERC721', - 185: 'LINK_ADDRESS', - 186: 'UNLINK_ADDRESS', - 187: 'LINK_ANY_URI', - 188: 'UNLINK_ANY_URI', - 189: 'LINK_LINKLIST', - 190: 'UNLINK_LINKLIST', - 191: 'SET_LINK_MODULE_FOR_CHARACTER', - 192: 'SET_LINK_MODULE_FOR_NOTE', - 193: 'SET_LINK_MODULE_FOR_LINKLIST', - 194: 'SET_MINT_MODULE_FOR_NOTE', - 195: 'SET_NOTE_URI', - 196: 'LOCK_NOTE', - 197: 'DELETE_NOTE', - 198: 'POST_NOTE_FOR_CHARACTER', - 199: 'POST_NOTE_FOR_ADDRESS', - 200: 'POST_NOTE_FOR_LINKLIST', - 201: 'POST_NOTE_FOR_NOTE', - 202: 'POST_NOTE_FOR_ERC721', - 203: 'POST_NOTE_FOR_ANY_URI', - 236: 'POST_NOTE', -} as const + 0: "SET_HANDLE", + 1: "SET_SOCIAL_TOKEN", + 2: "GRANT_OPERATOR_PERMISSIONS", + 3: "GRANT_OPERATORS_FOR_NOTE", + 176: "SET_CHARACTER_URI", + 177: "SET_LINKLIST_URI", + 178: "LINK_CHARACTER", + 179: "UNLINK_CHARACTER", + 180: "CREATE_THEN_LINK_CHARACTER", + 181: "LINK_NOTE", + 182: "UNLINK_NOTE", + 183: "LINK_ERC721", + 184: "UNLINK_ERC721", + 185: "LINK_ADDRESS", + 186: "UNLINK_ADDRESS", + 187: "LINK_ANY_URI", + 188: "UNLINK_ANY_URI", + 189: "LINK_LINKLIST", + 190: "UNLINK_LINKLIST", + 191: "SET_LINK_MODULE_FOR_CHARACTER", + 192: "SET_LINK_MODULE_FOR_NOTE", + 193: "SET_LINK_MODULE_FOR_LINKLIST", + 194: "SET_MINT_MODULE_FOR_NOTE", + 195: "SET_NOTE_URI", + 196: "LOCK_NOTE", + 197: "DELETE_NOTE", + 198: "POST_NOTE_FOR_CHARACTER", + 199: "POST_NOTE_FOR_ADDRESS", + 200: "POST_NOTE_FOR_LINKLIST", + 201: "POST_NOTE_FOR_NOTE", + 202: "POST_NOTE_FOR_ERC721", + 203: "POST_NOTE_FOR_ANY_URI", + 236: "POST_NOTE", +} as const; diff --git a/src/contract/subcontracts/revision.ts b/src/contract/subcontracts/revision.ts index 7894b49f5..258f18240 100644 --- a/src/contract/subcontracts/revision.ts +++ b/src/contract/subcontracts/revision.ts @@ -1,8 +1,8 @@ -import { type ReadOverrides, type Result } from '../../types/contract' -import { type Entry } from '../abi' -import { type BaseContract } from './base' +import type { ReadOverrides, Result } from "../../types/contract"; +import type { Entry } from "../abi"; +import type { BaseContract } from "./base"; -const CURRENT_SDK_REVISION = 4n +const CURRENT_SDK_REVISION = 4n; export class RevisionContract { constructor(private base: BaseContract) {} @@ -12,13 +12,13 @@ export class RevisionContract { * @returns The remote latest revision of the contract. */ async getLatest( - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { - const revision = await this.base.contract.read.getRevision(overrides) + const revision = await this.base.contract.read.getRevision(overrides); return { data: revision, - } + }; } /** @@ -29,7 +29,7 @@ export class RevisionContract { getCurrent(): Result { return { data: CURRENT_SDK_REVISION, - } + }; } /** @@ -45,16 +45,16 @@ export class RevisionContract { async check(): Promise< Result< { - isUpToDate: boolean - currentRevision: bigint - latestRevision: bigint + isUpToDate: boolean; + currentRevision: bigint; + latestRevision: bigint; }, false > > { - const { data: latestRevision } = await this.getLatest() - const currentRevision = CURRENT_SDK_REVISION - const isUpToDate = latestRevision === currentRevision + const { data: latestRevision } = await this.getLatest(); + const currentRevision = CURRENT_SDK_REVISION; + const isUpToDate = latestRevision === currentRevision; return { data: { @@ -62,6 +62,6 @@ export class RevisionContract { currentRevision, latestRevision, }, - } + }; } } diff --git a/src/contract/subcontracts/tips.ts b/src/contract/subcontracts/tips.ts index ac2a747c0..11c32b97b 100644 --- a/src/contract/subcontracts/tips.ts +++ b/src/contract/subcontracts/tips.ts @@ -1,14 +1,14 @@ -import { type Address, encodeAbiParameters, isAddressEqual } from 'viem' -import { - type Numberish, - type ReadOverrides, - type Result, - type WriteOverrides, -} from '../../types' -import { waitForTransactionReceiptWithRetry } from '../../utils/viem' -import { type Entry, type Mira, type NewbieVilla, type Tips } from '../abi' -import { autoSwitchMainnet } from '../decorators' -import { type BaseContract } from './base' +import { type Address, encodeAbiParameters, isAddressEqual } from "viem"; +import type { + Numberish, + ReadOverrides, + Result, + WriteOverrides, +} from "../../types"; +import { waitForTransactionReceiptWithRetry } from "../../utils/viem"; +import type { Entry, Mira, NewbieVilla, Tips } from "../abi"; +import { autoSwitchMainnet } from "../decorators"; +import type { BaseContract } from "./base"; export class TipsContract { constructor(private base: BaseContract) {} @@ -27,33 +27,33 @@ export class TipsContract { amount, }: { /** The character ID of the character that is tipping. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The character ID of the character that is being tipped. */ - toCharacterId: Numberish + toCharacterId: Numberish; /** The amount of $MIRA token to tip. Unit: wei. */ - amount: Numberish + amount: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const data = encodeAbiParameters( - [{ type: 'uint256' }, { type: 'uint256' }], + [{ type: "uint256" }, { type: "uint256" }], [BigInt(fromCharacterId), BigInt(toCharacterId)], - ) + ); const hash = await this.base.miraContract.write.send( [this.base.options.contractAddresses.tips, BigInt(amount), data], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } @autoSwitchMainnet() @@ -63,26 +63,26 @@ export class TipsContract { toCharacterId, amount, }: { - fromCharacterId: Numberish - toCharacterId: Numberish - amount: Numberish + fromCharacterId: Numberish; + toCharacterId: Numberish; + amount: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ) { const hash = await this.base.newbieVillaContract.write.tipCharacter( [BigInt(fromCharacterId), BigInt(toCharacterId), BigInt(amount)], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } @autoSwitchMainnet() @@ -91,7 +91,7 @@ export class TipsContract { toCharacterId: Numberish, toNoteId: Numberish, amount: Numberish, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ) { const hash = await this.base.newbieVillaContract.write.tipCharacterForNote( [ @@ -101,17 +101,17 @@ export class TipsContract { BigInt(amount), ], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -129,35 +129,35 @@ export class TipsContract { amount, }: { /** The character ID of the character that is tipping. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The character ID of the character that is being tipped. */ - toCharacterId: Numberish + toCharacterId: Numberish; /** The note ID of the note that is being tipped. */ - toNoteId: Numberish + toNoteId: Numberish; /** The amount of $MIRA token to tip. Unit: wei. */ - amount: Numberish + amount: Numberish; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const data = encodeAbiParameters( - [{ type: 'uint256' }, { type: 'uint256' }, { type: 'uint256' }], + [{ type: "uint256" }, { type: "uint256" }, { type: "uint256" }], [BigInt(fromCharacterId), BigInt(toCharacterId), BigInt(toNoteId)], - ) + ); const hash = await this.base.miraContract.write.send( [this.base.options.contractAddresses.tips, BigInt(amount), data], overrides, - ) + ); const receipt = await waitForTransactionReceiptWithRetry( this.base.publicClient, hash, - ) + ); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** * This gets the balance of $MIRA token of a character. @@ -175,14 +175,14 @@ export class TipsContract { characterId, }: { /** The character ID to get the balance of. */ - characterId: Numberish + characterId: Numberish; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const address = await this.base.contract.read.ownerOf( [BigInt(characterId)], overrides, - ) + ); const balance = isAddressEqual( address, @@ -191,10 +191,10 @@ export class TipsContract { ? await this.base.newbieVillaContract.read.balanceOf( [BigInt(characterId)], overrides, - ) - : await this.base.miraContract.read.balanceOf([address], overrides) + ) + : await this.base.miraContract.read.balanceOf([address], overrides); - return { data: balance } + return { data: balance }; } /** @@ -208,18 +208,18 @@ export class TipsContract { address, }: { /** The address to get the balance of. */ - address: Address + address: Address; }, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const balance = await this.base.miraContract.read.balanceOf( [address], overrides, - ) + ); return { data: balance, - } + }; } /** @@ -229,13 +229,13 @@ export class TipsContract { * @returns The token address of $MIRA. */ async getTokenAddress( - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { - const res = await this.base.tipsContract.read.getToken(overrides) + const res = await this.base.tipsContract.read.getToken(overrides); return { data: res, - } + }; } /** @@ -245,12 +245,12 @@ export class TipsContract { * @returns The token decimals of $MIRA. */ async getTokenDecimals( - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { - const res = await this.base.miraContract.read.decimals(overrides) + const res = await this.base.miraContract.read.decimals(overrides); return { data: res, - } + }; } } diff --git a/src/contract/subcontracts/tips_with_fee.ts b/src/contract/subcontracts/tips_with_fee.ts index db05980df..331a20291 100644 --- a/src/contract/subcontracts/tips_with_fee.ts +++ b/src/contract/subcontracts/tips_with_fee.ts @@ -1,14 +1,14 @@ -import { type Address, encodeAbiParameters } from 'viem' -import { - type Numberish, - type ReadOverrides, - type Result, - type WriteOverrides, -} from '../../types' -import { type Mira } from '../abi' -import { type TipsWithFee } from '../abi/tips-with-fee' -import { autoSwitchMainnet } from '../decorators' -import { type BaseContract } from './base' +import { type Address, encodeAbiParameters } from "viem"; +import type { + Numberish, + ReadOverrides, + Result, + WriteOverrides, +} from "../../types"; +import type { Mira } from "../abi"; +import type { TipsWithFee } from "../abi/tips-with-fee"; +import { autoSwitchMainnet } from "../decorators"; +import type { BaseContract } from "./base"; export class TipsWithFeeContract { constructor(private base: BaseContract) {} @@ -28,34 +28,34 @@ export class TipsWithFeeContract { feeReceiver, }: { /** The character ID of the character that is tipping. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The character ID of the character that is being tipped. */ - toCharacterId: Numberish + toCharacterId: Numberish; /** The amount of $MIRA token to tip. Unit: wei. */ - amount: Numberish + amount: Numberish; /** Fee receiver address. */ - feeReceiver: Address + feeReceiver: Address; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const data = encodeAbiParameters( - [{ type: 'uint256' }, { type: 'uint256' }, { type: 'address' }], + [{ type: "uint256" }, { type: "uint256" }, { type: "address" }], [BigInt(fromCharacterId), BigInt(toCharacterId), feeReceiver], - ) + ); const hash = await this.base.miraContract.write.send( [this.base.options.contractAddresses.tipsWithFee, BigInt(amount), data], overrides, - ) + ); const receipt = await this.base.publicClient.waitForTransactionReceipt({ hash, - }) + }); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -74,24 +74,24 @@ export class TipsWithFeeContract { feeReceiver, }: { /** The character ID of the character that is tipping. */ - fromCharacterId: Numberish + fromCharacterId: Numberish; /** The character ID of the character that is being tipped. */ - toCharacterId: Numberish + toCharacterId: Numberish; /** The note ID of the note that is being tipped. */ - toNoteId: Numberish + toNoteId: Numberish; /** The amount of $MIRA token to tip. Unit: wei. */ - amount: Numberish + amount: Numberish; /** Fee receiver address. */ - feeReceiver: Address + feeReceiver: Address; }, - overrides: WriteOverrides = {}, + overrides: WriteOverrides = {}, ): Promise> { const data = encodeAbiParameters( [ - { type: 'uint256' }, - { type: 'uint256' }, - { type: 'uint256' }, - { type: 'address' }, + { type: "uint256" }, + { type: "uint256" }, + { type: "uint256" }, + { type: "address" }, ], [ BigInt(fromCharacterId), @@ -99,21 +99,21 @@ export class TipsWithFeeContract { BigInt(toNoteId), feeReceiver, ], - ) + ); const hash = await this.base.miraContract.write.send( [this.base.options.contractAddresses.tipsWithFee, BigInt(amount), data], overrides, - ) + ); const receipt = await this.base.publicClient.waitForTransactionReceipt({ hash, - }) + }); return { data: undefined, transactionHash: receipt.transactionHash, - } + }; } /** @@ -126,16 +126,16 @@ export class TipsWithFeeContract { feeReceiver: Address, characterId: Numberish, noteId: Numberish, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const res = await this.base.tipsWithFeeContract.read.getFeeFraction( [feeReceiver, BigInt(characterId), BigInt(noteId)], overrides, - ) + ); return { data: res, - } + }; } /** @@ -149,15 +149,15 @@ export class TipsWithFeeContract { characterId: Numberish, noteId: Numberish, tipAmount: Numberish, - overrides: ReadOverrides = {}, + overrides: ReadOverrides = {}, ): Promise> { const res = await this.base.tipsWithFeeContract.read.getFeeAmount( [feeReceiver, BigInt(characterId), BigInt(noteId), BigInt(tipAmount)], overrides, - ) + ); return { data: res, - } + }; } } diff --git a/src/index.ts b/src/index.ts index c3c1fd2df..28e2457e6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ -export * from './contract' -export * as contracts from './contract/subcontracts' +export * from "./contract"; +export * as contracts from "./contract/subcontracts"; -export * from './indexer' -export * from './utils' -export * from './types' -export * as Abi from './contract/abi' +export * from "./indexer"; +export * from "./utils"; +export * from "./types"; +export * as Abi from "./contract/abi"; diff --git a/src/indexer/index.ts b/src/indexer/index.ts index d1a278ceb..2d8ffe1c0 100644 --- a/src/indexer/index.ts +++ b/src/indexer/index.ts @@ -1,2 +1,2 @@ -export * from './indexer' -export { withHeaders } from './utils' +export * from "./indexer"; +export { withHeaders } from "./utils"; diff --git a/src/indexer/indexer.ts b/src/indexer/indexer.ts index ec345a91f..3574fac6b 100644 --- a/src/indexer/indexer.ts +++ b/src/indexer/indexer.ts @@ -1,21 +1,21 @@ -import { AchievementIndexer } from './subapis/achievement' -import { BaseIndexer, type IndexerOptions } from './subapis/base' -import { CharacterIndexer } from './subapis/character' -import { FeedIndexer } from './subapis/feed' -import { LinkIndexer } from './subapis/link' -import { LinkModuleIndexer } from './subapis/link_module' -import { LinklistIndexer } from './subapis/linklist' -import { MetadataIndexer } from './subapis/metadata' -import { MintModuleIndexer } from './subapis/mint_module' -import { MintedNoteIndexer } from './subapis/minted_note' -import { NewbieIndexer } from './subapis/newbie' -import { NoteIndexer } from './subapis/note' -import { NotificationIndexer } from './subapis/notification' -import { OperatorIndexer } from './subapis/operators' -import { SearchIndexer } from './subapis/search' -import { SiweIndexer } from './subapis/siwe' -import { StatIndexer } from './subapis/stat' -import { TipIndexer } from './subapis/tip' +import { AchievementIndexer } from "./subapis/achievement"; +import { BaseIndexer, type IndexerOptions } from "./subapis/base"; +import { CharacterIndexer } from "./subapis/character"; +import { FeedIndexer } from "./subapis/feed"; +import { LinkIndexer } from "./subapis/link"; +import { LinkModuleIndexer } from "./subapis/link_module"; +import { LinklistIndexer } from "./subapis/linklist"; +import { MetadataIndexer } from "./subapis/metadata"; +import { MintModuleIndexer } from "./subapis/mint_module"; +import { MintedNoteIndexer } from "./subapis/minted_note"; +import { NewbieIndexer } from "./subapis/newbie"; +import { NoteIndexer } from "./subapis/note"; +import { NotificationIndexer } from "./subapis/notification"; +import { OperatorIndexer } from "./subapis/operators"; +import { SearchIndexer } from "./subapis/search"; +import { SiweIndexer } from "./subapis/siwe"; +import { StatIndexer } from "./subapis/stat"; +import { TipIndexer } from "./subapis/tip"; /** * This class is used to fetch data like characters, links from the indexer. @@ -32,23 +32,23 @@ import { TipIndexer } from './subapis/tip' * @see https://indexer.crossbell.io/docs The underlying APIs. */ export class Indexer extends BaseIndexer { - link = new LinkIndexer(this) - linklist = new LinklistIndexer(this) - note = new NoteIndexer(this) - character = new CharacterIndexer(this) - search = new SearchIndexer(this) - feed = new FeedIndexer(this) - mintedNote = new MintedNoteIndexer(this) - metadata = new MetadataIndexer(this) - achievement = new AchievementIndexer(this) - notification = new NotificationIndexer(this) - operator = new OperatorIndexer(this) - tip = new TipIndexer(this) - linkModule = new LinkModuleIndexer(this) - mintModule = new MintModuleIndexer(this) - newbie = new NewbieIndexer(this) - siwe = new SiweIndexer(this) - stat = new StatIndexer(this) + link = new LinkIndexer(this); + linklist = new LinklistIndexer(this); + note = new NoteIndexer(this); + character = new CharacterIndexer(this); + search = new SearchIndexer(this); + feed = new FeedIndexer(this); + mintedNote = new MintedNoteIndexer(this); + metadata = new MetadataIndexer(this); + achievement = new AchievementIndexer(this); + notification = new NotificationIndexer(this); + operator = new OperatorIndexer(this); + tip = new TipIndexer(this); + linkModule = new LinkModuleIndexer(this); + mintModule = new MintModuleIndexer(this); + newbie = new NewbieIndexer(this); + siwe = new SiweIndexer(this); + stat = new StatIndexer(this); } /** @@ -66,5 +66,5 @@ export class Indexer extends BaseIndexer { * @see https://indexer.crossbell.io/docs The underlying APIs. */ export function createIndexer(endpointOrOptions?: IndexerOptions) { - return new Indexer(endpointOrOptions) + return new Indexer(endpointOrOptions); } diff --git a/src/indexer/subapis/achievement.ts b/src/indexer/subapis/achievement.ts index c11c60332..5476fdb3e 100644 --- a/src/indexer/subapis/achievement.ts +++ b/src/indexer/subapis/achievement.ts @@ -1,11 +1,11 @@ -import { - type AchievementItem, - type AchievementSection, - type AchievementStatusKey, - type ListResponse, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { + AchievementItem, + AchievementSection, + AchievementStatusKey, + ListResponse, + Numberish, +} from "../../types"; +import type { BaseIndexer } from "./base"; export class AchievementIndexer { constructor(private base: BaseIndexer) {} @@ -21,10 +21,10 @@ export class AchievementIndexer { characterId: Numberish, { status }: { status?: AchievementStatusKey[] } = {}, ) { - const url = `/characters/${characterId}/achievements` + const url = `/characters/${characterId}/achievements`; return this.base.fetch | null>(url, { params: { status }, - }) + }); } /** @@ -35,7 +35,7 @@ export class AchievementIndexer { * @returns The achievement minted. */ mint(characterId: Numberish, achievementId: Numberish) { - const url = `/characters/${characterId}/achievements/${achievementId}` - return this.base.fetch(url, { method: 'POST' }) + const url = `/characters/${characterId}/achievements/${achievementId}`; + return this.base.fetch(url, { method: "POST" }); } } diff --git a/src/indexer/subapis/base.ts b/src/indexer/subapis/base.ts index ff798d933..bff47a7f6 100644 --- a/src/indexer/subapis/base.ts +++ b/src/indexer/subapis/base.ts @@ -1,13 +1,13 @@ -import { createCache } from 'async-cache-dedupe' -import { type MaybeArray } from '../../types/utils' -import { createSearchParamsString, getHeadersScope } from '../utils' +import { createCache } from "async-cache-dedupe"; +import type { MaybeArray } from "../../types/utils"; +import { createSearchParamsString, getHeadersScope } from "../utils"; -export type FetchOptions = Omit +export type FetchOptions = Omit; export type IndexerOptions = | string | { - endpoint?: string - fetchOptions?: FetchOptions + endpoint?: string; + fetchOptions?: FetchOptions; /** /** * This option is used to enable the experimental request dedupe feature for performance. @@ -30,66 +30,66 @@ export type IndexerOptions = * * @default false */ - experimentalRequestDedupe: boolean - } + experimentalRequestDedupe: boolean; + }; type InternalFetchOptions = RequestInit & { params?: Record< string, boolean | MaybeArray | null | undefined - > - data?: any - token?: string -} + >; + data?: any; + token?: string; +}; export class BaseIndexer { /** The indexer endpoint */ - endpoint = 'https://indexer.crossbell.io/v1' + endpoint = "https://indexer.crossbell.io/v1"; /** The options to send to the fetch function. */ - fetchOptions: FetchOptions = {} + fetchOptions: FetchOptions = {}; #cache = createCache({ ttl: 0, - storage: { type: 'memory' }, + storage: { type: "memory" }, }).define( - 'fetch', + "fetch", { serialize( args: [input: RequestInfo | URL, init?: RequestInit | undefined], ) { - const url = args[0] - const options = args[1] - const body = options?.body + const url = args[0]; + const options = args[1]; + const body = options?.body; const headers = Object.fromEntries( (options?.headers as Headers)?.entries(), - ) + ); return { url, ...options, body, headers, - } + }; }, }, (args: [input: RequestInfo | URL, init?: RequestInit | undefined]) => { // @ts-ignore built-in type conflicts - return fetch.call(globalThis, ...args) + return fetch.call(globalThis, ...args); }, - ) + ); constructor(private endpointOrOptions?: IndexerOptions) { - if (typeof endpointOrOptions === 'string') { - this.endpoint = endpointOrOptions - } else if (typeof endpointOrOptions === 'object') { - this.endpoint = endpointOrOptions.endpoint ?? this.endpoint - this.fetchOptions = endpointOrOptions.fetchOptions ?? this.fetchOptions - } else if (typeof endpointOrOptions !== 'undefined') { + if (typeof endpointOrOptions === "string") { + this.endpoint = endpointOrOptions; + } else if (typeof endpointOrOptions === "object") { + this.endpoint = endpointOrOptions.endpoint ?? this.endpoint; + this.fetchOptions = endpointOrOptions.fetchOptions ?? this.fetchOptions; + } else if (typeof endpointOrOptions !== "undefined") { throw new TypeError( `Invalid argument: ${JSON.stringify( endpointOrOptions, )}. It must be a string or an object.`, - ) + ); } } @@ -97,28 +97,28 @@ export class BaseIndexer { url: string, { params, data, token, ...options }: InternalFetchOptions = {}, ): Promise { - const newUrl = url + (params ? `?${createSearchParamsString(params)}` : '') + const newUrl = url + (params ? `?${createSearchParamsString(params)}` : ""); const headers = new Headers({ ...this.fetchOptions.headers, ...options.headers, ...getHeadersScope(), - }) - let body: string | undefined + }); + let body: string | undefined; if (data) { - body = JSON.stringify(data) - headers.set('Content-Type', 'application/json') + body = JSON.stringify(data); + headers.set("Content-Type", "application/json"); } if (token) { - headers.set('Authorization', `Bearer ${token}`) + headers.set("Authorization", `Bearer ${token}`); } const fetched = - typeof this.endpointOrOptions === 'object' && + typeof this.endpointOrOptions === "object" && this.endpointOrOptions.experimentalRequestDedupe && - (!options.method || options.method === 'GET') + (!options.method || options.method === "GET") ? this.#cache.fetch([ this.endpoint + newUrl, { @@ -127,16 +127,16 @@ export class BaseIndexer { ...options, headers, }, - ]) + ]) : fetch(this.endpoint + newUrl, { ...this.fetchOptions, body, ...options, headers, - }) + }); return fetched.then(async (r) => { - const res = r.clone() + const res = r.clone(); if (!res.ok) { return Promise.reject( new Error( @@ -144,9 +144,9 @@ export class BaseIndexer { r.status }\nResponse:\n${await res.text()}`, ), - ) + ); } - return res.json() - }) + return res.json(); + }); } } diff --git a/src/indexer/subapis/character.ts b/src/indexer/subapis/character.ts index c967997d6..292c15746 100644 --- a/src/indexer/subapis/character.ts +++ b/src/indexer/subapis/character.ts @@ -1,10 +1,6 @@ -import { type Address } from 'viem' -import { - type CharacterEntity, - type ListResponse, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { Address } from "viem"; +import type { CharacterEntity, ListResponse, Numberish } from "../../types"; +import type { BaseIndexer } from "./base"; export class CharacterIndexer { constructor(private base: BaseIndexer) {} @@ -24,17 +20,17 @@ export class CharacterIndexer { cursor, }: { /** If true, return only the primary character. */ - primary?: boolean + primary?: boolean; /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; } = {}, ) { - const url = `/addresses/${address}/characters` + const url = `/addresses/${address}/characters`; return this.base.fetch>(url, { params: { primary, limit, cursor }, - }) + }); } /** @@ -45,8 +41,8 @@ export class CharacterIndexer { * @returns The primary character. */ async getPrimary(address: Address): Promise { - const res = await this.getMany(address, { limit: 1, primary: true }) - return res.list?.[0] ?? null + const res = await this.getMany(address, { limit: 1, primary: true }); + return res.list?.[0] ?? null; } /** @@ -56,8 +52,8 @@ export class CharacterIndexer { * @returns The character. */ get(characterId: Numberish) { - const url = `/characters/${characterId}` - return this.base.fetch(url) + const url = `/characters/${characterId}`; + return this.base.fetch(url); } /** @@ -67,8 +63,8 @@ export class CharacterIndexer { * @returns The character. */ getByHandle(handle: string) { - const url = `/handles/${handle}/character` - return this.base.fetch(url) + const url = `/handles/${handle}/character`; + return this.base.fetch(url); } /** @@ -79,7 +75,7 @@ export class CharacterIndexer { * @returns Whether the handle exists. */ async checkIfHandleExists(handle: string): Promise { - const res = await this.getByHandle(handle) - return res !== null + const res = await this.getByHandle(handle); + return res !== null; } } diff --git a/src/indexer/subapis/feed.ts b/src/indexer/subapis/feed.ts index c3c767a12..b035861c3 100644 --- a/src/indexer/subapis/feed.ts +++ b/src/indexer/subapis/feed.ts @@ -1,11 +1,11 @@ -import { type Hash } from 'viem' -import { - type FeedEntity, - type FeedTypeKey, - type ListResponse, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { Hash } from "viem"; +import type { + FeedEntity, + FeedTypeKey, + ListResponse, + Numberish, +} from "../../types"; +import type { BaseIndexer } from "./base"; export class FeedIndexer { constructor(private base: BaseIndexer) {} @@ -26,21 +26,21 @@ export class FeedIndexer { cursor, }: { /** The type of feed */ - type?: FeedTypeKey | FeedTypeKey[] + type?: FeedTypeKey | FeedTypeKey[]; /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; } = {}, ) { - const url = `/characters/${characterId}/feed` + const url = `/characters/${characterId}/feed`; return this.base.fetch>(url, { params: { type, limit, cursor, }, - }) + }); } /** @@ -59,21 +59,21 @@ export class FeedIndexer { cursor, }: { /** The type of feed */ - type?: FeedTypeKey | FeedTypeKey[] + type?: FeedTypeKey | FeedTypeKey[]; /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; } = {}, ) { - const url = `/characters/${characterId}/feed/follow` + const url = `/characters/${characterId}/feed/follow`; return this.base.fetch>(url, { params: { type, limit, cursor, }, - }) + }); } /** @@ -85,7 +85,7 @@ export class FeedIndexer { * @returns The feed. */ get(transactionHash: Hash, logIndex: Numberish) { - const url = `/feed/${transactionHash}/${logIndex}` - return this.base.fetch(url) + const url = `/feed/${transactionHash}/${logIndex}`; + return this.base.fetch(url); } } diff --git a/src/indexer/subapis/link.ts b/src/indexer/subapis/link.ts index 3f2590bc5..8f8c2cfaf 100644 --- a/src/indexer/subapis/link.ts +++ b/src/indexer/subapis/link.ts @@ -1,40 +1,40 @@ -import { type Address } from 'viem' -import { - type LinkEntity, - type LinkItemType, - type ListResponse, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { Address } from "viem"; +import type { + LinkEntity, + LinkItemType, + ListResponse, + Numberish, +} from "../../types"; +import type { BaseIndexer } from "./base"; type LinksQuery = { /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; /** The link type to filter by. e.g. 'follow' */ - linkType?: string + linkType?: string; /** The link item type to filter by. e.g. 'Character' */ - linkItemType?: LinkItemType + linkItemType?: LinkItemType; /** The fromCharacterId to filter by. */ - fromCharacterId?: Numberish + fromCharacterId?: Numberish; /** The toCharacterId to filter by. */ - toCharacterId?: Numberish + toCharacterId?: Numberish; /** The toAddress to filter by. */ - toAddress?: Address + toAddress?: Address; /** The toNoteId to filter by. */ - toNoteId?: Numberish + toNoteId?: Numberish; /** The toContractAddress to filter by. */ - toContractAddress?: Address + toContractAddress?: Address; /** The toTokenId to filter by. */ - toTokenId?: Numberish + toTokenId?: Numberish; /** The toLinklistId to filter by. */ - toLinklistId?: Numberish + toLinklistId?: Numberish; /** The toUri to filter by. */ - toUri?: string + toUri?: string; /** The order to sort by. */ - order?: 'asc' | 'desc' -} + order?: "asc" | "desc"; +}; export class LinkIndexer { constructor(private base: BaseIndexer) {} @@ -50,10 +50,10 @@ export class LinkIndexer { * @returns The list of links. */ getMany(characterId: Numberish, options: LinksQuery = {}) { - const url = `/characters/${characterId}/links` + const url = `/characters/${characterId}/links`; return this.base.fetch>(url, { params: options, - }) + }); } /** @@ -67,10 +67,10 @@ export class LinkIndexer { * @returns The list of links. */ getManyByLinklistId(linklistId: Numberish, options: LinksQuery = {}) { - const url = `/linklists/${linklistId}/links` + const url = `/linklists/${linklistId}/links`; return this.base.fetch>(url, { params: options, - }) + }); } /** @@ -90,19 +90,19 @@ export class LinkIndexer { order, }: { /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; /** The link type to filter by. e.g. 'follow' */ - linkType?: string + linkType?: string; /** The order to sort by. */ - order?: 'asc' | 'desc' + order?: "asc" | "desc"; } = {}, ) { - const url = `/characters/${characterId}/backlinks` + const url = `/characters/${characterId}/backlinks`; return this.base.fetch>(url, { params: { limit, cursor, linkType, order }, - }) + }); } /** @@ -122,16 +122,16 @@ export class LinkIndexer { order, }: { /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; /** The link type to filter by. e.g. 'follow' */ - linkType?: string + linkType?: string; /** The order to sort by. */ - order?: 'asc' | 'desc' + order?: "asc" | "desc"; } = {}, ) { - const url = `/addresses/${address}/backlinks` + const url = `/addresses/${address}/backlinks`; return this.base.fetch>(url, { params: { limit, @@ -139,7 +139,7 @@ export class LinkIndexer { linkType, order, }, - }) + }); } /** @@ -161,19 +161,19 @@ export class LinkIndexer { order, }: { /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; /** The link type to filter by. e.g. 'follow' */ - linkType?: string + linkType?: string; /** The order to sort by. */ - order?: 'asc' | 'desc' + order?: "asc" | "desc"; } = {}, ) { - const url = `/notes/${characterId}/${noteId}/backlinks` + const url = `/notes/${characterId}/${noteId}/backlinks`; return this.base.fetch>(url, { params: { limit, cursor, linkType, order }, - }) + }); } /** @@ -195,19 +195,19 @@ export class LinkIndexer { order, }: { /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; /** The link type to filter by. e.g. 'follow' */ - linkType?: string + linkType?: string; /** The order to sort by. */ - order?: 'asc' | 'desc' + order?: "asc" | "desc"; } = {}, ) { - const url = `/erc721s/${contractAddress}/${tokenId}/backlinks` + const url = `/erc721s/${contractAddress}/${tokenId}/backlinks`; return this.base.fetch>(url, { params: { limit, cursor, linkType, order }, - }) + }); } /** @@ -227,16 +227,16 @@ export class LinkIndexer { order, }: { /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; /** The link type to filter by. e.g. 'follow' */ - linkType?: string + linkType?: string; /** The order to sort by. */ - order?: 'asc' | 'desc' + order?: "asc" | "desc"; } = {}, ) { - const url = `/linklists/${linklistId}/backlinks` + const url = `/linklists/${linklistId}/backlinks`; return this.base.fetch>(url, { params: { limit, @@ -244,7 +244,7 @@ export class LinkIndexer { linkType, order, }, - }) + }); } /** @@ -264,16 +264,16 @@ export class LinkIndexer { order, }: { /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; /** The link type to filter by. e.g. 'follow' */ - linkType?: string + linkType?: string; /** The order to sort by. */ - order?: 'asc' | 'desc' + order?: "asc" | "desc"; } = {}, ) { - const url = `/anyuris/${uri}/backlinks` + const url = `/anyuris/${uri}/backlinks`; return this.base.fetch>(url, { params: { limit, @@ -281,6 +281,6 @@ export class LinkIndexer { linkType, order, }, - }) + }); } } diff --git a/src/indexer/subapis/link_module.ts b/src/indexer/subapis/link_module.ts index 5248ee34d..e7ab8560f 100644 --- a/src/indexer/subapis/link_module.ts +++ b/src/indexer/subapis/link_module.ts @@ -1,11 +1,11 @@ -import { type Address } from 'viem' -import { - type LinkModuleEntity, - type LinkModuleTargetItemType, - type ListResponse, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { Address } from "viem"; +import type { + LinkModuleEntity, + LinkModuleTargetItemType, + ListResponse, + Numberish, +} from "../../types"; +import type { BaseIndexer } from "./base"; export class LinkModuleIndexer { constructor(private base: BaseIndexer) {} @@ -29,25 +29,25 @@ export class LinkModuleIndexer { cursor, }: { /** The target item type of the link module. */ - targetItemType?: LinkModuleTargetItemType + targetItemType?: LinkModuleTargetItemType; /** The address of the target item. */ - toAddress?: Address + toAddress?: Address; /** The character ID of the target item. */ - toCharacterId?: Numberish + toCharacterId?: Numberish; /** The note ID of the target item. */ - toNoteId?: Numberish + toNoteId?: Numberish; /** The contract address of the target item. */ - toContractAddress?: Address + toContractAddress?: Address; /** The token ID of the target item. */ - toTokenId?: Numberish + toTokenId?: Numberish; /** The linklist ID of the target item. */ - toLinklistId?: Numberish + toLinklistId?: Numberish; /** The limit of the number of items to return. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; } = {}) { - const url = '/link-modules' + const url = "/link-modules"; return this.base.fetch>(url, { params: { targetItemType, @@ -60,7 +60,7 @@ export class LinkModuleIndexer { limit, cursor, }, - }) + }); } /** @@ -72,7 +72,7 @@ export class LinkModuleIndexer { * @returns The link module. */ get(targetItemType: LinkModuleTargetItemType, linkValue: Numberish) { - const url = `/link-modules/${targetItemType}/${linkValue}` - return this.base.fetch(url) + const url = `/link-modules/${targetItemType}/${linkValue}`; + return this.base.fetch(url); } } diff --git a/src/indexer/subapis/linklist.ts b/src/indexer/subapis/linklist.ts index ec96be696..62db0ce61 100644 --- a/src/indexer/subapis/linklist.ts +++ b/src/indexer/subapis/linklist.ts @@ -1,9 +1,5 @@ -import { - type LinklistEntity, - type ListResponse, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { LinklistEntity, ListResponse, Numberish } from "../../types"; +import type { BaseIndexer } from "./base"; export class LinklistIndexer { constructor(private base: BaseIndexer) {} @@ -23,21 +19,21 @@ export class LinklistIndexer { cursor, }: { /** The link type to filter by. */ - linkType?: string + linkType?: string; /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; } = {}, ) { - const url = `/characters/${characterId}/linklists` + const url = `/characters/${characterId}/linklists`; return this.base.fetch>(url, { params: { linkType, limit, cursor, }, - }) + }); } /** @@ -47,7 +43,7 @@ export class LinklistIndexer { * @returns The character. */ get(linklistId: Numberish) { - const url = `/linklists/${linklistId}` - return this.base.fetch(url) + const url = `/linklists/${linklistId}`; + return this.base.fetch(url); } } diff --git a/src/indexer/subapis/metadata.ts b/src/indexer/subapis/metadata.ts index 379bbe80c..8af769c61 100644 --- a/src/indexer/subapis/metadata.ts +++ b/src/indexer/subapis/metadata.ts @@ -1,9 +1,5 @@ -import { - type CharacterMetadata, - type NoteMetadata, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { CharacterMetadata, NoteMetadata, Numberish } from "../../types"; +import type { BaseIndexer } from "./base"; export class MetadataIndexer { constructor(private base: BaseIndexer) {} @@ -14,8 +10,8 @@ export class MetadataIndexer { * @param characterId - the character id */ syncForCharacter(characterId: Numberish) { - const url = `/characters/${characterId}/metadata/sync` - return this.base.fetch(url) + const url = `/characters/${characterId}/metadata/sync`; + return this.base.fetch(url); } /** @@ -25,7 +21,7 @@ export class MetadataIndexer { * @param noteId - the note id */ syncForNote(characterId: Numberish, noteId: Numberish) { - const url = `/notes/${characterId}/${noteId}/metadata/sync` - return this.base.fetch(url) + const url = `/notes/${characterId}/${noteId}/metadata/sync`; + return this.base.fetch(url); } } diff --git a/src/indexer/subapis/mint_module.ts b/src/indexer/subapis/mint_module.ts index 3b6aa783e..4d704d0ee 100644 --- a/src/indexer/subapis/mint_module.ts +++ b/src/indexer/subapis/mint_module.ts @@ -1,10 +1,10 @@ -import { - type ListResponse, - type MintModuleEntity, - type MintModuleTargetItemType, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { + ListResponse, + MintModuleEntity, + MintModuleTargetItemType, + Numberish, +} from "../../types"; +import type { BaseIndexer } from "./base"; export class MintModuleIndexer { constructor(private base: BaseIndexer) {} @@ -24,17 +24,17 @@ export class MintModuleIndexer { cursor, }: { /** The target item type of the mint module. */ - targetItemType?: MintModuleTargetItemType + targetItemType?: MintModuleTargetItemType; /** The character ID of the target item. */ - toCharacterId?: Numberish + toCharacterId?: Numberish; /** The note ID of the target item. */ - toNoteId?: Numberish + toNoteId?: Numberish; /** The limit of the number of items to return. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; } = {}) { - const url = '/mint-modules' + const url = "/mint-modules"; return this.base.fetch>(url, { params: { targetItemType, @@ -43,7 +43,7 @@ export class MintModuleIndexer { limit, cursor, }, - }) + }); } /** @@ -55,7 +55,7 @@ export class MintModuleIndexer { * @returns The mint module. */ get(targetItemType: MintModuleTargetItemType, linkValue: Numberish) { - const url = `/mint-modules/${targetItemType}/${linkValue}` - return this.base.fetch(url) + const url = `/mint-modules/${targetItemType}/${linkValue}`; + return this.base.fetch(url); } } diff --git a/src/indexer/subapis/minted_note.ts b/src/indexer/subapis/minted_note.ts index 0ad28cdec..968c42937 100644 --- a/src/indexer/subapis/minted_note.ts +++ b/src/indexer/subapis/minted_note.ts @@ -1,11 +1,11 @@ -import { type Address } from 'viem' -import { - type ListResponse, - type MintedNoteEntity, - type NoteMetadata, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { Address } from "viem"; +import type { + ListResponse, + MintedNoteEntity, + NoteMetadata, + Numberish, +} from "../../types"; +import type { BaseIndexer } from "./base"; export class MintedNoteIndexer { constructor(private base: BaseIndexer) {} @@ -29,20 +29,20 @@ export class MintedNoteIndexer { order, }: { /** The character ID of the note */ - noteCharacterId?: Numberish + noteCharacterId?: Numberish; /** THe note id */ - noteId?: Numberish + noteId?: Numberish; /** The `metadata.content.variant` to filter by. */ - variant?: NoteMetadata['variant'] + variant?: NoteMetadata["variant"]; /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; /** The order to sort by. */ - order?: 'asc' | 'desc' + order?: "asc" | "desc"; } = {}, ) { - const url = `/addresses/${address}/minted/notes` + const url = `/addresses/${address}/minted/notes`; return this.base.fetch>(url, { params: { noteCharacterId, @@ -52,7 +52,7 @@ export class MintedNoteIndexer { cursor, order, }, - }) + }); } /** @@ -74,16 +74,16 @@ export class MintedNoteIndexer { order, }: { /** The address of the owner */ - owner?: Address + owner?: Address; /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; /** The order to sort by. */ - order?: 'asc' | 'desc' + order?: "asc" | "desc"; } = {}, ) { - const url = `/notes/${characterId}/${noteId}/minted` + const url = `/notes/${characterId}/${noteId}/minted`; return this.base.fetch>(url, { params: { owner, @@ -91,7 +91,7 @@ export class MintedNoteIndexer { cursor, order, }, - }) + }); } /** @@ -103,7 +103,7 @@ export class MintedNoteIndexer { * @returns The minted note. */ get(contractAddress: Address, tokenId: Numberish) { - const url = `/minted/notes/${contractAddress}/${tokenId}` - return this.base.fetch(url) + const url = `/minted/notes/${contractAddress}/${tokenId}`; + return this.base.fetch(url); } } diff --git a/src/indexer/subapis/newbie.ts b/src/indexer/subapis/newbie.ts index fe726f9e4..d0372e9ce 100644 --- a/src/indexer/subapis/newbie.ts +++ b/src/indexer/subapis/newbie.ts @@ -1,19 +1,19 @@ -import { type Address } from 'viem' -import { - type CharacterMetadata, - type EmailUserEntity, - type LinkItemNote, - type LinkItemType, - type NoteEntity, - type NoteMetadata, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { Address } from "viem"; +import type { + CharacterMetadata, + EmailUserEntity, + LinkItemNote, + LinkItemType, + NoteEntity, + NoteMetadata, + Numberish, +} from "../../types"; +import type { BaseIndexer } from "./base"; export class NewbieIndexer { constructor(private base: BaseIndexer) {} - token: string | undefined + token: string | undefined; /** * Ask for a verify-code to be sent to an email box for registration @@ -21,11 +21,11 @@ export class NewbieIndexer { * @category Newbie */ requestSignUpEmail(email: string) { - const url = '/newbie/account/signup/email' + const url = "/newbie/account/signup/email"; return this.base.fetch<{ ok: boolean }>(url, { - method: 'POST', + method: "POST", data: { email }, - }) + }); } /** @@ -33,11 +33,11 @@ export class NewbieIndexer { * @category Newbie */ verifySignUpCode(email: string, code: string) { - const url = '/newbie/account/signup/email/verify' + const url = "/newbie/account/signup/email/verify"; return this.base.fetch<{ ok: boolean }>(url, { - method: 'POST', + method: "POST", data: { email, code }, - }) + }); } /** @@ -46,18 +46,18 @@ export class NewbieIndexer { * @returns The token of the new user */ async signUp(options: { - email: string - emailVerifyCode: string - password: string - characterName: string + email: string; + emailVerifyCode: string; + password: string; + characterName: string; }) { - const url = '/newbie/account/signup' + const url = "/newbie/account/signup"; const { token } = await this.base.fetch<{ token: string }>(url, { - method: 'PUT', + method: "PUT", data: options, - }) - this.token = token - return token + }); + this.token = token; + return token; } /** @@ -66,13 +66,13 @@ export class NewbieIndexer { * @returns The token of the user */ async signIn(email: string, password: string) { - const url = '/newbie/account/signin' + const url = "/newbie/account/signin"; const { token } = await this.base.fetch<{ token: string }>(url, { - method: 'POST', + method: "POST", data: { email, password }, - }) - this.token = token - return token + }); + this.token = token; + return token; } /** @@ -80,11 +80,11 @@ export class NewbieIndexer { * @category Newbie */ requestResetPasswordEmail(email: string) { - const url = '/v1/newbie/account/reset-password/email' + const url = "/v1/newbie/account/reset-password/email"; return this.base.fetch<{ ok: boolean }>(url, { - method: 'POST', + method: "POST", data: { email }, - }) + }); } /** @@ -92,11 +92,11 @@ export class NewbieIndexer { * @category Newbie */ verifyResetPasswordCode(email: string, code: string) { - const url = '/newbie/account/reset-password/email/verify' + const url = "/newbie/account/reset-password/email/verify"; return this.base.fetch<{ ok: boolean }>(url, { - method: 'POST', + method: "POST", data: { email, code }, - }) + }); } /** @@ -104,31 +104,31 @@ export class NewbieIndexer { * @category Newbie */ resetPassword(options: { - email: string - emailVerifyCode: string - password: string + email: string; + emailVerifyCode: string; + password: string; }) { - const url = '/newbie/account/reset-password' + const url = "/newbie/account/reset-password"; return this.base.fetch<{ ok: boolean }>(url, { - method: 'POST', + method: "POST", data: options, - }) + }); } /** * Get current user information */ getAccount() { - const url = '/newbie/account' - return this.base.fetch(url, { token: this.token }) + const url = "/newbie/account"; + return this.base.fetch(url, { token: this.token }); } /** * Delete current user information */ async deleteAccount() { - const url = '/newbie/account' - await this.base.fetch(url, { method: 'DELETE', token: this.token }) + const url = "/newbie/account"; + await this.base.fetch(url, { method: "DELETE", token: this.token }); } linkNote({ @@ -137,15 +137,15 @@ export class NewbieIndexer { linkType, data, }: { - characterId: number - noteId: number - linkType: string - data?: string + characterId: number; + noteId: number; + linkType: string; + data?: string; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/newbie/contract/links/notes/${characterId}/${noteId}/${linkType}`, - { method: 'PUT', data: { data }, token: this.token }, - ) + { method: "PUT", data: { data }, token: this.token }, + ); } unlinkNote({ @@ -153,14 +153,14 @@ export class NewbieIndexer { characterId, linkType, }: { - characterId: number - noteId: number - linkType: string + characterId: number; + noteId: number; + linkType: string; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/newbie/contract/links/notes/${characterId}/${noteId}/${linkType}`, - { method: 'DELETE', token: this.token }, - ) + { method: "DELETE", token: this.token }, + ); } linkCharacter({ @@ -168,14 +168,14 @@ export class NewbieIndexer { linkType, data, }: { - toCharacterId: number - linkType: string - data?: string + toCharacterId: number; + linkType: string; + data?: string; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/newbie/contract/links/characters/${toCharacterId}/${linkType}`, - { method: 'PUT', data: { data }, token: this.token }, - ) + { method: "PUT", data: { data }, token: this.token }, + ); } linkCharacters({ @@ -184,64 +184,64 @@ export class NewbieIndexer { linkType, data, }: { - toCharacterIds: number[] - toAddresses: string[] - linkType: string - data?: string + toCharacterIds: number[]; + toAddresses: string[]; + linkType: string; + data?: string; }) { return this.base.fetch<{ transactionHash: string; data: string }>( - '/newbie/contract/links/characters', + "/newbie/contract/links/characters", { - method: 'PUT', + method: "PUT", data: { data, linkType, toCharacterIds, toAddresses }, token: this.token, }, - ) + ); } unlinkCharacter({ toCharacterId, linkType, }: { - toCharacterId: number - linkType: string + toCharacterId: number; + linkType: string; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/newbie/contract/links/characters/${toCharacterId}/${linkType}`, - { method: 'DELETE', token: this.token }, - ) + { method: "DELETE", token: this.token }, + ); } putNote(data: { - metadata: NoteMetadata - linkItemType?: LinkItemType - linkItem?: LinkItemNote - locked?: boolean + metadata: NoteMetadata; + linkItemType?: LinkItemType; + linkItem?: LinkItemNote; + locked?: boolean; }) { return this.base.fetch<{ transactionHash: string; data: string }>( - '/newbie/contract/notes', - { method: 'PUT', token: this.token, data }, - ) + "/newbie/contract/notes", + { method: "PUT", token: this.token, data }, + ); } updateNote({ noteId, metadata, }: { - metadata: NoteMetadata - noteId: NoteEntity['noteId'] + metadata: NoteMetadata; + noteId: NoteEntity["noteId"]; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/newbie/contract/notes/${noteId}/metadata`, - { method: 'POST', token: this.token, data: { metadata } }, - ) + { method: "POST", token: this.token, data: { metadata } }, + ); } - deleteNote({ noteId }: { noteId: NoteEntity['noteId'] }) { + deleteNote({ noteId }: { noteId: NoteEntity["noteId"] }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/newbie/contract/notes/${noteId}`, - { method: 'DELETE', token: this.token }, - ) + { method: "DELETE", token: this.token }, + ); } /** @@ -250,50 +250,50 @@ export class NewbieIndexer { refillBalance() { return this.base.fetch< { balance: string } | { ok: boolean; message: string } - >('/newbie/account/balance/refill', { method: 'POST', token: this.token }) + >("/newbie/account/balance/refill", { method: "POST", token: this.token }); } updateHandle(handle: string): Promise<{ ok: boolean; msg: string }> { - return this.base.fetch('/newbie/contract/characters/me/handle', { - method: 'POST', + return this.base.fetch("/newbie/contract/characters/me/handle", { + method: "POST", token: this.token, data: { handle }, - }) + }); } updateCharactersMetadata({ metadata, - mode = 'merge', + mode = "merge", }: { - metadata: CharacterMetadata - mode?: 'merge' | 'replace' + metadata: CharacterMetadata; + mode?: "merge" | "replace"; }) { return this.base.fetch<{ transactionHash: string; data: string }>( - '/newbie/contract/characters/me/metadata', + "/newbie/contract/characters/me/metadata", { - method: 'POST', + method: "POST", data: { metadata, mode }, token: this.token, }, - ) + ); } tipCharacter({ characterId, amount, }: { - characterId: Numberish + characterId: Numberish; /** amount to tip. (CSB in wei) */ - amount: Numberish + amount: Numberish; }) { return this.base.fetch<{ transactionHash: string; data: boolean }>( - '/newbie/contract/tips', + "/newbie/contract/tips", { - method: 'POST', + method: "POST", data: { characterId, amount }, token: this.token, }, - ) + ); } tipCharacterForNote({ @@ -301,19 +301,19 @@ export class NewbieIndexer { noteId, amount, }: { - characterId: Numberish - noteId: Numberish + characterId: Numberish; + noteId: Numberish; /** amount to tip. (CSB in wei) */ - amount: Numberish + amount: Numberish; }) { return this.base.fetch<{ transactionHash: string; data: boolean }>( - '/newbie/contract/tips', + "/newbie/contract/tips", { - method: 'POST', + method: "POST", data: { characterId, noteId, amount }, token: this.token, }, - ) + ); } /** @@ -321,8 +321,8 @@ export class NewbieIndexer { */ getWithdrawProof() { return this.base.fetch<{ proof: Address; nonce: number; expires: number }>( - '/newbie/account/withdraw/proof', - { method: 'GET', token: this.token }, - ) + "/newbie/account/withdraw/proof", + { method: "GET", token: this.token }, + ); } } diff --git a/src/indexer/subapis/note.ts b/src/indexer/subapis/note.ts index ce39a2fe6..233085ae7 100644 --- a/src/indexer/subapis/note.ts +++ b/src/indexer/subapis/note.ts @@ -1,72 +1,72 @@ -import { type Address } from 'viem' -import { - type LinkItemType, - type ListResponse, - type NoteEntity, - type NoteMetadata, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { Address } from "viem"; +import type { + LinkItemType, + ListResponse, + NoteEntity, + NoteMetadata, + Numberish, +} from "../../types"; +import type { BaseIndexer } from "./base"; export type NoteQueryOptions = { /** The owner(s) of notes */ - characterId?: Numberish | Numberish[] + characterId?: Numberish | Numberish[]; /** Excluded owner(s) of notes. This has higher priority than `characterId` */ - excludeCharacterId?: Numberish | Numberish[] + excludeCharacterId?: Numberish | Numberish[]; /** The link item type to filter by. e.g. 'Character' */ - linkItemType?: LinkItemType + linkItemType?: LinkItemType; /** The toCharacterId to filter by. */ - toCharacterId?: Numberish + toCharacterId?: Numberish; /** The toAddress to filter by. */ - toAddress?: Address + toAddress?: Address; /** The toNoteId to filter by. */ - toNoteId?: Numberish + toNoteId?: Numberish; /** The toContractAddress to filter by. */ - toContractAddress?: Address + toContractAddress?: Address; /** The toTokenId to filter by. */ - toTokenId?: Numberish + toTokenId?: Numberish; /** The toLinklistId to filter by. */ - toLinklistId?: Numberish + toLinklistId?: Numberish; /** The toUri to filter by. */ - toUri?: string + toUri?: string; /** Only returns locked notes or not */ - locked?: boolean + locked?: boolean; /** Also returns deleted notes or not */ - includeDeleted?: boolean + includeDeleted?: boolean; /** The `metadata.content.tags` to filter by. */ - tags?: string | string[] + tags?: string | string[]; /** The `metadata.content.sources` to filter by. */ - sources?: string | string[] + sources?: string | string[]; /** The `metadata.content.external_urls` to filter by. */ - externalUrls?: string | string[] + externalUrls?: string | string[]; /** The `metadata.content.variant` to filter by. */ - variant?: NoteMetadata['variant'] + variant?: NoteMetadata["variant"]; /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; /** Whether to include notes whose metadata content are empty even though the `tags`, `sources` or `external_urls` fields are specified. */ - includeEmptyMetadata?: boolean + includeEmptyMetadata?: boolean; /** Whether to include the character data in the response. */ - includeCharacter?: boolean + includeCharacter?: boolean; /** Whether to include the head character data in the response. */ - includeHeadCharacter?: boolean + includeHeadCharacter?: boolean; /** Whether to include the head note data in the response. */ - includeHeadNote?: boolean + includeHeadNote?: boolean; /** Whether to include nested notes */ - includeNestedNotes?: boolean + includeNestedNotes?: boolean; /** How many levels of nested notes to include */ - nestedNotesDepth?: 1 | 2 | 3 + nestedNotesDepth?: 1 | 2 | 3; /** How many nested notes to include per note */ - nestedNotesLimit?: Numberish + nestedNotesLimit?: Numberish; /** The orderBy of the returned list. */ - orderBy?: 'createdAt' | 'updatedAt' | 'publishedAt' | 'viewCount' + orderBy?: "createdAt" | "updatedAt" | "publishedAt" | "viewCount"; /** * The order of the returned list. * @default 'desc' **/ - order?: 'asc' | 'desc' -} + order?: "asc" | "desc"; +}; export class NoteIndexer { constructor(private base: BaseIndexer) {} @@ -79,10 +79,10 @@ export class NoteIndexer { * @returns The list of notes. */ getMany(params: NoteQueryOptions = {}) { - const url = '/notes' + const url = "/notes"; return this.base.fetch< ListResponse }> - >(url, { params }) + >(url, { params }); } /** @@ -95,12 +95,12 @@ export class NoteIndexer { */ getManyOfCharacterFollowing( characterId: Numberish, - params: Omit = {}, + params: Omit = {}, ) { - const url = `/characters/${characterId}/notes/following` + const url = `/characters/${characterId}/notes/following`; return this.base.fetch< ListResponse }> - >(url, { params }) + >(url, { params }); } /** @@ -112,8 +112,8 @@ export class NoteIndexer { * @returns The note. */ get(characterId: Numberish, noteId: Numberish) { - const url = `/characters/${characterId}/notes/${noteId}` - return this.base.fetch(url) + const url = `/characters/${characterId}/notes/${noteId}`; + return this.base.fetch(url); } /** @@ -130,15 +130,15 @@ export class NoteIndexer { sources, }: { /** The `metadata.content.sources` to filter by. */ - sources?: string | string[] + sources?: string | string[]; } = {}, ) { - const url = `/characters/${characterId}/notes/tags` + const url = `/characters/${characterId}/notes/tags`; return this.base.fetch>(url, { params: { sources, }, - }) + }); } /** @@ -155,14 +155,14 @@ export class NoteIndexer { tags, }: { /** The `metadata.content.tags` to filter by. */ - tags?: string | string[] + tags?: string | string[]; } = {}, ) { - const url = `/characters/${characterId}/notes/sources` + const url = `/characters/${characterId}/notes/sources`; return this.base.fetch>(url, { params: { tags, }, - }) + }); } } diff --git a/src/indexer/subapis/notification.ts b/src/indexer/subapis/notification.ts index 071249d8a..eb64e2447 100644 --- a/src/indexer/subapis/notification.ts +++ b/src/indexer/subapis/notification.ts @@ -1,11 +1,11 @@ -import { type Hash } from 'viem' -import { - type ListResponse, - type NotificationEntity, - type NotificationTypeKey, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { Hash } from "viem"; +import type { + ListResponse, + NotificationEntity, + NotificationTypeKey, + Numberish, +} from "../../types"; +import type { BaseIndexer } from "./base"; export class NotificationIndexer { constructor(private base: BaseIndexer) {} @@ -30,22 +30,22 @@ export class NotificationIndexer { cursor, }: { /** The type of notification */ - type?: NotificationTypeKey | NotificationTypeKey[] + type?: NotificationTypeKey | NotificationTypeKey[]; /** Whether to include metadata of the character */ - includeCharacterMetadata?: boolean + includeCharacterMetadata?: boolean; /** Whether to include actions invoked by the character itself */ - includeSelfInvoked?: boolean + includeSelfInvoked?: boolean; /** Whether to include `isRead` attribute to indicate whether the notification is read */ - includeIsRead?: boolean + includeIsRead?: boolean; /** @deprecated Whether to read notifications. Please use */ - read?: boolean + read?: boolean; /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; } = {}, ) { - const url = `/characters/${characterId}/notifications` + const url = `/characters/${characterId}/notifications`; return this.base.fetch>(url, { params: { type, @@ -56,7 +56,7 @@ export class NotificationIndexer { limit, cursor, }, - }) + }); } /** @@ -67,10 +67,10 @@ export class NotificationIndexer { * @returns The latest notification date string. */ markAllAsRead(characterId: Numberish) { - const url = `/characters/${characterId}/notifications/read` + const url = `/characters/${characterId}/notifications/read`; return this.base.fetch<{ data: string }>(url, { - method: 'POST', - }) + method: "POST", + }); } /** @@ -90,15 +90,15 @@ export class NotificationIndexer { includeCharacterMetadata, }: { /** Whether to include metadata of the character */ - includeCharacterMetadata?: boolean + includeCharacterMetadata?: boolean; } = {}, ) { - const url = `/characters/${characterId}/notifications/${transactionHash}/${logIndex}` + const url = `/characters/${characterId}/notifications/${transactionHash}/${logIndex}`; return this.base.fetch(url, { params: { includeCharacterMetadata, }, - }) + }); } /** @@ -107,7 +107,7 @@ export class NotificationIndexer { * @param characterId - The characterId of the notification owner. */ getUnreadCount(characterId: Numberish) { - const url = `/characters/${characterId}/notifications/unread/count` - return this.base.fetch<{ count: number }>(url) + const url = `/characters/${characterId}/notifications/unread/count`; + return this.base.fetch<{ count: number }>(url); } } diff --git a/src/indexer/subapis/operators.ts b/src/indexer/subapis/operators.ts index 6866243d8..69bf7e423 100644 --- a/src/indexer/subapis/operators.ts +++ b/src/indexer/subapis/operators.ts @@ -1,10 +1,10 @@ -import { type Address } from 'viem' -import { - type CharacterOperatorEntity, - type ListResponse, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { Address } from "viem"; +import type { + CharacterOperatorEntity, + ListResponse, + Numberish, +} from "../../types"; +import type { BaseIndexer } from "./base"; export class OperatorIndexer { constructor(private base: BaseIndexer) {} @@ -23,15 +23,15 @@ export class OperatorIndexer { cursor, }: { /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; } = {}, ) { - const url = `/characters/${characterId}/operators` + const url = `/characters/${characterId}/operators`; return this.base.fetch>(url, { params: { limit, cursor }, - }) + }); } /** @@ -42,7 +42,7 @@ export class OperatorIndexer { * @returns The primary character. */ getForCharacter(characterId: Numberish, address: Address) { - const url = `/characters/${characterId}/operators/${address}` - return this.base.fetch(url) + const url = `/characters/${characterId}/operators/${address}`; + return this.base.fetch(url); } } diff --git a/src/indexer/subapis/search.ts b/src/indexer/subapis/search.ts index c64f39608..304eb6367 100644 --- a/src/indexer/subapis/search.ts +++ b/src/indexer/subapis/search.ts @@ -1,11 +1,11 @@ -import { - type CharacterEntity, - type LinkItemType, - type ListResponse, - type NoteEntity, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { + CharacterEntity, + LinkItemType, + ListResponse, + NoteEntity, + Numberish, +} from "../../types"; +import type { BaseIndexer } from "./base"; export class SearchIndexer { constructor(private base: BaseIndexer) {} @@ -22,15 +22,15 @@ export class SearchIndexer { query: string, options: { /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; }, ) { - const url = '/characters/search' + const url = "/characters/search"; return this.base.fetch>(url, { params: { q: query, ...options }, - }) + }); } /** @@ -45,29 +45,29 @@ export class SearchIndexer { query: string, options: { /** Notes with the given tags. */ - tags?: string[] + tags?: string[]; /** Notes with the given sources. */ - sources?: string[] + sources?: string[]; /** The link item type to filter by. e.g. 'Character' */ - linkItemType?: LinkItemType + linkItemType?: LinkItemType; /** Note with the given characterId owner */ - characterId?: Numberish + characterId?: Numberish; /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; /** Whether to include character metadata */ - includeCharacterMetadata?: boolean + includeCharacterMetadata?: boolean; /** The order of the returned list. */ - orderBy?: 'createdAt' | 'updatedAt' | 'publishedAt' | 'viewCount' + orderBy?: "createdAt" | "updatedAt" | "publishedAt" | "viewCount"; }, ) { - const url = '/notes/search' + const url = "/notes/search"; return this.base.fetch>(url, { params: { q: query, ...options, }, - }) + }); } } diff --git a/src/indexer/subapis/siwe.ts b/src/indexer/subapis/siwe.ts index dbc57d45a..be5a17636 100644 --- a/src/indexer/subapis/siwe.ts +++ b/src/indexer/subapis/siwe.ts @@ -1,87 +1,87 @@ -import { - type CharacterMetadata, - type LinkItemNote, - type LinkItemType, - type NoteEntity, - type NoteMetadata, -} from '../../types' -import { type BaseIndexer } from './base' +import type { + CharacterMetadata, + LinkItemNote, + LinkItemType, + NoteEntity, + NoteMetadata, +} from "../../types"; +import type { BaseIndexer } from "./base"; export type BaseSigner = { - signMessage: (msg: string) => Promise - getAddress: () => Promise -} + signMessage: (msg: string) => Promise; + getAddress: () => Promise; +}; export class SiweIndexer { constructor(private base: BaseIndexer) {} - token: string | undefined + token: string | undefined; async signIn(signer: BaseSigner): Promise<{ token: string }> { - const address = await signer.getAddress() + const address = await signer.getAddress(); - if (!address) throw new Error(`SignInError: invalid address ${address}`) + if (!address) throw new Error(`SignInError: invalid address ${address}`); const { message } = await this.base.fetch<{ message: string }>( - '/siwe/challenge', + "/siwe/challenge", { - method: 'POST', + method: "POST", data: { address, domain: - (typeof window !== 'undefined' && window.location.host) || - 'crossbell.io', + (typeof window !== "undefined" && window.location.host) || + "crossbell.io", uri: - (typeof window !== 'undefined' && window.location.origin) || - 'https://crossbell.io', - statement: 'Sign in with Crossbell to the app.', + (typeof window !== "undefined" && window.location.origin) || + "https://crossbell.io", + statement: "Sign in with Crossbell to the app.", }, }, - ) + ); - const { token } = await this.base.fetch<{ token: string }>('/siwe/login', { - method: 'POST', + const { token } = await this.base.fetch<{ token: string }>("/siwe/login", { + method: "POST", data: { address, signature: await signer.signMessage(message), }, - }) + }); - this.token = token - return { token } + this.token = token; + return { token }; } getAccount() { - return this.base.fetch<{ address: string }>('/siwe/account', { - method: 'GET', + return this.base.fetch<{ address: string }>("/siwe/account", { + method: "GET", token: this.token, - }) + }); } getBalance() { - return this.base.fetch<{ balance: string }>('/siwe/account/balance', { - method: 'GET', + return this.base.fetch<{ balance: string }>("/siwe/account/balance", { + method: "GET", token: this.token, - }) + }); } updateMetadata({ - mode = 'merge', + mode = "merge", characterId, metadata, }: { - characterId: number - mode?: 'merge' | 'replace' - metadata: CharacterMetadata + characterId: number; + mode?: "merge" | "replace"; + metadata: CharacterMetadata; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/siwe/contract/characters/${characterId}/metadata`, { - method: 'POST', + method: "POST", token: this.token, data: { metadata, mode }, }, - ) + ); } linkNote({ @@ -91,16 +91,16 @@ export class SiweIndexer { linkType, data, }: { - fromCharacterId: number - characterId: number - noteId: number - linkType: string - data?: string + fromCharacterId: number; + characterId: number; + noteId: number; + linkType: string; + data?: string; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/siwe/contract/characters/${fromCharacterId}/links/notes/${characterId}/${noteId}/${linkType}`, - { method: 'PUT', token: this.token, data: { data } }, - ) + { method: "PUT", token: this.token, data: { data } }, + ); } unlinkNote({ @@ -109,15 +109,15 @@ export class SiweIndexer { characterId, linkType, }: { - fromCharacterId: number - characterId: number - noteId: number - linkType: string + fromCharacterId: number; + characterId: number; + noteId: number; + linkType: string; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/siwe/contract/characters/${fromCharacterId}/links/notes/${characterId}/${noteId}/${linkType}`, - { method: 'DELETE', token: this.token }, - ) + { method: "DELETE", token: this.token }, + ); } linkCharacter({ @@ -126,15 +126,15 @@ export class SiweIndexer { linkType, data, }: { - characterId: number - toCharacterId: number - linkType: string - data?: string + characterId: number; + toCharacterId: number; + linkType: string; + data?: string; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/siwe/contract/characters/${characterId}/links/characters/${toCharacterId}/${linkType}`, - { method: 'PUT', token: this.token, data: { data } }, - ) + { method: "PUT", token: this.token, data: { data } }, + ); } linkCharacters({ @@ -144,20 +144,20 @@ export class SiweIndexer { linkType, data, }: { - characterId: number - toCharacterIds: number[] - toAddresses: string[] - linkType: string - data?: string + characterId: number; + toCharacterIds: number[]; + toAddresses: string[]; + linkType: string; + data?: string; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/siwe/contract/characters/${characterId}/links/characters`, { - method: 'PUT', + method: "PUT", token: this.token, data: { data, linkType, toCharacterIds, toAddresses }, }, - ) + ); } unlinkCharacter({ @@ -165,34 +165,34 @@ export class SiweIndexer { toCharacterId, linkType, }: { - characterId: number - toCharacterId: number - linkType: string + characterId: number; + toCharacterId: number; + linkType: string; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/siwe/contract/characters/${characterId}/links/characters/${toCharacterId}/${linkType}`, - { method: 'DELETE', token: this.token }, - ) + { method: "DELETE", token: this.token }, + ); } putNote({ characterId, ...body }: { - characterId: number - metadata: NoteMetadata - linkItemType?: LinkItemType - linkItem?: LinkItemNote - locked?: boolean + characterId: number; + metadata: NoteMetadata; + linkItemType?: LinkItemType; + linkItem?: LinkItemNote; + locked?: boolean; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/siwe/contract/characters/${characterId}/notes`, { - method: 'PUT', + method: "PUT", token: this.token, data: body, }, - ) + ); } updateNote({ @@ -200,44 +200,44 @@ export class SiweIndexer { noteId, metadata, }: { - characterId: NoteEntity['characterId'] - noteId: NoteEntity['noteId'] - metadata: NoteMetadata + characterId: NoteEntity["characterId"]; + noteId: NoteEntity["noteId"]; + metadata: NoteMetadata; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/siwe/contract/characters/${characterId}/notes/${noteId}/metadata`, { - method: 'POST', + method: "POST", token: this.token, data: { metadata }, }, - ) + ); } deleteNote({ characterId, noteId, }: { - characterId: number - noteId: NoteEntity['noteId'] + characterId: number; + noteId: NoteEntity["noteId"]; }) { return this.base.fetch<{ transactionHash: string; data: string }>( `/siwe/contract/characters/${characterId}/notes/${noteId}`, { - method: 'DELETE', + method: "DELETE", token: this.token, }, - ) + ); } mintNote({ characterId, noteId }: { characterId: number; noteId: number }) { return this.base.fetch<{ - transactionHash: string - data: { contractAddress: string; tokenId: number } + transactionHash: string; + data: { contractAddress: string; tokenId: number }; }>(`/siwe/contract/characters/${characterId}/notes/${noteId}/minted`, { - method: 'PUT', + method: "PUT", token: this.token, data: {}, - }) + }); } } diff --git a/src/indexer/subapis/stat.ts b/src/indexer/subapis/stat.ts index aefc93bd1..69bf0879a 100644 --- a/src/indexer/subapis/stat.ts +++ b/src/indexer/subapis/stat.ts @@ -1,9 +1,9 @@ -import { - type CharacterStatEntity, - type NoteStatEntity, - type Numberish, -} from '../../types' -import { type BaseIndexer } from './base' +import type { + CharacterStatEntity, + NoteStatEntity, + Numberish, +} from "../../types"; +import type { BaseIndexer } from "./base"; export class StatIndexer { constructor(private base: BaseIndexer) {} @@ -15,8 +15,8 @@ export class StatIndexer { * @returns The stat of the character. */ getForCharacter(characterId: Numberish) { - const url = `/stat/characters/${characterId}` - return this.base.fetch(url) + const url = `/stat/characters/${characterId}`; + return this.base.fetch(url); } /** @@ -27,7 +27,7 @@ export class StatIndexer { * @returns The stat of the note. */ getForNote(characterId: Numberish, noteId: Numberish) { - const url = `/stat/notes/${characterId}/${noteId}` - return this.base.fetch(url) + const url = `/stat/notes/${characterId}/${noteId}`; + return this.base.fetch(url); } } diff --git a/src/indexer/subapis/tip.ts b/src/indexer/subapis/tip.ts index 1b5d09cda..32fd58a07 100644 --- a/src/indexer/subapis/tip.ts +++ b/src/indexer/subapis/tip.ts @@ -1,6 +1,6 @@ -import { type Address, type Hash } from 'viem' -import { type ListResponse, type Numberish, type TipEntity } from '../../types' -import { type BaseIndexer } from './base' +import type { Address, Hash } from "viem"; +import type { ListResponse, Numberish, TipEntity } from "../../types"; +import type { BaseIndexer } from "./base"; export class TipIndexer { constructor(private base: BaseIndexer) {} @@ -24,23 +24,23 @@ export class TipIndexer { cursor, }: { /** The characterId of the tip sender. */ - characterId?: Numberish + characterId?: Numberish; /** The characterId of the tip receiver. */ - toCharacterId?: Numberish + toCharacterId?: Numberish; /** The noteId of the tip receiver. */ - toNoteId?: Numberish + toNoteId?: Numberish; /** The token address of the token sent in tip. */ - tokenAddress?: Address + tokenAddress?: Address; /** Whether to include tips with zero amount. */ - includeZeroAmount?: boolean + includeZeroAmount?: boolean; /** Whether to include character and note metadata */ - includeMetadata?: boolean + includeMetadata?: boolean; /** Limit the count of items returned. */ - limit?: Numberish + limit?: Numberish; /** Used for pagination. */ - cursor?: string + cursor?: string; } = {}) { - const url = '/tips' + const url = "/tips"; return this.base.fetch>(url, { params: { @@ -53,7 +53,7 @@ export class TipIndexer { limit, cursor, }, - }) + }); } /** @@ -65,7 +65,7 @@ export class TipIndexer { * @returns The tip. */ get(transactionHash: Hash, logIndex: Numberish) { - const url = `/tips/${transactionHash}/${logIndex}` - return this.base.fetch(url) + const url = `/tips/${transactionHash}/${logIndex}`; + return this.base.fetch(url); } } diff --git a/src/indexer/utils.ts b/src/indexer/utils.ts index 0db4ebdc7..438a0149b 100644 --- a/src/indexer/utils.ts +++ b/src/indexer/utils.ts @@ -1,8 +1,8 @@ -import { MaybeArray, Numberish } from '../types/utils' +import type { MaybeArray, Numberish } from "../types/utils"; -let headersScope: HeadersInit | undefined +let headersScope: HeadersInit | undefined; export function getHeadersScope() { - return headersScope + return headersScope; } /** @@ -29,13 +29,13 @@ export function withHeaders( headers: HeadersInit, ): T { const ensure = () => { - headersScope = headers - } + headersScope = headers; + }; - ensure() - const ret = fn(ensure) - headersScope = undefined - return ret + ensure(); + const ret = fn(ensure); + headersScope = undefined; + return ret; } export function createSearchParamsString( @@ -53,5 +53,5 @@ export function createSearchParamsString( ? values.map((value) => [key, value.toString()]) : [[key, values.toString()]], ), - ).toString() + ).toString(); } diff --git a/src/ipfs/index.ts b/src/ipfs/index.ts index dc8ca73f7..e98ec4776 100644 --- a/src/ipfs/index.ts +++ b/src/ipfs/index.ts @@ -1,152 +1,152 @@ -import { ipfsFetch, isIpfsUrl } from '@crossbell/ipfs-fetch' -import retry from 'async-retry' -import { - type BaseMetadata, - type CharacterMetadata, - type Metadata, - type NoteMetadata, -} from '../types/metadata' -import { normalizeCharacterMetadata } from '../utils/normalize-character-metadata' - -let IPFS_GATEWAY = 'https://w3s.link/ipfs/' +import { ipfsFetch, isIpfsUrl } from "@crossbell/ipfs-fetch"; +import retry from "async-retry"; +import type { + BaseMetadata, + CharacterMetadata, + Metadata, + NoteMetadata, +} from "../types/metadata"; +import { normalizeCharacterMetadata } from "../utils/normalize-character-metadata"; + +let IPFS_GATEWAY = "https://w3s.link/ipfs/"; export function getIpfsGateway() { - return IPFS_GATEWAY + return IPFS_GATEWAY; } export function setIpfsGateway(gateway: string) { - IPFS_GATEWAY = gateway + IPFS_GATEWAY = gateway; } export interface IpfsResponse { - status: 'ok' | 'error' - cid: string + status: "ok" | "error"; + cid: string; /** ipfs url. e.g. `ipfs://...` */ - url: string + url: string; /** http url. e.g. `https://...` */ - web2url: string + web2url: string; } export function ipfsUploadJson(json: any): Promise { return retry( async () => { - const res = await fetch('https://ipfs-relay.crossbell.io/json', { - method: 'POST', + const res = await fetch("https://ipfs-relay.crossbell.io/json", { + method: "POST", body: JSON.stringify(json), - }).then((res) => res.json()) + }).then((res) => res.json()); - return res as IpfsResponse + return res as IpfsResponse; }, { retries: 3 }, - ) + ); } export function ipfsUploadFile(file: File | Blob): Promise { return retry( async () => { - const formData = new FormData() + const formData = new FormData(); - formData.append('file', file) + formData.append("file", file); - const res = await fetch('https://ipfs-relay.crossbell.io/upload', { - method: 'post', + const res = await fetch("https://ipfs-relay.crossbell.io/upload", { + method: "post", body: formData, - }) + }); - return res.json() + return res.json(); }, { retries: 3 }, - ) + ); } export async function ipfsMetadataToUri(metadata: Metadata) { - const res = await ipfsUploadJson(metadata) + const res = await ipfsUploadJson(metadata); - if (!res?.url?.startsWith('ipfs://')) { - throw new Error('upload to IPFS failed') + if (!res?.url?.startsWith("ipfs://")) { + throw new Error("upload to IPFS failed"); } - return res.url + return res.url; } export function ipfsUriToMetadata(uri: string) { return retry( async () => { if (isIpfsUrl(uri)) { - const res = await ipfsFetch(uri).then((res) => res.text()) + const res = await ipfsFetch(uri).then((res) => res.text()); try { - const json = JSON.parse(res) - return json as T + const json = JSON.parse(res); + return json as T; } catch { - throw new Error(`Failed to parse metadata from uri: ${uri}`) + throw new Error(`Failed to parse metadata from uri: ${uri}`); } } - let res: T | string = '' + let res: T | string = ""; try { - res = (await fetch(uri).then((res) => res.text())) as string - res = JSON.parse(res) - return res as T + res = (await fetch(uri).then((res) => res.text())) as string; + res = JSON.parse(res); + return res as T; } catch { throw new Error( `Failed to fetch metadata from uri: ${uri} . Response: ${ res as string }`, - ) + ); } }, { retries: 3 }, - ) + ); } export async function ipfsParseMetadataOrUri( - type: 'note', + type: "note", metadataOrUri: NoteMetadata | string, retrieveMetadataIfNeeded?: false, -): Promise<{ uri: string }> +): Promise<{ uri: string }>; export async function ipfsParseMetadataOrUri( - type: 'note', + type: "note", metadataOrUri: NoteMetadata | string, retrieveMetadataIfNeeded: true, -): Promise<{ metadata: NoteMetadata; uri: string }> +): Promise<{ metadata: NoteMetadata; uri: string }>; export async function ipfsParseMetadataOrUri( - type: 'character', + type: "character", metadataOrUri: CharacterMetadata | string, retrieveMetadataIfNeeded?: false, -): Promise<{ uri: string }> +): Promise<{ uri: string }>; export async function ipfsParseMetadataOrUri( - type: 'character', + type: "character", metadataOrUri: CharacterMetadata | string, retrieveMetadataIfNeeded: true, -): Promise<{ metadata: CharacterMetadata; uri: string }> +): Promise<{ metadata: CharacterMetadata; uri: string }>; export async function ipfsParseMetadataOrUri( - type: BaseMetadata['type'], + type: BaseMetadata["type"], metadataOrUri: T | string, retrieveMetadataIfNeeded = false, ): Promise<{ metadata?: T; uri: string }> { - if (metadataOrUri === '') { - return { uri: '', metadata: undefined } + if (metadataOrUri === "") { + return { uri: "", metadata: undefined }; } - let uri: string - let metadata: T | undefined - if (typeof metadataOrUri === 'string') { - uri = metadataOrUri + let uri: string; + let metadata: T | undefined; + if (typeof metadataOrUri === "string") { + uri = metadataOrUri; metadata = retrieveMetadataIfNeeded ? await ipfsUriToMetadata(uri) - : undefined + : undefined; } else { - metadata = metadataOrUri + metadata = metadataOrUri; if (!metadata.type) { - metadata.type = type + metadata.type = type; } - uri = await ipfsMetadataToUri(metadata) + uri = await ipfsMetadataToUri(metadata); } - if (metadata && type === 'character') { - metadata = normalizeCharacterMetadata(metadata) + if (metadata && type === "character") { + metadata = normalizeCharacterMetadata(metadata); } return { metadata, uri, - } + }; } diff --git a/src/network/chains.ts b/src/network/chains.ts index 795b5ffae..3e53386c4 100644 --- a/src/network/chains.ts +++ b/src/network/chains.ts @@ -1,29 +1,29 @@ -import { defineChain } from 'viem/chains/utils' +import { defineChain } from "viem/chains/utils"; export const crossbellTestnet = /*#__PURE__*/ defineChain({ id: 3_636, - name: 'Crossbell L2 Testnet', + name: "Crossbell L2 Testnet", nativeCurrency: { decimals: 18, - name: 'ETH', - symbol: 'ETH', + name: "ETH", + symbol: "ETH", }, rpcUrls: { default: { - http: ['https://rpc.testnet.crossbell.io'], + http: ["https://rpc.testnet.crossbell.io"], }, }, blockExplorers: { default: { - name: 'CrossScan Testnet', - url: 'https://scan.testnet.crossbell.io/', + name: "CrossScan Testnet", + url: "https://scan.testnet.crossbell.io/", }, }, contracts: { multicall3: { - address: '0xcA11bde05977b3631167028862bE2a173976CA11', + address: "0xcA11bde05977b3631167028862bE2a173976CA11", blockCreated: 0, }, }, testnet: true, -}) +}); diff --git a/src/network/index.ts b/src/network/index.ts index deb9bf4bc..654eeff05 100644 --- a/src/network/index.ts +++ b/src/network/index.ts @@ -1,23 +1,23 @@ -import { type Address, type WalletClient } from 'viem' -import { crossbell } from 'viem/chains' -import { crossbellTestnet } from './chains' +import type { Address, WalletClient } from "viem"; +import { crossbell } from "viem/chains"; +import { crossbellTestnet } from "./chains"; -export { crossbell, crossbellTestnet } +export { crossbell, crossbellTestnet }; export const CONTRACT_ADDRESS = { - ENTRY: '0xa6f969045641Cf486a747A2688F3a5A6d43cd0D8', - PERIPHERY: '0x96e96b7af62d628ce7eb2016d2c1d2786614ea73', - NEWBIE_VILLA: '0xD0c83f0BB2c61D55B3d33950b70C59ba2f131caA', - CBT: '0x3D1b588a6Bcd728Bb61570ced6656eA4C05e404f', - TIPS: '0x0058be0845952D887D1668B5545de995E12e8783', - TIPS_WITH_CONFIG: '0xF1375C069998d06E123B800cF0566e44DA1BE30E', - TIPS_WITH_FEE: '0xf3158018f932981d0005701dDC22Ce51477E436d', - MIRA: '0xAfB95CC0BD320648B3E8Df6223d9CDD05EbeDC64', - LINKLIST: '0xFc8C75bD5c26F50798758f387B698f207a016b6A', - GCSB: '0x4200000000000000000000000000000000000301', -} as const satisfies Record + ENTRY: "0xa6f969045641Cf486a747A2688F3a5A6d43cd0D8", + PERIPHERY: "0x96e96b7af62d628ce7eb2016d2c1d2786614ea73", + NEWBIE_VILLA: "0xD0c83f0BB2c61D55B3d33950b70C59ba2f131caA", + CBT: "0x3D1b588a6Bcd728Bb61570ced6656eA4C05e404f", + TIPS: "0x0058be0845952D887D1668B5545de995E12e8783", + TIPS_WITH_CONFIG: "0xF1375C069998d06E123B800cF0566e44DA1BE30E", + TIPS_WITH_FEE: "0xf3158018f932981d0005701dDC22Ce51477E436d", + MIRA: "0xAfB95CC0BD320648B3E8Df6223d9CDD05EbeDC64", + LINKLIST: "0xFc8C75bD5c26F50798758f387B698f207a016b6A", + GCSB: "0x4200000000000000000000000000000000000301", +} as const satisfies Record; -let JSON_RPC_ADDRESS: string | undefined +let JSON_RPC_ADDRESS: string | undefined; /** * @deprecated @@ -28,7 +28,7 @@ let JSON_RPC_ADDRESS: string | undefined * to change the JSON RPC address. */ export function getJsonRpcAddress() { - return JSON_RPC_ADDRESS + return JSON_RPC_ADDRESS; } /** * @deprecated @@ -39,7 +39,7 @@ export function getJsonRpcAddress() { * to change the JSON RPC address. */ export function setJsonRpcAddress(address: string) { - JSON_RPC_ADDRESS = address + JSON_RPC_ADDRESS = address; } /** @@ -48,7 +48,7 @@ export function setJsonRpcAddress(address: string) { * @returns A boolean value indicating if the current network is the Crossbell mainnet. */ export async function isCrossbellMainnet(client: WalletClient) { - return (await client.getChainId()) === crossbell.id + return (await client.getChainId()) === crossbell.id; } /** @@ -57,7 +57,7 @@ export async function isCrossbellMainnet(client: WalletClient) { * @returns A boolean value indicating if the current network is the Crossbell testnet. */ export async function isCrossbellTestnet(client: WalletClient) { - return (await client.getChainId()) === crossbellTestnet.id + return (await client.getChainId()) === crossbellTestnet.id; } /** @@ -66,6 +66,6 @@ export async function isCrossbellTestnet(client: WalletClient) { * @returns A boolean value indicating if the current network is the Crossbell mainnet or testnet. */ export async function isCrossbellChain(client: WalletClient) { - const chainId = await client.getChainId() - return chainId === crossbell.id || chainId === crossbellTestnet.id + const chainId = await client.getChainId(); + return chainId === crossbell.id || chainId === crossbellTestnet.id; } diff --git a/src/types/contract/base.ts b/src/types/contract/base.ts index e752a8850..710890f5c 100644 --- a/src/types/contract/base.ts +++ b/src/types/contract/base.ts @@ -1,13 +1,13 @@ -import { type Abi } from 'abitype' -import { - type Account, - type Address, - type Chain, - type ContractFunctionArgs, - type ContractFunctionName, - type ReadContractParameters, - type WriteContractParameters, -} from 'viem' +import type { Abi } from "abitype"; +import type { + Account, + Address, + Chain, + ContractFunctionArgs, + ContractFunctionName, + ReadContractParameters, + WriteContractParameters, +} from "viem"; /** * The result of a call to a transaction / get function. @@ -17,10 +17,10 @@ export type Result< HasTxHash extends boolean = false, > = HasTxHash extends true ? { - data: T - transactionHash: Address - } - : { data: T } + data: T; + transactionHash: Address; + } + : { data: T }; /** * @description Construct a type with the properties of union type T except for those in type K. @@ -28,30 +28,30 @@ export type Result< * type Result = UnionOmit<{ a: string, b: number } | { a: string, b: undefined, c: number }, 'a'> * => { b: number } | { b: undefined, c: number } */ -type UnionOmit = T extends any ? Omit : never +type UnionOmit = T extends any ? Omit : never; export type ReadOverrides< TAbi extends Abi, - TFunctionName extends ContractFunctionName, + TFunctionName extends ContractFunctionName, > = UnionOmit< ReadContractParameters< TAbi, TFunctionName, - ContractFunctionArgs + ContractFunctionArgs >, - 'abi' | 'address' | 'args' | 'functionName' -> + "abi" | "address" | "args" | "functionName" +>; export type WriteOverrides< TAbi extends Abi, - TFunctionName extends ContractFunctionName, + TFunctionName extends ContractFunctionName, > = UnionOmit< WriteContractParameters< TAbi, TFunctionName, - ContractFunctionArgs, + ContractFunctionArgs, Chain, Account >, - 'abi' | 'address' | 'args' | 'functionName' -> + "abi" | "address" | "args" | "functionName" +>; diff --git a/src/types/contract/character.ts b/src/types/contract/character.ts index 764c6d1fe..1a6baa787 100644 --- a/src/types/contract/character.ts +++ b/src/types/contract/character.ts @@ -1,16 +1,16 @@ -import { type CharacterMetadata } from '../metadata' +import type { CharacterMetadata } from "../metadata"; export interface Character { /** The id of this character. */ - characterId: bigint + characterId: bigint; /** The handle of this character. */ - handle: string + handle: string; /** The metadata URI of this character. */ - uri: string + uri: string; /** The metadata of this character. */ - metadata?: CharacterMetadata + metadata?: CharacterMetadata; /** The social token of this character. */ - socialToken: string + socialToken: string; /** The count of notes this character posted. */ - noteCount: bigint + noteCount: bigint; } diff --git a/src/types/contract/index.ts b/src/types/contract/index.ts index b456419bd..d154683ab 100644 --- a/src/types/contract/index.ts +++ b/src/types/contract/index.ts @@ -1,5 +1,5 @@ -export * from './base' -export * from './character' -export * from './link' -export * from './note' -export * from './module' +export * from "./base"; +export * from "./character"; +export * from "./link"; +export * from "./note"; +export * from "./module"; diff --git a/src/types/contract/link.ts b/src/types/contract/link.ts index bfafee3fd..13708e2fe 100644 --- a/src/types/contract/link.ts +++ b/src/types/contract/link.ts @@ -1,12 +1,12 @@ -import { type Address } from 'viem' +import type { Address } from "viem"; export interface LinkItemMap { - Character: LinkItemCharacter - Address: LinkItemAddress - Note: LinkItemNote - ERC721: LinkItemERC721 - Linklist: LinkItemLinklist - AnyUri: LinkItemAnyUri + Character: LinkItemCharacter; + Address: LinkItemAddress; + Note: LinkItemNote; + ERC721: LinkItemERC721; + Linklist: LinkItemLinklist; + AnyUri: LinkItemAnyUri; // | 'CharacterLink' // | 'AddressLink' // | 'NoteLink' @@ -15,31 +15,31 @@ export interface LinkItemMap { // | 'AnyLink' } -export type LinkItemType = keyof LinkItemMap -export type LinkItem = LinkItemMap[LinkItemType] +export type LinkItemType = keyof LinkItemMap; +export type LinkItem = LinkItemMap[LinkItemType]; export interface LinkItemCharacter { - characterId: bigint + characterId: bigint; } export interface LinkItemAddress { - address: Address + address: Address; } export interface LinkItemNote { - characterId: bigint - noteId: bigint + characterId: bigint; + noteId: bigint; } export interface LinkItemERC721 { - contractAddress: Address - tokenId: string + contractAddress: Address; + tokenId: string; } export interface LinkItemLinklist { - linklistId: bigint + linklistId: bigint; } export interface LinkItemAnyUri { - uri: string + uri: string; } diff --git a/src/types/contract/module.ts b/src/types/contract/module.ts index 72379150a..30631b590 100644 --- a/src/types/contract/module.ts +++ b/src/types/contract/module.ts @@ -1,38 +1,38 @@ -import { type AbiType, type Address } from 'abitype' +import type { AbiType, Address } from "abitype"; -export interface MintOrLinkModule { +export interface MintOrLinkModule { /* Global unique id */ - id: string + id: string; /* Type of the module */ - type: T + type: T; /* The contract address of this module */ - address: Address + address: Address; /* Display name */ - name: string + name: string; /* Display Description */ - description: string + description: string; /* Module icon, an image url, in 256*256px */ - icon?: string + icon?: string; /* The character id of the author */ - authorCharacterId?: number + authorCharacterId?: number; /* Data structure of init data, a form to fill out in frontend */ initDataStructure: { /* Label of this field */ - label: string + label: string; /* Data type of this field. E.g. "address[]", "uint256", ... see https://docs.soliditylang.org/en/latest/abi-spec.html#types */ - type: AbiType + type: AbiType; /* Description of this field */ - description: string + description: string; /* Whether or not required, default: true */ - required?: boolean - }[] + required?: boolean; + }[]; /* Published date string */ - createdAt?: string + createdAt?: string; } export interface MintOrLinkModuleConfig { /** The contract address of this module */ - address: Address + address: Address; /** The init data */ - data: any[] + data: any[]; } diff --git a/src/types/contract/note.ts b/src/types/contract/note.ts index 4d9ae41e1..72eba46bb 100644 --- a/src/types/contract/note.ts +++ b/src/types/contract/note.ts @@ -1,55 +1,55 @@ -import { type Address } from 'viem' -import { type NoteMetadata } from '../metadata' -import { type Numberish } from '../utils' -import { type LinkItem, type LinkItemType } from './link' -import { type MintOrLinkModuleConfig } from './module' +import type { Address } from "viem"; +import type { NoteMetadata } from "../metadata"; +import type { Numberish } from "../utils"; +import type { LinkItem, LinkItemType } from "./link"; +import type { MintOrLinkModuleConfig } from "./module"; export interface Note { /** The character id of the address who owns the note. */ - characterId: bigint + characterId: bigint; /** The id of this note. Each id is unique under one character. */ - noteId: bigint + noteId: bigint; /** The content URI of this note. */ - contentUri: string + contentUri: string; /** The metadata content of this note. */ - metadata?: NoteMetadata + metadata?: NoteMetadata; /** The bytes32 representation of the link if there is one. */ - linkItemType: string + linkItemType: string; /** The type of the link if there is one. */ - linkItemTypeString?: LinkItemType + linkItemTypeString?: LinkItemType; - linkItem: T + linkItem: T; /** * The primary key (id) of the linking target. It's keccak256 encoded. * You may need to use `contract.getLinkingXXX(linkKey)` to get the target. **/ - linkKey: string + linkKey: string; /** The link module address of the note. */ - linkModule: string + linkModule: string; /** NFT contract address if this is a minted NFT note. */ - contractAddress: Address + contractAddress: Address; /** The mint module address of the note */ - mintModule: string + mintModule: string; /** Whether or not this note has been deleted. */ - deleted: boolean + deleted: boolean; /** Whether or not this note has been locked. I.e., not able to be edited. */ - locked: boolean + locked: boolean; } export interface PostNoteOptions { /** If locked, the note will be not able to be edited. */ - locked?: boolean + locked?: boolean; /** The mint module */ - mintModule?: MintOrLinkModuleConfig + mintModule?: MintOrLinkModuleConfig; /** The link module */ - linkModule?: MintOrLinkModuleConfig + linkModule?: MintOrLinkModuleConfig; /** The character ID of the owner who post this note. Must be your own character, otherwise it will be rejected. */ - characterId: Numberish + characterId: Numberish; /** The metadata or URI of the content you want to post. */ - metadataOrUri: NoteMetadata | string + metadataOrUri: NoteMetadata | string; } diff --git a/src/types/index.ts b/src/types/index.ts index ddecb3583..d108da34f 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,4 +1,4 @@ -export * from './contract' -export * from './indexer' -export * from './metadata' -export * from './utils' +export * from "./contract"; +export * from "./indexer"; +export * from "./metadata"; +export * from "./utils"; diff --git a/src/types/indexer/achievement.ts b/src/types/indexer/achievement.ts index 54227bc97..c8402e8e2 100644 --- a/src/types/indexer/achievement.ts +++ b/src/types/indexer/achievement.ts @@ -1,55 +1,55 @@ -import { type Hash } from 'viem' +import type { Hash } from "viem"; export interface AchievementInfo { - tokenId: number - name: FunctionStringCallback - uri: string + tokenId: number; + name: FunctionStringCallback; + uri: string; - description: string - media: string - attributes: [{ trait_type: string; value: string }] + description: string; + media: string; + attributes: [{ trait_type: string; value: string }]; - targetValue?: number - unit: string + targetValue?: number; + unit: string; } export enum AchievementStatus { - INACTIVE = 'INACTIVE', - MINTABLE = 'MINTABLE', - MINTED = 'MINTED', + INACTIVE = "INACTIVE", + MINTABLE = "MINTABLE", + MINTED = "MINTED", } -export type AchievementStatusKey = keyof typeof AchievementStatus +export type AchievementStatusKey = keyof typeof AchievementStatus; export interface AchievementItem { - tokenId: number - characterId: number - name: string - status: AchievementStatusKey - tokenNumber: number - currentValue: number - createdAt: string - updatedAt: string - mintedAt: string | null - transactionHash: Hash | null - info: AchievementInfo + tokenId: number; + characterId: number; + name: string; + status: AchievementStatusKey; + tokenNumber: number; + currentValue: number; + createdAt: string; + updatedAt: string; + mintedAt: string | null; + transactionHash: Hash | null; + info: AchievementInfo; stat: { - mintedCount: number - } + mintedCount: number; + }; } export interface AchievementItemGroup { info: { - name: string - title: string - } - items: AchievementItem[] + name: string; + title: string; + }; + items: AchievementItem[]; } export interface AchievementSection { info: { - name: string - title: string - } - groups: AchievementItemGroup[] + name: string; + title: string; + }; + groups: AchievementItemGroup[]; } diff --git a/src/types/indexer/base.ts b/src/types/indexer/base.ts index 096193de1..f4f7c9832 100644 --- a/src/types/indexer/base.ts +++ b/src/types/indexer/base.ts @@ -1,5 +1,5 @@ export interface ListResponse { - cursor: string | null - count: number - list: T[] + cursor: string | null; + count: number; + list: T[]; } diff --git a/src/types/indexer/character.ts b/src/types/indexer/character.ts index 9e664e873..334605d76 100644 --- a/src/types/indexer/character.ts +++ b/src/types/indexer/character.ts @@ -1,23 +1,23 @@ -import { type Address, type Hash } from 'viem' -import { type MetadataEntity } from './metadata' +import type { Address, Hash } from "viem"; +import type { MetadataEntity } from "./metadata"; export interface CharacterEntity { - characterId: number - handle: string - primary: boolean - uri: string | null - metadata?: MetadataEntity<'CHARACTER'> | null - socialToken: string | null - operator: Address - owner: Address - fromAddress: Address - createdAt: string - updatedAt: string - deletedAt: string | null - transactionHash: Hash - blockNumber: number - logIndex: number - updatedTransactionHash: Hash - updatedBlockNumber: number - updatedLogIndex: number + characterId: number; + handle: string; + primary: boolean; + uri: string | null; + metadata?: MetadataEntity<"CHARACTER"> | null; + socialToken: string | null; + operator: Address; + owner: Address; + fromAddress: Address; + createdAt: string; + updatedAt: string; + deletedAt: string | null; + transactionHash: Hash; + blockNumber: number; + logIndex: number; + updatedTransactionHash: Hash; + updatedBlockNumber: number; + updatedLogIndex: number; } diff --git a/src/types/indexer/feed.ts b/src/types/indexer/feed.ts index 2a34fd1de..4f5b406c6 100644 --- a/src/types/indexer/feed.ts +++ b/src/types/indexer/feed.ts @@ -1,75 +1,69 @@ -import { type Address, type Hash } from 'viem' -import { type CharacterEntity } from './character' -import { type LinkEntity } from './link' -import { - type LinkModuleEntity, - type LinkModuleTargetItemType, -} from './link_module' -import { type LinklistEntity } from './linklist' -import { - type MintModuleEntity, - type MintModuleTargetItemType, -} from './mint_module' -import { type MintedNoteEntity } from './minted_note' -import { type NoteEntity } from './note' -import { type TipConfigEntity, type TipEntity } from './tip' +import type { Address, Hash } from "viem"; +import type { CharacterEntity } from "./character"; +import type { LinkEntity } from "./link"; +import type { LinkModuleEntity, LinkModuleTargetItemType } from "./link_module"; +import type { LinklistEntity } from "./linklist"; +import type { MintModuleEntity, MintModuleTargetItemType } from "./mint_module"; +import type { MintedNoteEntity } from "./minted_note"; +import type { NoteEntity } from "./note"; +import type { TipConfigEntity, TipEntity } from "./tip"; export enum FeedType { - CREATE_CHARACTER = 'CREATE_CHARACTER', - UPDATE_CHARACTER_HANDLE = 'UPDATE_CHARACTER_HANDLE', - UPDATE_CHARACTER_METADATA = 'UPDATE_CHARACTER_METADATA', - UPDATE_PRIMARY_CHARACTER = 'UPDATE_PRIMARY_CHARACTER', - TRANSFER_CHARACTER = 'TRANSFER_CHARACTER', - ADD_OPERATOR = 'ADD_OPERATOR', - REMOVE_OPERATOR = 'REMOVE_OPERATOR', - CREATE_LINKLIST = 'CREATE_LINKLIST', - UPDATE_LINKLIST = 'UPDATE_LINKLIST', - TRANSFER_LINKLIST = 'TRANSFER_LINKLIST', - LINK = 'LINK', - UNLINK = 'UNLINK', - POST_NOTE = 'POST_NOTE', - POST_NOTE_FOR_NOTE = 'POST_NOTE_FOR_NOTE', - POST_NOTE_FOR_ANY_URI = 'POST_NOTE_FOR_ANY_URI', - POST_NOTE_FOR_ADDRESS = 'POST_NOTE_FOR_ADDRESS', - POST_NOTE_FOR_LINKLIST = 'POST_NOTE_FOR_LINKLIST', - POST_NOTE_FOR_CHARACTER = 'POST_NOTE_FOR_CHARACTER', - POST_NOTE_FOR_ERC721 = 'POST_NOTE_FOR_ERC721', - UPDATE_NOTE = 'UPDATE_NOTE', - LOCK_NOTE = 'LOCK_NOTE', - DELETE_NOTE = 'DELETE_NOTE', - MINT_NOTE = 'MINT_NOTE', - TRANSFER_MINTED_NOTE = 'TRANSFER_MINTED_NOTE', - SET_LINK_MODULE = 'SET_LINK_MODULE', - SET_MINT_MODULE = 'SET_MINT_MODULE', - TIP_CHARACTER = 'TIP_CHARACTER', + CREATE_CHARACTER = "CREATE_CHARACTER", + UPDATE_CHARACTER_HANDLE = "UPDATE_CHARACTER_HANDLE", + UPDATE_CHARACTER_METADATA = "UPDATE_CHARACTER_METADATA", + UPDATE_PRIMARY_CHARACTER = "UPDATE_PRIMARY_CHARACTER", + TRANSFER_CHARACTER = "TRANSFER_CHARACTER", + ADD_OPERATOR = "ADD_OPERATOR", + REMOVE_OPERATOR = "REMOVE_OPERATOR", + CREATE_LINKLIST = "CREATE_LINKLIST", + UPDATE_LINKLIST = "UPDATE_LINKLIST", + TRANSFER_LINKLIST = "TRANSFER_LINKLIST", + LINK = "LINK", + UNLINK = "UNLINK", + POST_NOTE = "POST_NOTE", + POST_NOTE_FOR_NOTE = "POST_NOTE_FOR_NOTE", + POST_NOTE_FOR_ANY_URI = "POST_NOTE_FOR_ANY_URI", + POST_NOTE_FOR_ADDRESS = "POST_NOTE_FOR_ADDRESS", + POST_NOTE_FOR_LINKLIST = "POST_NOTE_FOR_LINKLIST", + POST_NOTE_FOR_CHARACTER = "POST_NOTE_FOR_CHARACTER", + POST_NOTE_FOR_ERC721 = "POST_NOTE_FOR_ERC721", + UPDATE_NOTE = "UPDATE_NOTE", + LOCK_NOTE = "LOCK_NOTE", + DELETE_NOTE = "DELETE_NOTE", + MINT_NOTE = "MINT_NOTE", + TRANSFER_MINTED_NOTE = "TRANSFER_MINTED_NOTE", + SET_LINK_MODULE = "SET_LINK_MODULE", + SET_MINT_MODULE = "SET_MINT_MODULE", + TIP_CHARACTER = "TIP_CHARACTER", } -export type FeedTypeKey = keyof typeof FeedType +export type FeedTypeKey = keyof typeof FeedType; export interface FeedEntity { - type: FeedType - character?: CharacterEntity - characterId?: number - linklist?: LinklistEntity - linklistId: number - link?: LinkEntity - linkValue?: string - note?: NoteEntity - noteId?: number - mintedNote?: MintedNoteEntity - contractAddress?: Address - tokenId?: number - linkModuleTargetItemType?: LinkModuleTargetItemType - linkModule?: LinkModuleEntity - mintModuleTargetItemType?: MintModuleTargetItemType - mintModule?: MintModuleEntity - tip?: TipEntity - tipConfig?: TipConfigEntity - owner: Address - createdAt: Date - updatedAt: Date - deletedAt: Date | null - transactionHash: Hash - blockNumber: number - logIndex: number + type: FeedType; + character?: CharacterEntity; + characterId?: number; + linklist?: LinklistEntity; + linklistId: number; + link?: LinkEntity; + linkValue?: string; + note?: NoteEntity; + noteId?: number; + mintedNote?: MintedNoteEntity; + contractAddress?: Address; + tokenId?: number; + linkModuleTargetItemType?: LinkModuleTargetItemType; + linkModule?: LinkModuleEntity; + mintModuleTargetItemType?: MintModuleTargetItemType; + mintModule?: MintModuleEntity; + tip?: TipEntity; + tipConfig?: TipConfigEntity; + owner: Address; + createdAt: Date; + updatedAt: Date; + deletedAt: Date | null; + transactionHash: Hash; + blockNumber: number; + logIndex: number; } diff --git a/src/types/indexer/index.ts b/src/types/indexer/index.ts index cd3e7dfd6..ccf1401d7 100644 --- a/src/types/indexer/index.ts +++ b/src/types/indexer/index.ts @@ -1,16 +1,16 @@ -export * from './achievement' -export * from './stat' -export * from './metadata' -export * from './base' -export * from './linklist' -export * from './character' -export * from './link' -export * from './note' -export * from './minted_note' -export * from './feed' -export * from './notification' -export * from './operator' -export * from './tip' -export * from './link_module' -export * from './mint_module' -export * from './newbie' +export * from "./achievement"; +export * from "./stat"; +export * from "./metadata"; +export * from "./base"; +export * from "./linklist"; +export * from "./character"; +export * from "./link"; +export * from "./note"; +export * from "./minted_note"; +export * from "./feed"; +export * from "./notification"; +export * from "./operator"; +export * from "./tip"; +export * from "./link_module"; +export * from "./mint_module"; +export * from "./newbie"; diff --git a/src/types/indexer/link.ts b/src/types/indexer/link.ts index f43f9a9ac..78213167e 100644 --- a/src/types/indexer/link.ts +++ b/src/types/indexer/link.ts @@ -1,36 +1,36 @@ -import { type Address, type Hash } from 'viem' -import { type LinkItemType } from '../contract' -import { type CharacterEntity } from './character' -import { type LinklistEntity } from './linklist' -import { type NoteEntity } from './note' +import type { Address, Hash } from "viem"; +import type { LinkItemType } from "../contract"; +import type { CharacterEntity } from "./character"; +import type { LinklistEntity } from "./linklist"; +import type { NoteEntity } from "./note"; export interface LinkEntity { - linklistId: number - linklist?: LinklistEntity - linkType: string - linkItemType: LinkItemType - linkValue: string - fromCharacterId: number | null - fromCharacter?: CharacterEntity | null - toCharacterId: number | null - toCharacter?: CharacterEntity | null - toAddress: Address | null - toNoteId: number | null - toNote?: NoteEntity | null - toContractAddress: Address | null - toTokenId: number | null - toLinklistId: number | null - toLinklist?: LinklistEntity | null - toUri: string | null - operator: Address - owner: Address - createdAt: string - updatedAt: string - deletedAt: string | null - transactionHash: Hash - blockNumber: number - logIndex: number - updatedTransactionHash: Hash - updatedBlockNumber: number - updatedLogIndex: number + linklistId: number; + linklist?: LinklistEntity; + linkType: string; + linkItemType: LinkItemType; + linkValue: string; + fromCharacterId: number | null; + fromCharacter?: CharacterEntity | null; + toCharacterId: number | null; + toCharacter?: CharacterEntity | null; + toAddress: Address | null; + toNoteId: number | null; + toNote?: NoteEntity | null; + toContractAddress: Address | null; + toTokenId: number | null; + toLinklistId: number | null; + toLinklist?: LinklistEntity | null; + toUri: string | null; + operator: Address; + owner: Address; + createdAt: string; + updatedAt: string; + deletedAt: string | null; + transactionHash: Hash; + blockNumber: number; + logIndex: number; + updatedTransactionHash: Hash; + updatedBlockNumber: number; + updatedLogIndex: number; } diff --git a/src/types/indexer/link_module.ts b/src/types/indexer/link_module.ts index 031be8c0e..ffe596b54 100644 --- a/src/types/indexer/link_module.ts +++ b/src/types/indexer/link_module.ts @@ -1,38 +1,38 @@ -import { type Address, type Hash } from 'viem' -import { type CharacterEntity } from './character' -import { type LinklistEntity } from './linklist' -import { type NoteEntity } from './note' +import type { Address, Hash } from "viem"; +import type { CharacterEntity } from "./character"; +import type { LinklistEntity } from "./linklist"; +import type { NoteEntity } from "./note"; export type LinkModuleTargetItemType = - | 'Address' - | 'Character' - | 'ERC721' - | 'Linklist' - | 'Note' + | "Address" + | "Character" + | "ERC721" + | "Linklist" + | "Note"; export interface LinkModuleEntity { - targetItemType: LinkModuleTargetItemType - linkValue: string - contractAddress: Address - initData: string - returnData: string - toCharacterId: number | null - toCharacter?: CharacterEntity | null - toAddress: Address - toNoteId: number | null - toNote?: NoteEntity | null - toContractAddress: Address | null - toTokenId: number | null - toLinklistId: number | null - toLinklist?: LinklistEntity | null - operator: Address - createdAt: Date - updatedAt: Date - deletedAt: Date | null - transactionHash: Hash - blockNumber: number - logIndex: number - updatedTransactionHash: Hash - updatedBlockNumber: number - updatedLogIndex: number + targetItemType: LinkModuleTargetItemType; + linkValue: string; + contractAddress: Address; + initData: string; + returnData: string; + toCharacterId: number | null; + toCharacter?: CharacterEntity | null; + toAddress: Address; + toNoteId: number | null; + toNote?: NoteEntity | null; + toContractAddress: Address | null; + toTokenId: number | null; + toLinklistId: number | null; + toLinklist?: LinklistEntity | null; + operator: Address; + createdAt: Date; + updatedAt: Date; + deletedAt: Date | null; + transactionHash: Hash; + blockNumber: number; + logIndex: number; + updatedTransactionHash: Hash; + updatedBlockNumber: number; + updatedLogIndex: number; } diff --git a/src/types/indexer/linklist.ts b/src/types/indexer/linklist.ts index 92bf48ff5..d8b506ffd 100644 --- a/src/types/indexer/linklist.ts +++ b/src/types/indexer/linklist.ts @@ -1,22 +1,22 @@ -import { type Address, type Hash } from 'viem' -import { type MetadataEntity } from './metadata' +import type { Address, Hash } from "viem"; +import type { MetadataEntity } from "./metadata"; export interface LinklistEntity { - linklistId: number - attached: boolean - fromCharacterId: number | null - linkType: string - uri: string | null - metadata?: MetadataEntity<'LINKLIST'> | null - operator: Address - owner: Address - fromAddress: Address - createdAt: string - updatedAt: string - transactionHash: Hash - blockNumber: number - logIndex: number - updatedTransactionHash: Hash - updatedBlockNumber: number - updatedLogIndex: number + linklistId: number; + attached: boolean; + fromCharacterId: number | null; + linkType: string; + uri: string | null; + metadata?: MetadataEntity<"LINKLIST"> | null; + operator: Address; + owner: Address; + fromAddress: Address; + createdAt: string; + updatedAt: string; + transactionHash: Hash; + blockNumber: number; + logIndex: number; + updatedTransactionHash: Hash; + updatedBlockNumber: number; + updatedLogIndex: number; } diff --git a/src/types/indexer/metadata.ts b/src/types/indexer/metadata.ts index 71836bea4..ad835b51b 100644 --- a/src/types/indexer/metadata.ts +++ b/src/types/indexer/metadata.ts @@ -1,15 +1,15 @@ -import { type CharacterMetadata, type NoteMetadata } from './../metadata' +import type { CharacterMetadata, NoteMetadata } from "./../metadata"; -export type MetadataType = 'CHARACTER' | 'NOTE' | 'LINKLIST' +export type MetadataType = "CHARACTER" | "NOTE" | "LINKLIST"; export interface MetadataEntity { - uri?: string - type?: MetadataType | null + uri?: string; + type?: MetadataType | null; content?: - | (T extends 'CHARACTER' + | (T extends "CHARACTER" ? CharacterMetadata - : T extends 'NOTE' - ? NoteMetadata - : object) - | null + : T extends "NOTE" + ? NoteMetadata + : object) + | null; } diff --git a/src/types/indexer/mint_module.ts b/src/types/indexer/mint_module.ts index e2651f995..82addc8c2 100644 --- a/src/types/indexer/mint_module.ts +++ b/src/types/indexer/mint_module.ts @@ -1,27 +1,27 @@ -import { type Address, type Hash } from 'viem' -import { type CharacterEntity } from './character' -import { type NoteEntity } from './note' +import type { Address, Hash } from "viem"; +import type { CharacterEntity } from "./character"; +import type { NoteEntity } from "./note"; -export type MintModuleTargetItemType = 'Note' +export type MintModuleTargetItemType = "Note"; export interface MintModuleEntity { - targetItemType: MintModuleTargetItemType - linkValue: string - contractAddress: Address - initData: string - returnData: string - toCharacterId: number | null - toCharacter?: CharacterEntity | null - toNoteId: number | null - toNote?: NoteEntity | null - operator: Address - createdAt: Date - updatedAt: Date - deletedAt: Date | null - transactionHash: Hash - blockNumber: number - logIndex: number - updatedTransactionHash: Hash - updatedBlockNumber: number - updatedLogIndex: number + targetItemType: MintModuleTargetItemType; + linkValue: string; + contractAddress: Address; + initData: string; + returnData: string; + toCharacterId: number | null; + toCharacter?: CharacterEntity | null; + toNoteId: number | null; + toNote?: NoteEntity | null; + operator: Address; + createdAt: Date; + updatedAt: Date; + deletedAt: Date | null; + transactionHash: Hash; + blockNumber: number; + logIndex: number; + updatedTransactionHash: Hash; + updatedBlockNumber: number; + updatedLogIndex: number; } diff --git a/src/types/indexer/minted_note.ts b/src/types/indexer/minted_note.ts index 29f722376..2b149f4b4 100644 --- a/src/types/indexer/minted_note.ts +++ b/src/types/indexer/minted_note.ts @@ -1,23 +1,23 @@ -import { type Address, type Hash } from 'viem' -import { type CharacterEntity } from './character' -import { type NoteEntity } from './note' +import type { Address, Hash } from "viem"; +import type { CharacterEntity } from "./character"; +import type { NoteEntity } from "./note"; export interface MintedNoteEntity { - noteCharacterId: number - noteCharacter?: CharacterEntity - noteId: number - note?: NoteEntity | null - contractAddress: Address - tokenId: number - operator: Address - owner: Address - fromAddress: Address - createdAt: string - updatedAt: string - transactionHash: Hash - blockNumber: number - logIndex: number - updatedTransactionHash: Hash - updatedBlockNumber: number - updatedLogIndex: number + noteCharacterId: number; + noteCharacter?: CharacterEntity; + noteId: number; + note?: NoteEntity | null; + contractAddress: Address; + tokenId: number; + operator: Address; + owner: Address; + fromAddress: Address; + createdAt: string; + updatedAt: string; + transactionHash: Hash; + blockNumber: number; + logIndex: number; + updatedTransactionHash: Hash; + updatedBlockNumber: number; + updatedLogIndex: number; } diff --git a/src/types/indexer/newbie.ts b/src/types/indexer/newbie.ts index 7fd789f4c..4bbda5ec5 100644 --- a/src/types/indexer/newbie.ts +++ b/src/types/indexer/newbie.ts @@ -1,10 +1,10 @@ export interface EmailUserEntity { - email: string - characterId?: number - characterWithdrawnAt?: string - characterWithdrawnTo?: string - csb?: string - createdAt: string - updatedAt: string - deletedAt?: string + email: string; + characterId?: number; + characterWithdrawnAt?: string; + characterWithdrawnTo?: string; + csb?: string; + createdAt: string; + updatedAt: string; + deletedAt?: string; } diff --git a/src/types/indexer/note.ts b/src/types/indexer/note.ts index 1ce65cddd..501cbce01 100644 --- a/src/types/indexer/note.ts +++ b/src/types/indexer/note.ts @@ -1,44 +1,44 @@ -import { type Address, type Hash } from 'viem' -import { type LinkItemType } from './../contract' -import { type CharacterEntity } from './character' -import { type LinklistEntity } from './linklist' -import { type MetadataEntity } from './metadata' +import type { Address, Hash } from "viem"; +import type { LinkItemType } from "./../contract"; +import type { CharacterEntity } from "./character"; +import type { LinklistEntity } from "./linklist"; +import type { MetadataEntity } from "./metadata"; export interface NoteEntity { - characterId: number - noteId: number - linkItemType: LinkItemType | null - linkKey: string - character?: CharacterEntity | null - toCharacterId: number | null - toCharacter?: CharacterEntity | null - toAddress: Address | null - toNoteId: number | null - toNote?: NoteEntity | null - toHeadCharacterId: number | null - toHeadCharacter?: CharacterEntity | null - toHeadNoteId: number | null - toHeadNote?: NoteEntity | null - toContractAddress: Address | null - toTokenId: number | null - toLinklistId: number | null - toLinklist?: LinklistEntity | null - toUri: string | null - deleted: boolean - locked: boolean - contractAddress: Address | null - uri: string | null - metadata?: MetadataEntity<'NOTE'> | null - operator: Address - owner: Address - createdAt: string - publishedAt: string - updatedAt: string - deletedAt: string | null - transactionHash: Hash - blockNumber: number - logIndex: number - updatedTransactionHash: Hash - updatedBlockNumber: number - updatedLogIndex: number + characterId: number; + noteId: number; + linkItemType: LinkItemType | null; + linkKey: string; + character?: CharacterEntity | null; + toCharacterId: number | null; + toCharacter?: CharacterEntity | null; + toAddress: Address | null; + toNoteId: number | null; + toNote?: NoteEntity | null; + toHeadCharacterId: number | null; + toHeadCharacter?: CharacterEntity | null; + toHeadNoteId: number | null; + toHeadNote?: NoteEntity | null; + toContractAddress: Address | null; + toTokenId: number | null; + toLinklistId: number | null; + toLinklist?: LinklistEntity | null; + toUri: string | null; + deleted: boolean; + locked: boolean; + contractAddress: Address | null; + uri: string | null; + metadata?: MetadataEntity<"NOTE"> | null; + operator: Address; + owner: Address; + createdAt: string; + publishedAt: string; + updatedAt: string; + deletedAt: string | null; + transactionHash: Hash; + blockNumber: number; + logIndex: number; + updatedTransactionHash: Hash; + updatedBlockNumber: number; + updatedLogIndex: number; } diff --git a/src/types/indexer/notification.ts b/src/types/indexer/notification.ts index 4859baf24..9be37262b 100644 --- a/src/types/indexer/notification.ts +++ b/src/types/indexer/notification.ts @@ -1,29 +1,29 @@ -import { type Hash } from 'viem' -import { type CharacterEntity } from './character' -import { type FeedEntity } from './feed' +import type { Hash } from "viem"; +import type { CharacterEntity } from "./character"; +import type { FeedEntity } from "./feed"; export enum NotificationType { - OPERATOR_ADDED = 'OPERATOR_ADDED', - OPERATOR_REMOVED = 'OPERATOR_REMOVED', - LINKED = 'LINKED', - UNLINKED = 'UNLINKED', - NOTE_MINTED = 'NOTE_MINTED', - NOTE_POSTED = 'NOTE_POSTED', - MENTIONED = 'MENTIONED', - TIPPED = 'TIPPED', - TIP_CONFIG_SET = 'TIP_CONFIG_SET', + OPERATOR_ADDED = "OPERATOR_ADDED", + OPERATOR_REMOVED = "OPERATOR_REMOVED", + LINKED = "LINKED", + UNLINKED = "UNLINKED", + NOTE_MINTED = "NOTE_MINTED", + NOTE_POSTED = "NOTE_POSTED", + MENTIONED = "MENTIONED", + TIPPED = "TIPPED", + TIP_CONFIG_SET = "TIP_CONFIG_SET", } -export type NotificationTypeKey = keyof typeof NotificationType +export type NotificationTypeKey = keyof typeof NotificationType; export interface NotificationEntity { - characterId: number - character?: CharacterEntity - type: NotificationTypeKey - transactionHash: Hash - blockNumber: number - logIndex: number - feed?: FeedEntity - createdAt: Date - isRead?: boolean + characterId: number; + character?: CharacterEntity; + type: NotificationTypeKey; + transactionHash: Hash; + blockNumber: number; + logIndex: number; + feed?: FeedEntity; + createdAt: Date; + isRead?: boolean; } diff --git a/src/types/indexer/operator.ts b/src/types/indexer/operator.ts index 487dc2016..714c10413 100644 --- a/src/types/indexer/operator.ts +++ b/src/types/indexer/operator.ts @@ -1,53 +1,53 @@ -import { type Address, type Hash } from 'viem' +import type { Address, Hash } from "viem"; export enum CharacterOperatorPermission { - SET_HANDLE = 'SET_HANDLE', - SET_SOCIAL_TOKEN = 'SET_SOCIAL_TOKEN', - GRANT_OPERATOR_PERMISSIONS = 'GRANT_OPERATOR_PERMISSIONS', - GRANT_OPERATORS_FOR_NOTE = 'GRANT_OPERATORS_FOR_NOTE', - SET_CHARACTER_URI = 'SET_CHARACTER_URI', - SET_LINKLIST_URI = 'SET_LINKLIST_URI', - LINK_CHARACTER = 'LINK_CHARACTER', - UNLINK_CHARACTER = 'UNLINK_CHARACTER', - CREATE_THEN_LINK_CHARACTER = 'CREATE_THEN_LINK_CHARACTER', - LINK_NOTE = 'LINK_NOTE', - UNLINK_NOTE = 'UNLINK_NOTE', - LINK_ERC721 = 'LINK_ERC721', - UNLINK_ERC721 = 'UNLINK_ERC721', - LINK_ADDRESS = 'LINK_ADDRESS', - UNLINK_ADDRESS = 'UNLINK_ADDRESS', - LINK_ANY_URI = 'LINK_ANY_URI', - UNLINK_ANY_URI = 'UNLINK_ANY_URI', - LINK_LINKLIST = 'LINK_LINKLIST', - UNLINK_LINKLIST = 'UNLINK_LINKLIST', - SET_LINK_MODULE_FOR_CHARACTER = 'SET_LINK_MODULE_FOR_CHARACTER', - SET_LINK_MODULE_FOR_NOTE = 'SET_LINK_MODULE_FOR_NOTE', - SET_LINK_MODULE_FOR_LINKLIST = 'SET_LINK_MODULE_FOR_LINKLIST', - SET_MINT_MODULE_FOR_NOTE = 'SET_MINT_MODULE_FOR_NOTE', - SET_NOTE_URI = 'SET_NOTE_URI', - LOCK_NOTE = 'LOCK_NOTE', - DELETE_NOTE = 'DELETE_NOTE', - POST_NOTE_FOR_CHARACTER = 'POST_NOTE_FOR_CHARACTER', - POST_NOTE_FOR_ADDRESS = 'POST_NOTE_FOR_ADDRESS', - POST_NOTE_FOR_LINKLIST = 'POST_NOTE_FOR_LINKLIST', - POST_NOTE_FOR_NOTE = 'POST_NOTE_FOR_NOTE', - POST_NOTE_FOR_ERC721 = 'POST_NOTE_FOR_ERC721', - POST_NOTE_FOR_ANY_URI = 'POST_NOTE_FOR_ANY_URI', - POST_NOTE = 'POST_NOTE', + SET_HANDLE = "SET_HANDLE", + SET_SOCIAL_TOKEN = "SET_SOCIAL_TOKEN", + GRANT_OPERATOR_PERMISSIONS = "GRANT_OPERATOR_PERMISSIONS", + GRANT_OPERATORS_FOR_NOTE = "GRANT_OPERATORS_FOR_NOTE", + SET_CHARACTER_URI = "SET_CHARACTER_URI", + SET_LINKLIST_URI = "SET_LINKLIST_URI", + LINK_CHARACTER = "LINK_CHARACTER", + UNLINK_CHARACTER = "UNLINK_CHARACTER", + CREATE_THEN_LINK_CHARACTER = "CREATE_THEN_LINK_CHARACTER", + LINK_NOTE = "LINK_NOTE", + UNLINK_NOTE = "UNLINK_NOTE", + LINK_ERC721 = "LINK_ERC721", + UNLINK_ERC721 = "UNLINK_ERC721", + LINK_ADDRESS = "LINK_ADDRESS", + UNLINK_ADDRESS = "UNLINK_ADDRESS", + LINK_ANY_URI = "LINK_ANY_URI", + UNLINK_ANY_URI = "UNLINK_ANY_URI", + LINK_LINKLIST = "LINK_LINKLIST", + UNLINK_LINKLIST = "UNLINK_LINKLIST", + SET_LINK_MODULE_FOR_CHARACTER = "SET_LINK_MODULE_FOR_CHARACTER", + SET_LINK_MODULE_FOR_NOTE = "SET_LINK_MODULE_FOR_NOTE", + SET_LINK_MODULE_FOR_LINKLIST = "SET_LINK_MODULE_FOR_LINKLIST", + SET_MINT_MODULE_FOR_NOTE = "SET_MINT_MODULE_FOR_NOTE", + SET_NOTE_URI = "SET_NOTE_URI", + LOCK_NOTE = "LOCK_NOTE", + DELETE_NOTE = "DELETE_NOTE", + POST_NOTE_FOR_CHARACTER = "POST_NOTE_FOR_CHARACTER", + POST_NOTE_FOR_ADDRESS = "POST_NOTE_FOR_ADDRESS", + POST_NOTE_FOR_LINKLIST = "POST_NOTE_FOR_LINKLIST", + POST_NOTE_FOR_NOTE = "POST_NOTE_FOR_NOTE", + POST_NOTE_FOR_ERC721 = "POST_NOTE_FOR_ERC721", + POST_NOTE_FOR_ANY_URI = "POST_NOTE_FOR_ANY_URI", + POST_NOTE = "POST_NOTE", } -export type CharacterPermissionKey = keyof typeof CharacterOperatorPermission +export type CharacterPermissionKey = keyof typeof CharacterOperatorPermission; export interface CharacterOperatorEntity { - characterId: number - operator: Address - permissions: CharacterPermissionKey[] - createdAt: Date - updatedAt: Date - transactionHash: Hash - blockNumber: number - logIndex: number - updatedTransactionHash: Hash - updatedBlockNumber: number - updatedLogIndex: number + characterId: number; + operator: Address; + permissions: CharacterPermissionKey[]; + createdAt: Date; + updatedAt: Date; + transactionHash: Hash; + blockNumber: number; + logIndex: number; + updatedTransactionHash: Hash; + updatedBlockNumber: number; + updatedLogIndex: number; } diff --git a/src/types/indexer/stat.ts b/src/types/indexer/stat.ts index f9479845e..d8efb8f62 100644 --- a/src/types/indexer/stat.ts +++ b/src/types/indexer/stat.ts @@ -1,15 +1,15 @@ export interface CharacterStatEntity { - characterId: number - viewCount: number - viewInListCount: number - viewDetailCount: number - viewNoteCount: number + characterId: number; + viewCount: number; + viewInListCount: number; + viewDetailCount: number; + viewNoteCount: number; } export interface NoteStatEntity { - characterId: number - noteId: number - viewCount: number - viewInListCount: number - viewDetailCount: number + characterId: number; + noteId: number; + viewCount: number; + viewInListCount: number; + viewDetailCount: number; } diff --git a/src/types/indexer/tip.ts b/src/types/indexer/tip.ts index c3819c715..c28837463 100644 --- a/src/types/indexer/tip.ts +++ b/src/types/indexer/tip.ts @@ -1,43 +1,43 @@ -import { type Address, type Hash } from 'viem' -import { type CharacterEntity } from './character' -import { type NoteEntity } from './note' +import type { Address, Hash } from "viem"; +import type { CharacterEntity } from "./character"; +import type { NoteEntity } from "./note"; export interface TipEntity { - characterId: number - character?: CharacterEntity - toCharacterId: number - toCharacter?: CharacterEntity - toNoteId: number | null - toNote?: NoteEntity | null - amount: string - fee: string | null - feeReceiverAddress: Address | null - tokenAddress: Address - createdAt: Date - transactionHash: Hash - blockNumber: number - logIndex: number + characterId: number; + character?: CharacterEntity; + toCharacterId: number; + toCharacter?: CharacterEntity; + toNoteId: number | null; + toNote?: NoteEntity | null; + amount: string; + fee: string | null; + feeReceiverAddress: Address | null; + tokenAddress: Address; + createdAt: Date; + transactionHash: Hash; + blockNumber: number; + logIndex: number; } export interface TipConfigEntity { - tipConfigId: number - characterId: number - character?: CharacterEntity - toCharacterId: number - toCharacter?: CharacterEntity - amount: number - startTime: Date - endTime: Date - currentRound: number - totalRound: number - tokenAddress: string - createdAt: Date - updatedAt: Date - tips: TipEntity[] - transactionHash: string - blockNumber: number - logIndex: number - updatedTransactionHash: string - updatedBlockNumber: number - updatedLogIndex: number + tipConfigId: number; + characterId: number; + character?: CharacterEntity; + toCharacterId: number; + toCharacter?: CharacterEntity; + amount: number; + startTime: Date; + endTime: Date; + currentRound: number; + totalRound: number; + tokenAddress: string; + createdAt: Date; + updatedAt: Date; + tips: TipEntity[]; + transactionHash: string; + blockNumber: number; + logIndex: number; + updatedTransactionHash: string; + updatedBlockNumber: number; + updatedLogIndex: number; } diff --git a/src/types/metadata/base.ts b/src/types/metadata/base.ts index 2c5e9bebe..631000a23 100644 --- a/src/types/metadata/base.ts +++ b/src/types/metadata/base.ts @@ -1,7 +1,7 @@ export interface BaseMetadata { // version: '1' // TODO: do we need this? - type?: 'character' | 'note' | 'linklist' + type?: "character" | "note" | "linklist"; } export interface AttributesMetadata { @@ -12,8 +12,8 @@ export interface AttributesMetadata { * [{ value: "post", trait_type: "type" }, { value: "https://example.com", trait_type: "URL" }, { value: 1546360800, trait_type: 'Birthday', "display_type": "date" }] */ attributes?: { - value: string | number | boolean | null - trait_type?: string - display_type?: 'string' | 'number' | 'date' | 'boolean' - }[] + value: string | number | boolean | null; + trait_type?: string; + display_type?: "string" | "number" | "date" | "boolean"; + }[]; } diff --git a/src/types/metadata/character.ts b/src/types/metadata/character.ts index 99cf8f6db..2c0a2a9d6 100644 --- a/src/types/metadata/character.ts +++ b/src/types/metadata/character.ts @@ -1,8 +1,8 @@ -import { type AttributesMetadata, type BaseMetadata } from './base' +import type { AttributesMetadata, BaseMetadata } from "./base"; export interface CharacterMetadata extends BaseMetadata, AttributesMetadata { /** The name of this character. */ - name?: string + name?: string; /** * The avatars of this character. @@ -11,10 +11,10 @@ export interface CharacterMetadata extends BaseMetadata, AttributesMetadata { * @example * ['ipfs://Qm...', 'ipfs://Qm...'] */ - avatars?: string[] + avatars?: string[]; /** The bio of this character. */ - bio?: string + bio?: string; /** * The websites of this character. @@ -22,7 +22,7 @@ export interface CharacterMetadata extends BaseMetadata, AttributesMetadata { * @example * ['https://example.com', 'https://example.org'] */ - websites?: string[] + websites?: string[]; /** * The banners of this character. @@ -34,13 +34,13 @@ export interface CharacterMetadata extends BaseMetadata, AttributesMetadata { /** * The address (url) of this banner. */ - address: string + address: string; /** * The mime type of this banner file. */ - mime_type: string - }[] + mime_type: string; + }[]; /** * The social links of this character. It should follow the csb:// scheme. @@ -50,7 +50,7 @@ export interface CharacterMetadata extends BaseMetadata, AttributesMetadata { * @example * ['csb://account:someone@twitter', 'csb://account:someone@github'] */ - connected_accounts?: string[] + connected_accounts?: string[]; /** * The special connected avatars of this character. it should follow the csb:// scheme. @@ -62,5 +62,5 @@ export interface CharacterMetadata extends BaseMetadata, AttributesMetadata { * @example * ['csb://asset:0x5452c7fb99d99fab3cc1875e9da9829cb50f7a13-753@ethereum'] */ - connected_avatars?: string[] + connected_avatars?: string[]; } diff --git a/src/types/metadata/index.ts b/src/types/metadata/index.ts index 62b00b954..827339cba 100644 --- a/src/types/metadata/index.ts +++ b/src/types/metadata/index.ts @@ -1,8 +1,8 @@ -import { type CharacterMetadata } from './character' -import { type NoteMetadata } from './note' +import type { CharacterMetadata } from "./character"; +import type { NoteMetadata } from "./note"; -export type Metadata = CharacterMetadata | NoteMetadata +export type Metadata = CharacterMetadata | NoteMetadata; -export * from './base' -export * from './character' -export * from './note' +export * from "./base"; +export * from "./character"; +export * from "./note"; diff --git a/src/types/metadata/note.ts b/src/types/metadata/note.ts index 7d70c9262..fb0e49fb9 100644 --- a/src/types/metadata/note.ts +++ b/src/types/metadata/note.ts @@ -1,48 +1,48 @@ -import { type AttributesMetadata, type BaseMetadata } from './base' +import type { AttributesMetadata, BaseMetadata } from "./base"; export interface NoteMetadataAttachmentBase< - ContentType extends 'address' | 'content', + ContentType extends "address" | "content", > { /** * The name of this attachment. */ - name?: string + name?: string; /** * The address (url) of this attachment. */ - address?: ContentType extends 'address' ? string : never + address?: ContentType extends "address" ? string : never; /** * The plain content of this attachment. */ - content?: ContentType extends 'content' ? string : never + content?: ContentType extends "content" ? string : never; /** * The mime type of the `content`. */ - mime_type?: string + mime_type?: string; /** * The size of the `content` in bytes. */ - size_in_bytes?: number + size_in_bytes?: number; /** * The alternate text (description) of this attachment. * This is used for accessibility or is displayed when the source is not available. */ - alt?: string + alt?: string; /** * The width of this attachment, in pixels. */ - width?: number + width?: number; /** * The height of this attachment, in pixels. */ - height?: number + height?: number; } export interface NoteMetadata extends BaseMetadata, AttributesMetadata { @@ -52,12 +52,12 @@ export interface NoteMetadata extends BaseMetadata, AttributesMetadata { * @example * ['article', 'dairy'] */ - tags?: string[] + tags?: string[]; /** * The title of this note. */ - title?: string + title?: string; /** * The (markdown) content of this note. @@ -65,15 +65,15 @@ export interface NoteMetadata extends BaseMetadata, AttributesMetadata { * @example * '# Hello World\n\nThis is a markdown note.' */ - content?: string + content?: string; /** * The attachments of this note. */ attachments?: ( - | NoteMetadataAttachmentBase<'address'> - | NoteMetadataAttachmentBase<'content'> - )[] + | NoteMetadataAttachmentBase<"address"> + | NoteMetadataAttachmentBase<"content"> + )[]; /** * The source of this note. I.e. where it was originally created. @@ -82,7 +82,7 @@ export interface NoteMetadata extends BaseMetadata, AttributesMetadata { * @example * ['xlog'] */ - sources?: string[] + sources?: string[]; /** * Where this note was created. User can view this note on this location. @@ -90,7 +90,7 @@ export interface NoteMetadata extends BaseMetadata, AttributesMetadata { * @example * ['https://twitter.com/_Crossbell/status/1555900801058488322'] */ - external_urls?: string[] + external_urls?: string[]; /** * The date this content was published, following the ISO 8601 format. @@ -104,7 +104,7 @@ export interface NoteMetadata extends BaseMetadata, AttributesMetadata { * @example * '2022-01-01T00:00:00Z' */ - date_published?: string + date_published?: string; /** * A content warning for this note. On the client side, this will be displayed as a warning. @@ -112,7 +112,7 @@ export interface NoteMetadata extends BaseMetadata, AttributesMetadata { * @example * 'nsfw' */ - content_warning?: 'nsfw' | 'sensitive' | 'spoiler' + content_warning?: "nsfw" | "sensitive" | "spoiler"; /** * The variant of this note. @@ -123,5 +123,5 @@ export interface NoteMetadata extends BaseMetadata, AttributesMetadata { * @example * 'achievement' */ - variant?: 'achievement' + variant?: "achievement"; } diff --git a/src/types/utils.ts b/src/types/utils.ts index 33aebc878..75532daed 100644 --- a/src/types/utils.ts +++ b/src/types/utils.ts @@ -1,3 +1,3 @@ -export type MaybeArray = T | T[] -export type Overwrite = Pick> & U -export type Numberish = bigint | number | string +export type MaybeArray = T | T[]; +export type Overwrite = Pick> & U; +export type Numberish = bigint | number | string; diff --git a/src/utils/address.ts b/src/utils/address.ts index 34399e36a..0482ab685 100644 --- a/src/utils/address.ts +++ b/src/utils/address.ts @@ -1,15 +1,16 @@ -import { type Address } from 'viem' -import { type MaybeArray } from '../types/utils' -import { validateIsInSdn } from './sdn' +import type { Address } from "viem"; +import type { MaybeArray } from "../types/utils"; +import { validateIsInSdn } from "./sdn"; -export const NIL_ADDRESS: Address = '0x0000000000000000000000000000000000000000' +export const NIL_ADDRESS: Address = + "0x0000000000000000000000000000000000000000"; export function validateAddress(address: MaybeArray
) { if (Array.isArray(address)) { for (const addr of address) { - validateAddress(addr) + validateAddress(addr); } } else { - validateIsInSdn(address) + validateIsInSdn(address); } } diff --git a/src/utils/csb.ts b/src/utils/csb.ts index f08c1181c..3c65da361 100644 --- a/src/utils/csb.ts +++ b/src/utils/csb.ts @@ -1,29 +1,29 @@ -const CSB_PROTOCOL = 'csb://' as const +const CSB_PROTOCOL = "csb://" as const; -const SUPPORTED_SCOPES = ['account', 'asset'] as const +const SUPPORTED_SCOPES = ["account", "asset"] as const; export function parseCsbUri(uri: string) { if (!uri.startsWith(CSB_PROTOCOL)) { - throw new Error('Invalid csb uri. It should start with csb://') + throw new Error("Invalid csb uri. It should start with csb://"); } - const newUri = uri.replace(CSB_PROTOCOL, 'http://') // new URL() only accepts common protocols + const newUri = uri.replace(CSB_PROTOCOL, "http://"); // new URL() only accepts common protocols - const url = new URL(newUri) + const url = new URL(newUri); - const scheme = CSB_PROTOCOL - const scope = url.username as (typeof SUPPORTED_SCOPES)[number] - const identity = url.password - const host = url.host + const scheme = CSB_PROTOCOL; + const scope = url.username as (typeof SUPPORTED_SCOPES)[number]; + const identity = url.password; + const host = url.host; // account - const platform = scope === 'account' ? host : undefined + const platform = scope === "account" ? host : undefined; // asset - const network = scope === 'asset' ? host : undefined + const network = scope === "asset" ? host : undefined; const contract_address = - scope === 'asset' ? identity.split('-')[0] : undefined - const token_id = scope === 'asset' ? identity.split('-')[1] : undefined + scope === "asset" ? identity.split("-")[0] : undefined; + const token_id = scope === "asset" ? identity.split("-")[1] : undefined; return { scheme, @@ -34,5 +34,5 @@ export function parseCsbUri(uri: string) { network, contract_address, token_id, - } + }; } diff --git a/src/utils/index.ts b/src/utils/index.ts index eea0bb3ee..fcc83d3a1 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,6 +1,6 @@ -export * from './address' -export * from './csb' -export * from './module' -export * from './sdn' -export * from './validate-handle' -export * from './viem' +export * from "./address"; +export * from "./csb"; +export * from "./module"; +export * from "./sdn"; +export * from "./validate-handle"; +export * from "./viem"; diff --git a/src/utils/logger.ts b/src/utils/logger.ts index d0b92e719..4e326cb3f 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -1,20 +1,20 @@ /* eslint-disable no-console */ -const PREFIX = '[crossbell]' -const isProduction = globalThis?.process?.env?.NODE_ENV === 'production' +const PREFIX = "[crossbell]"; +const isProduction = globalThis?.process?.env?.NODE_ENV === "production"; export function log(...message: any[]) { - if (!isProduction) console.log(PREFIX, ...message) + if (!isProduction) console.log(PREFIX, ...message); } export function warn(...message: any[]) { - console.warn(PREFIX, ...message) + console.warn(PREFIX, ...message); } export function error(...message: any[]) { - console.error(PREFIX, ...message) + console.error(PREFIX, ...message); } export function info(...message: any[]) { - console.info(PREFIX, ...message) + console.info(PREFIX, ...message); } diff --git a/src/utils/module.ts b/src/utils/module.ts index d233f5e60..31050745e 100644 --- a/src/utils/module.ts +++ b/src/utils/module.ts @@ -4,64 +4,64 @@ import { decodeAbiParameters, encodeAbiParameters, isAddressEqual, -} from 'viem' -import { type MintOrLinkModule, type MintOrLinkModuleConfig } from '../types' -import { NIL_ADDRESS } from './address' +} from "viem"; +import type { MintOrLinkModule, MintOrLinkModuleConfig } from "../types"; +import { NIL_ADDRESS } from "./address"; -let moduleResponseCache: MintOrLinkModule[] | undefined = undefined -let lastModuleResponseCacheTime = 0 +let moduleResponseCache: MintOrLinkModule[] | undefined = undefined; +let lastModuleResponseCacheTime = 0; -export async function getModules({ +export async function getModules({ type, }: { type?: T } = {}): Promise[]> { - const now = Date.now() - const isMoreThanOneMinute = now - lastModuleResponseCacheTime > 60 * 1000 + const now = Date.now(); + const isMoreThanOneMinute = now - lastModuleResponseCacheTime > 60 * 1000; - let res: MintOrLinkModule[] = [] + let res: MintOrLinkModule[] = []; if (!moduleResponseCache || isMoreThanOneMinute) { res = (await fetch( - 'https://raw.githubusercontent.com/Crossbell-Box/Crossbell-Contracts/main/deployments/modules.json', - ).then((res) => res.json())) as MintOrLinkModule[] - moduleResponseCache = res - lastModuleResponseCacheTime = now + "https://raw.githubusercontent.com/Crossbell-Box/Crossbell-Contracts/main/deployments/modules.json", + ).then((res) => res.json())) as MintOrLinkModule[]; + moduleResponseCache = res; + lastModuleResponseCacheTime = now; } else { - res = moduleResponseCache as MintOrLinkModule[] + res = moduleResponseCache as MintOrLinkModule[]; } if (type) { - return res.filter((module) => module.type === type) + return res.filter((module) => module.type === type); } - return res + return res; } export async function getModule(address: Address) { - const modules = await getModules() - return modules.find((module) => isAddressEqual(module.address, address)) + const modules = await getModules(); + return modules.find((module) => isAddressEqual(module.address, address)); } export function getLinkModules() { - return getModules({ type: 'link' }) + return getModules({ type: "link" }); } export async function getLinkModule(address: Address) { - const modules = await getLinkModules() + const modules = await getLinkModules(); return modules.find( (module) => - isAddressEqual(module.address, address) && module.type === 'link', - ) + isAddressEqual(module.address, address) && module.type === "link", + ); } export function getMintModules() { - return getModules({ type: 'mint' }) + return getModules({ type: "mint" }); } export async function getMintModule(address: Address) { - const modules = await getMintModules() + const modules = await getMintModules(); return modules.find( (module) => - isAddressEqual(module.address, address) && module.type === 'mint', - ) + isAddressEqual(module.address, address) && module.type === "mint", + ); } export async function getModuleConfig(m?: MintOrLinkModuleConfig) { @@ -69,12 +69,12 @@ export async function getModuleConfig(m?: MintOrLinkModuleConfig) { return { address: NIL_ADDRESS, initData: NIL_ADDRESS, - } + }; } - const module = await getModule(m.address) + const module = await getModule(m.address); if (!module) { - throw new Error(`Invalid module address ${m.address}`) + throw new Error(`Invalid module address ${m.address}`); } const initData = encodeAbiParameters( @@ -82,44 +82,44 @@ export async function getModuleConfig(m?: MintOrLinkModuleConfig) { type: item.type, })), m.data, - ) + ); return { address: m.address, initData, - } + }; } export async function encodeModuleInitData( moduleAddress: Address, data: any[], ) { - const module = await getModule(moduleAddress) + const module = await getModule(moduleAddress); if (!module) { - throw new Error(`Invalid module address ${moduleAddress}`) + throw new Error(`Invalid module address ${moduleAddress}`); } const result = encodeAbiParameters( module.initDataStructure.map((item) => ({ type: item.type })), data, - ) + ); - return result + return result; } export async function decodeModuleInitData( moduleAddress: Address, initData: Hex, ) { - const module = await getModule(moduleAddress) + const module = await getModule(moduleAddress); if (!module) { - throw new Error(`Invalid module address ${moduleAddress}`) + throw new Error(`Invalid module address ${moduleAddress}`); } const result = decodeAbiParameters( module.initDataStructure.map((item) => ({ type: item.type })), initData, - ) + ); - return result + return result; } diff --git a/src/utils/nonce-manager.ts b/src/utils/nonce-manager.ts index 7ca4c7ee1..d4dfa8638 100644 --- a/src/utils/nonce-manager.ts +++ b/src/utils/nonce-manager.ts @@ -1,5 +1,5 @@ -import { createNonceManager, jsonRpc } from 'viem/nonce' +import { createNonceManager, jsonRpc } from "viem/nonce"; export const nonceManager = createNonceManager({ source: jsonRpc(), -}) +}); diff --git a/src/utils/normalize-character-metadata.ts b/src/utils/normalize-character-metadata.ts index d47fa2caa..6c37a02e6 100644 --- a/src/utils/normalize-character-metadata.ts +++ b/src/utils/normalize-character-metadata.ts @@ -1,31 +1,31 @@ -import type { CharacterMetadata } from '../types' +import type { CharacterMetadata } from "../types"; export function normalizeCharacterMetadata< T extends CharacterMetadata | undefined, >(metadata: T): T { - if (!metadata) return metadata + if (!metadata) return metadata; return { ...metadata, connected_accounts: normalizeConnectedAccounts(metadata.connected_accounts), - } + }; } function normalizeConnectedAccounts(items?: unknown[]): string[] { - if (!Array.isArray(items)) return [] + if (!Array.isArray(items)) return []; return items .map((item) => { switch (typeof item) { - case 'string': - return item - case 'object': - return item && 'uri' in item && typeof item.uri === 'string' + case "string": + return item; + case "object": + return item && "uri" in item && typeof item.uri === "string" ? item.uri - : '' + : ""; default: - return '' + return ""; } }) - .filter(Boolean) + .filter(Boolean); } diff --git a/src/utils/sdn.ts b/src/utils/sdn.ts index 978cbb80a..986344a4e 100644 --- a/src/utils/sdn.ts +++ b/src/utils/sdn.ts @@ -1,62 +1,62 @@ -import { type Address } from 'viem' +import type { Address } from "viem"; // https://home.treasury.gov/policy-issues/financial-sanctions/recent-actions/20220808 const sdnList = new Set([ - '0x8589427373d6d84e98730d7795d8f6f8731fda16', - '0x722122df12d4e14e13ac3b6895a86e84145b6967', - '0xdd4c48c0b24039969fc16d1cdf626eab821d3384', - '0xd90e2f925da726b50c4ed8d0fb90ad053324f31b', - '0xd96f2b1c14db8458374d9aca76e26c3d18364307', - '0x4736dcf1b7a3d580672cce6e7c65cd5cc9cfba9d', - '0xd4b88df4d29f5cedd6857912842cff3b20c8cfa3', - '0x910cbd523d972eb0a6f4cae4618ad62622b39dbf', - '0xa160cdab225685da1d56aa342ad8841c3b53f291', - '0xfd8610d20aa15b7b2e3be39b396a1bc3516c7144', - '0xf60dd140cff0706bae9cd734ac3ae76ad9ebc32a', - '0x22aaa7720ddd5388a3c0a3333430953c68f1849b', - '0xba214c1c1928a32bffe790263e38b4af9bfcd659', - '0xb1c8094b234dce6e03f10a5b673c1d8c69739a00', - '0x527653ea119f3e6a1f5bd18fbf4714081d7b31ce', - '0x58e8dcc13be9780fc42e8723d8ead4cf46943df2', - '0xd691f27f38b395864ea86cfc7253969b409c362d', - '0xaeaac358560e11f52454d997aaff2c5731b6f8a6', - '0x1356c899d8c9467c7f71c195612f8a395abf2f0a', - '0xa60c772958a3ed56c1f15dd055ba37ac8e523a0d', - '0x169ad27a470d064dede56a2d3ff727986b15d52b', - '0x0836222f2b2b24a3f36f98668ed8f0b38d1a872f', - '0xf67721a2d8f736e75a49fdd7fad2e31d8676542a', - '0x9ad122c22b14202b4490edaf288fdb3c7cb3ff5e', - '0x905b63fff465b9ffbf41dea908ceb12478ec7601', - '0x07687e702b410fa43f4cb4af7fa097918ffd2730', - '0x94a1b5cdb22c43faab4abeb5c74999895464ddaf', - '0xb541fc07bc7619fd4062a54d96268525cbc6ffef', - '0x12d66f87a04a9e220743712ce6d9bb1b5616b8fc', - '0x47ce0c6ed5b0ce3d3a51fdb1c52dc66a7c3c2936', - '0x23773e65ed146a459791799d01336db287f25334', - '0xd21be7248e0197ee08e0c20d4a96debdac3d20af', - '0x610b717796ad172b316836ac95a2ffad065ceab4', - '0x178169b423a011fff22b9e3f3abea13414ddd0f1', - '0xbb93e510bbcd0b7beb5a853875f9ec60275cf498', - '0x2717c5e28cf931547b621a5dddb772ab6a35b701', - '0x03893a7c7463ae47d46bc7f091665f1893656003', - '0xca0840578f57fe71599d29375e16783424023357', - '0x58e8dcc13be9780fc42e8723d8ead4cf46943df2', - '0x8589427373d6d84e98730d7795d8f6f8731fda16', - '0x722122df12d4e14e13ac3b6895a86e84145b6967', - '0xdd4c48c0b24039969fc16d1cdf626eab821d3384', - '0xd90e2f925da726b50c4ed8d0fb90ad053324f31b', - '0xd96f2b1c14db8458374d9aca76e26c3d18364307', - '0x4736dcf1b7a3d580672cce6e7c65cd5cc9cfba9d', -]) + "0x8589427373d6d84e98730d7795d8f6f8731fda16", + "0x722122df12d4e14e13ac3b6895a86e84145b6967", + "0xdd4c48c0b24039969fc16d1cdf626eab821d3384", + "0xd90e2f925da726b50c4ed8d0fb90ad053324f31b", + "0xd96f2b1c14db8458374d9aca76e26c3d18364307", + "0x4736dcf1b7a3d580672cce6e7c65cd5cc9cfba9d", + "0xd4b88df4d29f5cedd6857912842cff3b20c8cfa3", + "0x910cbd523d972eb0a6f4cae4618ad62622b39dbf", + "0xa160cdab225685da1d56aa342ad8841c3b53f291", + "0xfd8610d20aa15b7b2e3be39b396a1bc3516c7144", + "0xf60dd140cff0706bae9cd734ac3ae76ad9ebc32a", + "0x22aaa7720ddd5388a3c0a3333430953c68f1849b", + "0xba214c1c1928a32bffe790263e38b4af9bfcd659", + "0xb1c8094b234dce6e03f10a5b673c1d8c69739a00", + "0x527653ea119f3e6a1f5bd18fbf4714081d7b31ce", + "0x58e8dcc13be9780fc42e8723d8ead4cf46943df2", + "0xd691f27f38b395864ea86cfc7253969b409c362d", + "0xaeaac358560e11f52454d997aaff2c5731b6f8a6", + "0x1356c899d8c9467c7f71c195612f8a395abf2f0a", + "0xa60c772958a3ed56c1f15dd055ba37ac8e523a0d", + "0x169ad27a470d064dede56a2d3ff727986b15d52b", + "0x0836222f2b2b24a3f36f98668ed8f0b38d1a872f", + "0xf67721a2d8f736e75a49fdd7fad2e31d8676542a", + "0x9ad122c22b14202b4490edaf288fdb3c7cb3ff5e", + "0x905b63fff465b9ffbf41dea908ceb12478ec7601", + "0x07687e702b410fa43f4cb4af7fa097918ffd2730", + "0x94a1b5cdb22c43faab4abeb5c74999895464ddaf", + "0xb541fc07bc7619fd4062a54d96268525cbc6ffef", + "0x12d66f87a04a9e220743712ce6d9bb1b5616b8fc", + "0x47ce0c6ed5b0ce3d3a51fdb1c52dc66a7c3c2936", + "0x23773e65ed146a459791799d01336db287f25334", + "0xd21be7248e0197ee08e0c20d4a96debdac3d20af", + "0x610b717796ad172b316836ac95a2ffad065ceab4", + "0x178169b423a011fff22b9e3f3abea13414ddd0f1", + "0xbb93e510bbcd0b7beb5a853875f9ec60275cf498", + "0x2717c5e28cf931547b621a5dddb772ab6a35b701", + "0x03893a7c7463ae47d46bc7f091665f1893656003", + "0xca0840578f57fe71599d29375e16783424023357", + "0x58e8dcc13be9780fc42e8723d8ead4cf46943df2", + "0x8589427373d6d84e98730d7795d8f6f8731fda16", + "0x722122df12d4e14e13ac3b6895a86e84145b6967", + "0xdd4c48c0b24039969fc16d1cdf626eab821d3384", + "0xd90e2f925da726b50c4ed8d0fb90ad053324f31b", + "0xd96f2b1c14db8458374d9aca76e26c3d18364307", + "0x4736dcf1b7a3d580672cce6e7c65cd5cc9cfba9d", +]); const isInSdn = (address: Address) => { - return sdnList.has(address.toLowerCase()) -} + return sdnList.has(address.toLowerCase()); +}; export const validateIsInSdn = (address: Address) => { if (isInSdn(address)) { throw new Error( `This address ${address} is in the U.S. SDN list. All transactions from this address will be rejected. Info: https://home.treasury.gov/policy-issues/financial-sanctions/recent-actions/20220808`, - ) + ); } -} +}; diff --git a/src/utils/validate-handle.ts b/src/utils/validate-handle.ts index 93e91bdfc..0835067c3 100644 --- a/src/utils/validate-handle.ts +++ b/src/utils/validate-handle.ts @@ -1,4 +1,4 @@ -import { type Indexer } from '../indexer' +import type { Indexer } from "../indexer"; /** * @@ -10,7 +10,7 @@ import { type Indexer } from '../indexer' * - 'lengthInvalid': The handle must be between 3 and 31 characters. * - 'charsInvalid': The handle must only contain lower-case letters, numbers, hyphens (-), or underscores (_). */ -export type ValidateHandleError = 'existed' | 'lengthInvalid' | 'charsInvalid' +export type ValidateHandleError = "existed" | "lengthInvalid" | "charsInvalid"; /** * Validate a handle. @@ -26,25 +26,25 @@ export async function validateHandle( indexer: Indexer, ): Promise { if (handle.length >= 32 || handle.length <= 2) { - return 'lengthInvalid' + return "lengthInvalid"; } if (!/^[\d_a-z-]+$/.test(handle)) { - return 'charsInvalid' + return "charsInvalid"; } if (await checkIfExisted(handle, indexer)) { - return 'existed' + return "existed"; } - return null + return null; } async function checkIfExisted( handle: string, indexer: Indexer, ): Promise { - return !!(await indexer.character.getByHandle(handle)) + return !!(await indexer.character.getByHandle(handle)); } /** @@ -97,57 +97,57 @@ export function validateHandleFormat( * * @default `false`. */ - disallowAddress?: boolean + disallowAddress?: boolean; } = {}, ): | { - readonly valid: true - readonly code: 'valid' - readonly message: null + readonly valid: true; + readonly code: "valid"; + readonly message: null; } | { - readonly valid: false + readonly valid: false; readonly code: - | 'invalidLength' - | 'invalidChars' - | 'shouldNotBeAddress' - | 'notAString' - readonly message: string + | "invalidLength" + | "invalidChars" + | "shouldNotBeAddress" + | "notAString"; + readonly message: string; } { - if (typeof value !== 'string') { + if (typeof value !== "string") { return { valid: false, - code: 'notAString', - message: 'Handle must be a string.', - } + code: "notAString", + message: "Handle must be a string.", + }; } - if (value.length === 42 && value.startsWith('0x')) { + if (value.length === 42 && value.startsWith("0x")) { if (disallowAddress) { return { valid: false, - code: 'shouldNotBeAddress', - message: 'Handle must not be an Ethereum address.', - } + code: "shouldNotBeAddress", + message: "Handle must not be an Ethereum address.", + }; } - return { valid: true, code: 'valid', message: null } + return { valid: true, code: "valid", message: null }; } if (value.length < 3 || value.length > 31) { return { valid: false, - code: 'invalidLength', - message: 'Handle must be between 3 and 31 characters.', - } + code: "invalidLength", + message: "Handle must be between 3 and 31 characters.", + }; } if (/^[\d_a-z-]+$/i.test(value)) { - return { valid: true, code: 'valid', message: null } + return { valid: true, code: "valid", message: null }; } return { valid: false, - code: 'invalidChars', - message: 'Handle must only contain [a-z0-9-_].', - } + code: "invalidChars", + message: "Handle must only contain [a-z0-9-_].", + }; } diff --git a/src/utils/viem.ts b/src/utils/viem.ts index 00522a982..6965c9fbf 100644 --- a/src/utils/viem.ts +++ b/src/utils/viem.ts @@ -1,11 +1,11 @@ -import { - type Abi as _Abi, - type AbiType, - type AbiTypeToPrimitiveType, - type ExtractAbiEvent, -} from 'abitype' -import { type EIP1193Provider } from 'eip1193-types' -import { backOff } from 'exponential-backoff' +import type { + AbiType, + AbiTypeToPrimitiveType, + ExtractAbiEvent, + Abi as _Abi, +} from "abitype"; +import type { EIP1193Provider } from "eip1193-types"; +import { backOff } from "exponential-backoff"; import { http, type Account, @@ -14,7 +14,7 @@ import { type ContractEventName, type DecodeEventLogReturnType, type Log, - ParseAccount, + type ParseAccount, type PrivateKeyAccount, type PublicClient, type TransactionReceipt, @@ -25,44 +25,41 @@ import { custom, decodeEventLog, webSocket, -} from 'viem' -import * as Abi from '../contract/abi' -import { getJsonRpcAddress } from '../network' -import { log } from './logger' +} from "viem"; +import * as Abi from "../contract/abi"; +import { getJsonRpcAddress } from "../network"; +import { log } from "./logger"; export function createTransport(url: string): Transport { - const url_ = getJsonRpcAddress() ?? url + const url_ = getJsonRpcAddress() ?? url; - if (url_.startsWith('ws')) { + if (url_.startsWith("ws")) { return webSocket(url_, { timeout: 30_000, - key: 'crossbell', - name: 'crossbell', + key: "crossbell", + name: "crossbell", retryCount: 5, retryDelay: 5000, - }) + }); } return http(url_, { timeout: 30_000, - key: 'crossbell', - name: 'crossbell', - }) + key: "crossbell", + name: "crossbell", + }); } export function createPublicClientFromChain( chain: TChain, rpcUrl?: string, ): PublicClient { - const transport = createTransport(rpcUrl ?? chain.rpcUrls.default.http[0]) + const transport = createTransport(rpcUrl ?? chain.rpcUrls.default.http[0]); return createPublicClient({ transport, chain, pollingInterval: 100, - batch: { - multicall: true, - }, - }) + }); } export function createWalletClientFromPrivateKeyAccount< @@ -73,25 +70,25 @@ export function createWalletClientFromPrivateKeyAccount< chain: TChain, rpcUrl?: string, ): WalletClient> { - const transport = createTransport(rpcUrl ?? chain.rpcUrls.default.http[0]) + const transport = createTransport(rpcUrl ?? chain.rpcUrls.default.http[0]); return createWalletClient({ transport, chain, account, pollingInterval: 100, - }) + }); } export function getProviderAccount( provider: EIP1193Provider, ): Account | undefined { - if ('selectedAddress' in provider && provider.selectedAddress) { - return addressToAccount(provider.selectedAddress as Address) + if ("selectedAddress" in provider && provider.selectedAddress) { + return addressToAccount(provider.selectedAddress as Address); } - if ('send' in provider && typeof provider.send === 'function') { - const result: any = provider.send({ method: 'eth_accounts' }) + if ("send" in provider && typeof provider.send === "function") { + const result: any = provider.send({ method: "eth_accounts" }); if (result?.result?.[0]) { - return addressToAccount(result.result[0]) + return addressToAccount(result.result[0]); } } } @@ -109,13 +106,13 @@ export function createWalletClientFromProvider< chain, account, pollingInterval: 100, - }) + }); } type EventInputs< TAbi extends _Abi, TName extends ContractEventName, -> = ExtractAbiEvent['inputs'] +> = ExtractAbiEvent["inputs"]; type GetAbiType< TAbi extends _Abi, @@ -124,24 +121,24 @@ type GetAbiType< > = Extract< NonNullable[number]>, { name: Key } ->['type'] +>["type"]; type GetEventArgs> = { [K in NonNullable< - EventInputs[number]['name'] + EventInputs[number]["name"] >]: AbiTypeToPrimitiveType< GetAbiType extends AbiType ? GetAbiType : never - > -} + >; +}; export type FixedEventReturn< TAbi extends _Abi, TName extends ContractEventName, -> = Omit, 'args'> & { - args: GetEventArgs -} +> = Omit, "args"> & { + args: GetEventArgs; +}; export function parseLog< TAbi extends _Abi = Abi.Entry, @@ -150,11 +147,11 @@ export function parseLog< logs: Log[], filterTopic: TName, options: { - throwOnMultipleLogsFound?: boolean - returnMultipleLogs: true - abi?: TAbi + throwOnMultipleLogsFound?: boolean; + returnMultipleLogs: true; + abi?: TAbi; }, -): FixedEventReturn[] +): FixedEventReturn[]; export function parseLog< TAbi extends _Abi = Abi.Entry, TName extends ContractEventName = ContractEventName, @@ -162,11 +159,11 @@ export function parseLog< logs: Log[], filterTopic: TName, options?: { - throwOnMultipleLogsFound?: boolean - returnMultipleLogs?: boolean - abi?: TAbi + throwOnMultipleLogsFound?: boolean; + returnMultipleLogs?: boolean; + abi?: TAbi; }, -): FixedEventReturn +): FixedEventReturn; export function parseLog< TAbi extends _Abi = Abi.Entry, TName extends ContractEventName = ContractEventName, @@ -177,8 +174,8 @@ export function parseLog< throwOnMultipleLogsFound, returnMultipleLogs, }: { - throwOnMultipleLogsFound?: boolean - returnMultipleLogs?: boolean + throwOnMultipleLogsFound?: boolean; + returnMultipleLogs?: boolean; } = {}, ): any { const parsedLogs = logs @@ -187,33 +184,33 @@ export function parseLog< return decodeEventLog({ abi: [...Abi.entry, ...Abi.linklist], ...log, - }) + }); } catch { - return undefined + return undefined; } }) - .filter((log) => log?.eventName === targetTopic) + .filter((log) => log?.eventName === targetTopic); if (parsedLogs.length === 0) { - throw new Error(`Log with topic ${targetTopic} not found`) + throw new Error(`Log with topic ${targetTopic} not found`); } if (throwOnMultipleLogsFound && parsedLogs.length > 1) { - throw new Error(`More than one log with topic ${parsedLogs} found`) + throw new Error(`More than one log with topic ${parsedLogs} found`); } - if (returnMultipleLogs) return parsedLogs + if (returnMultipleLogs) return parsedLogs; - return parsedLogs[0] + return parsedLogs[0]; } export function addressToAccount(address: Address | Account): Account { - if (typeof address === 'string') + if (typeof address === "string") return { - type: 'json-rpc', + type: "json-rpc", address, - } - return address + }; + return address; } /** @@ -232,11 +229,11 @@ export async function waitForTransactionReceiptWithRetry( ): Promise { return backOff(() => client.waitForTransactionReceipt({ hash }), { retry: (e, i) => { - log('retrying waitForTransactionReceipt', { hash, i, e }) - return true + log("retrying waitForTransactionReceipt", { hash, i, e }); + return true; }, numOfAttempts: 6, timeMultiple: 2, startingDelay: 100, - }) + }); } diff --git a/test/contracts/cbt.test.ts b/test/contracts/cbt.test.ts index b25989372..8a3d05041 100644 --- a/test/contracts/cbt.test.ts +++ b/test/contracts/cbt.test.ts @@ -1,9 +1,9 @@ -import { describe } from 'vitest' +import { describe } from "vitest"; // import { Contract } from '../../src' // import { mockUser } from '../mock' // const contract = new Contract(mockUser.privateKey) -describe.todo('cbt', () => { +describe.todo("cbt", () => { // -}) +}); diff --git a/test/contracts/character.test.ts b/test/contracts/character.test.ts index 472199755..5b794b5d2 100644 --- a/test/contracts/character.test.ts +++ b/test/contracts/character.test.ts @@ -1,5 +1,5 @@ -import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts' -import { describe, expect, test } from 'vitest' +import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; +import { describe, expect, test } from "vitest"; import { genRandomHandle, metadataUri, @@ -8,45 +8,45 @@ import { randomHandle, randomHandle2, testContract, -} from '../mock' +} from "../mock"; -let characterId: bigint | null = null +let characterId: bigint | null = null; -describe('character', () => { - describe('create a character and check', () => { - test('should fail to createCharacter if the handle is not in correct format', () => { +describe("character", () => { + describe("create a character and check", () => { + test("should fail to createCharacter if the handle is not in correct format", () => { expect( testContract.character.create({ owner: mockUser.address, - handle: 'cannot contain whitespace', + handle: "cannot contain whitespace", metadataOrUri: metadataUri, }), - ).rejects.toThrow(/Handle must only contain \[a-z0-9-_\]./) + ).rejects.toThrow(/Handle must only contain \[a-z0-9-_\]./); expect( testContract.character.create({ owner: mockUser.address, handle: - 'cannot-contain-be-more-than-32-characters-longlonglonglonglonglonglonglonglong', + "cannot-contain-be-more-than-32-characters-longlonglonglonglonglonglonglonglong", metadataOrUri: metadataUri, }), - ).rejects.toThrow(/Handle must be between 3 and 31 characters/) - }) + ).rejects.toThrow(/Handle must be between 3 and 31 characters/); + }); - test('check if a character exists', async () => { - const randAccount = privateKeyToAccount(generatePrivateKey()) - const randAddr = randAccount.address - const randHandle = genRandomHandle() + test("check if a character exists", async () => { + const randAccount = privateKeyToAccount(generatePrivateKey()); + const randAddr = randAccount.address; + const randHandle = genRandomHandle(); // not exists if not created const { data: exists } = await testContract.character.existsForAddress({ address: randAddr, - }) - expect(exists).toBe(false) + }); + expect(exists).toBe(false); const { data: exists2 } = await testContract.character.existsForHandle({ handle: randHandle, - }) - expect(exists2).toBe(false) + }); + expect(exists2).toBe(false); // create one const characterId = await testContract.character @@ -55,161 +55,161 @@ describe('character', () => { handle: randHandle, metadataOrUri: metadataUri, }) - .then(({ data }) => data) + .then(({ data }) => data); - expect(characterId).not.toBeNull() + expect(characterId).not.toBeNull(); // should exist now const { data: exists3 } = await testContract.character.existsForAddress({ address: randAddr, - }) - expect(exists3).toBe(true) + }); + expect(exists3).toBe(true); const { data: exists4 } = await testContract.character.existsForHandle({ handle: randHandle, - }) - expect(exists4).toBe(true) - }) + }); + expect(exists4).toBe(true); + }); - test('createCharacter and getCharacterByTransaction', async () => { + test("createCharacter and getCharacterByTransaction", async () => { const result = await testContract.character.create({ owner: mockUser.address, handle: randomHandle, metadataOrUri: metadataUri, - }) - characterId = result.data - expect(result.data).not.toBeNull() + }); + characterId = result.data; + expect(result.data).not.toBeNull(); const character = await testContract.character.getByTransaction({ txHash: result.transactionHash, - }) - expect(character.data.characterId).toBe(characterId) - }) + }); + expect(character.data.characterId).toBe(characterId); + }); - test.concurrent('getCharacter', async () => { - if (!characterId) throw new Error('characterId is null') + test.concurrent("getCharacter", async () => { + if (!characterId) throw new Error("characterId is null"); const { data } = await testContract.character.get({ characterId: characterId, - }) - expect(data.handle).toBe(randomHandle) - expect(data.uri).toBe(metadataUri) - }) + }); + expect(data.handle).toBe(randomHandle); + expect(data.uri).toBe(metadataUri); + }); - test.concurrent('getCharacterByHandle', async () => { + test.concurrent("getCharacterByHandle", async () => { const { data } = await testContract.character.getByHandle({ handle: randomHandle, - }) + }); // expect(data.characterId).toBe(characterId) - expect(data.handle).toBe(randomHandle) - expect(data.uri).toBe(metadataUri) - }) + expect(data.handle).toBe(randomHandle); + expect(data.uri).toBe(metadataUri); + }); - test.concurrent('getHandle', async () => { - if (!characterId) throw new Error('characterId is null') + test.concurrent("getHandle", async () => { + if (!characterId) throw new Error("characterId is null"); const { data } = await testContract.character.getHandle({ characterId: characterId, - }) - expect(data).toBe(randomHandle) - }) + }); + expect(data).toBe(randomHandle); + }); - test.concurrent('getCharacterMetadataUri', async () => { - if (!characterId) throw new Error('characterId is null') + test.concurrent("getCharacterMetadataUri", async () => { + if (!characterId) throw new Error("characterId is null"); const { data } = await testContract.character.getUri({ characterId: characterId, - }) - expect(data).toBe(metadataUri) - }) - }) - - describe('change a character and check', () => { - test('setPrimaryCharacter', async () => { - if (!characterId) throw new Error('characterId is null') - await testContract.character.setPrimaryId({ characterId: characterId }) - }) - - test('getPrimaryCharacter', async () => { + }); + expect(data).toBe(metadataUri); + }); + }); + + describe("change a character and check", () => { + test("setPrimaryCharacter", async () => { + if (!characterId) throw new Error("characterId is null"); + await testContract.character.setPrimaryId({ characterId: characterId }); + }); + + test("getPrimaryCharacter", async () => { const { data } = await testContract.character.getPrimaryId({ address: mockUser.address, - }) - expect(data).toBe(characterId) - }) + }); + expect(data).toBe(characterId); + }); - test('isPrimaryCharacterId', async () => { - if (!characterId) throw new Error('characterId is null') + test("isPrimaryCharacterId", async () => { + if (!characterId) throw new Error("characterId is null"); const { data } = await testContract.character.isPrimaryId({ characterId: characterId, - }) - expect(data).toBe(true) - }) + }); + expect(data).toBe(true); + }); - test('setHandle', async () => { - if (!characterId) throw new Error('characterId is null') + test("setHandle", async () => { + if (!characterId) throw new Error("characterId is null"); await testContract.character.setHandle({ characterId: characterId, handle: randomHandle2, - }) - }) + }); + }); - test('getHandle - after changed', async () => { - if (!characterId) throw new Error('characterId is null') + test("getHandle - after changed", async () => { + if (!characterId) throw new Error("characterId is null"); const { data } = await testContract.character.getHandle({ characterId: characterId, - }) - expect(data).toBe(randomHandle2) - }) + }); + expect(data).toBe(randomHandle2); + }); - test('setMetadataUri', async () => { - if (!characterId) throw new Error('characterId is null') + test("setMetadataUri", async () => { + if (!characterId) throw new Error("characterId is null"); await testContract.character.setUri({ characterId: characterId, metadataOrUri: metadataUri2, - }) - }) + }); + }); - test('getMetadataUri', async () => { - if (!characterId) throw new Error('characterId is null') + test("getMetadataUri", async () => { + if (!characterId) throw new Error("characterId is null"); const { data } = await testContract.character.getUri({ characterId: characterId, - }) - expect(data).toBe(metadataUri2) - }) - }) - - describe('change character metadata and check', () => { - test('setCharacterMetadata', async () => { - if (!characterId) throw new Error('characterId is null') + }); + expect(data).toBe(metadataUri2); + }); + }); + + describe("change character metadata and check", () => { + test("setCharacterMetadata", async () => { + if (!characterId) throw new Error("characterId is null"); await testContract.character.setMetadata({ characterId: characterId, metadata: { - name: 'test-name', - bio: 'test-bio', + name: "test-name", + bio: "test-bio", }, - }) + }); const { data } = await testContract.character.get({ characterId: characterId, - }) + }); - expect(data.metadata?.name).toBe('test-name') - expect(data.metadata?.bio).toBe('test-bio') - }) + expect(data.metadata?.name).toBe("test-name"); + expect(data.metadata?.bio).toBe("test-bio"); + }); - test('changeCharacterMetadata', async () => { - if (!characterId) throw new Error('characterId is null') + test("changeCharacterMetadata", async () => { + if (!characterId) throw new Error("characterId is null"); await testContract.character.changeMetadata({ characterId: characterId, modifier: (metadata) => { return { ...metadata, - name: 'test-name-2', - } + name: "test-name-2", + }; }, - }) + }); const { data } = await testContract.character.get({ characterId: characterId, - }) + }); - expect(data.metadata?.name).toBe('test-name-2') - expect(data.metadata?.bio).toBe('test-bio') - }) - }) -}) + expect(data.metadata?.name).toBe("test-name-2"); + expect(data.metadata?.bio).toBe("test-bio"); + }); + }); +}); diff --git a/test/contracts/csb.test.ts b/test/contracts/csb.test.ts index 81779d125..d8160f14a 100644 --- a/test/contracts/csb.test.ts +++ b/test/contracts/csb.test.ts @@ -1,19 +1,19 @@ -import { describe, expect, test } from 'vitest' -import { mockUser, testContract } from '../mock' +import { describe, expect, test } from "vitest"; +import { mockUser, testContract } from "../mock"; -describe('csb', () => { - test('getBalance', async () => { +describe("csb", () => { + test("getBalance", async () => { const { data: balance } = await testContract.csb.getBalance({ owner: mockUser.address, - }) - expect(balance > 0n).toBe(true) - }) + }); + expect(balance > 0n).toBe(true); + }); - test('transfer', async () => { + test("transfer", async () => { const res = await testContract.csb.transfer({ toAddress: mockUser.address, amount: 0, - }) - expect(res.transactionHash).toBeDefined() - }) -}) + }); + expect(res.transactionHash).toBeDefined(); + }); +}); diff --git a/test/contracts/link.test.ts b/test/contracts/link.test.ts index 8fc0baa04..ad23d5d5c 100644 --- a/test/contracts/link.test.ts +++ b/test/contracts/link.test.ts @@ -1,145 +1,145 @@ -import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts' -import { describe, expect, test } from 'vitest' +import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; +import { describe, expect, test } from "vitest"; -import { genRandomHandle, metadataUri, mockUser, testContract } from '../mock' +import { genRandomHandle, metadataUri, mockUser, testContract } from "../mock"; -describe('link and check', () => { +describe("link and check", () => { // create two characters first - let characterId1: bigint | null = null - let characterId2: bigint | null = null - test('create two characters to link with', async () => { + let characterId1: bigint | null = null; + let characterId2: bigint | null = null; + test("create two characters to link with", async () => { characterId1 = await testContract.character .create({ owner: mockUser.address, handle: genRandomHandle(), metadataOrUri: metadataUri, }) - .then(({ data }) => data) + .then(({ data }) => data); characterId2 = await testContract.character .create({ owner: mockUser.address, handle: genRandomHandle(), metadataOrUri: metadataUri, }) - .then(({ data }) => data) + .then(({ data }) => data); - expect(characterId1).not.toBeNull() - expect(characterId2).not.toBeNull() - }) + expect(characterId1).not.toBeNull(); + expect(characterId2).not.toBeNull(); + }); - const linkType = 'follow' - let linklistId: bigint | null = null - test('linkCharacter', async () => { - if (!characterId1 || !characterId2) throw new Error('characterId is null') + const linkType = "follow"; + let linklistId: bigint | null = null; + test("linkCharacter", async () => { + if (!characterId1 || !characterId2) throw new Error("characterId is null"); const result = await testContract.link.linkCharacter({ fromCharacterId: characterId1, toCharacterId: characterId2, linkType, - }) - linklistId = result.data - expect(linklistId).not.toBeNull() + }); + linklistId = result.data; + expect(linklistId).not.toBeNull(); const linklist = await testContract.link.getLinklistIdByTransaction({ hash: result.transactionHash, - }) - expect(linklist.data).toBe(linklistId) - }) + }); + expect(linklist.data).toBe(linklistId); + }); - test('linkCharactersInBatch', async () => { - if (!characterId1 || !characterId2) throw new Error('characterId is null') + test("linkCharactersInBatch", async () => { + if (!characterId1 || !characterId2) throw new Error("characterId is null"); const result = await testContract.link.linkCharactersInBatch({ fromCharacterId: characterId1, toCharacterIds: [characterId2], toAddresses: [], linkType, - }) + }); - expect(result.data).toBe(linklistId) - }) + expect(result.data).toBe(linklistId); + }); - test('getLinkingCharacterIds', async () => { - if (!characterId1 || !characterId2) throw new Error('characterId is null') + test("getLinkingCharacterIds", async () => { + if (!characterId1 || !characterId2) throw new Error("characterId is null"); const { data } = await testContract.link.getLinkingCharacterIds({ fromCharacterId: characterId1, linkType, - }) - expect(data).toContain(characterId2) - }) + }); + expect(data).toContain(characterId2); + }); - test('unlinkCharacter and check', async () => { - if (!characterId1 || !characterId2) throw new Error('characterId is null') + test("unlinkCharacter and check", async () => { + if (!characterId1 || !characterId2) throw new Error("characterId is null"); await testContract.link .unlinkCharacter({ fromCharacterId: characterId1, toCharacterId: characterId2, linkType, }) - .then(({ data }) => data) + .then(({ data }) => data); const { data } = await testContract.link.getLinkingCharacterIds({ fromCharacterId: characterId1, linkType, - }) - expect(data).not.toContain(characterId2) - }) + }); + expect(data).not.toContain(characterId2); + }); - test('createThenLinkCharacter and check', async () => { - if (!characterId1) throw new Error('characterId is null') - const randomAddress = privateKeyToAccount(generatePrivateKey()).address + test("createThenLinkCharacter and check", async () => { + if (!characterId1) throw new Error("characterId is null"); + const randomAddress = privateKeyToAccount(generatePrivateKey()).address; const result = await testContract.link.createThenLinkCharacter({ fromCharacterId: characterId1, toAddress: randomAddress, linkType, - }) + }); - expect(result.data.toCharacterId).not.toBeNull() - expect(linklistId).not.toBeNull() + expect(result.data.toCharacterId).not.toBeNull(); + expect(linklistId).not.toBeNull(); const { data } = await testContract.link.getLinkingCharacterIds({ fromCharacterId: characterId1, linkType, - }) - expect(data).toContain(result.data.toCharacterId) + }); + expect(data).toContain(result.data.toCharacterId); const { data: { handle }, - } = await testContract.character.getByHandle({ handle: randomAddress }) - expect(handle).toBe(randomAddress.toLowerCase()) + } = await testContract.character.getByHandle({ handle: randomAddress }); + expect(handle).toBe(randomAddress.toLowerCase()); // should also able to get character by transaction const { data: character } = await testContract.character.getByTransaction({ txHash: result.transactionHash, - }) - expect(character.characterId).toBe(result.data.toCharacterId) - }) + }); + expect(character.characterId).toBe(result.data.toCharacterId); + }); // link note - test('create a note and link it', async () => { - if (!characterId1) throw new Error('characterId is null') + test("create a note and link it", async () => { + if (!characterId1) throw new Error("characterId is null"); const note = await testContract.note.post({ characterId: characterId1, metadataOrUri: { - content: 'test', + content: "test", }, - }) + }); // like this note const result1 = await testContract.link.linkNote({ fromCharacterId: characterId1, toCharacterId: characterId1, toNoteId: note.data.noteId, - linkType: 'like', - }) - expect(result1.data).not.toBeNull() + linkType: "like", + }); + expect(result1.data).not.toBeNull(); // unlike this note const result2 = await testContract.link.unlinkNote({ fromCharacterId: characterId1, toCharacterId: characterId1, toNoteId: note.data.noteId, - linkType: 'like', - }) - expect(result2.data).not.toBeNull() - }) -}) + linkType: "like", + }); + expect(result2.data).not.toBeNull(); + }); +}); diff --git a/test/contracts/mint-module.test.ts b/test/contracts/mint-module.test.ts index 8e05c571c..300b52e32 100644 --- a/test/contracts/mint-module.test.ts +++ b/test/contracts/mint-module.test.ts @@ -1,30 +1,30 @@ -import { describe, expect, test } from 'vitest' +import { describe, expect, test } from "vitest"; import { decodeModuleInitData, encodeModuleInitData, getModules, -} from '../../src' +} from "../../src"; -describe('mind-module', () => { +describe("mind-module", () => { const input = [ [ - '0x1234567890123456789012345678901234567890', - '0xAbc123def456aBc123def456aBc123DEf456ABc1', + "0x1234567890123456789012345678901234567890", + "0xAbc123def456aBc123def456aBc123DEf456ABc1", ], 1n, - ] + ]; const output = - '0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000001234567890123456789012345678901234567890000000000000000000000000abc123def456abc123def456abc123def456abc1' + "0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000001234567890123456789012345678901234567890000000000000000000000000abc123def456abc123def456abc123def456abc1"; - test('encodeModuleInitData', async () => { - const modules = await getModules() - const result = await encodeModuleInitData(modules[0].address, input) - expect(result).toBe(output) - }) + test("encodeModuleInitData", async () => { + const modules = await getModules(); + const result = await encodeModuleInitData(modules[0].address, input); + expect(result).toBe(output); + }); - test('decodeModuleInitData', async () => { - const modules = await getModules() - const result = await decodeModuleInitData(modules[0].address, output) - expect(result).toStrictEqual(input) - }) -}) + test("decodeModuleInitData", async () => { + const modules = await getModules(); + const result = await decodeModuleInitData(modules[0].address, output); + expect(result).toStrictEqual(input); + }); +}); diff --git a/test/contracts/note.test.ts b/test/contracts/note.test.ts index e2edc5be0..56d65a236 100644 --- a/test/contracts/note.test.ts +++ b/test/contracts/note.test.ts @@ -1,135 +1,135 @@ -import { beforeAll, describe, expect, test } from 'vitest' -import { mockUser, testContract } from '../mock' +import { beforeAll, describe, expect, test } from "vitest"; +import { mockUser, testContract } from "../mock"; -describe('should post note', () => { - let characterId: bigint | null = null +describe("should post note", () => { + let characterId: bigint | null = null; beforeAll(async () => { const { data: pid } = await testContract.character.getPrimaryId({ address: mockUser.address, - }) - characterId = pid - }) + }); + characterId = pid; + }); - test('postNote and check', async () => { - if (!characterId) throw new Error('characterId is null') + test("postNote and check", async () => { + if (!characterId) throw new Error("characterId is null"); const { data } = await testContract.note.post({ characterId, metadataOrUri: { - title: 'test', - content: 'test', + title: "test", + content: "test", }, - }) + }); - expect(data.noteId).toBeDefined() + expect(data.noteId).toBeDefined(); const { data: note } = await testContract.note.get({ characterId, noteId: data.noteId, - }) - expect(note.metadata?.title).toBe('test') - }) + }); + expect(note.metadata?.title).toBe("test"); + }); - test('postNotes and check', async () => { - if (!characterId) throw new Error('characterId is null') + test("postNotes and check", async () => { + if (!characterId) throw new Error("characterId is null"); const { data } = await testContract.note.postMany({ notes: [ { characterId, metadataOrUri: { - title: 'test1', - content: 'test1', + title: "test1", + content: "test1", }, }, { characterId, metadataOrUri: { - title: 'test2', - content: 'test2', + title: "test2", + content: "test2", }, }, ], - }) + }); - expect(data.noteIds).toHaveLength(2) + expect(data.noteIds).toHaveLength(2); const { data: note1 } = await testContract.note.get({ characterId, noteId: data.noteIds[0], - }) - expect(note1.metadata?.title).toBe('test1') + }); + expect(note1.metadata?.title).toBe("test1"); const { data: note2 } = await testContract.note.get({ characterId, noteId: data.noteIds[1], - }) - expect(note2.metadata?.title).toBe('test2') - }) + }); + expect(note2.metadata?.title).toBe("test2"); + }); - test('mintNote', async () => { - if (!characterId) throw new Error('characterId is null') + test("mintNote", async () => { + if (!characterId) throw new Error("characterId is null"); const { data } = await testContract.note.post({ characterId, metadataOrUri: { - title: 'test', - content: 'test', + title: "test", + content: "test", }, - }) + }); - expect(data.noteId).toBeDefined() + expect(data.noteId).toBeDefined(); const { transactionHash: mintHash } = await testContract.note.mint({ characterId, noteId: data.noteId, toAddress: mockUser.address, - }) + }); - expect(mintHash).toBeDefined() + expect(mintHash).toBeDefined(); // TODO: how do i check the NFT? - }) + }); - test('deleteNote', async () => { - if (!characterId) throw new Error('characterId is null') + test("deleteNote", async () => { + if (!characterId) throw new Error("characterId is null"); const { data } = await testContract.note.post({ characterId, metadataOrUri: { - title: 'test', - content: 'test', + title: "test", + content: "test", }, - }) + }); - expect(data.noteId).toBeDefined() + expect(data.noteId).toBeDefined(); const { transactionHash: deleteHash } = await testContract.note.delete({ characterId, noteId: data.noteId, - }) + }); - expect(deleteHash).toBeDefined() + expect(deleteHash).toBeDefined(); const { data: note } = await testContract.note.get({ characterId, noteId: data.noteId, - }) - expect(note.deleted).toBeTruthy() - }) + }); + expect(note.deleted).toBeTruthy(); + }); - test('postNoteForAnyUri', async () => { - if (!characterId) throw new Error('characterId is null') + test("postNoteForAnyUri", async () => { + if (!characterId) throw new Error("characterId is null"); const { data } = await testContract.note.postForAnyUri({ characterId, - metadataOrUri: { title: 'test', content: 'test' }, - targetUri: 'https://example.com', - }) + metadataOrUri: { title: "test", content: "test" }, + targetUri: "https://example.com", + }); - expect(data.noteId).toBeDefined() + expect(data.noteId).toBeDefined(); const { data: note } = await testContract.note.get({ characterId, noteId: data.noteId, - }) + }); expect(note.linkKey).toBe( - testContract.note.getLinkKeyForAnyUri({ toUri: 'https://example.com' }), - ) - }) -}) + testContract.note.getLinkKeyForAnyUri({ toUri: "https://example.com" }), + ); + }); +}); diff --git a/test/contracts/operator.test.ts b/test/contracts/operator.test.ts index 3f09fd54f..39e25563f 100644 --- a/test/contracts/operator.test.ts +++ b/test/contracts/operator.test.ts @@ -1,39 +1,39 @@ -import { beforeAll, describe, expect, test } from 'vitest' -import { NIL_ADDRESS, mockUser, testContract } from '../mock' +import { beforeAll, describe, expect, test } from "vitest"; +import { NIL_ADDRESS, mockUser, testContract } from "../mock"; -let characterId: bigint | null = null +let characterId: bigint | null = null; -describe('operator', () => { +describe("operator", () => { beforeAll(async () => { characterId = await testContract.character .getPrimaryId({ address: mockUser.address }) - .then((res) => res.data) + .then((res) => res.data); - expect(characterId).not.toBe(null) - }) + expect(characterId).not.toBe(null); + }); - describe('grant a permission and check', () => { - test('grant permission', async () => { - if (!characterId) throw new Error('characterId is null') + describe("grant a permission and check", () => { + test("grant permission", async () => { + if (!characterId) throw new Error("characterId is null"); const res = await testContract.operator.grantForCharacter({ characterId: characterId, operator: NIL_ADDRESS, - permissions: ['POST_NOTE', 'SET_NOTE_URI', 'LINK_CHARACTER'], - }) + permissions: ["POST_NOTE", "SET_NOTE_URI", "LINK_CHARACTER"], + }); - expect(res.data.bitmapUint256.toString()).toBeDefined() - }) + expect(res.data.bitmapUint256.toString()).toBeDefined(); + }); - test('check permission', async () => { - if (!characterId) throw new Error('characterId is null') + test("check permission", async () => { + if (!characterId) throw new Error("characterId is null"); const res = await testContract.operator.getPermissionsForCharacter({ characterId: characterId, operator: NIL_ADDRESS, - }) + }); expect(res.data.sort()).toEqual( - ['POST_NOTE', 'SET_NOTE_URI', 'LINK_CHARACTER'].sort(), - ) - }) - }) -}) + ["POST_NOTE", "SET_NOTE_URI", "LINK_CHARACTER"].sort(), + ); + }); + }); +}); diff --git a/test/contracts/revision.test.ts b/test/contracts/revision.test.ts index 72de7dc59..c219ca9ce 100644 --- a/test/contracts/revision.test.ts +++ b/test/contracts/revision.test.ts @@ -1,19 +1,19 @@ -import { describe, expect, it } from 'vitest' -import { testContract } from '../mock' +import { describe, expect, it } from "vitest"; +import { testContract } from "../mock"; -describe('revision', () => { - it.concurrent('should return the latest revision', async () => { - const { data: latest } = await testContract.revision.getLatest() - expect(latest > 0n).toBe(true) +describe("revision", () => { + it.concurrent("should return the latest revision", async () => { + const { data: latest } = await testContract.revision.getLatest(); + expect(latest > 0n).toBe(true); - const { data: current } = testContract.revision.getCurrent() - expect(current).toBe(latest) - }) + const { data: current } = testContract.revision.getCurrent(); + expect(current).toBe(latest); + }); - it.concurrent('check', async () => { - const res = await testContract.revision.check() - expect(res.data.currentRevision > 0n).toBe(true) - expect(res.data.isUpToDate).is.a('boolean') - expect(res.data.latestRevision > 0n).toBe(true) - }) -}) + it.concurrent("check", async () => { + const res = await testContract.revision.check(); + expect(res.data.currentRevision > 0n).toBe(true); + expect(res.data.isUpToDate).is.a("boolean"); + expect(res.data.latestRevision > 0n).toBe(true); + }); +}); diff --git a/test/contracts/tips-with-fee.test.ts b/test/contracts/tips-with-fee.test.ts index e523932ee..2f5ab80a0 100644 --- a/test/contracts/tips-with-fee.test.ts +++ b/test/contracts/tips-with-fee.test.ts @@ -1,45 +1,45 @@ -import { beforeAll, describe, expect, test } from 'vitest' -import { mockUser, testContract } from '../mock' +import { beforeAll, describe, expect, test } from "vitest"; +import { mockUser, testContract } from "../mock"; -let characterId: bigint | null = null +let characterId: bigint | null = null; -describe('tips with fee', () => { +describe("tips with fee", () => { beforeAll(async () => { characterId = await testContract.character .getPrimaryId({ address: mockUser.address }) - .then((res) => res.data) + .then((res) => res.data); - expect(characterId).not.toBe(null) - }) + expect(characterId).not.toBe(null); + }); - describe('tip', () => { - test('tip character', async () => { - if (!characterId) throw new Error('characterId is null') + describe("tip", () => { + test("tip character", async () => { + if (!characterId) throw new Error("characterId is null"); const res = await testContract.tipsWithFee.tipCharacter({ fromCharacterId: characterId, toCharacterId: characterId, amount: 0, feeReceiver: mockUser.address, - }) + }); - expect(res.transactionHash).toBeDefined() - }) + expect(res.transactionHash).toBeDefined(); + }); - test('tip character for a note', async () => { - if (!characterId) throw new Error('characterId is null') + test("tip character for a note", async () => { + if (!characterId) throw new Error("characterId is null"); const res = await testContract.tipsWithFee.tipCharacterForNote({ fromCharacterId: characterId, toCharacterId: characterId, toNoteId: 1n, amount: 0, feeReceiver: mockUser.address, - }) + }); - expect(res.transactionHash).toBeDefined() - }) + expect(res.transactionHash).toBeDefined(); + }); - test('tip failed when amount not enough', () => { - if (!characterId) throw new Error('characterId is null') + test("tip failed when amount not enough", () => { + if (!characterId) throw new Error("characterId is null"); expect( testContract.tipsWithFee.tipCharacterForNote({ fromCharacterId: characterId, @@ -48,7 +48,7 @@ describe('tips with fee', () => { amount: 1000000000000n, feeReceiver: mockUser.address, }), - ).rejects.toThrow() - }) - }) -}) + ).rejects.toThrow(); + }); + }); +}); diff --git a/test/contracts/tips.test.ts b/test/contracts/tips.test.ts index c3b72d44a..e5bef3c02 100644 --- a/test/contracts/tips.test.ts +++ b/test/contracts/tips.test.ts @@ -1,44 +1,44 @@ -import { beforeAll, describe, expect, test } from 'vitest' +import { beforeAll, describe, expect, test } from "vitest"; -import { mockUser, testContract } from '../mock' +import { mockUser, testContract } from "../mock"; -let characterId: bigint | null = null +let characterId: bigint | null = null; -describe('tips', () => { +describe("tips", () => { beforeAll(async () => { characterId = await testContract.character .getPrimaryId({ address: mockUser.address }) - .then((res) => res.data) + .then((res) => res.data); - expect(characterId).not.toBe(null) - }) + expect(characterId).not.toBe(null); + }); - describe('tip', () => { - test('tip character', async () => { - if (!characterId) throw new Error('characterId is null') + describe("tip", () => { + test("tip character", async () => { + if (!characterId) throw new Error("characterId is null"); const res = await testContract.tips.tipCharacter({ fromCharacterId: characterId, toCharacterId: characterId, amount: 0, - }) + }); - expect(res.transactionHash).toBeDefined() - }) + expect(res.transactionHash).toBeDefined(); + }); - test('tip character for a note', async () => { - if (!characterId) throw new Error('characterId is null') + test("tip character for a note", async () => { + if (!characterId) throw new Error("characterId is null"); const res = await testContract.tips.tipCharacterForNote({ fromCharacterId: characterId, toCharacterId: characterId, toNoteId: 1n, amount: 0, - }) + }); - expect(res.transactionHash).toBeDefined() - }) + expect(res.transactionHash).toBeDefined(); + }); - test('tip failed when amount not enough', () => { - if (!characterId) throw new Error('characterId is null') + test("tip failed when amount not enough", () => { + if (!characterId) throw new Error("characterId is null"); expect( testContract.tips.tipCharacterForNote({ fromCharacterId: characterId, @@ -46,7 +46,7 @@ describe('tips', () => { toNoteId: 1n, amount: 1000000000000n, }), - ).rejects.toThrow() - }) - }) -}) + ).rejects.toThrow(); + }); + }); +}); diff --git a/test/indexer/dedupe-cache.test.ts b/test/indexer/dedupe-cache.test.ts index 5f745a548..24db36052 100644 --- a/test/indexer/dedupe-cache.test.ts +++ b/test/indexer/dedupe-cache.test.ts @@ -1,96 +1,96 @@ -import { describe, expect, test, vi } from 'vitest' -import { createIndexer } from '../../src' +import { describe, expect, test, vi } from "vitest"; +import { createIndexer } from "../../src"; const indexer = createIndexer({ experimentalRequestDedupe: true, -}) +}); -describe('dedupe-cache', () => { - test('simple', async () => { - const fakeResponse = { result: true } - const fakeFetch = vi.fn>(() => +describe("dedupe-cache", () => { + test("simple", async () => { + const fakeResponse = { result: true }; + const fakeFetch = vi.fn(() => Promise.resolve(new Response(JSON.stringify(fakeResponse))), - ) - vi.stubGlobal('fetch', fakeFetch) + ); + vi.stubGlobal("fetch", fakeFetch); const [result1, result2] = await Promise.all([ - indexer.fetch('/foo'), - indexer.fetch('/foo'), - ]) + indexer.fetch("/foo"), + indexer.fetch("/foo"), + ]); - expect(result1).toEqual(fakeResponse) - expect(result2).toEqual(fakeResponse) - expect(fakeFetch).toBeCalledTimes(1) + expect(result1).toEqual(fakeResponse); + expect(result2).toEqual(fakeResponse); + expect(fakeFetch).toBeCalledTimes(1); - vi.unstubAllGlobals() - }) + vi.unstubAllGlobals(); + }); - test('complex', async () => { - const fakeResponse = { result: true } - const fakeFetch = vi.fn>(() => + test("complex", async () => { + const fakeResponse = { result: true }; + const fakeFetch = vi.fn(() => Promise.resolve(new Response(JSON.stringify(fakeResponse))), - ) - vi.stubGlobal('fetch', fakeFetch) + ); + vi.stubGlobal("fetch", fakeFetch); const [result1, result2] = await Promise.all([ - indexer.fetch('/foo', { + indexer.fetch("/foo", { params: { a: 1, b: 2 }, - headers: { 'x-foo': 'bar', 'x-foo2': 'bar' }, + headers: { "x-foo": "bar", "x-foo2": "bar" }, }), - indexer.fetch('/foo', { + indexer.fetch("/foo", { params: { b: 2, a: 1 }, - headers: { 'x-foo2': 'bar', 'x-foo': 'bar' }, // no matter the order + headers: { "x-foo2": "bar", "x-foo": "bar" }, // no matter the order }), - ]) + ]); - expect(result1).toEqual(fakeResponse) - expect(result2).toEqual(fakeResponse) - expect(fakeFetch).toBeCalledTimes(1) + expect(result1).toEqual(fakeResponse); + expect(result2).toEqual(fakeResponse); + expect(fakeFetch).toBeCalledTimes(1); - vi.unstubAllGlobals() - }) + vi.unstubAllGlobals(); + }); - test('different-params', async () => { - const fakeResponse = { result: true } - const fakeFetch = vi.fn>(() => + test("different-params", async () => { + const fakeResponse = { result: true }; + const fakeFetch = vi.fn(() => Promise.resolve(new Response(JSON.stringify(fakeResponse))), - ) - vi.stubGlobal('fetch', fakeFetch) + ); + vi.stubGlobal("fetch", fakeFetch); const [result1, result2] = await Promise.all([ - indexer.fetch('/foo', { params: { a: 1, b: 2 } }), - indexer.fetch('/foo', { params: { a: 2, b: 3 } }), - ]) + indexer.fetch("/foo", { params: { a: 1, b: 2 } }), + indexer.fetch("/foo", { params: { a: 2, b: 3 } }), + ]); - expect(result1).toEqual(fakeResponse) - expect(result2).toEqual(fakeResponse) - expect(fakeFetch).toBeCalledTimes(2) + expect(result1).toEqual(fakeResponse); + expect(result2).toEqual(fakeResponse); + expect(fakeFetch).toBeCalledTimes(2); - vi.unstubAllGlobals() - }) + vi.unstubAllGlobals(); + }); - test('different-headers', async () => { - const fakeResponse = { result: true } - const fakeFetch = vi.fn>(() => + test("different-headers", async () => { + const fakeResponse = { result: true }; + const fakeFetch = vi.fn(() => Promise.resolve(new Response(JSON.stringify(fakeResponse))), - ) - vi.stubGlobal('fetch', fakeFetch) + ); + vi.stubGlobal("fetch", fakeFetch); const [result1, result2] = await Promise.all([ - indexer.fetch('/foo', { + indexer.fetch("/foo", { params: { a: 1, b: 2 }, - headers: { 'x-foo': 'bar', 'x-foo2': 'bar' }, + headers: { "x-foo": "bar", "x-foo2": "bar" }, }), - indexer.fetch('/foo', { + indexer.fetch("/foo", { params: { a: 1, b: 2 }, - headers: { 'x-foo': 'baz', 'x-foo2': 'baz' }, + headers: { "x-foo": "baz", "x-foo2": "baz" }, }), - ]) + ]); - expect(result1).toEqual(fakeResponse) - expect(result2).toEqual(fakeResponse) - expect(fakeFetch).toBeCalledTimes(2) + expect(result1).toEqual(fakeResponse); + expect(result2).toEqual(fakeResponse); + expect(fakeFetch).toBeCalledTimes(2); - vi.unstubAllGlobals() - }) -}) + vi.unstubAllGlobals(); + }); +}); diff --git a/test/indexer/indexer.test.ts b/test/indexer/indexer.test.ts index 15ab8f5c3..0782b0392 100644 --- a/test/indexer/indexer.test.ts +++ b/test/indexer/indexer.test.ts @@ -1,42 +1,42 @@ -import { describe, expect, test } from 'vitest' -import { createIndexer } from '../../src' -import { mockUser } from '../mock' - -const indexer = createIndexer() - -describe.concurrent('characters', () => { - test.concurrent('getCharacters', async () => { - const res = await indexer.character.getMany(mockUser.address) - expect(res.list).toBeInstanceOf(Array) - }) - - test.concurrent('getPrimaryCharacters', async () => { - const res = await indexer.character.getPrimary(mockUser.address) - expect(res?.handle).toBeDefined() - }) -}) - -describe.concurrent('links', () => { - test.concurrent('getLinklists', async () => { - const res = await indexer.linklist.getMany(10n) - expect(res.list).toBeInstanceOf(Array) - }) - - test.concurrent('getLinkingItems', async () => { +import { describe, expect, test } from "vitest"; +import { createIndexer } from "../../src"; +import { mockUser } from "../mock"; + +const indexer = createIndexer(); + +describe.concurrent("characters", () => { + test.concurrent("getCharacters", async () => { + const res = await indexer.character.getMany(mockUser.address); + expect(res.list).toBeInstanceOf(Array); + }); + + test.concurrent("getPrimaryCharacters", async () => { + const res = await indexer.character.getPrimary(mockUser.address); + expect(res?.handle).toBeDefined(); + }); +}); + +describe.concurrent("links", () => { + test.concurrent("getLinklists", async () => { + const res = await indexer.linklist.getMany(10n); + expect(res.list).toBeInstanceOf(Array); + }); + + test.concurrent("getLinkingItems", async () => { const res = await indexer.link.getMany(10n, { - linkType: 'follow', - linkItemType: 'Character', - }) - expect(res.list).toBeInstanceOf(Array) - }) + linkType: "follow", + linkItemType: "Character", + }); + expect(res.list).toBeInstanceOf(Array); + }); - test.concurrent('getBacklinkingItems', async () => { + test.concurrent("getBacklinkingItems", async () => { const res = await indexer.linklist.getMany(10n, { - linkType: 'follow', - }) + linkType: "follow", + }); - expect(res.list).toBeInstanceOf(Array) - }) -}) + expect(res.list).toBeInstanceOf(Array); + }); +}); // TODO: more apis diff --git a/test/indexer/newbie.test.ts b/test/indexer/newbie.test.ts index 72f1dfa66..347f8117b 100644 --- a/test/indexer/newbie.test.ts +++ b/test/indexer/newbie.test.ts @@ -1,19 +1,22 @@ -import { describe, expect, test } from 'vitest' -import { createIndexer } from '../../src' -import { mockUser } from '../mock' +import { describe, expect, test } from "vitest"; +import { createIndexer } from "../../src"; +import { mockUser } from "../mock"; -const indexer = createIndexer() +const indexer = createIndexer(); -describe('newbie', () => { - test('sign in', async () => { - const token = await indexer.newbie.signIn(mockUser.email, mockUser.password) - expect(token).toBeTruthy() - expect(token).toEqual(indexer.newbie.token) - }) +describe("newbie", () => { + test("sign in", async () => { + const token = await indexer.newbie.signIn( + mockUser.email, + mockUser.password, + ); + expect(token).toBeTruthy(); + expect(token).toEqual(indexer.newbie.token); + }); - test('current user', async () => { - const account = await indexer.newbie.getAccount() - expect(account.email).toEqual(mockUser.email) - expect(account.characterId).to.be.a('number') - }) -}) + test("current user", async () => { + const account = await indexer.newbie.getAccount(); + expect(account.email).toEqual(mockUser.email); + expect(account.characterId).to.be.a("number"); + }); +}); diff --git a/test/indexer/notification.test.ts b/test/indexer/notification.test.ts index cfdd43ee7..a707aed62 100644 --- a/test/indexer/notification.test.ts +++ b/test/indexer/notification.test.ts @@ -1,18 +1,18 @@ -import { describe, expect, test } from 'vitest' -import { createIndexer } from '../../src' +import { describe, expect, test } from "vitest"; +import { createIndexer } from "../../src"; -const indexer = createIndexer() -const characterId = 55926 +const indexer = createIndexer(); +const characterId = 55926; -describe('notification', () => { - test('get many', async () => { - const notifications = await indexer.notification.getMany(characterId) - expect(notifications.list).is.an('array') - expect(notifications.count).is.an('number') - }) +describe("notification", () => { + test("get many", async () => { + const notifications = await indexer.notification.getMany(characterId); + expect(notifications.list).is.an("array"); + expect(notifications.count).is.an("number"); + }); - test('unread count', async () => { - const { count } = await indexer.notification.getUnreadCount(characterId) - expect(count).is.a('number') - }) -}) + test("unread count", async () => { + const { count } = await indexer.notification.getUnreadCount(characterId); + expect(count).is.a("number"); + }); +}); diff --git a/test/indexer/with-headers.test.ts b/test/indexer/with-headers.test.ts index beb2fdd58..b9c9bc91d 100644 --- a/test/indexer/with-headers.test.ts +++ b/test/indexer/with-headers.test.ts @@ -1,29 +1,29 @@ -import { describe, expect, test, vi } from 'vitest' -import { createIndexer, withHeaders } from '../../src' +import { describe, expect, test, vi } from "vitest"; +import { createIndexer, withHeaders } from "../../src"; -const indexer = createIndexer() +const indexer = createIndexer(); -describe('with-headers', () => { - test('headers', async () => { - const fakeResponse = { result: true } +describe("with-headers", () => { + test("headers", async () => { + const fakeResponse = { result: true }; const headers = { - 'x-my-header': 'foo', - } - const fakeFetch = vi.fn>(() => + "x-my-header": "foo", + }; + const fakeFetch = vi.fn(() => Promise.resolve(new Response(JSON.stringify(fakeResponse))), - ) - vi.stubGlobal('fetch', fakeFetch) + ); + vi.stubGlobal("fetch", fakeFetch); - const result = withHeaders(() => indexer.fetch('/foo'), headers) + const result = withHeaders(() => indexer.fetch("/foo"), headers); - await expect(result).resolves.toEqual(fakeResponse) - expect(fakeFetch).toBeCalledTimes(1) + await expect(result).resolves.toEqual(fakeResponse); + expect(fakeFetch).toBeCalledTimes(1); const requestHeaders = Object.fromEntries( (fakeFetch.mock.calls[0][1]?.headers as Headers).entries(), - ) - expect(requestHeaders).toEqual(headers) + ); + expect(requestHeaders).toEqual(headers); - vi.unstubAllGlobals() - }) -}) + vi.unstubAllGlobals(); + }); +}); diff --git a/test/mock.ts b/test/mock.ts index 00969a1cc..cd8ccfd42 100644 --- a/test/mock.ts +++ b/test/mock.ts @@ -1,31 +1,31 @@ -import { type Address, type Hex } from 'viem' -import { Contract } from '../src' +import type { Address, Hex } from "viem"; +import { Contract } from "../src"; export const mockUser = { address: process.env.VITE_MOCK_USER_ADDRESS as Address, privateKey: process.env.VITE_MOCK_USER_PRIVATE_KEY as Hex, email: process.env.VITE_MOCK_USER_EMAIL as string, password: process.env.VITE_MOCK_USER_PASSWORD as string, -} +}; -export const randomHandle = genRandomHandle() -export const randomHandle2 = genRandomHandle() +export const randomHandle = genRandomHandle(); +export const randomHandle2 = genRandomHandle(); export const metadataUri = - 'ipfs://QmTMD6sLA7M4iegKDhbdMPBZ4HLi5fjW27w2J16gqc5Cb7/1.json' + "ipfs://QmTMD6sLA7M4iegKDhbdMPBZ4HLi5fjW27w2J16gqc5Cb7/1.json"; export const metadataUri2 = - 'ipfs://QmTMD6sLA7M4iegKDhbdMPBZ4HLi5fjW27w2J16gqc5Cb7/2.json' + "ipfs://QmTMD6sLA7M4iegKDhbdMPBZ4HLi5fjW27w2J16gqc5Cb7/2.json"; export function genRandomHandle(): string { - const chars = 'abcdefghijklmnopqrstuvwxyz0123456789' - let handle = '' + const chars = "abcdefghijklmnopqrstuvwxyz0123456789"; + let handle = ""; for (let i = 0; i < 10; i++) { - handle += chars.charAt(Math.floor(Math.random() * chars.length)) + handle += chars.charAt(Math.floor(Math.random() * chars.length)); } - return `a-random-handle-${handle}` + return `a-random-handle-${handle}`; } -export const NIL_ADDRESS = '0x0000000000000000000000000000000000000000' +export const NIL_ADDRESS = "0x0000000000000000000000000000000000000000"; export const testContract = new Contract(mockUser.privateKey, { - chain: 'testnet', -}) + chain: "testnet", +}); diff --git a/test/utils/csb.test.ts b/test/utils/csb.test.ts index f077052db..b94ab49d0 100644 --- a/test/utils/csb.test.ts +++ b/test/utils/csb.test.ts @@ -1,26 +1,26 @@ -import { describe, expect, test } from 'vitest' -import { parseCsbUri } from '../../src/utils/csb' +import { describe, expect, test } from "vitest"; +import { parseCsbUri } from "../../src/utils/csb"; -describe.concurrent('csb', () => { - test.concurrent('parseCsbUri', () => { +describe.concurrent("csb", () => { + test.concurrent("parseCsbUri", () => { // error cases - expect(() => parseCsbUri('https://random')).toThrow() + expect(() => parseCsbUri("https://random")).toThrow(); // success cases - let res = parseCsbUri('csb://account:0x0@ethereum') - expect(res.scheme).toBe('csb://') - expect(res.scope).toBe('account') - expect(res.identity).toBe('0x0') - expect(res.platform).toBe('ethereum') + let res = parseCsbUri("csb://account:0x0@ethereum"); + expect(res.scheme).toBe("csb://"); + expect(res.scope).toBe("account"); + expect(res.identity).toBe("0x0"); + expect(res.platform).toBe("ethereum"); - res = parseCsbUri('csb://asset:0x123-4@polygon') - expect(res.scheme).toBe('csb://') - expect(res.scope).toBe('asset') - expect(res.identity).toBe('0x123-4') - expect(res.network).toBe('polygon') - expect(res.contract_address).toBe('0x123') - expect(res.token_id).toBe('4') - }) -}) + res = parseCsbUri("csb://asset:0x123-4@polygon"); + expect(res.scheme).toBe("csb://"); + expect(res.scope).toBe("asset"); + expect(res.identity).toBe("0x123-4"); + expect(res.network).toBe("polygon"); + expect(res.contract_address).toBe("0x123"); + expect(res.token_id).toBe("4"); + }); +}); diff --git a/test/utils/ipfs.test.ts b/test/utils/ipfs.test.ts index be51d5e27..07de67340 100644 --- a/test/utils/ipfs.test.ts +++ b/test/utils/ipfs.test.ts @@ -1,16 +1,16 @@ -import { describe, expect, test } from 'vitest' -import { ipfsUploadJson } from '../../src/ipfs' +import { describe, expect, test } from "vitest"; +import { ipfsUploadJson } from "../../src/ipfs"; -describe.concurrent('ipfs', () => { - test.concurrent('uploadJson', async () => { +describe.concurrent("ipfs", () => { + test.concurrent("uploadJson", async () => { const res = await ipfsUploadJson({ - type: 'character', - name: 'test', - }) + type: "character", + name: "test", + }); - expect(res.status).toBe('ok') - expect(res.cid).toBeDefined() - expect(res.url).toBeDefined() - expect(res.web2url).toBeDefined() - }) -}) + expect(res.status).toBe("ok"); + expect(res.cid).toBeDefined(); + expect(res.url).toBeDefined(); + expect(res.web2url).toBeDefined(); + }); +}); diff --git a/tsconfig.json b/tsconfig.json index 7fa253954..ed4b2e3fb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,18 @@ { - "compilerOptions": { - "target": "esnext", - "module": "esnext", - "lib": ["es2022", "dom", "DOM.Iterable"], - "strict": true, - "esModuleInterop": true, - "moduleResolution": "bundler", - "skipLibCheck": true, - "noUnusedLocals": true, - "noImplicitAny": true, - "resolveJsonModule": true, - "experimentalDecorators": true, - "types": [] - }, - "include": ["src", "test"], - "references": [{ "path": "./tsconfig.node.json" }] + "compilerOptions": { + "target": "esnext", + "module": "esnext", + "lib": ["es2022", "dom", "DOM.Iterable"], + "strict": true, + "esModuleInterop": true, + "moduleResolution": "bundler", + "skipLibCheck": true, + "noUnusedLocals": true, + "noImplicitAny": true, + "resolveJsonModule": true, + "experimentalDecorators": true, + "types": [] + }, + "include": ["src", "test"], + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/tsup.config.ts b/tsup.config.ts index 6d804f15c..e2b6b1200 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,35 +1,35 @@ -import { type Options, defineConfig } from 'tsup' +import { type Options, defineConfig } from "tsup"; const commonConfig: Options = { entry: [ - './src/index.ts', - './src/contract/index.ts', - './src/indexer/index.ts', - './src/ipfs/index.ts', - './src/network/index.ts', - './src/utils/index.ts', + "./src/index.ts", + "./src/contract/index.ts", + "./src/indexer/index.ts", + "./src/ipfs/index.ts", + "./src/network/index.ts", + "./src/utils/index.ts", ], - outDir: 'dist', + outDir: "dist", clean: true, sourcemap: true, treeshake: true, -} +}; export default defineConfig((options) => [ { ...commonConfig, - format: ['cjs', 'esm'], - platform: 'node', + format: ["cjs", "esm"], + platform: "node", dts: options.dts, - target: 'node16.14', + target: "node16.14", }, { ...commonConfig, - format: ['iife'], - globalName: 'Crossbell', + format: ["iife"], + globalName: "Crossbell", minify: !options.watch, - platform: 'browser', + platform: "browser", dts: false, - target: 'es2020', + target: "es2020", }, -]) +]); diff --git a/vitest.config.ts b/vitest.config.ts index dcaf131ce..39224e5cd 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,13 +1,13 @@ -import { defineConfig } from 'vitest/config' +import { defineConfig } from "vitest/config"; export default defineConfig({ test: { testTimeout: 10 * 60 * 1000, poolOptions: { - threads: { - singleThread: true, + forks: { + singleFork: true, }, }, watch: false, }, -}) +});