open-index/open-npm huggingface dataset:
npm package: @roamin/sdk-as
Description: [![Test](https://github.com/koinos/koinos-sdk-as/actions/workflows/test.yml/badge.svg)](https://github.com/koinos/koinos-sdk-as/actions/workflows/test.yml)
Author: Koinos Group
Latest version: 1.0.5

[![Test](https://github.com/koinos/koinos-sdk-as/actions/workflows/test.yml/badge.svg)](https://github.com/koinos/koinos-sdk-as/actions/workflows/test.yml)

# koinos-sdk-as
AssemblyScript (AS) Software Development Toolkit (SDK) for the Koinos Blockchain

See documentation: https://koinos.github.io/koinos-sdk-as/

Learn how to create smart contracts by looking at the examples repo: https://github.com/roaminro/koinos-sdk-as-examples

## Requirements:
You need to install NodeJS v16 or higher [download](https://nodejs.org/en/download/)

## Installation

```sh
# with npm
npm install koinos-sdk-as

# with yarn
yarn add koinos-sdk-as
```
## Run unit tests
```sh
# with npm
npm test

# with yarn
yarn test
```

## Build test contract
```sh
# with npm
npm run buildTestContract

# with yarn
yarn run buildTestContract
```

## Upload and trigger the test contract on a local devnet using [Local-Koinos](https://github.com/roaminroe/local-koinos)
```sh
🚫 🔐 > open wallets/bob.wallet bob
Opened wallet: wallets/bob.wallet

🚫 🔓 > connect http://localhost:8080
Connected to endpoint http://localhost:8080

🔓 > register foobar 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g /test/abi/foobar.abi
Contract 'foobar' at address 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g registered

🔓 > foobar.foobar 42
Calling foobar.foobar with arguments 'value:42'
Transaction with ID 0x1220654597dfe99b4d5f841c129be39d3fe725539240b9efb43f8ea8ab4d9cd35742 containing 1 operations submitted.
Mana cost: 0.01831902 (Disk: 10, Network: 254, Compute: 1830532)
Logs:
entryPoint: 3282800625
contractArgs: 42
contractId (b58): 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g
headInfo.head_block_time: 1645327982254
headInfo.head_topology.height: 7771
headInfo.last_irreversible_block.: 7711
callerData.caller_privilege: 1
lastIrreversibleBlock: 7711
putRes: 0
obj: testValue
putRes: 0
obj: testValue2
obj: testValue2
putRes3: 0
obj5.value: 42
no obj5
recoveredKey (b58): 1DQzuCcTKacbs9GGScRTU1Hc8BsyARTPqe
value2
no key5
value3
key3
value1
key1
nothing before key1
nothing after key3
obj201.value: 200
next obj202.value: 300
prev obj202.value: 100
nothing before key1
nothing after key3
payer: 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g
payer: 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g
```
npm package: @roamin/sdk-as-cli
Description: ![Test Ubuntu](https://github.com/roaminro/koinos-sdk-as-cli/actions/workflows/test-ubuntu.yml/badge.svg) ![Test Windows](https://github.com/roaminro/koinos-sdk-as-cli/actions/workflows/test-windows.yml/badge.svg) ![Test MacOS](https://github.com/roaminro
Author: Koinos Group
Latest version: 1.1.5

![Test Ubuntu](https://github.com/roaminro/koinos-sdk-as-cli/actions/workflows/test-ubuntu.yml/badge.svg)
![Test Windows](https://github.com/roaminro/koinos-sdk-as-cli/actions/workflows/test-windows.yml/badge.svg)
![Test MacOS](https://github.com/roaminro/koinos-sdk-as-cli/actions/workflows/test-macos.yml/badge.svg)


## Installation

```sh
# with npm
npm install -g @roamin/sdk-as-cli

# with yarn
yarn global add @roamin/sdk-as-cli
```

## Create a contract boilerplate
```sh
# will create "mycontract" in the current working folder
koinos-sdk-as-cli create mycontract
```

## Important note
- It important that your smart contract file lives in the `assembly` folder of your project. (i.e.: `assembly/Calculator.ts`)
- And, it is also important that your `proto` files live in the `assembly/proto/` folder of your project. (i.e.: `assembly/proto/calculator.proto`)

## Help
```sh
koinos-sdk-as-cli help
```
## Build a contract
```sh
# example for building a calculator contract
# build the debug version
koinos-sdk-as-cli build-all debug calculator.proto 

# build the release version
koinos-sdk-as-cli build-all release calculator.proto 
```

This will result in the generation of:

- a `calculator.abi` file in the folder `abi/`
- a `calculator-abi.json` file in the folder `abi/`
- a `contract.wasm` file in the folder `build/release` and `build/debug`
- an `index.ts` file in the folder `assembly/`
- a `Calculator.boilerplate.ts` file in the folder `assembly/`
  
## Generate ABI file
```sh
# example for a calculator contract
koinos-sdk-as-cli generate-abi calculator.proto
```
This will generate a calculator.abi file in the folder `abi/`

## Generate contract.boilerplate.ts and index.ts files
```sh
# example for a calculator contract
koinos-sdk-as-cli generate-contract-as calculator.proto
```

This will generate a `Calculator.boilerplate.ts`file and `index.ts` file in the folder `assembly/`

## Generate AssemblyScript files for all the proto files of a contract
```sh
koinos-sdk-as-cli generate-contract-proto
```

## Generate AS files for the given proto files
```sh
# example for a calculator contract
koinos-sdk-as-cli generate-as-proto calculator/assembly/proto/calculator.proto
```

## Run tests
```sh
koinos-sdk-as-cli run-tests
```
npm package: @roaminroe/as-covers
Description: Code coverage transform for AssemblyScript
Author: Joshua Tenner
Latest version: 0.1.0

# AS-Covers

Code coverage for AssemblyScript projects that uses a few simple packages to make visualizing how well your code branches are covered.

# Usage

First install from npm.

```sh
npm install @as-covers/core
```

Next, add the following transform and entry point to your AssemblyScript compilation.

```sh
# uses multiple lines for clarity
asc node_modules/@as-covers/assembly/index.ts
  --transform @as-covers/transform/lib/index.js
  --explicitStart
```

These will inject some immutable cover points into your web assembly binary.

The next step is to instantiate the module:

```ts
import { Covers } from "@as-covers/glue";
import * as fs from "fs";
import { instantiate } from "@assemblyscript/loader";

// import your web assembly binary
const binary = fs.readFileSync("build/untouched.wasm");
const covers = new Covers();
// Install your imports here
const imports = covers.installImports({});

(async function() {
  const loader = await instantiate(binary, imports);
  covers.registerLoader(loader);
  loader.exports._start();
  process.stdout.write(covers.stringify());
}());

```

Covers is designed to work over multiple binary compilations with the transform applied. Each cover point is immutably hashed so that you can test code coverage with different test files.

Just remember to register the loader each time before calling the `_start()` method.

# License

```
MIT License

Copyright (c) 2021 Joshua Tenner <tenner.joshua@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
npm package: @roaminroe/as-covers-assembly
Description: AssemblyScript code coverage for as-covers
Author: Joshua Tenner
Latest version: 0.3.0

# AS-Covers

Code coverage for AssemblyScript projects that uses a few simple packages to make visualizing how well your code branches are covered.

# Usage

First install from npm.

```sh
npm install @as-covers/core
```

Next, add the following transform and entry point to your AssemblyScript compilation.

```sh
# uses multiple lines for clarity
asc node_modules/@as-covers/assembly/index.ts
  --transform @as-covers/transform/lib/index.js
  --explicitStart
```

These will inject some immutable cover points into your web assembly binary.

The next step is to instantiate the module:

```ts
import { Covers } from "@as-covers/glue";
import * as fs from "fs";
import { instantiate } from "@assemblyscript/loader";

// import your web assembly binary
const binary = fs.readFileSync("build/untouched.wasm");
const covers = new Covers();
// Install your imports here
const imports = covers.installImports({});

(async function() {
  const loader = await instantiate(binary, imports);
  covers.registerLoader(loader);
  loader.exports._start();
  process.stdout.write(covers.stringify());
}());

```

Covers is designed to work over multiple binary compilations with the transform applied. Each cover point is immutably hashed so that you can test code coverage with different test files.

Just remember to register the loader each time before calling the `_start()` method.

# License

```
MIT License

Copyright (c) 2021 Joshua Tenner <tenner.joshua@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
npm package: @roaminroe/as-covers-core
Description: Core code coverage package for as-covers.
Author: Joshua Tenner
Latest version: 0.3.0

# AS-Covers

Code coverage for AssemblyScript projects that uses a few simple packages to make visualizing how well your code branches are covered.

# Usage

First install from npm.

```sh
npm install @as-covers/core
```

Next, add the following transform and entry point to your AssemblyScript compilation.

```sh
# uses multiple lines for clarity
asc node_modules/@as-covers/assembly/index.ts
  --transform @as-covers/transform/lib/index.js
  --explicitStart
```

These will inject some immutable cover points into your web assembly binary.

The next step is to instantiate the module:

```ts
import { Covers } from "@as-covers/glue";
import * as fs from "fs";
import { instantiate } from "@assemblyscript/loader";

// import your web assembly binary
const binary = fs.readFileSync("build/untouched.wasm");
const covers = new Covers();
// Install your imports here
const imports = covers.installImports({});

(async function() {
  const loader = await instantiate(binary, imports);
  covers.registerLoader(loader);
  loader.exports._start();
  process.stdout.write(covers.stringify());
}());

```

Covers is designed to work over multiple binary compilations with the transform applied. Each cover point is immutably hashed so that you can test code coverage with different test files.

Just remember to register the loader each time before calling the `_start()` method.

# License

```
MIT License

Copyright (c) 2021 Joshua Tenner <tenner.joshua@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
npm package: @roaminroe/as-covers-glue
Description: Glue code for code coverage using node.js
Author: Joshua Tenner
Latest version: 0.3.0

# AS-Covers (glue)
**AssemblyScript code coverage glue**

## Installation

```bash
~ npm install @as-covers/glue
```

### AS-Covers

Code coverage for AssemblyScript projects that uses a few simple packages to make visualizing how well your code branches are covered.

# Usage

First install from npm.

```sh
npm install @as-covers/core
```

Next, add the following transform and entry point to your AssemblyScript compilation.

```sh
# uses multiple lines for clarity
asc node_modules/@as-covers/assembly/index.ts
  --transform @as-covers/transform/lib/index.js
  --explicitStart
```

These will inject some immutable cover points into your web assembly binary.

The next step is to instantiate the module:

```ts
import { Covers } from "@as-covers/glue";
import * as fs from "fs";
import { instantiate } from "@assemblyscript/loader";

// import your web assembly binary
const binary = fs.readFileSync("build/untouched.wasm");
const covers = new Covers();
// Install your imports here
const imports = covers.installImports({});

(async function() {
  const loader = await instantiate(binary, imports);
  covers.registerLoader(loader);
  loader.exports._start();
  process.stdout.write(covers.stringify());
}());

```

Covers is designed to work over multiple binary compilations with the transform applied. Each cover point is immutably hashed so that you can test code coverage with different test files.

Just remember to register the loader each time before calling the `_start()` method.

# License

```
MIT License

Copyright (c) 2021 Joshua Tenner <tenner.joshua@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
npm package: @roaminroe/as-covers-transform
Description: The transform that enables code coverage for assemblyscript
Author: Joshua Tenner
Latest version: 0.3.0

# AS-Covers (transform)
**AssemblyScript code coverage transform**

## Installation

```bash
~ npm install @as-covers/transform
```# AS-Covers

Code coverage for AssemblyScript projects that uses a few simple packages to make visualizing how well your code branches are covered.

# Usage

First install from npm.

```sh
npm install @as-covers/core
```

Next, add the following transform and entry point to your AssemblyScript compilation.

```sh
# uses multiple lines for clarity
asc node_modules/@as-covers/assembly/index.ts
  --transform @as-covers/transform/lib/index.js
  --explicitStart
```

These will inject some immutable cover points into your web assembly binary.

The next step is to instantiate the module:

```ts
import { Covers } from "@as-covers/glue";
import * as fs from "fs";
import { instantiate } from "@assemblyscript/loader";

// import your web assembly binary
const binary = fs.readFileSync("build/untouched.wasm");
const covers = new Covers();
// Install your imports here
const imports = covers.installImports({});

(async function() {
  const loader = await instantiate(binary, imports);
  covers.registerLoader(loader);
  loader.exports._start();
  process.stdout.write(covers.stringify());
}());

```

Covers is designed to work over multiple binary compilations with the transform applied. Each cover point is immutably hashed so that you can test code coverage with different test files.

Just remember to register the loader each time before calling the `_start()` method.

# License

```
MIT License

Copyright (c) 2021 Joshua Tenner <tenner.joshua@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
npm package: @roaminroe/as-pect-assembly
Description: Write AssemblyScript tests at blazing fast speeds
Author: Joshua Tenner
Latest version: 6.3.1

# jtenner/as-pect - @as-pect/assembly

[![Greenkeeper badge](https://badges.greenkeeper.io/jtenner/as-pect.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/jtenner/as-pect.svg?branch=master)](https://travis-ci.org/jtenner/as-pect)
[![Coverage Status](https://coveralls.io/repos/github/jtenner/as-pect/badge.svg?branch=master)](https://coveralls.io/github/jtenner/as-pect?branch=master)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)

Write your module in AssemblyScript and get blazing fast bootstrapped tests
with WebAssembly speeds!

## Documentation

To view the documentation, it's located [here](https://tenner-joshua.gitbook.io/as-pect/) on the gitbook. If there are any issues with the docs, please feel free to file an issue!

## Contributors

To contribute please see [CONTRIBUTING.md](./CONTRIBUTING.md).

Thanks to [@willemneal](https://github.com/willemneal) and
[@MaxGraey](https://github.com/maxgraey) for all their support in making `as-pect` the
best software it can be.

Other Contributors:

- [@trusktr](https://github.com/trusktr) - Documentation Changes
- [@MaxGraey](https://github.com/maxgraey) - Performance API suggestions
- [@torch2424](https://github.com/torch2424) - Documentation Changes
- [@dcodeIO](https://github.com/dcodeIO) - Made AssemblyScript itself!
- [@9oelM](https://github.com/9oelM) - Misc functionalities

## Special Thanks

Special thanks to the [AssemblyScript](https://github.com/AssemblyScript/assemblyscript)
team for creating AssemblyScript itself.
npm package: @roaminroe/as-pect-cli
Description: Write AssemblyScript tests at blazing fast speeds
Author: Joshua Tenner
Latest version: 6.3.9

# jtenner/as-pect - @as-pect/cli

[![Greenkeeper badge](https://badges.greenkeeper.io/jtenner/as-pect.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/jtenner/as-pect.svg?branch=master)](https://travis-ci.org/jtenner/as-pect)
[![Coverage Status](https://coveralls.io/repos/github/jtenner/as-pect/badge.svg?branch=master)](https://coveralls.io/github/jtenner/as-pect?branch=master)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)

Write your module in AssemblyScript and get blazing fast bootstrapped tests
with WebAssembly speeds!

## Documentation

To view the documentation, it's located [here](https://tenner-joshua.gitbook.io/as-pect/) on the gitbook. If there are any issues with the docs, please feel free to file an issue!

## Contributors

To contribute please see [CONTRIBUTING.md](./CONTRIBUTING.md).

Thanks to [@willemneal](https://github.com/willemneal) and
[@MaxGraey](https://github.com/maxgraey) for all their support in making `as-pect` the
best software it can be.

Other Contributors:

- [@trusktr](https://github.com/trusktr) - Documentation Changes
- [@MaxGraey](https://github.com/maxgraey) - Performance API suggestions
- [@torch2424](https://github.com/torch2424) - Documentation Changes
- [@dcodeio](https://github.com/torch2424) - Made AssemblyScript itself!
- [@9oelM](https://github.com/9oelM) - Misc functionalities

## Special Thanks

Special thanks to the [AssemblyScript](https://github.com/AssemblyScript/assemblyscript)
team for creating AssemblyScript itself.
npm package: @roaminroe/as-pect-core
Description: Write AssemblyScript tests at blazing fast speeds
Author: Joshua Tenner
Latest version: 6.3.3

# jtenner/as-pect - @as-pect/core

[![Greenkeeper badge](https://badges.greenkeeper.io/jtenner/as-pect.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/jtenner/as-pect.svg?branch=master)](https://travis-ci.org/jtenner/as-pect)
[![Coverage Status](https://coveralls.io/repos/github/jtenner/as-pect/badge.svg?branch=master)](https://coveralls.io/github/jtenner/as-pect?branch=master)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)

Write your module in AssemblyScript and get blazing fast bootstrapped tests
with WebAssembly speeds!

## Documentation

To view the documentation, it's located [here](https://tenner-joshua.gitbook.io/as-pect/) on the gitbook. If there are any issues with the docs, please feel free to file an issue!

## Contributors

To contribute please see [CONTRIBUTING.md](./CONTRIBUTING.md).

Thanks to [@willemneal](https://github.com/willemneal) and
[@MaxGraey](https://github.com/maxgraey) for all their support in making `as-pect` the
best software it can be.

Other Contributors:

- [@trusktr](https://github.com/trusktr) - Documentation Changes
- [@MaxGraey](https://github.com/maxgraey) - Performance API suggestions
- [@torch2424](https://github.com/torch2424) - Documentation Changes
- [@dcodeio](https://github.com/torch2424) - Made AssemblyScript itself!
- [@9oelM](https://github.com/9oelM) - Misc functionalities

## Special Thanks

Special thanks to the [AssemblyScript](https://github.com/AssemblyScript/assemblyscript)
team for creating AssemblyScript itself.
npm package: @roaminroe/as-pect-csv-reporter
Description: csv reporter for as-pect
Author: Joshua Tenner
Latest version: 6.3.0

# jtenner/as-pect - @as-pect/csv-reporter

[![Greenkeeper badge](https://badges.greenkeeper.io/jtenner/as-pect.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/jtenner/as-pect.svg?branch=master)](https://travis-ci.org/jtenner/as-pect)
[![Coverage Status](https://coveralls.io/repos/github/jtenner/as-pect/badge.svg?branch=master)](https://coveralls.io/github/jtenner/as-pect?branch=master)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)

Write your module in AssemblyScript and get blazing fast bootstrapped tests
with WebAssembly speeds!

## Documentation

To view the documentation, it's located [here](https://tenner-joshua.gitbook.io/as-pect/) on the gitbook. If there are any issues with the docs, please feel free to file an issue!

## Contributors

To contribute please see [CONTRIBUTING.md](./CONTRIBUTING.md).

Thanks to [@willemneal](https://github.com/willemneal) and
[@MaxGraey](https://github.com/maxgraey) for all their support in making `as-pect` the
best software it can be.

Other Contributors:

- [@trusktr](https://github.com/trusktr) - Documentation Changes
- [@MaxGraey](https://github.com/maxgraey) - Performance API suggestions
- [@torch2424](https://github.com/torch2424) - Documentation Changes
- [@dcodeio](https://github.com/torch2424) - Made AssemblyScript itself!
- [@9oelM](https://github.com/9oelM) - Misc functionalities

## Special Thanks

Special thanks to the [AssemblyScript](https://github.com/AssemblyScript/assemblyscript)
team for creating AssemblyScript itself.
npm package: @roaminroe/as-pect-json-reporter
Description: Json reporter for as-pect
Author: Joshua Tenner
Latest version: 6.3.0

# jtenner/as-pect - @as-pect/json-reporter

[![Greenkeeper badge](https://badges.greenkeeper.io/jtenner/as-pect.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/jtenner/as-pect.svg?branch=master)](https://travis-ci.org/jtenner/as-pect)
[![Coverage Status](https://coveralls.io/repos/github/jtenner/as-pect/badge.svg?branch=master)](https://coveralls.io/github/jtenner/as-pect?branch=master)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)

Write your module in AssemblyScript and get blazing fast bootstrapped tests
with WebAssembly speeds!

## Documentation

To view the documentation, it's located [here](https://tenner-joshua.gitbook.io/as-pect/) on the gitbook. If there are any issues with the docs, please feel free to file an issue!

## Contributors

To contribute please see [CONTRIBUTING.md](./CONTRIBUTING.md).

Thanks to [@willemneal](https://github.com/willemneal) and
[@MaxGraey](https://github.com/maxgraey) for all their support in making `as-pect` the
best software it can be.

Other Contributors:

- [@trusktr](https://github.com/trusktr) - Documentation Changes
- [@MaxGraey](https://github.com/maxgraey) - Performance API suggestions
- [@torch2424](https://github.com/torch2424) - Documentation Changes
- [@dcodeio](https://github.com/torch2424) - Made AssemblyScript itself!
- [@9oelM](https://github.com/9oelM) - Misc functionalities

## Special Thanks

Special thanks to the [AssemblyScript](https://github.com/AssemblyScript/assemblyscript)
team for creating AssemblyScript itself.
npm package: @roaminroe/koinos-sdk-as
Description: ![Test Ubuntu](https://github.com/koinos/koinos-sdk-as/actions/workflows/test-ubuntu.yml/badge.svg) ![Test Windows](https://github.com/koinos/koinos-sdk-as/actions/workflows/test-windows.yml/badge.svg) ![Test MacOS](https://github.com/koinos/koinos-sdk-as
Author: Koinos Group
Latest version: 0.4.11

![Test Ubuntu](https://github.com/koinos/koinos-sdk-as/actions/workflows/test-ubuntu.yml/badge.svg)
![Test Windows](https://github.com/koinos/koinos-sdk-as/actions/workflows/test-windows.yml/badge.svg)
![Test MacOS](https://github.com/koinos/koinos-sdk-as/actions/workflows/test-macos.yml/badge.svg)

# koinos-sdk-as
AssemblyScript (AS) Software Development Toolkit (SDK) for the Koinos Blockchain

See documentation: https://koinos.github.io/koinos-sdk-as/

Learn how to create smart contracts by looking at the examples repo: https://github.com/roaminroe/koinos-sdk-as-examples

## Requirements:
You need to install NodeJS v16 or higher [download](https://nodejs.org/en/download/)

## Installation

```sh
# with npm
npm install koinos-sdk-as

# with yarn
yarn add koinos-sdk-as
```
## Run unit tests
```sh
# with npm
npm test

# with yarn
yarn test
```

## Build test contract
```sh
# with npm
npm run buildTestContract

# with yarn
yarn run buildTestContract
```

## Upload and trigger the test contract on a local devnet using [Local-Koinos](https://github.com/roaminroe/local-koinos)
```sh
🚫 🔐 > open wallets/bob.wallet bob
Opened wallet: wallets/bob.wallet

🚫 🔓 > connect http://localhost:8080
Connected to endpoint http://localhost:8080

🔓 > register foobar 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g /test/abi/foobar.abi
Contract 'foobar' at address 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g registered

🔓 > foobar.foobar 42
Calling foobar.foobar with arguments 'value:42'
Transaction with ID 0x1220654597dfe99b4d5f841c129be39d3fe725539240b9efb43f8ea8ab4d9cd35742 containing 1 operations submitted.
Mana cost: 0.01831902 (Disk: 10, Network: 254, Compute: 1830532)
Logs:
entryPoint: 3282800625
contractArgs: 42
contractId (b58): 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g
headInfo.head_block_time: 1645327982254
headInfo.head_topology.height: 7771
headInfo.last_irreversible_block.: 7711
callerData.caller_privilege: 1
lastIrreversibleBlock: 7711
putRes: 0
obj: testValue
putRes: 0
obj: testValue2
obj: testValue2
putRes3: 0
obj5.value: 42
no obj5
recoveredKey (b58): 1DQzuCcTKacbs9GGScRTU1Hc8BsyARTPqe
value2
no key5
value3
key3
value1
key1
nothing before key1
nothing after key3
obj201.value: 200
next obj202.value: 300
prev obj202.value: 100
nothing before key1
nothing after key3
payer: 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g
payer: 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g
```