From 93c68d48508ffdbae9e7e0825ad069fc5ab30866 Mon Sep 17 00:00:00 2001 From: "Thang X. Vu" Date: Sun, 7 Dec 2025 17:35:23 +0700 Subject: [PATCH 1/2] fix(template): next16 linting issues --- .../templates/inkv5-nextjs/eslint.config.mjs | 28 +++++++++++++++++++ .../templates/inkv5-nextjs/package.json | 9 ++---- .../templates/inkv6-nextjs/eslint.config.mjs | 28 +++++++++++++++++++ .../templates/inkv6-nextjs/package.json | 9 ++---- .../inkv6-sol-nextjs/eslint.config.mjs | 28 +++++++++++++++++++ .../templates/inkv6-sol-nextjs/package.json | 9 ++---- .../templates/sol-nextjs/eslint.config.mjs | 28 +++++++++++++++++++ .../templates/sol-nextjs/package.json | 9 ++---- 8 files changed, 124 insertions(+), 24 deletions(-) create mode 100644 packages/create-typink/templates/inkv5-nextjs/eslint.config.mjs create mode 100644 packages/create-typink/templates/inkv6-nextjs/eslint.config.mjs create mode 100644 packages/create-typink/templates/inkv6-sol-nextjs/eslint.config.mjs create mode 100644 packages/create-typink/templates/sol-nextjs/eslint.config.mjs diff --git a/packages/create-typink/templates/inkv5-nextjs/eslint.config.mjs b/packages/create-typink/templates/inkv5-nextjs/eslint.config.mjs new file mode 100644 index 00000000..bb16fda2 --- /dev/null +++ b/packages/create-typink/templates/inkv5-nextjs/eslint.config.mjs @@ -0,0 +1,28 @@ +import { defineConfig, globalIgnores } from 'eslint/config'; +import nextVitals from 'eslint-config-next/core-web-vitals'; +import nextTs from 'eslint-config-next/typescript'; + +const eslintConfig = defineConfig([ + ...nextVitals, + ...nextTs, + // Disable no-explicit-any + { + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-unused-expressions': 'off', + '@next/next/no-img-element': 'off', + 'react/no-unescaped-entities': 'off', + }, + }, + // Override default ignores of eslint-config-next. + globalIgnores([ + // Default ignores of eslint-config-next: + '.next/**', + 'out/**', + 'build/**', + 'next-env.d.ts', + ]), +]); + +export default eslintConfig; diff --git a/packages/create-typink/templates/inkv5-nextjs/package.json b/packages/create-typink/templates/inkv5-nextjs/package.json index 541ecc03..b88412c4 100644 --- a/packages/create-typink/templates/inkv5-nextjs/package.json +++ b/packages/create-typink/templates/inkv5-nextjs/package.json @@ -6,7 +6,7 @@ "dev": "next dev --turbopack", "build": "next build", "start": "next start", - "lint": "next lint", + "lint": "eslint", "typegen": "npx tsx ./scripts/typegen.ts" }, "dependencies": { @@ -35,11 +35,8 @@ "@types/node": "^24.5.2", "@types/react": "^19.1.1", "@types/react-dom": "^19.1.1", - "@typescript-eslint/eslint-plugin": "^8.44.0", - "@typescript-eslint/parser": "^8.44.0", - "eslint": "^9.35.0", - "eslint-import-resolver-typescript": "^4.4.4", - "eslint-plugin-import": "^2.32.0", + "eslint": "^9.39.1", + "eslint-config-next": "^16.0.7", "prettier": "^3.6.2", "prettier-plugin-organize-imports": "^4.2.0", "tailwindcss": "^4.1.13", diff --git a/packages/create-typink/templates/inkv6-nextjs/eslint.config.mjs b/packages/create-typink/templates/inkv6-nextjs/eslint.config.mjs new file mode 100644 index 00000000..bb16fda2 --- /dev/null +++ b/packages/create-typink/templates/inkv6-nextjs/eslint.config.mjs @@ -0,0 +1,28 @@ +import { defineConfig, globalIgnores } from 'eslint/config'; +import nextVitals from 'eslint-config-next/core-web-vitals'; +import nextTs from 'eslint-config-next/typescript'; + +const eslintConfig = defineConfig([ + ...nextVitals, + ...nextTs, + // Disable no-explicit-any + { + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-unused-expressions': 'off', + '@next/next/no-img-element': 'off', + 'react/no-unescaped-entities': 'off', + }, + }, + // Override default ignores of eslint-config-next. + globalIgnores([ + // Default ignores of eslint-config-next: + '.next/**', + 'out/**', + 'build/**', + 'next-env.d.ts', + ]), +]); + +export default eslintConfig; diff --git a/packages/create-typink/templates/inkv6-nextjs/package.json b/packages/create-typink/templates/inkv6-nextjs/package.json index cb1e8226..97c49dc4 100644 --- a/packages/create-typink/templates/inkv6-nextjs/package.json +++ b/packages/create-typink/templates/inkv6-nextjs/package.json @@ -6,7 +6,7 @@ "dev": "next dev --turbopack", "build": "next build", "start": "next start", - "lint": "next lint", + "lint": "eslint", "typegen": "npx tsx ./scripts/typegen.ts" }, "dependencies": { @@ -35,11 +35,8 @@ "@types/node": "^24.5.2", "@types/react": "^19.1.1", "@types/react-dom": "^19.1.1", - "@typescript-eslint/eslint-plugin": "^8.44.0", - "@typescript-eslint/parser": "^8.44.0", - "eslint": "^9.35.0", - "eslint-import-resolver-typescript": "^4.4.4", - "eslint-plugin-import": "^2.32.0", + "eslint": "^9.39.1", + "eslint-config-next": "^16.0.7", "prettier": "^3.6.2", "prettier-plugin-organize-imports": "^4.2.0", "tailwindcss": "^4.1.13", diff --git a/packages/create-typink/templates/inkv6-sol-nextjs/eslint.config.mjs b/packages/create-typink/templates/inkv6-sol-nextjs/eslint.config.mjs new file mode 100644 index 00000000..bb16fda2 --- /dev/null +++ b/packages/create-typink/templates/inkv6-sol-nextjs/eslint.config.mjs @@ -0,0 +1,28 @@ +import { defineConfig, globalIgnores } from 'eslint/config'; +import nextVitals from 'eslint-config-next/core-web-vitals'; +import nextTs from 'eslint-config-next/typescript'; + +const eslintConfig = defineConfig([ + ...nextVitals, + ...nextTs, + // Disable no-explicit-any + { + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-unused-expressions': 'off', + '@next/next/no-img-element': 'off', + 'react/no-unescaped-entities': 'off', + }, + }, + // Override default ignores of eslint-config-next. + globalIgnores([ + // Default ignores of eslint-config-next: + '.next/**', + 'out/**', + 'build/**', + 'next-env.d.ts', + ]), +]); + +export default eslintConfig; diff --git a/packages/create-typink/templates/inkv6-sol-nextjs/package.json b/packages/create-typink/templates/inkv6-sol-nextjs/package.json index 28879e52..1b03202a 100644 --- a/packages/create-typink/templates/inkv6-sol-nextjs/package.json +++ b/packages/create-typink/templates/inkv6-sol-nextjs/package.json @@ -6,7 +6,7 @@ "dev": "next dev --turbopack", "build": "next build", "start": "next start", - "lint": "next lint", + "lint": "eslint", "typegen": "npx tsx ./scripts/typegen.ts" }, "dependencies": { @@ -35,11 +35,8 @@ "@types/node": "^24.5.2", "@types/react": "^19.1.1", "@types/react-dom": "^19.1.1", - "@typescript-eslint/eslint-plugin": "^8.44.0", - "@typescript-eslint/parser": "^8.44.0", - "eslint": "^9.35.0", - "eslint-import-resolver-typescript": "^4.4.4", - "eslint-plugin-import": "^2.32.0", + "eslint": "^9.39.1", + "eslint-config-next": "^16.0.7", "prettier": "^3.6.2", "prettier-plugin-organize-imports": "^4.2.0", "tailwindcss": "^4.1.13", diff --git a/packages/create-typink/templates/sol-nextjs/eslint.config.mjs b/packages/create-typink/templates/sol-nextjs/eslint.config.mjs new file mode 100644 index 00000000..bb16fda2 --- /dev/null +++ b/packages/create-typink/templates/sol-nextjs/eslint.config.mjs @@ -0,0 +1,28 @@ +import { defineConfig, globalIgnores } from 'eslint/config'; +import nextVitals from 'eslint-config-next/core-web-vitals'; +import nextTs from 'eslint-config-next/typescript'; + +const eslintConfig = defineConfig([ + ...nextVitals, + ...nextTs, + // Disable no-explicit-any + { + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-unused-expressions': 'off', + '@next/next/no-img-element': 'off', + 'react/no-unescaped-entities': 'off', + }, + }, + // Override default ignores of eslint-config-next. + globalIgnores([ + // Default ignores of eslint-config-next: + '.next/**', + 'out/**', + 'build/**', + 'next-env.d.ts', + ]), +]); + +export default eslintConfig; diff --git a/packages/create-typink/templates/sol-nextjs/package.json b/packages/create-typink/templates/sol-nextjs/package.json index b200c72c..72690a5f 100644 --- a/packages/create-typink/templates/sol-nextjs/package.json +++ b/packages/create-typink/templates/sol-nextjs/package.json @@ -6,7 +6,7 @@ "dev": "next dev --turbopack", "build": "next build", "start": "next start", - "lint": "next lint", + "lint": "eslint", "typegen": "npx tsx ./scripts/typegen.ts" }, "dependencies": { @@ -35,11 +35,8 @@ "@types/node": "^24.5.2", "@types/react": "^19.1.1", "@types/react-dom": "^19.1.1", - "@typescript-eslint/eslint-plugin": "^8.44.0", - "@typescript-eslint/parser": "^8.44.0", - "eslint": "^9.35.0", - "eslint-import-resolver-typescript": "^4.4.4", - "eslint-plugin-import": "^2.32.0", + "eslint": "^9.39.1", + "eslint-config-next": "^16.0.7", "prettier": "^3.6.2", "prettier-plugin-organize-imports": "^4.2.0", "tailwindcss": "^4.1.13", From 6af403f33cd90d87f992a256396687013e2c4670 Mon Sep 17 00:00:00 2001 From: "Thang X. Vu" Date: Sun, 7 Dec 2025 17:42:16 +0700 Subject: [PATCH 2/2] regen --- .../contracts/types/greeter/constructor-query.d.ts | 7 +------ .../src/contracts/types/greeter/constructor-tx.d.ts | 12 +++--------- .../src/contracts/types/greeter/events.d.ts | 5 +---- .../src/contracts/types/greeter/index.d.ts | 10 +++++----- .../src/contracts/types/greeter/query.d.ts | 7 +------ .../inkv5-nextjs/src/contracts/types/greeter/tx.d.ts | 8 ++------ .../contracts/types/flipper/constructor-query.d.ts | 6 +----- .../src/contracts/types/flipper/constructor-tx.d.ts | 9 ++------- .../src/contracts/types/flipper/events.d.ts | 5 +---- .../src/contracts/types/flipper/index.d.ts | 10 +++++----- .../src/contracts/types/flipper/query.d.ts | 7 +------ .../inkv6-nextjs/src/contracts/types/flipper/tx.d.ts | 7 ++----- .../contracts/types/flipper/constructor-query.d.ts | 6 +----- .../src/contracts/types/flipper/constructor-tx.d.ts | 9 ++------- .../src/contracts/types/flipper/events.d.ts | 5 +---- .../src/contracts/types/flipper/index.d.ts | 10 +++++----- .../src/contracts/types/flipper/query.d.ts | 7 +------ .../src/contracts/types/flipper/tx.d.ts | 7 ++----- .../contracts/types/storage/constructor-query.d.ts | 6 +----- .../src/contracts/types/storage/constructor-tx.d.ts | 6 ++---- .../src/contracts/types/storage/events.d.ts | 5 +---- .../src/contracts/types/storage/index.d.ts | 10 +++++----- .../src/contracts/types/storage/query.d.ts | 7 +------ .../sol-nextjs/src/contracts/types/storage/tx.d.ts | 11 ++--------- 24 files changed, 49 insertions(+), 133 deletions(-) diff --git a/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/constructor-query.d.ts b/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/constructor-query.d.ts index 36f5fd24..8c200fe3 100644 --- a/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/constructor-query.d.ts +++ b/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/constructor-query.d.ts @@ -12,10 +12,7 @@ import type { } from 'dedot/contracts'; import type { InkPrimitivesLangError } from './types.js'; -export interface ConstructorQuery< - ChainApi extends GenericSubstrateApi, - Type extends MetadataType, -> extends GenericConstructorQuery { +export interface ConstructorQuery extends GenericConstructorQuery { /** * Creates a new greeter contract initialized with the given value. * @@ -25,7 +22,6 @@ export interface ConstructorQuery< * @selector 0x9bae9d5e **/ new: GenericConstructorQueryCall< - ChainApi, ( initValue: string, options?: ConstructorCallOptions, @@ -41,7 +37,6 @@ export interface ConstructorQuery< * @selector 0xed4b9d1b **/ default: GenericConstructorQueryCall< - ChainApi, (options?: ConstructorCallOptions) => Promise>, Type >; diff --git a/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/constructor-tx.d.ts b/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/constructor-tx.d.ts index e97f2567..0cd887c3 100644 --- a/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/constructor-tx.d.ts +++ b/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/constructor-tx.d.ts @@ -11,10 +11,9 @@ import type { } from 'dedot/contracts'; export interface ConstructorTx< - ChainApi extends GenericSubstrateApi, ContractApi extends InkGenericContractApi, Type extends MetadataType, -> extends GenericConstructorTx { +> extends GenericConstructorTx { /** * Creates a new greeter contract initialized with the given value. * @@ -24,11 +23,7 @@ export interface ConstructorTx< * @selector 0x9bae9d5e **/ new: GenericConstructorTxCall< - ChainApi, - ( - initValue: string, - options?: ConstructorTxOptions, - ) => GenericInstantiateSubmittableExtrinsic, + (initValue: string, options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic, Type >; @@ -40,8 +35,7 @@ export interface ConstructorTx< * @selector 0xed4b9d1b **/ default: GenericConstructorTxCall< - ChainApi, - (options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic, + (options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic, Type >; } diff --git a/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/events.d.ts b/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/events.d.ts index c4986c37..ef753c6b 100644 --- a/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/events.d.ts +++ b/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/events.d.ts @@ -4,10 +4,7 @@ import type { GenericSubstrateApi } from 'dedot/types'; import type { AccountId32 } from 'dedot/codecs'; import type { GenericContractEvents, GenericContractEvent, MetadataType } from 'dedot/contracts'; -export interface ContractEvents< - ChainApi extends GenericSubstrateApi, - Type extends MetadataType, -> extends GenericContractEvents { +export interface ContractEvents extends GenericContractEvents { /** * * @signature_topic: 0x184de1e97d8dba311c74fa923646f3bb4c5b0b4f747447857dbe70305dcd777e diff --git a/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/index.d.ts b/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/index.d.ts index 4be9b242..d3ac3d60 100644 --- a/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/index.d.ts +++ b/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/index.d.ts @@ -23,11 +23,11 @@ export interface GreeterContractApi< ChainApi extends GenericSubstrateApi = SubstrateApi, > extends InkGenericContractApi { metadataType: 'ink'; - query: ContractQuery; - tx: ContractTx; - constructorQuery: ConstructorQuery; - constructorTx: ConstructorTx; - events: ContractEvents; + query: ContractQuery<'ink'>; + tx: ContractTx<'ink'>; + constructorQuery: ConstructorQuery<'ink'>; + constructorTx: ConstructorTx; + events: ContractEvents<'ink'>; storage: { root(): Promise; lazy(): WithLazyStorage; diff --git a/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/query.d.ts b/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/query.d.ts index 44223cd6..5436f51f 100644 --- a/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/query.d.ts +++ b/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/query.d.ts @@ -12,10 +12,7 @@ import type { } from 'dedot/contracts'; import type { InkPrimitivesLangError } from './types.js'; -export interface ContractQuery< - ChainApi extends GenericSubstrateApi, - Type extends MetadataType, -> extends GenericContractQuery { +export interface ContractQuery extends GenericContractQuery { /** * Returns the current value of `message`. * @@ -24,7 +21,6 @@ export interface ContractQuery< * @selector 0x052cda08 **/ greet: GenericContractQueryCall< - ChainApi, (options?: ContractCallOptions) => Promise>, Type >; @@ -38,7 +34,6 @@ export interface ContractQuery< * @selector 0x1fe7426f **/ setMessage: GenericContractQueryCall< - ChainApi, (newValue: string, options?: ContractCallOptions) => Promise>, Type >; diff --git a/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/tx.d.ts b/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/tx.d.ts index 46741b9c..ceb9dddd 100644 --- a/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/tx.d.ts +++ b/packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/tx.d.ts @@ -9,10 +9,7 @@ import type { MetadataType, } from 'dedot/contracts'; -export interface ContractTx extends GenericContractTx< - ChainApi, - Type -> { +export interface ContractTx extends GenericContractTx { /** * Sets `message` to the given value. * @@ -22,8 +19,7 @@ export interface ContractTx ContractSubmittableExtrinsic, + (newValue: string, options?: ContractTxOptions) => ContractSubmittableExtrinsic, Type >; } diff --git a/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/constructor-query.d.ts b/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/constructor-query.d.ts index 7b23a19c..aa852618 100644 --- a/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/constructor-query.d.ts +++ b/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/constructor-query.d.ts @@ -12,10 +12,7 @@ import type { } from 'dedot/contracts'; import type { InkPrimitivesLangError } from './types.js'; -export interface ConstructorQuery< - ChainApi extends GenericSubstrateApi, - Type extends MetadataType, -> extends GenericConstructorQuery { +export interface ConstructorQuery extends GenericConstructorQuery { /** * Constructor that initializes the `bool` value to the given `init_value`. * @@ -25,7 +22,6 @@ export interface ConstructorQuery< * @selector 0x9bae9d5e **/ new: GenericConstructorQueryCall< - ChainApi, ( initValue: boolean, options?: ConstructorCallOptions, diff --git a/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/constructor-tx.d.ts b/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/constructor-tx.d.ts index a73b25cc..db894fca 100644 --- a/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/constructor-tx.d.ts +++ b/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/constructor-tx.d.ts @@ -11,10 +11,9 @@ import type { } from 'dedot/contracts'; export interface ConstructorTx< - ChainApi extends GenericSubstrateApi, ContractApi extends InkGenericContractApi, Type extends MetadataType, -> extends GenericConstructorTx { +> extends GenericConstructorTx { /** * Constructor that initializes the `bool` value to the given `init_value`. * @@ -24,11 +23,7 @@ export interface ConstructorTx< * @selector 0x9bae9d5e **/ new: GenericConstructorTxCall< - ChainApi, - ( - initValue: boolean, - options?: ConstructorTxOptions, - ) => GenericInstantiateSubmittableExtrinsic, + (initValue: boolean, options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic, Type >; } diff --git a/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/events.d.ts b/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/events.d.ts index 0b349573..48ce4ff3 100644 --- a/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/events.d.ts +++ b/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/events.d.ts @@ -4,10 +4,7 @@ import type { GenericSubstrateApi } from 'dedot/types'; import type { H160 } from 'dedot/codecs'; import type { GenericContractEvents, GenericContractEvent, MetadataType } from 'dedot/contracts'; -export interface ContractEvents< - ChainApi extends GenericSubstrateApi, - Type extends MetadataType, -> extends GenericContractEvents { +export interface ContractEvents extends GenericContractEvents { /** * Event emitted when the flipper value is flipped * diff --git a/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/index.d.ts b/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/index.d.ts index 22b7d62e..f81952c9 100644 --- a/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/index.d.ts +++ b/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/index.d.ts @@ -23,11 +23,11 @@ export interface FlipperContractApi< ChainApi extends GenericSubstrateApi = SubstrateApi, > extends InkGenericContractApi { metadataType: 'ink'; - query: ContractQuery; - tx: ContractTx; - constructorQuery: ConstructorQuery; - constructorTx: ConstructorTx; - events: ContractEvents; + query: ContractQuery<'ink'>; + tx: ContractTx<'ink'>; + constructorQuery: ConstructorQuery<'ink'>; + constructorTx: ConstructorTx; + events: ContractEvents<'ink'>; storage: { root(): Promise; lazy(): WithLazyStorage; diff --git a/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/query.d.ts b/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/query.d.ts index 49e44045..338385af 100644 --- a/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/query.d.ts +++ b/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/query.d.ts @@ -12,10 +12,7 @@ import type { } from 'dedot/contracts'; import type { InkPrimitivesLangError } from './types.js'; -export interface ContractQuery< - ChainApi extends GenericSubstrateApi, - Type extends MetadataType, -> extends GenericContractQuery { +export interface ContractQuery extends GenericContractQuery { /** * A message that can be called on instantiated contracts. * This one flips the value of the stored `bool` from `true` @@ -26,7 +23,6 @@ export interface ContractQuery< * @selector 0x633aa551 **/ flip: GenericContractQueryCall< - ChainApi, (options?: ContractCallOptions) => Promise>, Type >; @@ -39,7 +35,6 @@ export interface ContractQuery< * @selector 0x2f865bd9 **/ get: GenericContractQueryCall< - ChainApi, (options?: ContractCallOptions) => Promise>, Type >; diff --git a/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/tx.d.ts b/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/tx.d.ts index 37a9b7f6..8c8a9f40 100644 --- a/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/tx.d.ts +++ b/packages/create-typink/templates/inkv6-nextjs/src/contracts/types/flipper/tx.d.ts @@ -9,10 +9,7 @@ import type { MetadataType, } from 'dedot/contracts'; -export interface ContractTx extends GenericContractTx< - ChainApi, - Type -> { +export interface ContractTx extends GenericContractTx { /** * A message that can be called on instantiated contracts. * This one flips the value of the stored `bool` from `true` @@ -22,5 +19,5 @@ export interface ContractTx ContractSubmittableExtrinsic, Type>; + flip: GenericContractTxCall<(options?: ContractTxOptions) => ContractSubmittableExtrinsic, Type>; } diff --git a/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/constructor-query.d.ts b/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/constructor-query.d.ts index e7b48729..df59a206 100644 --- a/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/constructor-query.d.ts +++ b/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/constructor-query.d.ts @@ -10,16 +10,12 @@ import type { MetadataType, } from 'dedot/contracts'; -export interface ConstructorQuery< - ChainApi extends GenericSubstrateApi, - Type extends MetadataType, -> extends GenericConstructorQuery { +export interface ConstructorQuery extends GenericConstructorQuery { /** * @param {boolean} init_value * @param {ConstructorCallOptions} options **/ new: GenericConstructorQueryCall< - ChainApi, ( init_value: boolean, options?: ConstructorCallOptions, diff --git a/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/constructor-tx.d.ts b/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/constructor-tx.d.ts index 5d99153e..6e447df1 100644 --- a/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/constructor-tx.d.ts +++ b/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/constructor-tx.d.ts @@ -11,20 +11,15 @@ import type { } from 'dedot/contracts'; export interface ConstructorTx< - ChainApi extends GenericSubstrateApi, ContractApi extends SolGenericContractApi, Type extends MetadataType, -> extends GenericConstructorTx { +> extends GenericConstructorTx { /** * @param {boolean} init_value * @param {ConstructorTxOptions} options **/ new: GenericConstructorTxCall< - ChainApi, - ( - init_value: boolean, - options?: ConstructorTxOptions, - ) => GenericInstantiateSubmittableExtrinsic, + (init_value: boolean, options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic, Type >; } diff --git a/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/events.d.ts b/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/events.d.ts index 08ebc697..cb983639 100644 --- a/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/events.d.ts +++ b/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/events.d.ts @@ -4,10 +4,7 @@ import type { GenericSubstrateApi } from 'dedot/types'; import type { H160 } from 'dedot/codecs'; import type { GenericContractEvents, GenericContractEvent, MetadataType } from 'dedot/contracts'; -export interface ContractEvents< - ChainApi extends GenericSubstrateApi, - Type extends MetadataType, -> extends GenericContractEvents { +export interface ContractEvents extends GenericContractEvents { Flipped: GenericContractEvent< 'Flipped', { diff --git a/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/index.d.ts b/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/index.d.ts index 9285b25d..0f2bf7c0 100644 --- a/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/index.d.ts +++ b/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/index.d.ts @@ -15,11 +15,11 @@ export interface FlipperContractApi< ChainApi extends GenericSubstrateApi = SubstrateApi, > extends SolGenericContractApi { metadataType: 'sol'; - query: ContractQuery; - tx: ContractTx; - constructorQuery: ConstructorQuery; - events: ContractEvents; - constructorTx: ConstructorTx; + query: ContractQuery<'sol'>; + tx: ContractTx<'sol'>; + constructorQuery: ConstructorQuery<'sol'>; + events: ContractEvents<'sol'>; + constructorTx: ConstructorTx; types: { ChainApi: ChainApi; diff --git a/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/query.d.ts b/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/query.d.ts index fc18988e..3410bd62 100644 --- a/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/query.d.ts +++ b/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/query.d.ts @@ -10,15 +10,11 @@ import type { MetadataType, } from 'dedot/contracts'; -export interface ContractQuery< - ChainApi extends GenericSubstrateApi, - Type extends MetadataType, -> extends GenericContractQuery { +export interface ContractQuery extends GenericContractQuery { /** * @param {ContractCallOptions} options **/ flip: GenericContractQueryCall< - ChainApi, (options?: ContractCallOptions) => Promise>, Type >; @@ -27,7 +23,6 @@ export interface ContractQuery< * @param {ContractCallOptions} options **/ get: GenericContractQueryCall< - ChainApi, (options?: ContractCallOptions) => Promise>, Type >; diff --git a/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/tx.d.ts b/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/tx.d.ts index af7dfeec..0f8c3d20 100644 --- a/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/tx.d.ts +++ b/packages/create-typink/templates/inkv6-sol-nextjs/src/contracts/types/flipper/tx.d.ts @@ -9,12 +9,9 @@ import type { MetadataType, } from 'dedot/contracts'; -export interface ContractTx extends GenericContractTx< - ChainApi, - Type -> { +export interface ContractTx extends GenericContractTx { /** * @param {ContractTxOptions} options **/ - flip: GenericContractTxCall ContractSubmittableExtrinsic, Type>; + flip: GenericContractTxCall<(options?: ContractTxOptions) => ContractSubmittableExtrinsic, Type>; } diff --git a/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/constructor-query.d.ts b/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/constructor-query.d.ts index a97a07e7..b2b8d1cd 100644 --- a/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/constructor-query.d.ts +++ b/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/constructor-query.d.ts @@ -10,15 +10,11 @@ import type { MetadataType, } from 'dedot/contracts'; -export interface ConstructorQuery< - ChainApi extends GenericSubstrateApi, - Type extends MetadataType, -> extends GenericConstructorQuery { +export interface ConstructorQuery extends GenericConstructorQuery { /** * @param {ConstructorCallOptions} options **/ new: GenericConstructorQueryCall< - ChainApi, (options?: ConstructorCallOptions) => Promise>, Type >; diff --git a/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/constructor-tx.d.ts b/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/constructor-tx.d.ts index b952db4f..a582a12e 100644 --- a/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/constructor-tx.d.ts +++ b/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/constructor-tx.d.ts @@ -11,16 +11,14 @@ import type { } from 'dedot/contracts'; export interface ConstructorTx< - ChainApi extends GenericSubstrateApi, ContractApi extends SolGenericContractApi, Type extends MetadataType, -> extends GenericConstructorTx { +> extends GenericConstructorTx { /** * @param {ConstructorTxOptions} options **/ new: GenericConstructorTxCall< - ChainApi, - (options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic, + (options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic, Type >; } diff --git a/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/events.d.ts b/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/events.d.ts index 8293ffd9..ee5743c0 100644 --- a/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/events.d.ts +++ b/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/events.d.ts @@ -4,10 +4,7 @@ import type { GenericSubstrateApi } from 'dedot/types'; import type { H160 } from 'dedot/codecs'; import type { GenericContractEvents, GenericContractEvent, MetadataType } from 'dedot/contracts'; -export interface ContractEvents< - ChainApi extends GenericSubstrateApi, - Type extends MetadataType, -> extends GenericContractEvents { +export interface ContractEvents extends GenericContractEvents { Updated: GenericContractEvent< 'Updated', { diff --git a/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/index.d.ts b/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/index.d.ts index aa8b61dc..8d7ac36a 100644 --- a/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/index.d.ts +++ b/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/index.d.ts @@ -15,11 +15,11 @@ export interface StorageContractApi< ChainApi extends GenericSubstrateApi = SubstrateApi, > extends SolGenericContractApi { metadataType: 'sol'; - query: ContractQuery; - tx: ContractTx; - constructorQuery: ConstructorQuery; - events: ContractEvents; - constructorTx: ConstructorTx; + query: ContractQuery<'sol'>; + tx: ContractTx<'sol'>; + constructorQuery: ConstructorQuery<'sol'>; + events: ContractEvents<'sol'>; + constructorTx: ConstructorTx; types: { ChainApi: ChainApi; diff --git a/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/query.d.ts b/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/query.d.ts index 6bb4405e..b80e6e79 100644 --- a/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/query.d.ts +++ b/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/query.d.ts @@ -10,15 +10,11 @@ import type { MetadataType, } from 'dedot/contracts'; -export interface ContractQuery< - ChainApi extends GenericSubstrateApi, - Type extends MetadataType, -> extends GenericContractQuery { +export interface ContractQuery extends GenericContractQuery { /** * @param {ContractCallOptions} options **/ retrieve: GenericContractQueryCall< - ChainApi, (options?: ContractCallOptions) => Promise>, Type >; @@ -28,7 +24,6 @@ export interface ContractQuery< * @param {ContractCallOptions} options **/ store: GenericContractQueryCall< - ChainApi, (num: bigint, options?: ContractCallOptions) => Promise>, Type >; diff --git a/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/tx.d.ts b/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/tx.d.ts index 31afb95c..9f795455 100644 --- a/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/tx.d.ts +++ b/packages/create-typink/templates/sol-nextjs/src/contracts/types/storage/tx.d.ts @@ -9,17 +9,10 @@ import type { MetadataType, } from 'dedot/contracts'; -export interface ContractTx extends GenericContractTx< - ChainApi, - Type -> { +export interface ContractTx extends GenericContractTx { /** * @param {bigint} num * @param {ContractTxOptions} options **/ - store: GenericContractTxCall< - ChainApi, - (num: bigint, options?: ContractTxOptions) => ContractSubmittableExtrinsic, - Type - >; + store: GenericContractTxCall<(num: bigint, options?: ContractTxOptions) => ContractSubmittableExtrinsic, Type>; }