MassaLabs monorepo for assemblyscript libraries.
This repository is a collection of tools, objects and functions in AssemblyScript.
-
Essential Classes and helper functions with as-types
-
Probabilistic simulation functionalities for smart contracts with as-proba
-
AssemblyScript transformers, dynamic code replacement features with as-transformer
The complete documentation of all available functions and objects is here:
Packages are independent you can choose to install what you need
npm i --save-dev @massalabs/as-types
npm i --save-dev @massalabs/as-proba
npm i --save-dev @massalabs/as-transformer
npm run build
npm run fmt
npm run test
npm run doc
After installing As, you can import the object classes and functions that you need in your AssemblyScript file.
For example, to use the combination
function to determine the combination of 2 numbers, you can import and use it like this:
import { combination } from '@massalabs/as-proba';
import { Args } from '@massalabs/as-types';
//the argument args contains the serialized values n and k (n >= k) as U64
export function calculateCombination(args: StaticArray<u8>): void {
const n = args.nextU64();
const k = args.nextU64();
const result = combination(n, k);
generateEvent(`The result of the combination of ${n.toString()} and ${k.toString()} is ${result.toString()}`);
}
We welcome contributions from the community!
If you would like to contribute to As, please read the CONTRIBUTING file.
As is released under the MIT License.
As is developed with love by MassaLabs and powered by a variety of open-source projects.