{ "schemes": [ "http" ], "swagger": "2.0", "info": { "description": "Project fetches data from TON blockchain.", "title": "tonidx", "contact": { "name": "Dat Boi", "url": "https://datboi420.t.me" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "0.0.1" }, "host": "localhost", "basePath": "/api/v1", "paths": { "/account": { "get": { "description": "Returns account states and its parsed data", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "account" ], "summary": "account data", "parameters": [ { "type": "string", "description": "account address", "name": "address", "in": "query" }, { "type": "boolean", "description": "only latest account states", "name": "latest", "in": "query" }, { "type": "boolean", "description": "include parsed data", "name": "with_data", "in": "query" }, { "type": "array", "items": { "type": "string" }, "description": "filter by interfaces", "name": "interfaces", "in": "query" }, { "type": "string", "description": "filter FTs or NFTs by owner address", "name": "owner_address", "in": "query" }, { "type": "string", "description": "filter NFT items by collection address", "name": "collection_address", "in": "query" }, { "type": "integer", "description": "offset", "name": "offset", "in": "query", "required": true }, { "type": "integer", "description": "limit", "name": "limit", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/core.AccountState" } } } } } }, "/block": { "get": { "description": "Returns filtered blocks", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "block info", "parameters": [ { "type": "integer", "description": "workchain", "name": "workchain", "in": "query" }, { "type": "integer", "description": "shard", "name": "shard", "in": "query" }, { "type": "integer", "description": "seq_no", "name": "seq_no", "in": "query" }, { "type": "boolean", "description": "include transactions", "name": "with_transactions", "in": "query" }, { "type": "integer", "description": "offset", "name": "offset", "in": "query", "required": true }, { "type": "integer", "description": "limit", "name": "limit", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/core.Block" } } } } } }, "/contract/interface": { "get": { "description": "Returns known contract interfaces", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "contract" ], "summary": "contract interfaces", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/core.ContractInterface" } } } } } }, "/contract/operation": { "get": { "description": "Returns known contract message payloads schema", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "contract" ], "summary": "contract operations", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/core.ContractOperation" } } } } } }, "/message": { "get": { "description": "Returns filtered messages", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "transaction" ], "summary": "transaction messages", "parameters": [ { "type": "string", "description": "msg hash", "name": "hash", "in": "query" }, { "type": "string", "description": "source address", "name": "src_address", "in": "query" }, { "type": "string", "description": "destination address", "name": "dst_address", "in": "query" }, { "type": "string", "description": "source contract interface", "name": "src_contract", "in": "query" }, { "type": "string", "description": "destination contract interface", "name": "dst_contract", "in": "query" }, { "type": "array", "items": { "type": "string" }, "description": "filter by contract operation names", "name": "operation_names", "in": "query" }, { "type": "integer", "description": "offset", "name": "offset", "in": "query", "required": true }, { "type": "integer", "description": "limit", "name": "limit", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/core.AccountState" } } } } } }, "/transaction": { "get": { "description": "Returns transactions, states and messages", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "transaction" ], "summary": "transactions data", "parameters": [ { "type": "string", "description": "account address", "name": "address", "in": "query" }, { "type": "string", "description": "tx hash", "name": "hash", "in": "query" }, { "type": "boolean", "description": "with accounts", "name": "with_accounts", "in": "query" }, { "type": "array", "items": { "type": "string" }, "description": "filter by interfaces", "name": "interfaces", "in": "query" }, { "type": "integer", "description": "offset", "name": "offset", "in": "query", "required": true }, { "type": "integer", "description": "limit", "name": "limit", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/core.AccountState" } } } } } } }, "definitions": { "core.AccountData": { "type": "object", "properties": { "address": { "type": "string" }, "admin_addr": { "type": "string" }, "balance": { "description": "TODO: pointer here, bun bug", "type": "string", "example": "" }, "collection_address": { "type": "string" }, "content_description": { "type": "string" }, "content_image": { "type": "string" }, "content_image_data": { "type": "array", "items": { "type": "integer" } }, "content_name": { "type": "string" }, "content_uri": { "type": "string" }, "editor_address": { "type": "string" }, "initialized": { "type": "boolean" }, "item_index": { "type": "integer" }, "last_tx_hash": { "type": "array", "items": { "type": "integer" } }, "last_tx_lt": { "type": "integer" }, "master_address": { "description": "OwnerAddress *address.Address", "type": "string" }, "mintable": { "type": "boolean" }, "next_item_index": { "type": "integer" }, "owner_address": { "description": "universal column for many contracts", "type": "string" }, "royalty_address": { "type": "string" }, "royalty_base": { "type": "integer" }, "royalty_factor": { "type": "integer" }, "total_supply": { "description": "TODO: pointer here, bun bug", "type": "string", "example": "" }, "types": { "description": "TODO: ContractType here, ch bug", "type": "array", "items": { "type": "string" } } } }, "core.AccountState": { "type": "object", "properties": { "address": { "type": "string" }, "balance": { "type": "integer" }, "code": { "type": "array", "items": { "type": "integer" } }, "code_hash": { "type": "array", "items": { "type": "integer" } }, "data": { "type": "array", "items": { "type": "integer" } }, "data_hash": { "type": "array", "items": { "type": "integer" } }, "depth": { "description": "TODO: do we need it?", "type": "integer" }, "is_active": { "type": "boolean" }, "last_tx_hash": { "type": "array", "items": { "type": "integer" } }, "last_tx_lt": { "type": "integer" }, "latest": { "type": "boolean" }, "state_data": { "$ref": "#/definitions/core.AccountData" }, "state_hash": { "description": "only if account is frozen", "type": "array", "items": { "type": "integer" } }, "status": { "description": "TODO: enum", "type": "string" }, "tick": { "type": "boolean" }, "tock": { "type": "boolean" }, "types": { "description": "TODO: list all get method hashes", "type": "array", "items": { "type": "string" } } } }, "core.Block": { "type": "object", "properties": { "file_hash": { "description": "TODO: []byte here, go-bun bug on has-many", "type": "array", "items": { "type": "integer" } }, "master": { "$ref": "#/definitions/core.BlockID" }, "root_hash": { "type": "array", "items": { "type": "integer" } }, "seq_no": { "type": "integer" }, "shard": { "type": "integer" }, "shards": { "type": "array", "items": { "$ref": "#/definitions/core.Block" } }, "transactions": { "type": "array", "items": { "$ref": "#/definitions/core.Transaction" } }, "workchain": { "type": "integer" } } }, "core.BlockID": { "type": "object", "properties": { "seq_no": { "type": "integer" }, "shard": { "type": "integer" }, "workchain": { "type": "integer" } } }, "core.ContractInterface": { "type": "object", "properties": { "address": { "type": "string" }, "code": { "type": "array", "items": { "type": "integer" } }, "get_methods": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" } } }, "core.ContractOperation": { "type": "object", "properties": { "contract_name": { "type": "string" }, "name": { "type": "string" }, "operation_id": { "type": "integer" }, "outgoing": { "description": "if operation is going from contract", "type": "boolean" }, "schema": { "type": "array", "items": { "type": "integer" } } } }, "core.Message": { "type": "object", "properties": { "amount": { "description": "TODO: uint256", "type": "integer" }, "body": { "type": "array", "items": { "type": "integer" } }, "body_hash": { "type": "array", "items": { "type": "integer" } }, "bounce": { "type": "boolean" }, "bounced": { "type": "boolean" }, "created_at": { "type": "integer" }, "created_lt": { "type": "integer" }, "dst_address": { "type": "string" }, "fwd_fee": { "description": "TODO: uint256", "type": "integer" }, "hash": { "type": "array", "items": { "type": "integer" } }, "ihr_disabled": { "type": "boolean" }, "ihr_fee": { "description": "TODO: uint256", "type": "integer" }, "msg_type": { "description": "TODO: ch enum", "type": "string" }, "operation_id": { "type": "integer" }, "payload": { "$ref": "#/definitions/core.MessagePayload" }, "source": { "$ref": "#/definitions/core.Transaction" }, "source_tx_hash": { "description": "SourceTx initiates outgoing message\nor contract can accept external incoming message in SourceTx", "type": "array", "items": { "type": "integer" } }, "source_tx_lt": { "type": "integer" }, "src_address": { "type": "string" }, "state_init_code": { "type": "array", "items": { "type": "integer" } }, "state_init_data": { "type": "array", "items": { "type": "integer" } }, "transfer_comment": { "type": "string" } } }, "core.MessagePayload": { "type": "object", "properties": { "body_hash": { "type": "array", "items": { "type": "integer" } }, "created_at": { "type": "integer" }, "created_lt": { "type": "integer" }, "data_json": { "type": "string" }, "dst_address": { "type": "string" }, "dst_contract": { "type": "string" }, "hash": { "type": "array", "items": { "type": "integer" } }, "msg_type": { "type": "string" }, "operation_id": { "type": "integer" }, "operation_name": { "type": "string" }, "src_address": { "type": "string" }, "src_contract": { "type": "string" } } }, "core.Transaction": { "type": "object", "properties": { "account": { "$ref": "#/definitions/core.AccountState" }, "address": { "type": "string" }, "block_seq_no": { "type": "integer" }, "block_shard": { "type": "integer" }, "block_workchain": { "type": "integer" }, "created_at": { "type": "integer" }, "created_lt": { "type": "integer" }, "description": { "description": "TODO: parse it (exit code, etc)", "type": "array", "items": { "type": "integer" } }, "end_status": { "type": "string" }, "hash": { "type": "array", "items": { "type": "integer" } }, "in_msg": { "description": "`ch:\"-\" bun:\"rel:belongs-to,join:in_msg_hash=hash\"`", "allOf": [ { "$ref": "#/definitions/core.Message" } ] }, "in_msg_hash": { "type": "array", "items": { "type": "integer" } }, "orig_status": { "type": "string" }, "out_msg": { "type": "array", "items": { "$ref": "#/definitions/core.Message" } }, "prev_tx_hash": { "type": "array", "items": { "type": "integer" } }, "prev_tx_lt": { "type": "integer" }, "state_update": { "type": "array", "items": { "type": "integer" } }, "total_fees": { "description": "`ch:\"type:UInt256\"`", "type": "integer" } } } } }