open-index/open-npm huggingface dataset:
npm package: @prosopo/typechain-compiler
Description: Util to test and compile your rust project
Author: Prosopo
Latest version: 1.1.15

# Typechain-Compiler

---

Utility package for compiling smart contracts, and generating TypeScript definitions & runtime code for them.

## Usage

In your project install this package:

```bash
npm i -D @prosopo/typechain-compiler
```

Now you can use it to compile smart contracts, and generate TS definitions & runtime code for them. To use typechain-compiler you need to create a config file, and pass it to the compiler.

### Config file

We need to create a config file, that will contain all the information about the project, and the contracts that we want to compile.
Config file should be in `.json` format, and should contain the following fields:

```typescript
export interface Config {
	projectFiles: string[];
	skipLinting : boolean;
	artifactsPath : string;
	typechainGeneratedPath : string;
	isWorkspace ?: boolean;
	workspacePath ?: string;
}
```

Also you can override the config value via CLI arguments.

### Compiler

To compile your project, and generate TS definitions & runtime code for it, run the following command:

```bash
npx @prosopo/typechain-compiler --config path/to/config.json
```

Also you can provide additional arguments to the compiler:

```bash
Options:
      --version            Show version number                         [boolean]
  -c, --config             Config file path
                                  [string] [required] [default: "./config.json"]
  -r, --release            Compile with release
                                           [boolean] [required] [default: false]
      --noCompile, --nc    Compile         [boolean] [required] [default: false]
      --noTypechain, --nt  Compile typechain code
                                           [boolean] [required] [default: false]
  -h, --help               Show help                                   [boolean]
```
npm package: @prosopo/typechain-polkadot-parser
Description: Parser that can generate typescript definitions from ABI of the contract
Author: Prosopo
Latest version: 1.1.15

# Typechain-polkadot-parser

---

Utility package for parsing ABIs of Polkadot smart contracts.

## Types

---

- `class TypeParser` - Parser for ABIs of Polkadot smart contracts. It contains only one public method `getType` that takes type id as a parameter and returns a `TypeInfo` object. Also it has public field `tsTypes` that contains a map of all parsed types.

- `class TypeInfo` - Contains information about a type.
``` typescript
	id: number; // - type id
	tsArgType: string; // - TypeScript type for function arguments
	tsReturnType: string; // - TypeScript type for function return value
	tsArgTypePrefixed: string; // - TypeScript type for function arguments with prefix (for imports)
	tsReturnTypePrefixed: string; // - TypeScript type for function return value with prefix (for imports)
	typeDescription: TypeTS; // - type description in TypeScript
	// For enums and composites
	bodyArgType ?: string; // - TypeScript type for function arguments
	bodyReturnType ?: string; // - TypeScript type for function return value
```