Skip to main content
Module

x/lucid/mod.ts>Core.Int

Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.
Very Popular
Go to Latest
class Core.Int
import { Core } from "https://deno.land/x/lucid@0.5.2/mod.ts";
const { Int } = Core;

Methods

as_i32(): number | undefined

!!! DEPRECATED !!! Returns an i32 value in case the underlying original i128 value is within the limits. Otherwise will just return an empty value (undefined).

as_i32_or_fail(): number

Returns the underlying value converted to i32 if possible (within limits) JsError in case of out of boundary overflow

as_i32_or_nothing(): number | undefined

Returns the underlying value converted to i32 if possible (within limits) Otherwise will just return an empty value (undefined).

as_negative(): BigNum | undefined

BigNum can only contain unsigned u64 values

This function will return the absolute BigNum representation only in case the underlying i128 value is negative.

Otherwise nothing will be returned (undefined).

as_positive(): BigNum | undefined

BigNum can only contain unsigned u64 values

This function will return the BigNum representation only in case the underlying i128 value is positive.

Otherwise nothing will be returned (undefined).

free(): void
is_positive(): boolean
to_bytes(): Uint8Array
to_str(): string

Returns string representation of the underlying i128 value directly. Might contain the minus sign (-) in case of negative value.

Static Methods

from_bytes(bytes: Uint8Array): Int
from_str(string: string): Int
new_i32(x: number): Int