API additions and changes

StarkEx Spot Trading 5.0 REST API Updates

  • MultiAssetTradeRequest – A new transaction type. Includes related objects. For more information, documented in the StarkEx 5.0 REST API reference.

  • MintRequest – This transaction type is now updated to support minting ERC-1155 and ERC-20 tokens.

Additional resources

StarkEx Spot Trading 4.5 REST API Updates

Gateway

Deprecated features

The Order type field from Settlement is deprecated. Support will be removed in a subsequent version.

Bundled transaction

The add_transaction method now accepts a bundled transaction, using the MultiTransactionRequest transaction type.

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 is 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.

      The old object names vault and order are unchanged. vault refers to the Validium vaults tree.

      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 now begin with v2/. For example:

    /v2/feeder_gateway/get_batch_info

    URLs starting without v2/ are deprecated but are still supported in this version.

  • get_batch_info in 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, and is not supported with the updated URL prefix v2/. If you still require this function, do not include the v2/ URL prefix. The function still receives the vault root, the order root, and the sequence number.

    The vault root should be the Validium vault root.