JSON conventions
- Requests and responses use
Content-Type: application/jsonand UTF-8. - Responses use
lowerCamelCasefield names (vaultUuid). Requests also accept thesnake_casename (vault_uuid). Unknown request fields are ignored without an error, so a misspelled optional field is read as omitted: for example, a misspelledcallbackClientSignerPublicKeysends a transaction or structured message request to the MPCVault app for manual signing. - Every field of a message is present in a response. A scalar that is unset has its zero value (
"","0",false, the first enum value,[]). A message or wrapper that is unset isnull. - A field that belongs to a
oneofis present only when it is set, so a response contains at most one of the members. - Field order is not significant.
- The OpenAPI schemas list the canonical form:
lowerCamelCasenames, enum names and decimal strings for 64-bit integers. The other forms in the table below are accepted but not listed.
Types
An enum can gain values. Treat a name you do not recognize as unknown instead of failing.
Field conventions
These conventions hold across the API. A field that follows another rule says so in its description.- Timestamps are Unix time in milliseconds, in a 64-bit integer (a decimal string in JSON).
- UUIDs are hyphenated strings in the form
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. - Amounts are decimal strings in the unit stated by the field (for example wei, satoshi or lamports), never floating-point numbers. A request created through the API holds an integer in that unit. For a request created in the MPCVault app, the stored amount is returned scaled to that unit without rounding, so it can have a fractional part if more precision was entered than the unit has. The stored amount can differ from the amount entered (for example, a Bitcoin send is capped to the value of the first 30 spendable outputs less a reserve for the fee).
- Addresses use the address format of the field’s network. The signing request payloads state the format of each address field.
- Hex strings are stated as such in the field description, with or without the
0xprefix as that field specifies.