@ston-fi/tolkbox
v0.5.0
Published
Collection of Tolk snippets/utilities
Keywords
Readme
TolkBox
Collection of Tolk snippets and utilities, built for Acton.
Installation
To install this package use
npm install -D @ston-fi/tolkboxor via yarn
yarn add -D @ston-fi/tolkboxUsage
The package ships the Tolk sources under src/. Map them in your project's Acton.toml:
[import-mappings]
tolkbox = "node_modules/@ston-fi/tolkbox/src"Then import the modules you need:
import "@tolkbox/Time"
import "@tolkbox/math/Fp"
fun example() {
val deadline: Time = Time.addDays(blockchain.now(), 2)!;
val interest: Fp18 = Fp18.from(2).sqrt();
}Modules
| Module | Description |
| --- | --- |
| @tolkbox/Actions | Building and packing of c5 out-actions (SendMsgAction, SetCodeAction, …) |
| @tolkbox/Address | address? fallback helpers (senderIfNone, otherIfNone) |
| @tolkbox/Cell | Cell helpers (cell.isEmpty) |
| @tolkbox/Consts | Common send-mode combinations and addresses |
| @tolkbox/Ctx | Incoming-message context readers (INMSG_* TVM params) |
| @tolkbox/Map | map<K, V> extensions (len, merge, deleteBatch, …) |
| @tolkbox/Reserves | Wrappers around common reserveGramsOnBalance modes |
| @tolkbox/StdlibExt | Functions missing from the standard library (typed load/store, hashes, c5 access, …) |
| @tolkbox/Time | Time type with add/sub helpers for days, hours and minutes |
| @tolkbox/Utils | Misc utilities (raw-string rendering, auto-deploy addresses, casts) |
| @tolkbox/interfaces/Jetton | Jetton (TEP-74) message structs |
| @tolkbox/interfaces/Nft | NFT (TEP-62) message structs |
| @tolkbox/interfaces/Sbt | SBT (TEP-85) message structs |
| @tolkbox/math/Fp | Fp18 fixed-point math with 18 decimals (sqrt, ln, exp, pow, …) |
| @tolkbox/math/Int | Integer math (IntMath.sqrt, IntMath.pow) |
| @tolkbox/math/Math | Shared math constants and the MathError exit codes |
Development
acton build # compile
acton test # run the test suite
acton check # lint (zero warnings enforced)
acton fmt --check # verify formattingLicensing
This project is licensed under the MIT License - see the LICENSE file for details.
