StaticfarmsThe farms package's casting namespace for farm objects and events.
StaticfaucetThe faucet package's casting namespace for faucet objects and events.
StaticFixedThe standard 18-decimal fixed-point utility class.
Statici64The maximum value of a signed 64-bit integer, 9223372036854775807n.
StaticIThe signed 18-decimal IFixed utility class.
StaticnftThe NFT AMM package's casting namespace for NFT pool objects and events.
StaticnftsThe NFT package's casting namespace for NFT object and display data.
StaticperpetualsThe perpetuals package's casting namespace for market and position data.
StaticpoolsThe pools package's casting namespace for pool, coin, and pool-event shapes.
StaticrouterThe router package's casting namespace for routes and trade data.
StaticstakingThe staking package's casting namespace for staking objects and events.
StaticsuiThe SuiFrens package's casting namespace for SuiFren objects and events.
Staticu64The maximum value of an unsigned 64-bit integer, 18446744073709551615n.
StaticaddressStaticaddressConverts byte values directly to a zero-padded Sui address string.
Each byte is rendered as two hexadecimal digits, concatenated after 0x,
and then left-padded to 64 hexadecimal digits. This method does not validate
that the input contains exactly 32 values.
The raw address byte values.
A 0x-prefixed address with 64 hexadecimal digits when the input
fits within 32 bytes.
StaticaddressConverts decimal byte strings to a zero-padded Sui address.
Each string is passed to Number without a separate range check, then the
resulting values are handled by addressFromBytes.
Decimal strings such as "255" and "0".
The string rendered by addressFromBytes; the helper does not
validate that the result is hexadecimal or contains exactly 32 bytes.
StaticbcsStaticbigConverts little-endian byte values to a bigint.
For example, [0x01, 0x02] becomes 0x0201, or 513n. The method calls
reverse() on bytes, so it reverses the caller's array in place. It does
not interpret a sign bit.
The little-endian byte values.
The resulting unsigned bigint.
StaticbigConverts an 18-decimal fixed-point bigint to a JavaScript number.
The method divides by 1e18. Large values can lose integer or fractional
precision when they pass through Number.
The 18-decimal fixed-point value.
The unscaled value as a JavaScript number.
StaticbpsConverts basis points to an unscaled percentage fraction.
The method divides by 10000 after converting the bigint to number, so
very large basis-point values can lose precision.
The basis-point count, where 500n means 5%.
The unscaled percentage fraction.
StaticbytesConverts decimal byte strings to JavaScript numbers.
The method calls Number for each string and does not validate the 0-255
byte range, so a non-numeric string produces NaN.
The decimal strings to convert.
A new numeric array with one value for each input string.
StaticcastDeserializes a SuiObjectResponse's base64 BCS bytes and maps the result.
The method extracts data.bcs.bcsBytes, calls bcsType.fromBase64, and
passes the decoded value to fromDeserialized. It performs no network I/O
and does not mutate the response.
The mapped value.
StaticnormalizeConverts an unscaled integer-percent slippage value to a fraction.
The method divides by 100 without validation, so 1 becomes 0.01 and
0.5 becomes 0.005.
The percent value to divide by 100.
The unscaled slippage fraction.
StaticnumberConverts a JavaScript number to an 18-decimal fixed-point bigint.
The method multiplies by 1e18, applies Math.floor, and converts the
result to bigint. Flooring also applies to negative values, so negative
fractional scaled values round toward negative infinity. The conversion
inherits JavaScript number precision.
The number to encode. Its scaled value must be finite; the result
is floored before conversion to bigint.
The 18-decimal fixed-point representation as a bigint.
StaticpercentageConverts a decimal fraction to basis points.
One basis point is 0.0001, so 0.05 becomes 500n and 1 becomes
10000n. The method rounds the product to the nearest integer basis point.
The unscaled percentage fraction, where 0.05 means 5%.
The rounded basis-point count as a bigint.
StaticscaleMultiplies a bigint by a JavaScript number and returns a bigint.
The method first converts the bigint to number, multiplies by scalar,
applies Math.floor, and converts the result to bigint. Large bigint
inputs can lose precision during the Number conversion.
The numeric multiplier.
The bigint to multiply.
The floored product as a bigint.
StaticstringConverts each byte to a JavaScript character code and joins the characters.
This is a character-code conversion, not UTF-8 decoding. The input array is not mutated.
The byte values to convert.
The resulting string.
Staticu8Encodes a JavaScript string as UTF-8 byte values.
The string to encode.
A new number[] containing the UTF-8 bytes.
StaticunwrapReturns the value of a deserialized BCS Option's Some property.
Any object without a Some property, including a { None: ... } value,
returns undefined. Falsy Some values, including 0, false, "", and
null, are returned unchanged.
The object produced by BCS deserialization.
The Some value, or undefined when the property is absent.
Provides local casting and conversion routines shared by the Aftermath modules.
The class does not perform network I/O. Its methods convert numbers, bytes, addresses, and BCS object responses, while its module properties expose the package-specific caster namespaces.