envio
Version:
A latency and sync speed optimized, developer friendly blockchain data indexer.
42 lines (34 loc) • 1.2 kB
JavaScript
// Generated by ReScript, PLEASE EDIT WITH CARE
;
var Belt_Int = require("rescript/lib/js/belt_Int.js");
var BignumberJs = require("bignumber.js");
var S$RescriptSchema = require("rescript-schema/src/S.res.js");
function toInt(b) {
return Belt_Int.fromString(b.toString());
}
function notEquals(a, b) {
return !a.isEqualTo(b);
}
var zero = new BignumberJs(0);
var one = new BignumberJs(1);
var schema = S$RescriptSchema.transform(S$RescriptSchema.setName(S$RescriptSchema.string, "BigDecimal"), (function (s) {
return {
p: (function (string) {
var bigDecimal = new BignumberJs(string);
if (bigDecimal !== undefined) {
return bigDecimal;
} else {
return s.fail("The string is not valid BigDecimal", undefined);
}
}),
s: (function (bigDecimal) {
return bigDecimal.toString();
})
};
}));
exports.toInt = toInt;
exports.notEquals = notEquals;
exports.zero = zero;
exports.one = one;
exports.schema = schema;
/* zero Not a pure module */