TEALScript supports every type defined in the ABI
Like typescript, you can define types in your TEALScript file. Currently, custom generics are not supported
type MyType = StaticArray<uint64, 3>
const a: MyType = [1, 2, 3]
Account
, Asset
, and Application
are all special types that indicate the given value must be added to the foreign reference array. TEALScript will automatically convert Account
to Address
(which is an alias for byte[32]
) and Asset
/Application
to uint64
where aplpicable. This means if you attempt to return one of these types or store in storage, it will converted automatically by the compiler to it's respective ABI type.
foo(asa: Asset): Asset {
return asa // returns the uint64 ID of the given asset
}
Generated using TypeDoc