Here we describe the encodings of various types and values throughout the APIs.
Addresses
All Ethereum addresses that are provided in responses are always lowercased.
Block numbers
Block numbers are always encoded as string
(s).
Token IDs
Tokens IDs are always encoded as string
(s).
Numerics
Quantities and any large numeric values are always encoded as string
(s).
Standard scalar types are used where possible, most commonly uint64
, uint32
, double
, bytes
.
Transaction values
Transaction values are always encoded as string
(s).
Timestamp
In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format.
That is, the format is {year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z
. The Z
suffix indicates the timezone (UTC
); the timezone
is required.
Array types
Array types in the URL parameter section must be represented by a repeating parameter.
?traits=<value>&traits=<value>
The value part of the parameter has to be URL-encoded as it may contain unsafe URL characters.
As an example with NFT traits, a valid query string is:
?traits=Clothes%3DPuffy%20Vest&traits=Fur%3DZombie