envio
Version:
A latency and sync speed optimized, developer friendly blockchain data indexer.
49 lines (45 loc) • 1.53 kB
JavaScript
// This file is needed to have control over TS version exports
// Some parts like Sury reexport are impossible to implement
// on the JS side, so we need to do it here
import * as Sury from "rescript-schema";
import { $$BigInt as UtilsBigInt } from "./src/Utils.res.mjs";
const bigintSchema = UtilsBigInt.schema;
import { schema as bigDecimalSchema } from "./src/bindings/BigDecimal.res.mjs";
export * from "./src/Envio.res.mjs";
export { indexer, createTestIndexer } from "./src/Api.res.mjs";
export { default as BigDecimal } from "bignumber.js";
// Important! Should match the index.d.ts file
export const S = {
string: Sury.string,
address: Sury.string,
evmChainId: Sury.number,
fuelChainId: Sury.number,
svmChainId: Sury.number,
jsonString: Sury.jsonString,
boolean: Sury.boolean,
int32: Sury.int32,
number: Sury.number,
bigint: bigintSchema,
never: Sury.never,
union: Sury.union,
object: Sury.object,
// Might change in a near future
// custom: Sury.custom,
// Don't expose recursive for now, since it's too advanced
// recursive: Sury.recursive,
transform: Sury.transform,
shape: Sury.shape,
refine: Sury.refine,
schema: Sury.schema,
record: Sury.record,
array: Sury.array,
tuple: Sury.tuple,
merge: Sury.merge,
optional: Sury.optional,
nullable: (schema) => Sury.union([schema, null]),
bigDecimal: bigDecimalSchema,
// Nullish type will change in "sury@10"
// nullish: Sury.nullish,
assertOrThrow: Sury.assertOrThrow,
parseOrThrow: Sury.parseOrThrow,
};