Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions packages/create-typink/templates/inkv5-nextjs/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -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;
9 changes: 3 additions & 6 deletions packages/create-typink/templates/inkv5-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChainApi, Type> {
export interface ConstructorQuery<Type extends MetadataType> extends GenericConstructorQuery<Type> {
/**
* Creates a new greeter contract initialized with the given value.
*
Expand All @@ -25,7 +22,6 @@ export interface ConstructorQuery<
* @selector 0x9bae9d5e
**/
new: GenericConstructorQueryCall<
ChainApi,
(
initValue: string,
options?: ConstructorCallOptions,
Expand All @@ -41,7 +37,6 @@ export interface ConstructorQuery<
* @selector 0xed4b9d1b
**/
default: GenericConstructorQueryCall<
ChainApi,
(options?: ConstructorCallOptions) => Promise<GenericConstructorCallResult<[], ContractInstantiateResult>>,
Type
>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import type {
} from 'dedot/contracts';

export interface ConstructorTx<
ChainApi extends GenericSubstrateApi,
ContractApi extends InkGenericContractApi,
Type extends MetadataType,
> extends GenericConstructorTx<ChainApi, Type> {
> extends GenericConstructorTx<Type> {
/**
* Creates a new greeter contract initialized with the given value.
*
Expand All @@ -24,11 +23,7 @@ export interface ConstructorTx<
* @selector 0x9bae9d5e
**/
new: GenericConstructorTxCall<
ChainApi,
(
initValue: string,
options?: ConstructorTxOptions,
) => GenericInstantiateSubmittableExtrinsic<ChainApi, ContractApi>,
(initValue: string, options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic<ContractApi>,
Type
>;

Expand All @@ -40,8 +35,7 @@ export interface ConstructorTx<
* @selector 0xed4b9d1b
**/
default: GenericConstructorTxCall<
ChainApi,
(options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic<ChainApi, ContractApi>,
(options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic<ContractApi>,
Type
>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChainApi, Type> {
export interface ContractEvents<Type extends MetadataType> extends GenericContractEvents<Type> {
/**
*
* @signature_topic: 0x184de1e97d8dba311c74fa923646f3bb4c5b0b4f747447857dbe70305dcd777e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export interface GreeterContractApi<
ChainApi extends GenericSubstrateApi = SubstrateApi,
> extends InkGenericContractApi<ChainApi> {
metadataType: 'ink';
query: ContractQuery<ChainApi, 'ink'>;
tx: ContractTx<ChainApi, 'ink'>;
constructorQuery: ConstructorQuery<ChainApi, 'ink'>;
constructorTx: ConstructorTx<ChainApi, GreeterContractApi, 'ink'>;
events: ContractEvents<ChainApi, 'ink'>;
query: ContractQuery<'ink'>;
tx: ContractTx<'ink'>;
constructorQuery: ConstructorQuery<'ink'>;
constructorTx: ConstructorTx<GreeterContractApi, 'ink'>;
events: ContractEvents<'ink'>;
storage: {
root(): Promise<Greeter>;
lazy(): WithLazyStorage<Greeter>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChainApi, Type> {
export interface ContractQuery<Type extends MetadataType> extends GenericContractQuery<Type> {
/**
* Returns the current value of `message`.
*
Expand All @@ -24,7 +21,6 @@ export interface ContractQuery<
* @selector 0x052cda08
**/
greet: GenericContractQueryCall<
ChainApi,
(options?: ContractCallOptions) => Promise<GenericContractCallResult<string, ContractCallResult>>,
Type
>;
Expand All @@ -38,7 +34,6 @@ export interface ContractQuery<
* @selector 0x1fe7426f
**/
setMessage: GenericContractQueryCall<
ChainApi,
(newValue: string, options?: ContractCallOptions) => Promise<GenericContractCallResult<[], ContractCallResult>>,
Type
>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import type {
MetadataType,
} from 'dedot/contracts';

export interface ContractTx<ChainApi extends GenericSubstrateApi, Type extends MetadataType> extends GenericContractTx<
ChainApi,
Type
> {
export interface ContractTx<Type extends MetadataType> extends GenericContractTx<Type> {
/**
* Sets `message` to the given value.
*
Expand All @@ -22,8 +19,7 @@ export interface ContractTx<ChainApi extends GenericSubstrateApi, Type extends M
* @selector 0x1fe7426f
**/
setMessage: GenericContractTxCall<
ChainApi,
(newValue: string, options?: ContractTxOptions) => ContractSubmittableExtrinsic<ChainApi>,
(newValue: string, options?: ContractTxOptions) => ContractSubmittableExtrinsic,
Type
>;
}
28 changes: 28 additions & 0 deletions packages/create-typink/templates/inkv6-nextjs/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -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;
9 changes: 3 additions & 6 deletions packages/create-typink/templates/inkv6-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChainApi, Type> {
export interface ConstructorQuery<Type extends MetadataType> extends GenericConstructorQuery<Type> {
/**
* Constructor that initializes the `bool` value to the given `init_value`.
*
Expand All @@ -25,7 +22,6 @@ export interface ConstructorQuery<
* @selector 0x9bae9d5e
**/
new: GenericConstructorQueryCall<
ChainApi,
(
initValue: boolean,
options?: ConstructorCallOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import type {
} from 'dedot/contracts';

export interface ConstructorTx<
ChainApi extends GenericSubstrateApi,
ContractApi extends InkGenericContractApi,
Type extends MetadataType,
> extends GenericConstructorTx<ChainApi, Type> {
> extends GenericConstructorTx<Type> {
/**
* Constructor that initializes the `bool` value to the given `init_value`.
*
Expand All @@ -24,11 +23,7 @@ export interface ConstructorTx<
* @selector 0x9bae9d5e
**/
new: GenericConstructorTxCall<
ChainApi,
(
initValue: boolean,
options?: ConstructorTxOptions,
) => GenericInstantiateSubmittableExtrinsic<ChainApi, ContractApi>,
(initValue: boolean, options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic<ContractApi>,
Type
>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChainApi, Type> {
export interface ContractEvents<Type extends MetadataType> extends GenericContractEvents<Type> {
/**
* Event emitted when the flipper value is flipped
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export interface FlipperContractApi<
ChainApi extends GenericSubstrateApi = SubstrateApi,
> extends InkGenericContractApi<ChainApi> {
metadataType: 'ink';
query: ContractQuery<ChainApi, 'ink'>;
tx: ContractTx<ChainApi, 'ink'>;
constructorQuery: ConstructorQuery<ChainApi, 'ink'>;
constructorTx: ConstructorTx<ChainApi, FlipperContractApi, 'ink'>;
events: ContractEvents<ChainApi, 'ink'>;
query: ContractQuery<'ink'>;
tx: ContractTx<'ink'>;
constructorQuery: ConstructorQuery<'ink'>;
constructorTx: ConstructorTx<FlipperContractApi, 'ink'>;
events: ContractEvents<'ink'>;
storage: {
root(): Promise<Flipper>;
lazy(): WithLazyStorage<Flipper>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChainApi, Type> {
export interface ContractQuery<Type extends MetadataType> extends GenericContractQuery<Type> {
/**
* A message that can be called on instantiated contracts.
* This one flips the value of the stored `bool` from `true`
Expand All @@ -26,7 +23,6 @@ export interface ContractQuery<
* @selector 0x633aa551
**/
flip: GenericContractQueryCall<
ChainApi,
(options?: ContractCallOptions) => Promise<GenericContractCallResult<[], ContractCallResult>>,
Type
>;
Expand All @@ -39,7 +35,6 @@ export interface ContractQuery<
* @selector 0x2f865bd9
**/
get: GenericContractQueryCall<
ChainApi,
(options?: ContractCallOptions) => Promise<GenericContractCallResult<boolean, ContractCallResult>>,
Type
>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import type {
MetadataType,
} from 'dedot/contracts';

export interface ContractTx<ChainApi extends GenericSubstrateApi, Type extends MetadataType> extends GenericContractTx<
ChainApi,
Type
> {
export interface ContractTx<Type extends MetadataType> extends GenericContractTx<Type> {
/**
* A message that can be called on instantiated contracts.
* This one flips the value of the stored `bool` from `true`
Expand All @@ -22,5 +19,5 @@ export interface ContractTx<ChainApi extends GenericSubstrateApi, Type extends M
*
* @selector 0x633aa551
**/
flip: GenericContractTxCall<ChainApi, (options?: ContractTxOptions) => ContractSubmittableExtrinsic<ChainApi>, Type>;
flip: GenericContractTxCall<(options?: ContractTxOptions) => ContractSubmittableExtrinsic, Type>;
}
Original file line number Diff line number Diff line change
@@ -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;
Loading