UNPKG

envio

Version:

A latency and sync speed optimized, developer friendly blockchain data indexer.

39 lines (31 loc) 892 B
// Generated by ReScript, PLEASE EDIT WITH CARE import * as Stdlib_Int from "@rescript/runtime/lib/es6/Stdlib_Int.js"; import BignumberJs from "bignumber.js"; import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs"; function toInt(b) { return Stdlib_Int.fromString(b.toString(), undefined); } function notEquals(a, b) { return !a.isEqualTo(b); } let zero = new BignumberJs(0); let one = new BignumberJs(1); let schema = S$RescriptSchema.transform(S$RescriptSchema.setName(S$RescriptSchema.string, "BigDecimal"), s => ({ p: string => { let bigDecimal = new BignumberJs(string); if (bigDecimal !== undefined) { return bigDecimal; } else { return s.fail("The string is not valid BigDecimal", undefined); } }, s: bigDecimal => bigDecimal.toString() })); export { toInt, notEquals, zero, one, schema, } /* zero Not a pure module */