# @zondax/fvm-as-bindgen

> [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![GithubActions](https://github.com/Zondax/fvm-as-bindgen/actions/workflows/main.yaml/badge.svg)](https://github.com/Zondax/fvm-as-bindgen/blob/master/.g

Latest version **1.1.0** (published 2022-10-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @zondax/fvm-as-bindgen
pnpm add @zondax/fvm-as-bindgen
yarn add @zondax/fvm-as-bindgen
bun add @zondax/fvm-as-bindgen
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2022-10-12 |
| First published | 2022-08-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 61.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Zondax AG |
| Maintainers | ftheirs, carlosala, jleni |

## Links

- npm: https://www.npmjs.com/package/@zondax/fvm-as-bindgen
- npm.io page: https://npm.io/package/@zondax/fvm-as-bindgen

## Dependencies (1)

- [assemblyscript](https://npm.io/package/assemblyscript.md) ^0.20.11

## Recent versions

- 1.1.0 (latest) — 2022-10-12
- 1.0.0 — 2022-08-18

## README

# FVM AssemblyScript Bindgen
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![GithubActions](https://github.com/Zondax/fvm-as-bindgen/actions/workflows/main.yaml/badge.svg)](https://github.com/Zondax/fvm-as-bindgen/blob/master/.github/workflows/main.yaml)


---

![zondax_light](docs/assets/zondax_light.png#gh-light-mode-only)
![zondax_dark](docs/assets/zondax_dark.png#gh-dark-mode-only)

_Please visit our website at [zondax.ch](https://www.zondax.ch)_

---

## Goal 
This projects aims to abstract as much fvm-related logic as it could from used-defined smart contracts in Filecoin network.
Thanks to the ability to provide [custom transformation](https://www.assemblyscript.org/compiler.html#transforms) class to the AS compiler,
code strictly related to FVM can be added before compiling the smart contract code to WASM.

## How to build it
You just need to run these two steps
```
yarn install
yarn build
```

## How to use it
These are a series of decorators you should set on your smart contract in order to tag files, functions and classes
the package will process.

- Use to indicate which class should be used as smart contract state
```
// @ts-ignore
@state
```
- Use to indicate the function that will be executed on smart contract instantiation

```
// @ts-ignore
@constructor
```

- Use to indicate functions that will be exported so that they can be called from the outside world
- They will be set as method to be invoked.
```
// @ts-ignore
@export_method()
```

## Foundational projects
Packages used to build this lib:

- [Near transformation class](https://github.com/near/near-sdk-as/bindgen)

---
_Source: https://npm.io/package/@zondax/fvm-as-bindgen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
