Skip to content
Snippets Groups Projects
Commit cf9cc94c authored by Éloïs's avatar Éloïs
Browse files

chore(types): manual files

parent 214cc867
No related branches found
No related tags found
No related merge requests found
# lc-core types
This npm package contains lc-core types generated with: https://polkadot.js.org/docs/api/examples/promise/typegen/
## Update types
1. Update manually file `src/interfaces/runtime/definitions.ts`
2. yarn
3. yarn build
4. yarn lint
5. fix eventually errors
This diff is collapsed.
{
"name": "lc-core-types",
"version": "0.0.1",
"description": "using @polkadot/typegen to generate lc-core type definitions",
"main": "index.js",
"repository": "https://git.duniter.org/nodes/rust/lc-core-substrate/types-bundle",
"author": "elois <c@elo.tf>",
"license": "AGPL-3.0",
"scripts": {
"build": "yarn generate:defs && yarn generate:meta",
"generate:defs": "ts-node --skip-project node_modules/.bin/polkadot-types-from-defs --package lc-core-types/interfaces --input ./src/interfaces",
"generate:meta": "ts-node --skip-project node_modules/.bin/polkadot-types-from-chain --package lc-core-types/interfaces --endpoint ./lc-core.json --output ./src/interfaces --strict",
"lint": "tsc --noEmit --pretty"
},
"dependencies": {
"@polkadot/api": "^5.1.1"
},
"devDependencies": {
"@polkadot/typegen": "^5.1.1",
"ts-node": "^8.6.2",
"typescript": "^3.8.2"
}
}
\ No newline at end of file
/* eslint-disable @typescript-eslint/camelcase */
export { default as runtime } from './runtime/definitions';
/* eslint-disable @typescript-eslint/camelcase */
export default {
types: {
Balance: "u64",
CertValue: {
chainable_on: "BlockNumber",
removable_on: "BlockNumber"
},
IdtyCertMeta: {
issued_count: "u8",
next_issuable_on: "BlockNumber",
received_count: "u32"
},
IdtyData: {
can_create_on: "BlockNumber"
},
IdtyDid: {
hash: "[u8; 32]",
planet: "Planet",
latitude: "u32",
longitude: "u32"
},
IdtyIndex: "u64",
IdtyRight: {
_enum: [
"CreateIdty",
"LightCert",
"StrongCert",
"Ud"
]
},
IdtyStatus: {
_enum: [
"Created",
"ConfirmedByOwner",
"Validated"
]
},
IdtyValue: {
did: "IdtyDid",
expire_on: "BlockNumber",
owner_key: "AccountId",
removable_on: "BlockNumber",
renewable_on: "BlockNumber",
rights: "Vec<(T::IdtyRight, Option<T::AccountId>)>",
status: "IdtyStatus",
data: "IdtyData"
},
Planet: {
_enum: [
"Earth"
]
}
}
};
\ No newline at end of file
{
"compilerOptions": {
// this is specific with augmented overrides
"paths": {
// this is the package name we use (in the interface imports, --package for generators)
"sample-polkadotjs-typegen/*": ["src/*"],
// here we replace the @polkadot/api augmentation with our own, generated from chain
"@polkadot/api/augment": ["src/interfaces/augment-api.ts"],
// replace the augmented types with our own, as generated from definitions
"@polkadot/types/augment": ["src/interfaces/augment-types.ts"]
},
// some other options, whatever you want for your environment
"target": "esnext",
"module": "esnext",
"jsx": "preserve",
"declaration": true,
"strict": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"baseUrl": ".",
"skipLibCheck": true,
"typeRoots": [
"./node_modules/@types"
]
},
"exclude": [
"build/**/*",
"node_modules"
]
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment