@tevm/voltaire / primitives/ReturnData
primitives/ReturnData
Classes
InvalidHexFormatError
Defined in: src/primitives/ReturnData/errors.ts:6 Error thrown when hex string format is invalidExtends
Constructors
Constructor
new InvalidHexFormatError(Defined in: src/primitives/ReturnData/errors.ts:7message,context?):InvalidHexFormatError
Parameters
message
string
context?
Record<string, unknown>
Returns
InvalidHexFormatError
Overrides
PrimitiveError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
PrimitiveError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
PrimitiveError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
PrimitiveError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
PrimitiveError.docsPath
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
PrimitiveError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
PrimitiveError.toJSON
InvalidValueError
Defined in: src/primitives/ReturnData/errors.ts:16 Error thrown when value type is unsupportedExtends
Constructors
Constructor
new InvalidValueError(Defined in: src/primitives/ReturnData/errors.ts:17message,context?):InvalidValueError
Parameters
message
string
context?
Record<string, unknown>
Returns
InvalidValueError
Overrides
PrimitiveError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
PrimitiveError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
PrimitiveError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
PrimitiveError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
PrimitiveError.docsPath
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
PrimitiveError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
PrimitiveError.toJSON
Type Aliases
ReturnDataType
ReturnDataType =Defined in: src/primitives/ReturnData/ReturnDataType.ts:9 ReturnData - Raw bytes returned from contract call Branded Uint8Array representing uninterpreted return data from contract execution. Can be decoded using ABI specifications.Uint8Array&object
Type Declaration
[brand]
readonly[brand]:"ReturnData"
Functions
_equals()
_equals(Defined in: src/primitives/ReturnData/equals.js:13 Check if two ReturnData instances are equala,b):boolean
Parameters
a
ReturnDataType
First ReturnData
b
ReturnDataType
Second ReturnData
Returns
boolean
True if equal
Example
_from()
_from(Defined in: src/primitives/ReturnData/from.js:19 Create ReturnData from various input typesvalue):ReturnDataType
Parameters
value
Hex string or Uint8Arraystring | Uint8Array<ArrayBufferLike>
Returns
ReturnDataType
ReturnData
Throws
If value type is unsupportedThrows
If hex string is invalidExample
_fromBytes()
_fromBytes(Defined in: src/primitives/ReturnData/fromBytes.js:12 Create ReturnData from Uint8Array (zero-copy cast)value):ReturnDataType
Parameters
value
Uint8Array<ArrayBufferLike>
Byte array
Returns
ReturnDataType
ReturnData
Example
_fromHex()
_fromHex(Defined in: src/primitives/ReturnData/fromHex.js:16 Create ReturnData from hex stringvalue):ReturnDataType
Parameters
value
string
Hex string (with or without 0x prefix)
Returns
ReturnDataType
ReturnData
Throws
If hex string is invalidExample
_isEmpty()
_isEmpty(Defined in: src/primitives/ReturnData/isEmpty.js:12 Check if ReturnData is emptydata):boolean
Parameters
data
ReturnDataType
ReturnData
Returns
boolean
True if empty
Example
_toBytes()
_toBytes(Defined in: src/primitives/ReturnData/toBytes.js:12 Convert ReturnData to plain Uint8Arraydata):Uint8Array<ArrayBufferLike>
Parameters
data
ReturnDataType
ReturnData
Returns
Uint8Array<ArrayBufferLike>
Plain byte array
Example
_toHex()
_toHex(Defined in: src/primitives/ReturnData/toHex.js:14 Convert ReturnData to hex stringdata):string
Parameters
data
ReturnDataType
ReturnData
Returns
string
Hex string with 0x prefix
Example
equals()
equals(Defined in: src/primitives/ReturnData/index.ts:51 Check if two ReturnData instances are equala,b):boolean
Parameters
a
ReturnDataType
b
ReturnDataType
Returns
boolean
from()
from(Defined in: src/primitives/ReturnData/index.ts:16 Create ReturnData from various input typesvalue):ReturnDataType
Parameters
value
string | Uint8Array<ArrayBufferLike>
Returns
ReturnDataType
fromBytes()
fromBytes(Defined in: src/primitives/ReturnData/index.ts:30 Create ReturnData from Uint8Arrayvalue):ReturnDataType
Parameters
value
Uint8Array
Returns
ReturnDataType
fromHex()
fromHex(Defined in: src/primitives/ReturnData/index.ts:23 Create ReturnData from hex stringvalue):ReturnDataType
Parameters
value
string
Returns
ReturnDataType
isEmpty()
isEmpty(Defined in: src/primitives/ReturnData/index.ts:58 Check if ReturnData is emptydata):boolean
Parameters
data
ReturnDataType
Returns
boolean
toBytes()
toBytes(Defined in: src/primitives/ReturnData/index.ts:44 Convert ReturnData to plain Uint8Arraydata):Uint8Array
Parameters
data
ReturnDataType
Returns
Uint8Array
toHex()
toHex(Defined in: src/primitives/ReturnData/index.ts:37 Convert ReturnData to hex stringdata):string
Parameters
data
ReturnDataType
Returns
string
