API updates

Gateway

  • The Order type field from Settlement is deprecated. Support will be removed in a subsequent version.
  • Add transaction now accepts a new type of transaction: a bundled transaction.

Example of a bundled transaction

"tx": {
"txs": [
{
"vault_id": 1654615998,
"token_id": "0x2dd48fd7a024204f7c1bd874da5e709d4713d60c8a70639eb1167b367a9c378",
"stark_key": "0x7c65c1e82e2e662f728b4fa42485e3a0a5d2f346baa9455e3e70682c2094cac",
"amount": "4029557120079369747",
"type": "DepositRequest"
},
{
"vault_id": 1654615998,
"token_id": "0x5ba91fa7a024204f7c1bd874da5e709d4713d60c8a70639eb1167b367a9c378",
"stark_key": "0x7c65c1e82e2e662f728b4fa42485e3a0a5d2f346baa9455e3e70682c2094cac",
"amount": "4029557120079369747",
"type": "WithdrawalRequest"
},
]
"type": "MultiTransactionRequest"
},
"tx_id": 1234

Availability gateway

  • The get_batch_data API now accepts an additional (optional) boolean GET parameter: validate_rollup.
    • If this parameter is omitted, the response will be the same as in StarkEx 4.0 (for backward compatibility).
    • If this parameter is provided (regardless of its value), the response will include the rollup vault tree root (in a new response object type).
    • If this parameter is provided and set to True, the rollup vault changes are also included in the response.
    • The committee will validate the rollup vault tree root if the parameter is set to True, however, this root will not be hashed as part of the DA claim.
  • Note: the old object names “vault” and “order” are unchanged; “vault” refers to the validium vaults tree.
  • Note: old versions of the committee service cannot use the new parameter. The committee may fail if validate_rollup is set (to any boolean value).

Example 1 of query response

availability_gateway/get_batch_data?batch_id=1
"update": {
"order_root": "0000000000000000000000000000000000000000000000000000000000000000",
"prev_batch_id": 0,
"vaults": {
"23336622": {
"stark_key": "0x0",
"balance": "0",
"token": "0x0"
}
}
"orders": {
"3065896435020512722": {
"fulfilled_amount": "0"
},
"4293697043586109717": {
"fulfilled_amount": "0"
}
},
"vault_root": "0298df9f3babf341237de93fdad83825cc0c25dadddf7ca15bcc596ff55bdea0"
}

Example 2 of query response

availability_gateway/get_batch_data?batch_id=1&validate_rollup=True
"update": {
"order_root": "0000000000000000000000000000000000000000000000000000000000000000",
"prev_batch_id": 0,
"vaults": {
"23336622": {
"stark_key": "0x0",
"balance": "0",
"token": "0x0"
}
},
"rollup_vaults": {
"9223372036878112430": {
"stark_key": "0x0",
"balance": "0",
"token": "0x0"
}
},
"orders": {
"3065896435020512722": {
"fulfilled_amount": "0"
},
"4293697043586109717": {
"fulfilled_amount": "0"
}
},
"vault_root": "0298df9f3babf341237de93fdad83825cc0c25dadddf7ca15bcc596ff55bdea0",
"rollup_vault_root": "0298df9f3babf341237de93fdad83825cc0c25dadddf7ca15bcc596ff55bdea0"
}

Feeder gateway

  • All URLs are now starting with v2/ and the ones starting without it are deprecated but will still be supported in this version. For example: /v2/feeder_gateway/get_batch_info
  • get_batch_info in the version 2 does not return roots. It returns the following:
    • previous batch id
    • number of the transaction in the sequence
    • time created
    • information about transactions
  • Previously, get_batch_info returned the roots of the orders tree and the vaults tree, that is, the Validium vaults tree. The root of the orders tree can be a root of a Patricia tree if the batch was created after upgrading to StarkEx 4.5, or the root of a Merkle tree, if the batch was created before upgrading to StarkEx 4.5.
  • get_batch_ids is a deprecated function. It will not be supported in the newer version. This means that the only way to use this function is without the v2 URL path. The function still receives vault_root, order_root, and sequence number. Notice that the vault root should be the Validium vault root.