Types¶
Balzac is a statically typed language, i.e. the type of each variable is determined at compile time.
The table below shows the list of types
Type |
Description |
Example |
---|---|---|
|
64-bit signed number |
|
|
A string of characters |
|
|
Either true or false value |
|
|
A string of bytes in hexadecimal representation |
|
|
A Bitcoin private key in the Wallet Input Format [1] |
|
|
A Bitcoin address in the Base58 format [2] |
|
|
A raw public key as hexadecimal string |
|
|
A raw signature as hexadecimal string |
|
|
A Bitcoin transaction, as hex payload or txid |
|
Hint
Type Coercion
Type coercion is an automatic type conversion by the compiler. In other words, some types can be safely converted to other ones:
key
can be used within expressions/statements where a typepubkey
oraddress
is expected;pubkey
can be used where a typeaddress
is expected.
Hint
Type Inference
Types can be declared explicitly (left box) or omitted (right box) if the type checker can statically infer them.
const n:int = 42
const n = 42
References