diff --git a/idea/frontend/package.json b/idea/frontend/package.json index 23f7fea42e..08696ea78d 100644 --- a/idea/frontend/package.json +++ b/idea/frontend/package.json @@ -9,17 +9,17 @@ "preview": "vite preview" }, "dependencies": { - "@gear-js/api": "0.38.1", + "@gear-js/api": "0.38.2", "@gear-js/react-hooks": "workspace:^", "@gear-js/ui": "workspace:^", "@hcaptcha/react-hcaptcha": "1.8.1", "@hookform/resolvers": "3.3.2", - "@polkadot/api": "11.0.2", + "@polkadot/api": "12.0.1", "@polkadot/react-identicon": "3.6.3", - "@polkadot/types": "11.0.2", + "@polkadot/types": "12.0.1", "@polkadot/util": "12.6.2", "@react-aria/utils": "3.21.0", - "@tanstack/react-query": "5.29.0", + "@tanstack/react-query": "5.56.2", "bignumber.js": "9.1.2", "clsx": "2.0.0", "ky": "1.0.1", @@ -37,7 +37,8 @@ "react-number-format": "5.3.1", "react-router-dom": "6.16.0", "react-transition-group": "4.4.5", - "sails-js": "0.1.8", + "sails-js": "0.2.0", + "sails-js-parser": "^0.0.1", "simplebar-react": "3.2.4", "yup": "1.3.2", "zod": "3.22.4" @@ -62,6 +63,7 @@ "eslint-plugin-react": "7.33.2", "eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-react-refresh": "0.4.3", + "sails-js-types": "^0.0.1", "sass": "1.69.1", "typescript": "5.5.3", "vite": "4.4.11", diff --git a/idea/frontend/src/features/program/hooks/use-program-status.ts b/idea/frontend/src/features/program/hooks/use-program-status.ts index fece65177e..2c474f6da3 100644 --- a/idea/frontend/src/features/program/hooks/use-program-status.ts +++ b/idea/frontend/src/features/program/hooks/use-program-status.ts @@ -1,5 +1,5 @@ import { useApi } from '@gear-js/react-hooks'; -import { HexString, GearCommonProgram } from '@gear-js/api'; +import { HexString, GearCoreProgram } from '@gear-js/api'; import { Option } from '@polkadot/types'; import { ProgramStatus } from '../consts'; @@ -10,7 +10,7 @@ const useProgramStatus = () => { const getProgramStatus = async (id: HexString) => { if (!isApiReady) return Promise.reject(new Error('API is not initialized')); - const option = (await api.query.gearProgram.programStorage(id)) as Option; + const option = (await api.query.gearProgram.programStorage(id)) as Option; const { isTerminated, isExited } = option.unwrap(); if (isTerminated) return ProgramStatus.Terminated; diff --git a/idea/frontend/src/features/sails/hooks/use-sails-init.ts b/idea/frontend/src/features/sails/hooks/use-sails-init.ts index c6d9c009f0..342ce40822 100644 --- a/idea/frontend/src/features/sails/hooks/use-sails-init.ts +++ b/idea/frontend/src/features/sails/hooks/use-sails-init.ts @@ -1,10 +1,17 @@ import { useQuery } from '@tanstack/react-query'; import { Sails } from 'sails-js'; +import { SailsIdlParser } from 'sails-js-parser'; function useSailsInit() { const { data } = useQuery({ queryKey: ['sails'], - queryFn: () => Sails.new(), + + queryFn: async () => { + const parser = await SailsIdlParser.new(); + + return new Sails(parser); + }, + refetchOnMount: false, refetchOnReconnect: false, refetchOnWindowFocus: false, diff --git a/idea/frontend/src/features/sails/ui/fields/enum-field.tsx b/idea/frontend/src/features/sails/ui/fields/enum-field.tsx index c6029dab07..66cbcb4853 100644 --- a/idea/frontend/src/features/sails/ui/fields/enum-field.tsx +++ b/idea/frontend/src/features/sails/ui/fields/enum-field.tsx @@ -1,15 +1,16 @@ import { Select } from '@gear-js/ui'; import { useState } from 'react'; -import { Sails, TypeDef } from 'sails-js'; +import { Sails } from 'sails-js'; +import { ISailsTypeDef } from 'sails-js-types'; import { useSetPayloadValue } from '../../hooks'; import { getNestedName, getDefaultValue } from '../../utils'; type Props = { sails: Sails; - def: TypeDef; + def: ISailsTypeDef; name: string; - renderField: (def: TypeDef, label: string, name: string) => JSX.Element | undefined; + renderField: (def: ISailsTypeDef, label: string, name: string) => JSX.Element | undefined; }; function EnumField({ sails, def, name, renderField }: Props) { diff --git a/idea/frontend/src/features/sails/ui/fields/fields.tsx b/idea/frontend/src/features/sails/ui/fields/fields.tsx index 530152118c..cc3ac3b1c9 100644 --- a/idea/frontend/src/features/sails/ui/fields/fields.tsx +++ b/idea/frontend/src/features/sails/ui/fields/fields.tsx @@ -1,4 +1,5 @@ -import { Sails, TypeDef } from 'sails-js'; +import { Sails } from 'sails-js'; +import { ISailsTypeDef } from 'sails-js-types'; import { Fieldset } from '@/shared/ui'; @@ -20,7 +21,7 @@ type Props = { }; function Fields({ sails, args }: Props) { - const getFieldComponent = (def: TypeDef) => { + const getFieldComponent = (def: ISailsTypeDef) => { if (def.isEnum) return EnumField; if (def.isStruct) return StructField; if (def.isOptional) return OptionalField; @@ -34,7 +35,7 @@ function Fields({ sails, args }: Props) { throw new Error('Unknown field type: ' + JSON.stringify(def)); }; - const renderField = (def: TypeDef, label: string = '', name: string = '') => { + const renderField = (def: ISailsTypeDef, label: string = '', name: string = '') => { if (!sails) throw new Error('Sails is not defined'); if (!def) return; // in case of empty enum variant, EnumVariant.def sails-js type is inaccurate at the moment diff --git a/idea/frontend/src/features/sails/ui/fields/fixed-size-array-field.tsx b/idea/frontend/src/features/sails/ui/fields/fixed-size-array-field.tsx index 1d2a749a18..ac72afb7b0 100644 --- a/idea/frontend/src/features/sails/ui/fields/fixed-size-array-field.tsx +++ b/idea/frontend/src/features/sails/ui/fields/fixed-size-array-field.tsx @@ -1,14 +1,14 @@ -import { TypeDef } from 'sails-js'; +import { ISailsTypeDef } from 'sails-js-types'; import { Fieldset } from '@/shared/ui'; import { getLabel, getNestedName } from '../../utils'; type Props = { - def: TypeDef; + def: ISailsTypeDef; name: string; label: string; - renderField: (def: TypeDef, name: string, label: string) => JSX.Element | undefined; + renderField: (def: ISailsTypeDef, name: string, label: string) => JSX.Element | undefined; }; function FixedSizeArrayField({ def, name, label, renderField }: Props) { diff --git a/idea/frontend/src/features/sails/ui/fields/map-field.tsx b/idea/frontend/src/features/sails/ui/fields/map-field.tsx index a8c8f0e1c5..4fd28f7ebb 100644 --- a/idea/frontend/src/features/sails/ui/fields/map-field.tsx +++ b/idea/frontend/src/features/sails/ui/fields/map-field.tsx @@ -1,11 +1,11 @@ -import { TypeDef } from 'sails-js'; +import { ISailsTypeDef } from 'sails-js-types'; import { Textarea } from '@/shared/ui'; import { getLabel } from '../../utils'; type Props = { - def: TypeDef; + def: ISailsTypeDef; name: string; label: string; }; diff --git a/idea/frontend/src/features/sails/ui/fields/optional-field.tsx b/idea/frontend/src/features/sails/ui/fields/optional-field.tsx index 6450d52893..3a275d4c8a 100644 --- a/idea/frontend/src/features/sails/ui/fields/optional-field.tsx +++ b/idea/frontend/src/features/sails/ui/fields/optional-field.tsx @@ -1,6 +1,7 @@ import { Select } from '@gear-js/ui'; import { useState } from 'react'; -import { Sails, TypeDef } from 'sails-js'; +import { Sails } from 'sails-js'; +import { ISailsTypeDef } from 'sails-js-types'; import { Fieldset } from '@/shared/ui'; @@ -9,10 +10,10 @@ import { getDefaultValue, getLabel } from '../../utils'; type Props = { sails: Sails; - def: TypeDef; + def: ISailsTypeDef; name: string; label: string; - renderField: (def: TypeDef, label: string, name: string) => JSX.Element | undefined; + renderField: (def: ISailsTypeDef, label: string, name: string) => JSX.Element | undefined; }; const OPTIONS = [ diff --git a/idea/frontend/src/features/sails/ui/fields/primitive-field.tsx b/idea/frontend/src/features/sails/ui/fields/primitive-field.tsx index 75878e1c6e..d7c93e89f2 100644 --- a/idea/frontend/src/features/sails/ui/fields/primitive-field.tsx +++ b/idea/frontend/src/features/sails/ui/fields/primitive-field.tsx @@ -1,11 +1,11 @@ -import { TypeDef } from 'sails-js'; +import { ISailsTypeDef } from 'sails-js-types'; import { Checkbox, Input } from '@/shared/ui'; import { getLabel } from '../../utils'; type Props = { - def: TypeDef; + def: ISailsTypeDef; name: string; label: string; }; diff --git a/idea/frontend/src/features/sails/ui/fields/result-field.tsx b/idea/frontend/src/features/sails/ui/fields/result-field.tsx index 7e07b3a865..90b1938f91 100644 --- a/idea/frontend/src/features/sails/ui/fields/result-field.tsx +++ b/idea/frontend/src/features/sails/ui/fields/result-field.tsx @@ -1,6 +1,7 @@ import { Select } from '@gear-js/ui'; import { useState } from 'react'; -import { Sails, TypeDef } from 'sails-js'; +import { Sails } from 'sails-js'; +import { ISailsTypeDef } from 'sails-js-types'; import { Fieldset } from '@/shared/ui'; @@ -11,10 +12,10 @@ import { getDefaultValue, getLabel, getNestedName } from '../../utils'; type Props = { sails: Sails; - def: TypeDef; + def: ISailsTypeDef; name: string; label: string; - renderField: (def: TypeDef, label: string, name: string) => JSX.Element | undefined; + renderField: (def: ISailsTypeDef, label: string, name: string) => JSX.Element | undefined; }; const OPTIONS = [ diff --git a/idea/frontend/src/features/sails/ui/fields/struct-field.tsx b/idea/frontend/src/features/sails/ui/fields/struct-field.tsx index 1635576e15..ec89755546 100644 --- a/idea/frontend/src/features/sails/ui/fields/struct-field.tsx +++ b/idea/frontend/src/features/sails/ui/fields/struct-field.tsx @@ -1,14 +1,14 @@ -import { TypeDef } from 'sails-js'; +import { ISailsTypeDef } from 'sails-js-types'; import { Fieldset } from '@/shared/ui'; import { getLabel, getNestedName } from '../../utils'; type Props = { - def: TypeDef; + def: ISailsTypeDef; name: string; label: string; - renderField: (def: TypeDef, label: string, name: string) => JSX.Element | undefined; + renderField: (def: ISailsTypeDef, label: string, name: string) => JSX.Element | undefined; }; function StructField({ def, name, label, renderField }: Props) { diff --git a/idea/frontend/src/features/sails/ui/fields/user-defined-field.tsx b/idea/frontend/src/features/sails/ui/fields/user-defined-field.tsx index 26cb773ba1..9b0dcae686 100644 --- a/idea/frontend/src/features/sails/ui/fields/user-defined-field.tsx +++ b/idea/frontend/src/features/sails/ui/fields/user-defined-field.tsx @@ -1,15 +1,16 @@ -import { Sails, TypeDef } from 'sails-js'; +import { Sails } from 'sails-js'; +import { ISailsTypeDef } from 'sails-js-types'; import { Fieldset } from '@/shared/ui'; import { getLabel } from '../../utils'; type Props = { - def: TypeDef; + def: ISailsTypeDef; sails: Sails; name: string; label: string; - renderField: (def: TypeDef, label: string, name: string) => JSX.Element | undefined; + renderField: (def: ISailsTypeDef, label: string, name: string) => JSX.Element | undefined; }; function UserDefinedField({ def, sails, name, label, renderField }: Props) { diff --git a/idea/frontend/src/features/sails/ui/fields/vec-field.tsx b/idea/frontend/src/features/sails/ui/fields/vec-field.tsx index fe4fe669ff..daf263d308 100644 --- a/idea/frontend/src/features/sails/ui/fields/vec-field.tsx +++ b/idea/frontend/src/features/sails/ui/fields/vec-field.tsx @@ -1,11 +1,11 @@ -import { TypeDef } from 'sails-js'; +import { ISailsTypeDef } from 'sails-js-types'; import { Textarea } from '@/shared/ui'; import { getLabel } from '../../utils'; type Props = { - def: TypeDef; + def: ISailsTypeDef; name: string; label: string; }; diff --git a/idea/frontend/src/features/sails/utils/field.ts b/idea/frontend/src/features/sails/utils/field.ts index 4ffc59c942..2d87e8c928 100644 --- a/idea/frontend/src/features/sails/utils/field.ts +++ b/idea/frontend/src/features/sails/utils/field.ts @@ -1,8 +1,8 @@ -import { TypeDef } from 'sails-js'; +import { ISailsTypeDef } from 'sails-js-types'; import { getType } from './type'; -const getLabel = (name: string, def: TypeDef) => { +const getLabel = (name: string, def: ISailsTypeDef) => { const type = getType(def); return name ? `${name} (${type})` : type; diff --git a/idea/frontend/src/features/sails/utils/payload/get-default-payload-value.ts b/idea/frontend/src/features/sails/utils/payload/get-default-payload-value.ts index 70c0e5ab9f..a4b97b4027 100644 --- a/idea/frontend/src/features/sails/utils/payload/get-default-payload-value.ts +++ b/idea/frontend/src/features/sails/utils/payload/get-default-payload-value.ts @@ -1,15 +1,15 @@ +import { Sails } from 'sails-js'; import { - EnumDef, - FixedSizeArrayDef, - MapDef, - PrimitiveDef, - ResultDef, - Sails, - StructDef, - TypeDef, - UserDefinedDef, - VecDef, -} from 'sails-js'; + ISailsEnumDef, + ISailsFixedSizeArrayDef, + ISailsMapDef, + ISailsPrimitiveDef, + ISailsResultDef, + ISailsStructDef, + ISailsTypeDef, + ISailsUserDefinedDef, + ISailsVecDef, +} from 'sails-js-types'; import { getPreformattedText } from '@/shared/helpers'; @@ -17,15 +17,16 @@ import { RESULT } from '../../consts'; import { PayloadValue, ISailsFuncArg } from '../../types'; const getDefaultValue = (sails: Sails) => { - const getPrimitiveValue = (def: PrimitiveDef) => (def.isBool ? false : ''); - const getResultValue = ({ [RESULT.OK]: { def } }: ResultDef) => ({ [RESULT.OK]: getValue(def) }); - const getVecValue = ({ def }: VecDef) => getPreformattedText([getValue(def)]); - const getFixedSizeArrayValue = ({ len, def }: FixedSizeArrayDef) => new Array(len).fill(getValue(def)); - const getMapValue = ({ key, value }: MapDef) => getPreformattedText([[getValue(key.def), getValue(value.def)]]); - const getUserDefinedValue = ({ name }: UserDefinedDef) => getValue(sails.getTypeDef(name)); - const getEnumValue = ({ variants: [{ def, name }] }: EnumDef) => ({ [name]: def ? getValue(def) : null }); - - const getStructValue = ({ isTuple, fields }: StructDef) => { + const getPrimitiveValue = (def: ISailsPrimitiveDef) => (def.isBool ? false : ''); + const getResultValue = ({ [RESULT.OK]: { def } }: ISailsResultDef) => ({ [RESULT.OK]: getValue(def) }); + const getVecValue = ({ def }: ISailsVecDef) => getPreformattedText([getValue(def)]); + const getFixedSizeArrayValue = ({ len, def }: ISailsFixedSizeArrayDef) => + new Array(len).fill(getValue(def)); + const getMapValue = ({ key, value }: ISailsMapDef) => getPreformattedText([[getValue(key.def), getValue(value.def)]]); + const getUserDefinedValue = ({ name }: ISailsUserDefinedDef) => getValue(sails.getTypeDef(name)); + const getEnumValue = ({ variants: [{ def, name }] }: ISailsEnumDef) => ({ [name]: def ? getValue(def) : null }); + + const getStructValue = ({ isTuple, fields }: ISailsStructDef) => { if (isTuple) return fields.map(({ def }) => getValue(def)); const result = fields.map(({ name, def }, index) => [name || index, getValue(def)] as const); @@ -33,7 +34,7 @@ const getDefaultValue = (sails: Sails) => { return Object.fromEntries(result); }; - const getValue = (def: TypeDef): PayloadValue => { + const getValue = (def: ISailsTypeDef): PayloadValue => { if (def.isPrimitive) return getPrimitiveValue(def.asPrimitive); if (def.isOptional) return null; if (def.isResult) return getResultValue(def.asResult); diff --git a/idea/frontend/src/features/sails/utils/payload/get-payload-schema.ts b/idea/frontend/src/features/sails/utils/payload/get-payload-schema.ts index 207aa89dac..72fa6d05b4 100644 --- a/idea/frontend/src/features/sails/utils/payload/get-payload-schema.ts +++ b/idea/frontend/src/features/sails/utils/payload/get-payload-schema.ts @@ -1,6 +1,7 @@ import { HexString } from '@gear-js/api'; import { AnyJson } from '@polkadot/types/types'; -import { Sails, TypeDef } from 'sails-js'; +import { Sails } from 'sails-js'; +import { ISailsTypeDef } from 'sails-js-types'; import { z } from 'zod'; import { RESULT } from '../../consts'; @@ -22,7 +23,7 @@ const asTuple = (schema: T[]) => z.tuple(schema as [T, . const isUnion = (arr: T[]): arr is [T, T, ...T[]] => arr.length >= 2; const getPayloadSchema = (sails: Sails, args: ISailsFuncArg[], encode: (..._args: unknown[]) => HexString) => { - const getSchema = (def: TypeDef): z.ZodType => { + const getSchema = (def: ISailsTypeDef): z.ZodType => { if (def.isPrimitive) return def.asPrimitive.isBool ? z.boolean() : z.string().trim(); if (def.isOptional) return z.union([z.null(), getSchema(def.asOptional.def)]); diff --git a/idea/frontend/src/features/sails/utils/type.ts b/idea/frontend/src/features/sails/utils/type.ts index 167d79ec98..64c93a5ca2 100644 --- a/idea/frontend/src/features/sails/utils/type.ts +++ b/idea/frontend/src/features/sails/utils/type.ts @@ -1,6 +1,6 @@ -import { PrimitiveDef, TypeDef } from 'sails-js'; +import { ISailsPrimitiveDef, ISailsTypeDef } from 'sails-js-types'; -const getPrimitiveType = (def: PrimitiveDef) => { +const getPrimitiveType = (def: ISailsPrimitiveDef) => { if (def.isNull) return 'Null'; if (def.isBool) return 'Bool'; if (def.isChar) return 'Char'; @@ -31,7 +31,7 @@ const getPrimitiveType = (def: PrimitiveDef) => { throw new Error('Unknown primitive type'); }; -const getType = (def: TypeDef): string => { +const getType = (def: ISailsTypeDef): string => { if (def.isPrimitive) return getPrimitiveType(def.asPrimitive); if (def.isOptional) return `Option<${getType(def.asOptional.def)}>`; if (def.isResult) return `Result<${getType(def.asResult.ok.def)}, ${getType(def.asResult.err.def)}>`; diff --git a/utils/gear-hooks/package.json b/utils/gear-hooks/package.json index fcb4ee84a8..0d7287010a 100644 --- a/utils/gear-hooks/package.json +++ b/utils/gear-hooks/package.json @@ -1,6 +1,6 @@ { "name": "@gear-js/react-hooks", - "version": "0.13.0", + "version": "0.13.1", "description": "React hooks used across Gear applications", "author": "Gear Technologies", "license": "GPL-3.0", @@ -21,29 +21,30 @@ "prepare": "yarn build" }, "peerDependencies": { - "@gear-js/api": "0.38.1", - "@polkadot/api": "11.0.2", - "@tanstack/react-query": "^5.29.0", + "@gear-js/api": "0.38.2", + "@polkadot/api": "12.0.1", + "@tanstack/react-query": "^5.56.2", "react": "^18.2.0", "react-dom": "^18.2.0", - "sails-js": "0.1.8" + "sails-js": "0.2.0" }, "dependencies": { - "@polkadot/api-derive": "11.0.2", + "@polkadot/api-derive": "12.0.1", "@polkadot/extension-inject": "0.51.1", "@polkadot/util": "12.6.2", "@substrate/connect": "0.8.10", "bignumber.js": "9.1.2", "nanoid": "5.0.1", - "react-transition-group": "4.4.5" + "react-transition-group": "4.4.5", + "sails-js-parser": "0.0.1" }, "devDependencies": { - "@gear-js/api": "0.38.1", - "@polkadot/api": "11.0.2", - "@polkadot/types": "11.0.2", + "@gear-js/api": "0.38.2", + "@polkadot/api": "12.0.1", + "@polkadot/types": "12.0.1", "@rollup/plugin-commonjs": "25.0.5", "@rollup/plugin-node-resolve": "15.2.3", - "@tanstack/react-query": "5.29.0", + "@tanstack/react-query": "5.56.2", "@types/react": "18.3.3", "@types/react-dom": "18.3.0", "@types/react-transition-group": "4.4.7", @@ -53,7 +54,7 @@ "rollup-plugin-peer-deps-external": "2.2.4", "rollup-plugin-terser": "7.0.2", "rollup-plugin-typescript2": "0.36.0", - "sails-js": "0.1.8", + "sails-js": "0.2.0", "typescript": "5.5.4" }, "main": "dist/cjs/index.js", diff --git a/utils/gear-hooks/src/hooks/sails/use-sails.ts b/utils/gear-hooks/src/hooks/sails/use-sails.ts index d285d25165..5d031cd918 100644 --- a/utils/gear-hooks/src/hooks/sails/use-sails.ts +++ b/utils/gear-hooks/src/hooks/sails/use-sails.ts @@ -1,6 +1,7 @@ import { HexString } from '@gear-js/api'; import { useQuery } from '@tanstack/react-query'; import { Sails } from 'sails-js'; +import { SailsIdlParser } from 'sails-js-parser'; import { useApi } from 'context'; @@ -20,7 +21,8 @@ function useSails({ programId, idl }: UseSailsParameters = DEFAULT_PARAMETERS) { const getSails = async () => { if (!isApiReady) throw new Error('API is not initialized'); - const sails = await Sails.new(); + const parser = await SailsIdlParser.new(); + const sails = new Sails(parser); sails.setApi(api); if (programId) sails.setProgramId(programId); diff --git a/yarn.lock b/yarn.lock index e596c5315f..1f76606d08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2473,6 +2473,17 @@ __metadata: languageName: node linkType: hard +"@gear-js/api@npm:0.38.2": + version: 0.38.2 + resolution: "@gear-js/api@npm:0.38.2" + peerDependencies: + "@polkadot/api": 12.0.1 + "@polkadot/wasm-crypto": 7.3.2 + rxjs: 7.8.1 + checksum: 79e8d84c2dc1ae08516b4a7d0fc27970aa50a9998b9a79f9f11dff51ebdb24837cf1ca23a685aa0cba84a9dec051713817178e92b26ce93f7f5708241a0f99a2 + languageName: node + linkType: hard + "@gear-js/common@workspace:^, @gear-js/common@workspace:idea/common": version: 0.0.0-use.local resolution: "@gear-js/common@workspace:idea/common" @@ -2524,17 +2535,17 @@ __metadata: version: 0.0.0-use.local resolution: "@gear-js/frontend@workspace:idea/frontend" dependencies: - "@gear-js/api": 0.38.1 + "@gear-js/api": 0.38.2 "@gear-js/react-hooks": "workspace:^" "@gear-js/ui": "workspace:^" "@hcaptcha/react-hcaptcha": 1.8.1 "@hookform/resolvers": 3.3.2 - "@polkadot/api": 11.0.2 + "@polkadot/api": 12.0.1 "@polkadot/react-identicon": 3.6.3 - "@polkadot/types": 11.0.2 + "@polkadot/types": 12.0.1 "@polkadot/util": 12.6.2 "@react-aria/utils": 3.21.0 - "@tanstack/react-query": 5.29.0 + "@tanstack/react-query": 5.56.2 "@types/lodash.isequal": 4.5.6 "@types/lodash.isplainobject": 4.0.7 "@types/lodash.isstring": 4.0.7 @@ -2571,7 +2582,9 @@ __metadata: react-number-format: 5.3.1 react-router-dom: 6.16.0 react-transition-group: 4.4.5 - sails-js: 0.1.8 + sails-js: 0.2.0 + sails-js-parser: ^0.0.1 + sails-js-types: ^0.0.1 sass: 1.69.1 simplebar-react: 3.2.4 typescript: 5.5.3 @@ -2653,16 +2666,16 @@ __metadata: version: 0.0.0-use.local resolution: "@gear-js/react-hooks@workspace:utils/gear-hooks" dependencies: - "@gear-js/api": 0.38.1 - "@polkadot/api": 11.0.2 - "@polkadot/api-derive": 11.0.2 + "@gear-js/api": 0.38.2 + "@polkadot/api": 12.0.1 + "@polkadot/api-derive": 12.0.1 "@polkadot/extension-inject": 0.51.1 - "@polkadot/types": 11.0.2 + "@polkadot/types": 12.0.1 "@polkadot/util": 12.6.2 "@rollup/plugin-commonjs": 25.0.5 "@rollup/plugin-node-resolve": 15.2.3 "@substrate/connect": 0.8.10 - "@tanstack/react-query": 5.29.0 + "@tanstack/react-query": 5.56.2 "@types/react": 18.3.3 "@types/react-dom": 18.3.0 "@types/react-transition-group": 4.4.7 @@ -2675,15 +2688,16 @@ __metadata: rollup-plugin-peer-deps-external: 2.2.4 rollup-plugin-terser: 7.0.2 rollup-plugin-typescript2: 0.36.0 - sails-js: 0.1.8 + sails-js: 0.2.0 + sails-js-parser: 0.0.1 typescript: 5.5.4 peerDependencies: - "@gear-js/api": 0.38.1 - "@polkadot/api": 11.0.2 - "@tanstack/react-query": ^5.29.0 + "@gear-js/api": 0.38.2 + "@polkadot/api": 12.0.1 + "@tanstack/react-query": ^5.56.2 react: ^18.2.0 react-dom: ^18.2.0 - sails-js: 0.1.8 + sails-js: 0.2.0 languageName: unknown linkType: soft @@ -3572,6 +3586,21 @@ __metadata: languageName: node linkType: hard +"@polkadot/api-augment@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/api-augment@npm:12.0.1" + dependencies: + "@polkadot/api-base": 12.0.1 + "@polkadot/rpc-augment": 12.0.1 + "@polkadot/types": 12.0.1 + "@polkadot/types-augment": 12.0.1 + "@polkadot/types-codec": 12.0.1 + "@polkadot/util": ^12.6.2 + tslib: ^2.6.2 + checksum: 392e3582cf6732b3da7888120622b8c20c3f59ac9114ccc5f0b194fe00558c52f9bfd8f7dd044591e4fae59edd81921cd4e10232bd4ed072ab8cd7183437056c + languageName: node + linkType: hard + "@polkadot/api-augment@npm:12.3.1": version: 12.3.1 resolution: "@polkadot/api-augment@npm:12.3.1" @@ -3600,6 +3629,19 @@ __metadata: languageName: node linkType: hard +"@polkadot/api-base@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/api-base@npm:12.0.1" + dependencies: + "@polkadot/rpc-core": 12.0.1 + "@polkadot/types": 12.0.1 + "@polkadot/util": ^12.6.2 + rxjs: ^7.8.1 + tslib: ^2.6.2 + checksum: ef8f1b9d7afe1b667b132b1bf993d6fe8214ac589a24559cd241b0ed98c8aceaa89d713fbad83af2b6fbf4c7c8202d205e30dc65729ef3b763cf6947f6d240f0 + languageName: node + linkType: hard + "@polkadot/api-base@npm:12.3.1": version: 12.3.1 resolution: "@polkadot/api-base@npm:12.3.1" @@ -3631,6 +3673,24 @@ __metadata: languageName: node linkType: hard +"@polkadot/api-derive@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/api-derive@npm:12.0.1" + dependencies: + "@polkadot/api": 12.0.1 + "@polkadot/api-augment": 12.0.1 + "@polkadot/api-base": 12.0.1 + "@polkadot/rpc-core": 12.0.1 + "@polkadot/types": 12.0.1 + "@polkadot/types-codec": 12.0.1 + "@polkadot/util": ^12.6.2 + "@polkadot/util-crypto": ^12.6.2 + rxjs: ^7.8.1 + tslib: ^2.6.2 + checksum: 9d83e006130612ea3669dac122541428d2b7d43a1ba9c24d1729a02078f23793fdc278c5ab9822571624c16b6abe348989e4719f4fdfbb7168b3f42f6a0c2d86 + languageName: node + linkType: hard + "@polkadot/api-derive@npm:12.3.1": version: 12.3.1 resolution: "@polkadot/api-derive@npm:12.3.1" @@ -3674,6 +3734,31 @@ __metadata: languageName: node linkType: hard +"@polkadot/api@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/api@npm:12.0.1" + dependencies: + "@polkadot/api-augment": 12.0.1 + "@polkadot/api-base": 12.0.1 + "@polkadot/api-derive": 12.0.1 + "@polkadot/keyring": ^12.6.2 + "@polkadot/rpc-augment": 12.0.1 + "@polkadot/rpc-core": 12.0.1 + "@polkadot/rpc-provider": 12.0.1 + "@polkadot/types": 12.0.1 + "@polkadot/types-augment": 12.0.1 + "@polkadot/types-codec": 12.0.1 + "@polkadot/types-create": 12.0.1 + "@polkadot/types-known": 12.0.1 + "@polkadot/util": ^12.6.2 + "@polkadot/util-crypto": ^12.6.2 + eventemitter3: ^5.0.1 + rxjs: ^7.8.1 + tslib: ^2.6.2 + checksum: 0e8efece8adc3adf49978884b1046b4659f803d88aa5217bc89371c35145cb181b75337ac182ff1ef5149a67f0d73b422923c1cdddc40d0b292b77b099142767 + languageName: node + linkType: hard + "@polkadot/api@npm:12.3.1, @polkadot/api@npm:^12.3.1": version: 12.3.1 resolution: "@polkadot/api@npm:12.3.1" @@ -3805,6 +3890,19 @@ __metadata: languageName: node linkType: hard +"@polkadot/rpc-augment@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/rpc-augment@npm:12.0.1" + dependencies: + "@polkadot/rpc-core": 12.0.1 + "@polkadot/types": 12.0.1 + "@polkadot/types-codec": 12.0.1 + "@polkadot/util": ^12.6.2 + tslib: ^2.6.2 + checksum: 44473672c3eebfa5fe0d55bb0fd816cfc4575804860d6f0fe3f1e802bc91d7bf11bc5d3eeec878025ed8bbf89c9e08c3016da8bef7323c49a358ce26dcd71207 + languageName: node + linkType: hard + "@polkadot/rpc-augment@npm:12.3.1": version: 12.3.1 resolution: "@polkadot/rpc-augment@npm:12.3.1" @@ -3832,6 +3930,20 @@ __metadata: languageName: node linkType: hard +"@polkadot/rpc-core@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/rpc-core@npm:12.0.1" + dependencies: + "@polkadot/rpc-augment": 12.0.1 + "@polkadot/rpc-provider": 12.0.1 + "@polkadot/types": 12.0.1 + "@polkadot/util": ^12.6.2 + rxjs: ^7.8.1 + tslib: ^2.6.2 + checksum: 78cdd9348a791673f3de43ebd92056d54d61259e51e6ea8cb221179dfa85e153e4e9624e77bf9e0ab696b79c2abfbf2c75125728c0475bc8ca32dadf2832f3b6 + languageName: node + linkType: hard + "@polkadot/rpc-core@npm:12.3.1": version: 12.3.1 resolution: "@polkadot/rpc-core@npm:12.3.1" @@ -3870,6 +3982,30 @@ __metadata: languageName: node linkType: hard +"@polkadot/rpc-provider@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/rpc-provider@npm:12.0.1" + dependencies: + "@polkadot/keyring": ^12.6.2 + "@polkadot/types": 12.0.1 + "@polkadot/types-support": 12.0.1 + "@polkadot/util": ^12.6.2 + "@polkadot/util-crypto": ^12.6.2 + "@polkadot/x-fetch": ^12.6.2 + "@polkadot/x-global": ^12.6.2 + "@polkadot/x-ws": ^12.6.2 + "@substrate/connect": 0.8.10 + eventemitter3: ^5.0.1 + mock-socket: ^9.3.1 + nock: ^13.5.0 + tslib: ^2.6.2 + dependenciesMeta: + "@substrate/connect": + optional: true + checksum: ad06bd63e631da155c0e7452b565e49620c2a10d8c7517c3977b3bab73476c0b5a7af64553f89a0b6af14a66ee6f18fb0de1fcbe0218f85e3262de8335c481de + languageName: node + linkType: hard + "@polkadot/rpc-provider@npm:12.3.1, @polkadot/rpc-provider@npm:^12.3.1": version: 12.3.1 resolution: "@polkadot/rpc-provider@npm:12.3.1" @@ -3906,6 +4042,18 @@ __metadata: languageName: node linkType: hard +"@polkadot/types-augment@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/types-augment@npm:12.0.1" + dependencies: + "@polkadot/types": 12.0.1 + "@polkadot/types-codec": 12.0.1 + "@polkadot/util": ^12.6.2 + tslib: ^2.6.2 + checksum: 69068c6768602448e88e7fdb894cf36e6a418e75f5da3cff8fe268c8732756e0f3475387e872002ee42d0b3f19250e4077d1d783088e8ab3e7926abe578ba355 + languageName: node + linkType: hard + "@polkadot/types-augment@npm:12.3.1": version: 12.3.1 resolution: "@polkadot/types-augment@npm:12.3.1" @@ -3929,6 +4077,17 @@ __metadata: languageName: node linkType: hard +"@polkadot/types-codec@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/types-codec@npm:12.0.1" + dependencies: + "@polkadot/util": ^12.6.2 + "@polkadot/x-bigint": ^12.6.2 + tslib: ^2.6.2 + checksum: c8ce91e741d86b3c85bca9eda80215532531cab8b4fae7053c9c159d22b147205e97ae23dc04fc539905cf81ef37962edc48a34667c0ae072bb27112f0431a10 + languageName: node + linkType: hard + "@polkadot/types-codec@npm:12.3.1": version: 12.3.1 resolution: "@polkadot/types-codec@npm:12.3.1" @@ -3951,6 +4110,17 @@ __metadata: languageName: node linkType: hard +"@polkadot/types-create@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/types-create@npm:12.0.1" + dependencies: + "@polkadot/types-codec": 12.0.1 + "@polkadot/util": ^12.6.2 + tslib: ^2.6.2 + checksum: 4f89a171f53c5a032974c574a35212b9073585a58a7b09c5d01572ebe1263c3f139210dba71add90eaa53c875ec7e48f1a3c8d67b37e418793f9ce8e3171ee01 + languageName: node + linkType: hard + "@polkadot/types-create@npm:12.3.1": version: 12.3.1 resolution: "@polkadot/types-create@npm:12.3.1" @@ -3976,6 +4146,20 @@ __metadata: languageName: node linkType: hard +"@polkadot/types-known@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/types-known@npm:12.0.1" + dependencies: + "@polkadot/networks": ^12.6.2 + "@polkadot/types": 12.0.1 + "@polkadot/types-codec": 12.0.1 + "@polkadot/types-create": 12.0.1 + "@polkadot/util": ^12.6.2 + tslib: ^2.6.2 + checksum: e39a66bb231f4f8ae198290ed5e1333bc054d71248177046351f091e49b9f4a2484ef0337161449d1ad0cdf00bc88d5804a31181a78f08e20b078e5bb509a36c + languageName: node + linkType: hard + "@polkadot/types-known@npm:12.3.1": version: 12.3.1 resolution: "@polkadot/types-known@npm:12.3.1" @@ -4000,6 +4184,16 @@ __metadata: languageName: node linkType: hard +"@polkadot/types-support@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/types-support@npm:12.0.1" + dependencies: + "@polkadot/util": ^12.6.2 + tslib: ^2.6.2 + checksum: 3f01a225a342ff49bb75d6fed819bf96fefeb45057a9f1b2dade76786b04d850a92f2d7b236c54c8f9e9370db587cc250a2712a37c8935d4c079336967327307 + languageName: node + linkType: hard + "@polkadot/types-support@npm:12.3.1": version: 12.3.1 resolution: "@polkadot/types-support@npm:12.3.1" @@ -4026,6 +4220,22 @@ __metadata: languageName: node linkType: hard +"@polkadot/types@npm:12.0.1": + version: 12.0.1 + resolution: "@polkadot/types@npm:12.0.1" + dependencies: + "@polkadot/keyring": ^12.6.2 + "@polkadot/types-augment": 12.0.1 + "@polkadot/types-codec": 12.0.1 + "@polkadot/types-create": 12.0.1 + "@polkadot/util": ^12.6.2 + "@polkadot/util-crypto": ^12.6.2 + rxjs: ^7.8.1 + tslib: ^2.6.2 + checksum: 37846996daa37d332f36098704259bbebfbbe597bb10731a4e7532e04c0792773b87512494119e54fe9d6a9854e7d348316d13fdfb908435c7ffba33e86f6513 + languageName: node + linkType: hard + "@polkadot/types@npm:12.3.1, @polkadot/types@npm:^12.3.1": version: 12.3.1 resolution: "@polkadot/types@npm:12.3.1" @@ -5928,21 +6138,21 @@ __metadata: languageName: node linkType: hard -"@tanstack/query-core@npm:5.29.0": - version: 5.29.0 - resolution: "@tanstack/query-core@npm:5.29.0" - checksum: 79d1033411842f289489afb721add7593cd0181411aab72c39a70615e437c577d53c290d0afa699fe9c6637597051195e03a7ef0eebaf03a9a83c943a46782d9 +"@tanstack/query-core@npm:5.56.2": + version: 5.56.2 + resolution: "@tanstack/query-core@npm:5.56.2" + checksum: e78430464de89fd2543155449391415983c7cdcd1ff2bb86da019414204b6800e2405e341db88000b36a101d3619ee7e94e90da1fa5497b2e021c5765924a64c languageName: node linkType: hard -"@tanstack/react-query@npm:5.29.0": - version: 5.29.0 - resolution: "@tanstack/react-query@npm:5.29.0" +"@tanstack/react-query@npm:5.56.2": + version: 5.56.2 + resolution: "@tanstack/react-query@npm:5.56.2" dependencies: - "@tanstack/query-core": 5.29.0 + "@tanstack/query-core": 5.56.2 peerDependencies: - react: ^18.0.0 - checksum: fa950a72d4e30ff472a6ec43c4aa49b20ff3f1ce2200f6ecc7e7a3aa50748975271045e7d6c1ea01abeead8f5fa79c1b9d9539d197a6ed66175686830b003937 + react: ^18 || ^19 + checksum: 7819a3a316c95df41844bd6e3435511594c3762320c21ee1ef2205ede18a87faae4556ff84d52b36ba17c99540b9554e72a5acf0c225481bdaf107ea79ace815 languageName: node linkType: hard @@ -17200,18 +17410,35 @@ __metadata: languageName: node linkType: hard -"sails-js@npm:0.1.8": - version: 0.1.8 - resolution: "sails-js@npm:0.1.8" - dependencies: - commander: 12.1.0 +"sails-js-parser@npm:0.0.1, sails-js-parser@npm:^0.0.1": + version: 0.0.1 + resolution: "sails-js-parser@npm:0.0.1" peerDependencies: - "@gear-js/api": ^0.38.1 - "@polkadot/api": ^11.0.1 - "@polkadot/types": ^11.0.1 + sails-js-types: 0.0.1 + checksum: b6ce5b187833e98620fa63c3ecf10e53dfb1605e7b2bc6d9f9e306ea26fa22f78928e8748d15300b85d6bb3af5e46f43b37b248b34212e7f6b0f9bd49f656999 + languageName: node + linkType: hard + +"sails-js-types@npm:^0.0.1": + version: 0.0.1 + resolution: "sails-js-types@npm:0.0.1" + checksum: d1218d9c8ab5cb25df641528db71c8e7eb90f2995d3c8df0c81aa9e2bcf9c31d487d1329f1bc8bed631bfd14aae15bd766e35bead3461a6f9cc7bad5c74322e5 + languageName: node + linkType: hard + +"sails-js@npm:0.2.0": + version: 0.2.0 + resolution: "sails-js@npm:0.2.0" + peerDependencies: + "@gear-js/api": 0.38.2 + "@polkadot/api": 12.0.1 + "@polkadot/types": 12.0.1 + sails-js-parser: 0.0.1 + sails-js-types: 0.0.1 + sails-js-util: 0.0.1 bin: - sails-js: app.js - checksum: d3fce31881a6cafb2b65cffc79deaa371475e1207761f64f7fcdfb76d85d1bd748df075d80ec8deb6447d28b8177a1625bf33e7f5ee52202c19a41e1e993fe5a + sails-js: ./lib/app.js + checksum: 5df373739ce97da34ab30bfcb4b70c23cf642d181d9b1d0ab54c98dedebdaeed95b06598d683927c9ced57cba6d07c1a199692bd9c9d605a93731a2f249d973a languageName: node linkType: hard