zkSync API v0.2
Accounts ¶
api/v0.2/accounts/{accountIdOrAddress}/{stateType} ¶
Get account stateGET/accounts/{accountIdOrAddress}/{stateType}
Returns committed or finalized account state
Example URI
- accountIdOrAddress
string
(required) Example: 1Account ID or address in the zkSync network
- stateType
"committed" | "finalized"
(required) Example: committedThe type of account state which you want to get
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"accountId": 12,
"address": "0xc0f97CC918C9d6fA4E9fc6be61a6a06589D199b3",
"nonce": 6412,
"pubKeyHash": "sync:82b9eb68c6f7f80cecf49ee1a20acb8ae9ecd602",
"lastUpdateInBlock": 15001,
"balances": {},
"accountType": "Owned",
"nfts": {
"ETH": "1000000000000000000"
},
"mintedNfts": {
"100000": {
"id": 100000,
"contentHash": "0x2216aae3714e46a9efe0066ff5f3684c95ea9a680a4c39cd36e62b117cb1837c",
"creatorId": 5,
"creatorAddress": "0x1849D6ae02349352258Ca59c27bC6D3159A7b752",
"serialId": 57,
"address": "0x2DEEA6ae02349352258C2DEEA6bC6D31592DEEA6",
"symbol": "NFT-100000"
}
}
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"accountId": {
"type": "number"
},
"address": {
"type": "string"
},
"nonce": {
"type": "number"
},
"pubKeyHash": {
"type": "string"
},
"lastUpdateInBlock": {
"type": "number"
},
"balances": {
"type": "object",
"properties": {}
},
"accountType": {
"type": [
"string",
"null"
],
"enum": [
"Owned",
"CREATE2",
null
]
},
"nfts": {
"$ref": "#/definitions/ETH",
"required": [
"ETH"
]
},
"mintedNfts": {
"$ref": "#/definitions/100000",
"required": [
"100000"
]
}
},
"required": [
"accountId",
"address",
"nonce",
"pubKeyHash",
"lastUpdateInBlock",
"balances",
"accountType",
"nfts",
"mintedNfts"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
],
"definitions": {
"100000": {
"type": "object",
"patternProperties": {
"": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"contentHash": {
"type": "string"
},
"creatorId": {
"type": "number"
},
"creatorAddress": {
"type": "string"
},
"serialId": {
"type": "number"
},
"address": {
"type": "string"
},
"symbol": {
"type": "string"
}
},
"required": [
"id",
"contentHash",
"creatorId",
"creatorAddress",
"serialId",
"address"
]
}
}
},
"ETH": {
"type": "object",
"patternProperties": {
"": {
"type": "string"
}
}
}
}
}
api/v0.2/accounts/{accountIdOrAddress} ¶
Get account full stateGET/accounts/{accountIdOrAddress}
Returns both committed and finalized account states
Example URI
- accountIdOrAddress
string
(required) Example: 1Account ID or address in the zkSync network
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"depositing": {
"balances": {
"ETH": {
"amount": "1000000000000000000",
"expectedAcceptBlock": 25136211
}
}
},
"committed": {
"accountId": 12,
"address": "0xc0f97CC918C9d6fA4E9fc6be61a6a06589D199b3",
"nonce": 6412,
"pubKeyHash": "sync:82b9eb68c6f7f80cecf49ee1a20acb8ae9ecd602",
"lastUpdateInBlock": 15001,
"balances": {},
"accountType": "Owned",
"nfts": {
"ETH": "1000000000000000000"
},
"mintedNfts": {
"100000": {
"id": 100000,
"contentHash": "0x2216aae3714e46a9efe0066ff5f3684c95ea9a680a4c39cd36e62b117cb1837c",
"creatorId": 5,
"creatorAddress": "0x1849D6ae02349352258Ca59c27bC6D3159A7b752",
"serialId": 57,
"address": "0x2DEEA6ae02349352258C2DEEA6bC6D31592DEEA6",
"symbol": "NFT-100000"
}
}
},
"finalized": {
"accountId": 12,
"address": "0xc0f97CC918C9d6fA4E9fc6be61a6a06589D199b3",
"nonce": 6412,
"pubKeyHash": "sync:82b9eb68c6f7f80cecf49ee1a20acb8ae9ecd602",
"lastUpdateInBlock": 15001,
"balances": {},
"accountType": "Owned",
"nfts": {
"ETH": "1000000000000000000"
},
"mintedNfts": {
"100000": {
"id": 100000,
"contentHash": "0x2216aae3714e46a9efe0066ff5f3684c95ea9a680a4c39cd36e62b117cb1837c",
"creatorId": 5,
"creatorAddress": "0x1849D6ae02349352258Ca59c27bC6D3159A7b752",
"serialId": 57,
"address": "0x2DEEA6ae02349352258C2DEEA6bC6D31592DEEA6",
"symbol": "NFT-100000"
}
}
}
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"depositing": {
"type": "object",
"properties": {
"balances": {
"$ref": "#/definitions/ETH",
"required": [
"ETH"
]
}
},
"required": [
"balances"
]
},
"committed": {
"type": [
"object",
"null"
],
"properties": {
"accountId": {
"type": "number"
},
"address": {
"type": "string"
},
"nonce": {
"type": "number"
},
"pubKeyHash": {
"type": "string"
},
"lastUpdateInBlock": {
"type": "number"
},
"balances": {
"type": "object",
"properties": {}
},
"accountType": {
"type": [
"string",
"null"
],
"enum": [
"Owned",
"CREATE2",
null
]
},
"nfts": {
"$ref": "#/definitions/ETH",
"required": [
"ETH"
]
},
"mintedNfts": {
"$ref": "#/definitions/100000",
"required": [
"100000"
]
}
},
"required": [
"accountId",
"address",
"nonce",
"pubKeyHash",
"lastUpdateInBlock",
"balances",
"accountType",
"nfts",
"mintedNfts"
]
},
"finalized": {
"type": [
"object",
"null"
],
"properties": {
"accountId": {
"type": "number"
},
"address": {
"type": "string"
},
"nonce": {
"type": "number"
},
"pubKeyHash": {
"type": "string"
},
"lastUpdateInBlock": {
"type": "number"
},
"balances": {
"type": "object",
"properties": {}
},
"accountType": {
"type": [
"string",
"null"
],
"enum": [
"Owned",
"CREATE2",
null
]
},
"nfts": {
"$ref": "#/definitions/ETH",
"required": [
"ETH"
]
},
"mintedNfts": {
"$ref": "#/definitions/100000",
"required": [
"100000"
]
}
},
"required": [
"accountId",
"address",
"nonce",
"pubKeyHash",
"lastUpdateInBlock",
"balances",
"accountType",
"nfts",
"mintedNfts"
]
}
},
"required": [
"depositing",
"committed",
"finalized"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
],
"definitions": {
"100000": {
"type": "object",
"patternProperties": {
"": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"contentHash": {
"type": "string"
},
"creatorId": {
"type": "number"
},
"creatorAddress": {
"type": "string"
},
"serialId": {
"type": "number"
},
"address": {
"type": "string"
},
"symbol": {
"type": "string"
}
},
"required": [
"id",
"contentHash",
"creatorId",
"creatorAddress",
"serialId",
"address"
]
}
}
},
"ETH": {
"type": "object",
"patternProperties": {
"": {
"type": "string"
}
}
}
}
}
api/v0.2/accounts/{accountIdOrAddress}/transactions ¶
Get account transactionsGET/accounts/{accountIdOrAddress}/transactions{?from,limit,direction}
Returns the transactions for a particular account according to the query params
Example URI
- accountIdOrAddress
string
(required) Example: 1Account ID or address in the zkSync network
- from
"latest" | string
(required) Example: latestThe hash of the transaction from which to show or
latest
- limit
number
(required) Example: 2The limit of transactions to be shown
- direction
"newer" | "older"
(required) Example: olderNewer or older than the ID of the
from
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"pagination": {
"from": "0x2dcb7cb4288b84766a1bef4a1bd4ae9ac15ab817f06ad07efc4dac035bcfdb45",
"limit": 2,
"direction": "older",
"count": 268
},
"list": [
{
"txHash": "0x732D0a2598ba5E9db4e5cfF36F86dF8dA88A959A",
"blockNumber": 12,
"op": {
"type": "Transfer",
"to": "0xD3c62D2F7b6d4A63577F2415E55A6Aa6E1DbB9CA",
"fee": "12000000000000000000",
"from": "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049",
"nonce": 12123,
"token": 0,
"amount": "17500000000000000",
"accountId": 2,
"validFrom": 0,
"validUntil": 1239213821,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
"status": "rejected",
"failReason": "Nonce mismatch",
"createdAt": "2018-12-12T01:02:03.123456789",
"batchId": 155
}
]
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"pagination": {
"type": "object",
"properties": {
"from": {
"type": "string"
},
"limit": {
"type": "number"
},
"direction": {
"type": "string"
},
"count": {
"type": "number"
}
},
"required": [
"from",
"limit",
"direction",
"count"
]
},
"list": {
"type": "array"
}
},
"required": [
"pagination",
"list"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
api/v0.2/accounts/{accountIdOrAddress}/transactions/pending ¶
Get pending priority operationsGET/accounts/{accountIdOrAddress}/transactions/pending{?from,limit,direction}
Get account pending priority operations.
Example URI
- accountIdOrAddress
string
(required) Example: 1Account ID or address in the zkSync network
- from
"latest" | number
(required) Example: 100The hash of the transaction from which to show or
latest
- limit
number
(required) Example: 2The limit of transactions to be shown
- direction
"newer" | "older"
(required) Example: olderNewer or older than the ID of the
from
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"pagination": {
"from": 5,
"limit": 2,
"direction": "older",
"count": 268
},
"list": [
{
"txHash": "0x732D0a2598ba5E9db4e5cfF36F86dF8dA88A959A",
"blockNumber": 12,
"op": {
"type": "Deposit",
"from": "0x555968cfc291aece5550822feb712d1cf66c57b4",
"tokenId": 12,
"amount": "18000000000000000",
"to": "0x3f0d95988eb8538c74e609cac0c1ce56ff3d3179",
"accountId": 1413,
"ethHash": "0xdda1287002282e1804af40a7c7373bd77cc99a2a27c88bf7908be45398e93148",
"id": 17002,
"txHash": "0x2dcb7cb4288b847d8a1bef4a1bd4ae9ac15ab817f06ad07efc4dac035bcfdb45"
},
"status": "rejected",
"failReason": "Nonce mismatch",
"createdAt": "2018-12-12T01:02:03.123456789"
}
]
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"pagination": {
"type": "object",
"properties": {
"from": {
"type": "number"
},
"limit": {
"type": "number"
},
"direction": {
"type": "string"
},
"count": {
"type": "number"
}
},
"required": [
"from",
"limit",
"direction",
"count"
]
},
"list": {
"type": "array"
}
},
"required": [
"pagination",
"list"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
Batches ¶
api/v0.2/transactions/batches ¶
Submit batch of transactionsPOST/transactions/batches
Submit batch of transactions.
Example URI
Headers
Content-Type: application/json
Body
{
"txs": [
{
"tx": {
"type": "Transfer",
"to": "0xD3c62D2F7b6d4A63577F2415E55A6Aa6E1DbB9CA",
"fee": "12000000000000000000",
"from": "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049",
"nonce": 12123,
"token": 0,
"amount": "17500000000000000",
"accountId": 2,
"validFrom": 0,
"validUntil": 1239213821,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
"signature": {
"type": "EthereumSignature",
"signature": "0x39d0446fac8657f6009408f231afdddc6c3161ed95b994478db50248466e1a99119510f59de827cdf97447d17f87976bdc6a1c7f293322fb357d4178a69619091b"
}
}
],
"signature": {
"type": "EthereumSignature",
"signature": "0x39d0446fac8657f6009408f231afdddc6c3161ed95b994478db50248466e1a99119510f59de827cdf97447d17f87976bdc6a1c7f293322fb357d4178a69619091b"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"txs": {
"type": "array"
},
"signature": {
"anyOf": [
{
"type": "extend",
"enum": [
{
"type": "EthereumSignature",
"signature": "0x39d0446fac8657f6009408f231afdddc6c3161ed95b994478db50248466e1a99119510f59de827cdf97447d17f87976bdc6a1c7f293322fb357d4178a69619091b"
}
]
},
{
"type": "array",
"enum": [
[
{
"type": "EthereumSignature",
"signature": "0x39d0446fac8657f6009408f231afdddc6c3161ed95b994478db50248466e1a99119510f59de827cdf97447d17f87976bdc6a1c7f293322fb357d4178a69619091b"
}
]
]
}
]
}
},
"required": [
"txs"
]
}
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"batchHash": "0x6d6f7e07c85a770c6cb9f667c6b7d2d6335781f956a3a66503c87a56fd392e80",
"transactionHashes": [
"0xca1d902dc4aa0d401aded0f3c4c6e73c1aa68fbb661856af1a8874472f5043bb"
]
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"batchHash": {
"type": "string"
},
"transactionHashes": {
"type": "array"
}
},
"required": [
"batchHash",
"transactionHashes"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
api/v0.2/transactions/batches/:txBatchHash ¶
Get transactions batch statusGET/transactions/batches/{txBatchHash}
Get transactions batch status (latest receipt)
Example URI
- txBatchHash
string
(required) Example: 0x22c3cb86f5f5d7284866916972655c0c3839b2a4bc350a5198f6b159fb43ae8bThe hash of the contents of the batch queried
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"batchHash": "0x6d6f7e07c85a770c6cb9f667c6b7d2d6335781f956a3a66503c87a56fd392e80",
"transactionHashes": [
"0xca1d902dc4aa0d401aded0f3c4c6e73c1aa68fbb661856af1a8874472f5043bb"
],
"createdAt": "2020-10-12T09:05:03.123416742",
"batchStatus": {
"updatedAt": "2020-10-12T09:05:03.123416742",
"lastState": "queued"
}
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"batchHash": {
"type": "string"
},
"transactionHashes": {
"type": "array"
},
"createdAt": {
"type": "string"
},
"batchStatus": {
"type": "object",
"properties": {
"updatedAt": {
"type": "string"
},
"lastState": {
"type": "string",
"enum": [
"queued",
"committed",
"finalized",
"rejected",
"queued"
]
}
},
"required": [
"updatedAt",
"lastState"
]
}
},
"required": [
"batchHash",
"transactionHashes",
"createdAt",
"batchStatus"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
Blocks ¶
api/v0.2/blocks ¶
Get blocks rangeGET/blocks{?from,limit,direction}
Get blocks range
Example URI
- from
"latest" | number
(required) Example: latestThe number of the block from which to show or
latest
- limit
number
(required) Example: 2The limit of transactions to be shown
- direction
"newer" | "older"
(required) Example: olderNewer or older than the ID of the
from
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"pagination": {
"from": 5,
"limit": 2,
"direction": "older",
"count": 268
},
"list": [
{
"blockNumber": 11109,
"newStateRoot": "0x61684c1bd4ac3f7843b6a20d4270d58dc4139d546ea4249424bc6c2ce0a48f92",
"blockSize": 110,
"commitTxHash": "0xc2541cf68c6f41a6bc55f9d6ba24816c79431942ca3762514f448540cfa475",
"verifyTxHash": "0x5e188571f82171b0dc313d9ff5433f10d03153a573e6c2ae5b4fbf683dd2a3",
"committedAt": "2020-10-12T12:05:03.123416742",
"finalizedAt": "2020-10-12T12:10:03.123416742",
"status": "committed"
}
]
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"pagination": {
"type": "object",
"properties": {
"from": {
"type": "number"
},
"limit": {
"type": "number"
},
"direction": {
"type": "string"
},
"count": {
"type": "number"
}
},
"required": [
"from",
"limit",
"direction",
"count"
]
},
"list": {
"type": "array"
}
},
"required": [
"pagination",
"list"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
api/v0.2/blocks/:block_number ¶
Get block detailsGET/blocks/{blockNumber}
Get block details
Example URI
- blockNumber
BlockNumber
(required) Example: lastCommittedAn integer block number,
lastCommitted
orlastFinalized
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"blockNumber": 11109,
"newStateRoot": "0x61684c1bd4ac3f7843b6a20d4270d58dc4139d546ea4249424bc6c2ce0a48f92",
"blockSize": 110,
"commitTxHash": "0xc2541cf68c6f41a6bc55f9d6ba24816c79431942ca3762514f448540cfa475",
"verifyTxHash": "0x5e188571f82171b0dc313d9ff5433f10d03153a573e6c2ae5b4fbf683dd2a3",
"committedAt": "2020-10-12T12:05:03.123416742",
"finalizedAt": "2020-10-12T12:10:03.123416742",
"status": "committed"
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"blockNumber": {
"type": "number"
},
"newStateRoot": {
"type": "string"
},
"blockSize": {
"type": "number"
},
"commitTxHash": {
"type": [
"string",
"null"
]
},
"verifyTxHash": {
"type": [
"string",
"null"
]
},
"committedAt": {
"type": "string"
},
"finalizedAt": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string"
}
},
"required": [
"blockNumber",
"newStateRoot",
"blockSize",
"commitTxHash",
"verifyTxHash",
"committedAt",
"finalizedAt",
"status"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
api/v0.2/blocks/blockNumber/transactions ¶
Get block transactionsGET/blocks/{blockNumber}/transactions{?from,limit,direction}
Get block transactions
Example URI
- blockNumber
BlockNumber
(required) Example: lastCommittedAn integer block number,
lastCommitted
orlastFinalized
- from
"latest" | string
(required) Example: latestThe hash of the transaction from which to show or
latest
- limit
number
(required) Example: 2The limit of transactions to be shown
- direction
"newer" | "older"
(required) Example: olderNewer or older than the ID of the
from
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"pagination": {
"from": "0x2dcb7cb4288b84766a1bef4a1bd4ae9ac15ab817f06ad07efc4dac035bcfdb45",
"limit": 2,
"direction": "older",
"count": 268
},
"list": [
{
"txHash": "0x732D0a2598ba5E9db4e5cfF36F86dF8dA88A959A",
"blockNumber": 12,
"op": {
"type": "Transfer",
"to": "0xD3c62D2F7b6d4A63577F2415E55A6Aa6E1DbB9CA",
"fee": "12000000000000000000",
"from": "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049",
"nonce": 12123,
"token": 0,
"amount": "17500000000000000",
"accountId": 2,
"validFrom": 0,
"validUntil": 1239213821,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
"status": "rejected",
"failReason": "Nonce mismatch",
"createdAt": "2018-12-12T01:02:03.123456789",
"batchId": 155
}
]
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"pagination": {
"type": "object",
"properties": {
"from": {
"type": "string"
},
"limit": {
"type": "number"
},
"direction": {
"type": "string"
},
"count": {
"type": "number"
}
},
"required": [
"from",
"limit",
"direction",
"count"
]
},
"list": {
"type": "array"
}
},
"required": [
"pagination",
"list"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
Config ¶
api/v0.2/config ¶
Get config of networkGET/config
Returns the config of network
Example URI
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"network": "mainnet",
"contract": "0x5D8cec831732d6DA03677a33430796C4840728f7",
"govContract": "0x70e7fB5A89f9556F8fF9611bB6f42C8eAFDB6c93",
"depositConfirmations": 10,
"zksyncVersion": "contractV4"
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"mainnet"
]
},
"contract": {
"type": "string"
},
"govContract": {
"type": "string"
},
"depositConfirmations": {
"type": "number"
},
"zksyncVersion": {
"type": "string"
}
},
"required": [
"network",
"contract",
"govContract",
"depositConfirmations",
"zksyncVersion"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
Fees ¶
api/v0.2/fee ¶
Get fee for a single transactionPOST/fee
Request fee for a single transaction.
Example URI
Headers
Content-Type: application/json
Body
{
"txType": "Transfer",
"address": "0xf33A2D61DD09541A8C9897D7236aDcCCC14Cf769",
"tokenLike": 1
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"txType": {
"anyOf": [
{
"type": "string",
"enum": [
"Transfer",
"Withdraw",
"FastWithdraw",
"ForcedExit",
"Swap",
"MintNFT",
"WithdrawNFT",
"FastWithdrawNFT",
"Transfer"
]
},
{
"type": "object",
"properties": {
"ChangePubKey": {
"type": "string",
"enum": [
"Onchain",
"ECDSA",
"CREATE2"
]
}
},
"required": [
"ChangePubKey"
],
"enum": [
{
"ChangePubKey": "Onchain"
},
{
"ChangePubKey": {
"onchainPubkeyAuth": false
}
}
]
}
]
},
"address": {
"type": "string"
},
"tokenLike": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"enum": [
"ETH"
]
}
]
}
},
"required": [
"txType",
"address",
"tokenLike"
]
}
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"gasFee": "12000000000",
"zkpFee": "12000000",
"totalFee": "12012000000"
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"gasFee": {
"type": "string"
},
"zkpFee": {
"type": "string"
},
"totalFee": {
"type": "string"
}
},
"required": [
"gasFee",
"zkpFee",
"totalFee"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
api/v0.2/fee/batch ¶
Get fee for a transactions batchPOST/fee/batch
Request fee for a transactions batch.
Example URI
Headers
Content-Type: application/json
Body
{
"transactions": [
{
"txType": "Transfer",
"address": "0xF659D25A06607Da53e62DAA5842499316A4e2548"
}
],
"tokenLike": 1
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"transactions": {
"type": "array"
},
"tokenLike": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"enum": [
"ETH"
]
}
]
}
},
"required": [
"transactions",
"tokenLike"
]
}
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"gasFee": "12000000000",
"zkpFee": "12000000",
"totalFee": "12012000000"
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"gasFee": {
"type": "string"
},
"zkpFee": {
"type": "string"
},
"totalFee": {
"type": "string"
}
},
"required": [
"gasFee",
"zkpFee",
"totalFee"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
Network status ¶
api/v0.2/networkStatus ¶
Get network statusGET/networkStatus
Returns the status of the network
Example URI
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"lastCommitted": 1298,
"finalized": 1296,
"totalTransactions": 1200000,
"mempoolSize": 123
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"lastCommitted": {
"type": "number"
},
"finalized": {
"type": "number"
},
"totalTransactions": {
"type": "number"
},
"mempoolSize": {
"type": "number"
}
},
"required": [
"lastCommitted",
"finalized",
"totalTransactions",
"mempoolSize"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
Tokens ¶
api/v0.2/tokens ¶
Get list of supported tokensGET/tokens{?from,limit,direction}
Returns the tokens that are currently supported by zkSync
Example URI
- from
"latest" | number
(required) Example: latestToken ID of transaction from which to show or
latest
- limit
number
(required) Example: 2The limit of tokens to be returned
- direction
"newer" | "older"
(required) Example: olderNewer or older than the ID of the
from
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"pagination": {
"from": 5,
"limit": 2,
"direction": "older",
"count": 268
},
"list": [
{
"id": 12,
"address": "0x0849D6ae02349352258Ca59c27bC6D3159A7b752",
"symbol": "MLTT",
"decimals": 18,
"enabledForFees": true
}
]
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"pagination": {
"type": "object",
"properties": {
"from": {
"type": "number"
},
"limit": {
"type": "number"
},
"direction": {
"type": "string"
},
"count": {
"type": "number"
}
},
"required": [
"from",
"limit",
"direction",
"count"
]
},
"list": {
"type": "array"
}
},
"required": [
"pagination",
"list"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
api/v0.2/tokens/:tokenLike ¶
Get token infoGET/tokens/{tokenLike}
Get token into
Example URI
- tokenLike
string
(required) Example: 2ID, address or symbol of the token in the zkSync network
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"id": 12,
"address": "0x0849D6ae02349352258Ca59c27bC6D3159A7b752",
"symbol": "MLTT",
"decimals": 18,
"enabledForFees": true
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"address": {
"type": "string"
},
"symbol": {
"type": "string"
},
"decimals": {
"type": "number"
},
"enabledForFees": {
"type": "boolean"
}
},
"required": [
"id",
"address",
"symbol",
"decimals",
"enabledForFees"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
api/v0.2/tokens/:tokenLike/priceIn/:currency ¶
Get token priceGET/tokens/{tokenLike}/priceIn/{currency}
Get token price relative to another token
Example URI
- tokenLike
string
(required) Example: 2ID, address or symbol of the token in the zkSync network
- currency
string
(required) Example: usdEither
usd
or ID of any of the supported tokens in the zkSync network
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"tokenId": 12,
"tokenSymbol": "MLTT",
"priceIn": "USD",
"decimals": 18,
"price": "1.01"
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"tokenId": {
"type": "number"
},
"tokenSymbol": {
"type": "string"
},
"priceIn": {
"type": "string"
},
"decimals": {
"type": "number"
},
"price": {
"type": "string"
}
},
"required": [
"tokenId",
"tokenSymbol",
"priceIn",
"decimals",
"price"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
api/v0.2/tokens/nft/:id ¶
Get NFT infoGET/tokens/nft/{id}
Get NFT info
Example URI
- id
number
(required) Example: 65536ID of the NFT in the zkSync network
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"id": 100000,
"contentHash": "0x2216aae3714e46a9efe0066ff5f3684c95ea9a680a4c39cd36e62b117cb1837c",
"creatorId": 5,
"creatorAddress": "0x1849D6ae02349352258Ca59c27bC6D3159A7b752",
"serialId": 57,
"address": "0x2DEEA6ae02349352258C2DEEA6bC6D31592DEEA6",
"symbol": "NFT-100000",
"currentFactory": "0x5DFEA6ae02349352258C2DEEA6bC6D31592D5DFE",
"withdrawnFactory": "0x5DFEA6ae02349352258C2DEEA6bC6D31592D5DFE"
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"contentHash": {
"type": "string"
},
"creatorId": {
"type": "number"
},
"creatorAddress": {
"type": "string"
},
"serialId": {
"type": "number"
},
"address": {
"type": "string"
},
"symbol": {
"type": "string"
},
"currentFactory": {
"type": "string"
},
"withdrawnFactory": {
"type": [
"string",
"null"
]
}
},
"required": [
"id",
"contentHash",
"creatorId",
"creatorAddress",
"serialId",
"address",
"currentFactory",
"withdrawnFactory"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
api/v0.2/tokens/nft/:id/owner ¶
Get NFT owner IDGET/tokens/nft/{id}/owner
Get NFT owner ID
Example URI
- id
number
(required) Example: 65536ID of the NFT in the zkSync network
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": null,
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"number",
"null"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
Transactions ¶
api/v0.2/transactions ¶
Submit transactionPOST/transactions
Submit single transaction
Example URI
Headers
Content-Type: application/json
Body
{
"tx": {
"type": "Transfer",
"to": "0xD3c62D2F7b6d4A63577F2415E55A6Aa6E1DbB9CA",
"fee": "12000000000000000000",
"from": "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049",
"nonce": 12123,
"token": 0,
"amount": "17500000000000000",
"accountId": 2,
"validFrom": 0,
"validUntil": 1239213821,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
"signature": {
"type": "EthereumSignature",
"signature": "0x39d0446fac8657f6009408f231afdddc6c3161ed95b994478db50248466e1a99119510f59de827cdf97447d17f87976bdc6a1c7f293322fb357d4178a69619091b"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"tx": {
"type": "extend",
"enum": [
{
"type": "Transfer",
"to": "0xD3c62D2F7b6d4A63577F2415E55A6Aa6E1DbB9CA",
"fee": "12000000000000000000",
"from": "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049",
"nonce": 12123,
"token": 0,
"amount": "17500000000000000",
"accountId": 2,
"validFrom": 0,
"validUntil": 1239213821,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
{
"type": "Withdraw",
"to": "0xD3c62D2F7b6d4A63577F2415E55A6Aa6E1DbB9CA",
"fee": 1200000000,
"from": "0xD3c62D2F7b6d4A63577F2415E55A6Aa6E1DbB9CA",
"nonce": 12123,
"tokenId": 10,
"amount": 17500000000000000,
"accountId": 12123,
"validFrom": 0,
"validUntil": 1239213821,
"fast": false,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
{
"type": "ChangePubKey",
"accountId": 1201,
"account": "0x3EEe181F789c6585B39904eBAeAb10ACf70f5F1a",
"newPkHash": "5fcf0bad911e8fdebd4fd79b0a832bc92a694e55",
"feeTokenId": 6,
"fee": 121000000000000,
"nonce": 51,
"ethAuthData": "ECDSAAuthType",
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
},
"ethSignature": "0xf0947f0a731ada6e09ca99d3aafb1469a3baaf602eab2f5661edd30d6386",
"validFrom": 0,
"validUntil": 1239213821
},
{
"type": "ForcedExit",
"initiatorAccountId": 12,
"target": "0x38de1b4a24548d6ff66fa8e56448d9de09955b08",
"nonce": 1001,
"tokenId": 5,
"fee": "12000000000",
"validFrom": 0,
"validUntil": 1239213821,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
{
"type": "Swap",
"submitterId": 12,
"submitterAddress": "0x38de1b4a24548d6ff66fa8e56448d9de09955b08",
"nonce": 1001,
"orders": [
{
"accountId": 12,
"recipient": "0x38de1b4a24548d6ff66fa8e56448d9de09955b08",
"nonce": 1001,
"tokenBuy": 1,
"tokenSell": 2,
"ratio": [
"100",
"2"
],
"amount": "100000000",
"validFrom": 0,
"validUntil": 1239213821,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
}
],
"amounts": [
"100000000",
"20000"
],
"fee": "12000000000",
"feeToken": 5,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
{
"type": "MintNFT",
"creatorId": 12,
"creatorAddress": "0x38de1b4a24548d6ff66fa8e56448d9de09955b08",
"contentHash": "0x2216aae3714e46a9efe0066ff5f3684c95ea9a680a4c39cd36e62b117cb1837c",
"recipient": "0x44de1b4a24548d6ff66fa8e56448d9de09955b00",
"fee": "12000000000",
"feeToken": 5,
"nonce": 1001,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
{
"type": "WithdrawNFT",
"accountId": 12,
"from": "0x38de1b4a24548d6ff66fa8e56448d9de09955b08",
"to": "0x38de1b4a24548d6ff66fa8e56448d9de09955b08",
"token": 100000,
"feeToken": 5,
"fee": "12000000000",
"nonce": 1001,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
},
"fast": false,
"validFrom": 0,
"validUntil": 1239213821
}
]
},
"signature": {
"type": "extend",
"enum": [
{
"type": "EthereumSignature",
"signature": "0x39d0446fac8657f6009408f231afdddc6c3161ed95b994478db50248466e1a99119510f59de827cdf97447d17f87976bdc6a1c7f293322fb357d4178a69619091b"
},
{
"type": "EIP1271Signature",
"signature": "0xc9eb71b736ef69192d90a6516c5d66af883f6bc9a1749ed98edff106bcd49594618644860be89b08725de834d3a312d409810ecb39e9e7a5a5a9d8d870b166ab1c"
}
]
}
},
"required": [
"tx"
]
}
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": "0xb092a0a2eabbf0b5b57d18e70d929899676cf3c0ad4df0f9492c3094ec4a8b19",
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"string",
"null"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
api/v0.2/transactions/:txHash ¶
Get transaction receiptGET/transactions/{txHash}
Get transaction receipt
Example URI
- txHash
string
(required) Example: 0x4637c9eea692cce9926e286db2ebbbaae3666c6cdb47e66ac2abf3e7cafd3c31The hash of the transaction in the zkSync network
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"status": "committed",
"ethBlock": 134300,
"rollupBlock": 99812,
"id": 12001
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"extend",
"null"
],
"enum": [
{
"status": "committed",
"ethBlock": 134300,
"rollupBlock": 99812,
"id": 12001
},
{
"txHash": "0x466a9432e5337ee85deb9092526bb96377d316b9a1f0717ae4027798837fb85b",
"rollupBlock": 99812,
"status": "committed",
"failReason": "null"
},
null
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
api/v0.2/transactions/:txHash/data ¶
Get transaction dataGET/transactions/{txHash}/data
Get transaction data
Example URI
- txHash
string
(required) Example: 0x4637c9eea692cce9926e286db2ebbbaae3666c6cdb47e66ac2abf3e7cafd3c31The hash of the transaction in the zkSync network
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"tx": {
"txHash": "0x732D0a2598ba5E9db4e5cfF36F86dF8dA88A959A",
"blockNumber": 12,
"op": {
"type": "Transfer",
"to": "0xD3c62D2F7b6d4A63577F2415E55A6Aa6E1DbB9CA",
"fee": "12000000000000000000",
"from": "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049",
"nonce": 12123,
"token": 0,
"amount": "17500000000000000",
"accountId": 2,
"validFrom": 0,
"validUntil": 1239213821,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
"status": "rejected",
"failReason": "Nonce mismatch",
"createdAt": "2018-12-12T01:02:03.123456789",
"batchId": 155
},
"ethSignature": "0xb71ef30467c91b779ccc07c6615ac5fcd2e8293847dda0a6d0c63c85e95120c812e3f1e1973fc79f1718f45554120ffeca99b21b6d424dca854e8191415d2ce91b"
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"tx": {
"type": "object",
"properties": {
"txHash": {
"type": "string"
},
"blockNumber": {
"type": "number"
},
"op": {
"type": "extend",
"enum": [
{
"type": "Transfer",
"to": "0xD3c62D2F7b6d4A63577F2415E55A6Aa6E1DbB9CA",
"fee": "12000000000000000000",
"from": "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049",
"nonce": 12123,
"token": 0,
"amount": "17500000000000000",
"accountId": 2,
"validFrom": 0,
"validUntil": 1239213821,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
{
"type": "Withdraw",
"to": "0xD3c62D2F7b6d4A63577F2415E55A6Aa6E1DbB9CA",
"fee": 1200000000,
"from": "0xD3c62D2F7b6d4A63577F2415E55A6Aa6E1DbB9CA",
"nonce": 12123,
"tokenId": 10,
"amount": 17500000000000000,
"accountId": 12123,
"validFrom": 0,
"validUntil": 1239213821,
"fast": false,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
},
"ethTxHash": "0xdda1287002282e1804af40a7c7373bd77cc99a2a27c88bf7908be45398e93148"
},
{
"type": "ChangePubKey",
"accountId": 1201,
"account": "0x3EEe181F789c6585B39904eBAeAb10ACf70f5F1a",
"newPkHash": "5fcf0bad911e8fdebd4fd79b0a832bc92a694e55",
"feeTokenId": 6,
"fee": 121000000000000,
"nonce": 51,
"ethAuthData": "ECDSAAuthType",
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
},
"ethSignature": "0xf0947f0a731ada6e09ca99d3aafb1469a3baaf602eab2f5661edd30d6386",
"validFrom": 0,
"validUntil": 1239213821
},
{
"type": "ForcedExit",
"initiatorAccountId": 12,
"target": "0x38de1b4a24548d6ff66fa8e56448d9de09955b08",
"nonce": 1001,
"tokenId": 5,
"fee": "12000000000",
"validFrom": 0,
"validUntil": 1239213821,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
},
"ethTxHash": "0xdda1287002282e1804af40a7c7373bd77cc99a2a27c88bf7908be45398e93148"
},
{
"type": "Swap",
"submitterId": 12,
"submitterAddress": "0x38de1b4a24548d6ff66fa8e56448d9de09955b08",
"nonce": 1001,
"orders": [
{
"accountId": 12,
"recipient": "0x38de1b4a24548d6ff66fa8e56448d9de09955b08",
"nonce": 1001,
"tokenBuy": 1,
"tokenSell": 2,
"ratio": [
"100",
"2"
],
"amount": "100000000",
"validFrom": 0,
"validUntil": 1239213821,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
}
],
"amounts": [
"100000000",
"20000"
],
"fee": "12000000000",
"feeToken": 5,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
{
"type": "MintNFT",
"creatorId": 12,
"creatorAddress": "0x38de1b4a24548d6ff66fa8e56448d9de09955b08",
"contentHash": "0x2216aae3714e46a9efe0066ff5f3684c95ea9a680a4c39cd36e62b117cb1837c",
"recipient": "0x44de1b4a24548d6ff66fa8e56448d9de09955b00",
"fee": "12000000000",
"feeToken": 5,
"nonce": 1001,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
}
},
{
"type": "WithdrawNFT",
"accountId": 12,
"from": "0x38de1b4a24548d6ff66fa8e56448d9de09955b08",
"to": "0x38de1b4a24548d6ff66fa8e56448d9de09955b08",
"token": 100000,
"feeToken": 5,
"fee": "12000000000",
"nonce": 1001,
"signature": {
"pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
"signature": "9a8119110d2dd15c5b7be55de3870667055ac281c35607b67488873d8db23f8d21af4ff9027edee980124e7b2ce7b79b84fe91801e1badce3f7f339d65d8f003"
},
"fast": false,
"validFrom": 0,
"validUntil": 1239213821
},
{
"type": "Deposit",
"from": "0x555968cfc291aece5550822feb712d1cf66c57b4",
"tokenId": 12,
"amount": "18000000000000000",
"to": "0x3f0d95988eb8538c74e609cac0c1ce56ff3d3179",
"accountId": 1413,
"ethHash": "0xdda1287002282e1804af40a7c7373bd77cc99a2a27c88bf7908be45398e93148",
"id": 17002,
"txHash": "0x2dcb7cb4288b847d8a1bef4a1bd4ae9ac15ab817f06ad07efc4dac035bcfdb45"
},
{
"type": "FullExit",
"accountId": 123,
"tokenId": 34,
"ethHash": "0x1216aae3714e46a9efe0066ff5f3684c95ea9a680a4c39cd36e62b117cb1837c",
"id": 1348,
"txHash": "0xaf0612970ea1b7809886ab0cce398bb14524d700e4c7305c54c34b5f9f3e6f56"
}
]
},
"status": {
"type": "string",
"enum": [
"queued",
"committed",
"finalized",
"rejected",
"rejected"
]
},
"failReason": {
"type": [
"string",
"null"
]
},
"createdAt": {
"type": [
"string",
"null"
]
},
"batchId": {
"type": [
"number",
"null"
]
}
},
"required": [
"txHash",
"blockNumber",
"op",
"status",
"failReason",
"createdAt",
"batchId"
]
},
"ethSignature": {
"type": [
"string",
"null"
]
}
},
"required": [
"tx",
"ethSignature"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}
api/v0.2/transactions/toggle2FA ¶
Toggle 2-factor authenticationPOST/transactions/toggle2FA
Enable or disable requirement for L1 signature for L2 transactions. It takes an optional pubKeyHash
parameter, which, if specified,
ensures that only transactions signed with a specific L2 private key won’t have their Ethereum signature checked.
Example URI
Headers
Content-Type: application/json
Body
{
"enable": false,
"accountId": 2,
"timestamp": 1632468148929,
"signature": {
"type": "EthereumSignature",
"signature": "0x9f33411e7d290e4dfbc2e7d226079c5b7d7c54d635581ab3bc2520b32002a3412a3ebaf868f7dda73b60057dafed275d277a4092f65be7e24a2d76db929e62a51c"
},
"pubKeyHash": "sync:87360b28b1cb80bd05c1ce4fecf0b0707d68d928"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"enable": {
"type": "boolean"
},
"accountId": {
"type": "number"
},
"timestamp": {
"type": "number"
},
"signature": {
"type": "extend",
"enum": [
{
"type": "EthereumSignature",
"signature": "0x9f33411e7d290e4dfbc2e7d226079c5b7d7c54d635581ab3bc2520b32002a3412a3ebaf868f7dda73b60057dafed275d277a4092f65be7e24a2d76db929e62a51c"
},
{
"type": "EIP1271Signature",
"signature": "0xc9eb71b736ef69192d90a6516c5d66af883f6bc9a1749ed98edff106bcd49594618644860be89b08725de834d3a312d409810ecb39e9e7a5a5a9d8d870b166ab1c"
}
]
},
"pubKeyHash": {
"type": "string"
}
},
"required": [
"enable",
"accountId",
"timestamp",
"signature"
]
}
200
Headers
Content-Type: application/json
Body
{
"request": {
"network": "localhost",
"apiVersion": "v02",
"resource": "/api/v0.2/...",
"args": {},
"timestamp": "2021-05-31T14:17:24.112536900Z"
},
"status": "success",
"result": {
"success": true
},
"error": {
"errorType": "errorType",
"code": 0,
"message": "message"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"request": {
"type": "object",
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"rinkeby",
"ropsten",
"localhost",
"localhost"
]
},
"apiVersion": {
"type": "string",
"enum": [
"v02"
]
},
"resource": {
"type": "string"
},
"args": {
"type": "object",
"properties": {}
},
"timestamp": {
"type": "string"
}
},
"required": [
"network",
"apiVersion",
"resource",
"args",
"timestamp"
]
},
"status": {
"type": "string"
},
"result": {
"type": [
"object",
"null"
],
"properties": {
"success": {
"type": "boolean"
}
},
"required": [
"success"
]
},
"error": {
"type": [
"object",
"null"
],
"properties": {
"errorType": {
"type": "string"
},
"code": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"errorType",
"code",
"message"
]
}
},
"required": [
"request",
"status",
"result",
"error"
]
}