NativeUnionVal
in package
Container for contract union variant values
This class represents a union variant value for Soroban smart contracts. Unions in Soroban allow for variant types where one of multiple possible cases is active. Each union has a tag (case name) and optional associated values for that case.
Used by ContractSpec::nativeToXdrSCVal() when converting native PHP values to XDR for user-defined union types.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
Properties
$tag
public
string
$tag
$values
public
array<string|int, mixed>|null
$values
= null
Methods
__construct()
public
__construct(string $tag[, array<string|int, mixed>|null $values = null ]) : mixed
Parameters
- $tag : string
-
The name of the union case/variant to use.
- $values : array<string|int, mixed>|null = null
-
The values associated with this union case. Null for void cases, array of values for tuple cases. The array must match the expected types defined in the contract spec for this union case.