Constructor
new XdrLargeInt(type, values)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
type |
string
|
force a specific data type. the type choices are:
'i64', 'u64', 'i128', 'u128', 'i256', and 'u256' (default: the smallest
one that fits the |
values |
number
|
bigint
|
string
|
Array.<(number|bigint|string)>
|
a list of integer-like values interpreted in big-endian order |
Classes
Members
Methods
toI128() → {xdr.ScVal}
- Source:
Throws:
-
if the value cannot fit in 128 bits
- Type
-
RangeError
Returns:
- Type:
-
xdr.ScVal
the integer encoded with ScValType = I128
toI256() → {xdr.ScVal}
- Source:
Returns:
- Type:
-
xdr.ScVal
the integer encoded with ScValType = I256
toI64() → {xdr.ScVal}
- Source:
Returns:
- Type:
-
xdr.ScVal
the integer encoded with ScValType = I64
toNumber() → {number}
- Source:
Throws:
-
if the value can't fit into a Number
- Type
-
RangeError
Returns:
- Type:
-
number
toScVal() → {xdr.ScVal}
- Source:
Returns:
- Type:
-
xdr.ScVal
the smallest interpretation of the stored value
toU128() → {xdr.ScVal}
- Source:
Throws:
-
if the value cannot fit in 128 bits
- Type
-
RangeError
Returns:
- Type:
-
xdr.ScVal
the integer encoded with ScValType = U128
toU256() → {xdr.ScVal}
- Source:
Returns:
- Type:
-
xdr.ScVal
the integer encoded with ScValType = U256
toU64() → {xdr.ScVal}
- Source:
Returns:
- Type:
-
xdr.ScVal
the integer encoded with ScValType = U64
(static) getType(scvType) → {string}
Convert the raw ScValType
string (e.g. 'scvI128', generated by the XDR)
to a type description for XdrLargeInt construction (e.g. 'i128')
- Source:
Parameters:
Name | Type | Description |
---|---|---|
scvType |
string
|
the |
Returns:
- Type:
-
string
a suitable equivalent type to construct this object