BigIntType class final
Arbitrary precision signed integer type.
Represents signed integers of any size with no minimum/maximum limit. Uses minimal two's complement encoding for efficient storage.
Example
// From Dart int
final small = BigIntType.create(42);
// From BigInt (large numbers)
final large = BigIntType.create(BigInt.parse('123456789012345678901234567890'));
print(small.nativeValue); // 42
print(large.toHex()); // Hex representation
// Use in struct definitions
final structType = StructType(
name: 'SignedLedger',
fieldDefinitions: [
FieldDefinition(name: 'signedLarge', type: BigIntType.type),
],
);
- Inheritance
-
- Object
- AbiType
- PrimitiveType
- NumericalType
- BigIntType
- Available extensions
- Annotations
-
- @immutable
Properties
- cardinality → TypeCardinality
-
Type cardinality.
finalinherited
-
classHierarchy
→ List<
String> -
Returns full class hierarchy from most specific to most general.
no setteroverride
- className → String
-
Returns class name for runtime type identification.
no setteroverride
- firstTypeParameter → AbiType
-
Gets first type parameter.
no setterinherited
- fullyQualifiedName → String
-
Returns fully qualified name including type parameters.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasMetadata → bool
-
Whether type has metadata attached.
no setterinherited
- isDynamic → bool
-
Whether type has dynamic (variable) length.
no setterinherited
- isDynamic → bool
-
Available on AbiType, provided by the AbiTypeExtensions extension
Returns whether the type has dynamic length.no setter - isGeneric → bool
-
Whether type is generic (has type parameters).
no setterinherited
- isSigned → bool
-
Whether this type represents signed integers.
finalinherited
- metadata → dynamic
-
Optional metadata.
finalinherited
- name → String
-
Type name (e.g., 'u32', 'Address', 'List').
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sizeInBytes → int?
-
Returns byte size if fixed, null if dynamic.
finalinherited
-
typeParameters
→ List<
AbiType> -
Type parameters for generic types.
finalinherited
Methods
-
canAcceptValue(
dynamic nativeValue) → bool -
Checks if type can accept the given native value.
inherited
-
createValue(
dynamic nativeValue) → BigIntValue -
Creates typed value from native Dart value.
override
-
createValueOrThrow<
T extends TypedValue> (dynamic nativeValue) → T -
Available on AbiType, provided by the AbiTypeOrThrowExtensions extension
Creates a TypedValue from native value and ensures it matches expected type. -
equals(
AbiType other) → bool -
Checks type equality based on fully qualified names.
inherited
-
hasClassOrSuperclass(
String name) → bool -
Checks if instance is or extends the specified class.
inherited
-
hasExactClass(
String name) → bool -
Checks if instance is exactly the specified class.
inherited
-
isAssignableFrom(
AbiType other) → bool -
Checks if type can be assigned from
othertype.inherited -
isValidValue(
dynamic value) → bool -
Available on AbiType, provided by the AbiTypeExtensions extension
Checks if the value is valid for this type. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requireType<
T extends AbiType> (String message) → T -
Available on AbiType, provided by the AbiTypeValidationExtensions extension
Ensures this type is an instance ofT, throwing with a custom message if not. -
toMap(
) → Map< String, dynamic> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- type → BigIntType
-
Gets the singleton type instance for use in type definitions.
no setter
Static Methods
-
create(
dynamic nativeValue) → BigIntValue - Creates a BigIntValue from native Dart value.
-
createFromString(
String value) → BigIntValue - Creates a BigInt from string representation.
-
createZero(
) → BigIntValue - Creates a zero BigInt value.