diff --git a/.gitignore b/.gitignore index d0dba09..43a5109 100644 --- a/.gitignore +++ b/.gitignore @@ -215,8 +215,9 @@ sandbox.ipynb /ton-http-api/src/core/tlb/tokens-tlb.h # build -[Bb][Uu][Ii][Ll][Dd]*/ -sandbox/ +/[Bb][Uu][Ii][Ll][Dd]*/ +/sandbox +/artifacts # vs code .vscode/ @@ -226,3 +227,4 @@ sandbox/ # codegen schemas playground/schemas/ ton-http-api/src/schemas/ +ton-http-api/static/openapi.json diff --git a/Dockerfile b/Dockerfile index c983162..9fb0779 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,6 +37,7 @@ COPY external/ /app/external/ ARG BUILD_WITH_TON_REPO ARG BUILD_WITH_TON_REPO +ARG API_VERSION_TAG RUN if [ -n "${BUILD_WITH_TON_REPO}" ]; then \ echo "Using ton from ${BUILD_WITH_TON_REPO}:${BUILD_WITH_TON_REPO:-master}"; \ rm -rf /app/external/ton/ && \ @@ -47,7 +48,7 @@ RUN if [ -n "${BUILD_WITH_TON_REPO}" ]; then \ WORKDIR /app/build RUN touch /app/suppression_mappings.txt \ - && cmake -DCMAKE_BUILD_TYPE=Release -DTON_USE_STATIC_ZLIB=1 -DUSERVER_USE_STATIC_LIBS=1 -DPORTABLE=1 -GNinja .. \ + && cmake -DCMAKE_BUILD_TYPE=Release -DAPI_VERSION_TAG=${API_VERSION_TAG:-2.1} -DTON_USE_STATIC_ZLIB=1 -DUSERVER_USE_STATIC_LIBS=1 -DPORTABLE=1 -GNinja .. \ && ninja -j$(nproc) # end builder diff --git a/README.md b/README.md index f74eb70..ba31e53 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,19 @@ List of available environment variables: - `THACPP_STATIC_CONTENT_DIR` - directory for static content served by API (default: `"/static/"`) - `THACPP_MAX_STACK_ENTRY_DEPTH` - max stack entry depth for runGetMethod (higher values increase memory usage) (default: `256`) +### Ansible +To deploy a service using Ansible, please follow the instructions: +- Adjust file `ansible/inventory.yaml` to match your environment. +- Adjust file `ansible/vars.json` to match your environment. + - *Important*: encode your `global.config.json` into base64 string and put it into `ton_global_config` var. Possible way to do this: `cat global.config.json | base64 -w0`. + - Use `stack_name` to deploy several installations. + - Use `deploy_path` to specify the path to install the service, the deployment path should be different for each installation. +- Run `ansible-playbook -i ansible/inventory.yaml -e @ansible/vars.json deploy-systemd.yaml` + +Requirements: +- Ubuntu 22.04 or 24.04, builder and worker nodes should run the same version. +- Ansible core 2.20 or higher. + ### Local run - Install dependencies: diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..e446c07 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,4 @@ +[defaults] +host_key_checking=false +allow_world_readable_tmpfiles=true +interpreter_python=auto_silent diff --git a/ansible/api.service.j2 b/ansible/api.service.j2 new file mode 100644 index 0000000..9043a11 --- /dev/null +++ b/ansible/api.service.j2 @@ -0,0 +1,32 @@ +[Unit] +Description={{ stack_name }} API v2++ +After=network-online.target +Wants=network-online.target + +StartLimitIntervalSec={{ service_config.start_limit_interval_sec }} +StartLimitBurst={{ service_config.start_limit_burst }} + +[Service] +Type=simple + +User={{ ansible_user }} +Group={{ ansible_user }} +WorkingDirectory={{ deploy_path }} + +ExecStart={{ deploy_path }}/ton-http-api-cpp --config {{ deploy_path }}/static_config.yaml --config_vars {{ deploy_path }}/config_vars.yaml 2>&1 + +Restart={{ service_config.restart_policy }} +RestartSec={{ service_config.restart_sec }} + +# Graceful shutdown +KillSignal=SIGTERM +TimeoutStopSec=30 + +# Hardening, optional but useful +NoNewPrivileges=true +PrivateTmp=true +ProtectSystem=full +ProtectHome=true + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/ansible/config_vars.yaml.j2 b/ansible/config_vars.yaml.j2 new file mode 100644 index 0000000..76c0325 --- /dev/null +++ b/ansible/config_vars.yaml.j2 @@ -0,0 +1,5 @@ +tonlib_config_path: {{ deploy_path }}/ton_global_config.json +tonlib_keystore_path: {{ deploy_path }}/keystore +static_content_dir: {{ deploy_path }}/static + +{{ config_vars | to_nice_yaml(indent=0, sort_keys=false) }} diff --git a/ansible/healthcheck.service.j2 b/ansible/healthcheck.service.j2 new file mode 100644 index 0000000..0ce5c2a --- /dev/null +++ b/ansible/healthcheck.service.j2 @@ -0,0 +1,7 @@ +[Unit] +Description=Healthcheck for {{ stack_name }}_api_v2pp + +[Service] +Type=oneshot + +ExecStart=/bin/sh -c 'curl -fsS --max-time 5 "http://localhost:{{ config_vars.server_port }}/api/v2/getMasterchainInfo" >/dev/null || systemctl restart {{ stack_name }}_api_v2pp.service' diff --git a/ansible/healthcheck.timer.j2 b/ansible/healthcheck.timer.j2 new file mode 100644 index 0000000..1f7941f --- /dev/null +++ b/ansible/healthcheck.timer.j2 @@ -0,0 +1,10 @@ +[Unit] +Description=Run {{ stack_name }}_api_v2pp healthcheck periodically + +[Timer] +OnBootSec=30 +OnUnitActiveSec=2 +AccuracySec=5 + +[Install] +WantedBy=timers.target diff --git a/ansible/inventory.yaml b/ansible/inventory.yaml new file mode 100644 index 0000000..604c90d --- /dev/null +++ b/ansible/inventory.yaml @@ -0,0 +1,22 @@ +all: + vars: + ansible_user: ubuntu + ansible_ssh_private_key_file: ~/.ssh/id_rsa + hosts: + ubuntu-01: + ansible_host: ubuntu-01.local + ubuntu-02: + ansible_host: ubuntu-02.local + builder-01: + ansible_host: tc-node-02.toncenter.local + children: + builder: + hosts: + builder-01: + mainnet__http_api_cpp: + hosts: + ubuntu-01: + ubuntu-02: + testnet__http_api_cpp: + hosts: + ubuntu-01: diff --git a/ansible/vars.json b/ansible/vars.json new file mode 100644 index 0000000..f2b5a89 --- /dev/null +++ b/ansible/vars.json @@ -0,0 +1,28 @@ +{ + "stack_name": "mainnet", + "deploy_path": "/opt/ton-http-api/mainnet", + "service_config": { + "start_limit_interval_sec": 60, + "restart_sec": 5, + "start_limit_burst": 10, + "restart_policy": "on-failure" + }, + "config_vars": { + "server_port": 8877, + "monitor_port": 8878, + "tonlib_boc_endpoints": [], + "tonlib_threads": 2, + "main_worker_threads": 4, + "fs_worker_threads": 1, + "http_worker_threads": 2, + "log_level": "warning", + "log_format": "json", + "system_log_level": "critical", + "system_log_path": "@stderr", + "jsonrpc_log_level": "critical", + "jsonrpc_log_path": "@stderr", + "http_worker_user_agent": "empty", + "max_stack_entry_depth": 1024 + }, + "ton_global_config": "" +} \ No newline at end of file diff --git a/config/static_config.yaml b/config/static_config.yaml index ca8bca4..46dedb7 100644 --- a/config/static_config.yaml +++ b/config/static_config.yaml @@ -108,6 +108,15 @@ components_manager: dir: $static_content_dir dir#fallback: /app/static/ update-period: 10s + + # + # middlewares + # + default-server-middleware-pipeline-builder: + append: + - version-header-middleware + version-header-middleware: {} + # # api v2 handlers # diff --git a/deploy-docker.yaml b/deploy-docker.yaml new file mode 100644 index 0000000..ec2b1f8 --- /dev/null +++ b/deploy-docker.yaml @@ -0,0 +1,189 @@ +- name: Compute image tag + hosts: localhost + connection: local + gather_facts: false + vars: + repo_dir: "{{ playbook_dir }}" + tasks: + - name: Get short git commit + ansible.builtin.command: git rev-parse --short HEAD + args: + chdir: "{{ repo_dir }}" + register: git_commit_short + changed_when: false + no_log: true + - name: Get tags pointing at current commit + ansible.builtin.command: git tag --points-at HEAD --sort=-creatordate + args: + chdir: "{{ repo_dir }}" + register: git_tags + changed_when: false + no_log: true + - name: Get latest git tag in current history + ansible.builtin.command: git describe --tags --abbrev=0 + args: + chdir: "{{ repo_dir }}" + register: git_latest_tag + changed_when: false + failed_when: false + - name: Set image_tag + ansible.builtin.set_fact: + image_tag: >- + {{ + git_tags.stdout_lines[0] + if git_tags.stdout_lines | length > 0 + else ( + git_latest_tag.stdout + '-' + git_commit_short.stdout + if git_latest_tag.rc == 0 and git_latest_tag.stdout | length > 0 + else git_commit_short.stdout + ) + }} + - name: Show image tag + ansible.builtin.debug: + var: image_tag + +- name: Build TON HTTP API docker image + hosts: builder + gather_facts: true + vars: + image_tag: "{{ hostvars['localhost']['image_tag'] }}" + tasks: + - name: Ensure docker is installed + become: true + ansible.builtin.package: + name: docker + state: present + - name: Create temp workspace + ansible.builtin.tempfile: + state: directory + prefix: ton_http_api_cpp + suffix: "_{{ image_tag }}" + register: build_dir + - block: + - name: Copy project to builder from . to {{ build_dir.path }} with rsync + ansible.builtin.synchronize: + src: "{{ playbook_dir }}/" + dest: "{{ build_dir.path }}" + rsync_opts: + - "--exclude=.git" + - "--exclude={{ playbook_dir }}/artifacts" + - "--exclude={{ playbook_dir }}/private" + - "--exclude={{ playbook_dir }}/build" + - "--exclude={{ playbook_dir }}/sandbox" + recursive: true + delete: false + - name: Ensure output directory + ansible.builtin.file: + path: "{{ build_dir.path }}/images" + state: directory + mode: '0755' + - name: Build docker image + community.docker.docker_image_build: + name: "{{ stack_name }}_http_api_cpp" + tag: "{{ image_tag }}" + path: "{{ build_dir.path }}" + dockerfile: Dockerfile + target: http-api-cpp + rebuild: always + - name: Export docker image + community.docker.docker_image_export: + names: + - "{{ stack_name }}_http_api_cpp:{{ image_tag }}" + path: "{{ build_dir.path }}/images/{{ stack_name }}_{{ image_tag }}.tar" + - name: Collect artifacts + ansible.builtin.fetch: + src: "{{ build_dir.path }}/images/{{ item }}" + dest: "artifacts/" + flat: true + loop: + - "{{ stack_name }}_{{ image_tag }}.tar" + always: + - name: Cleanup workspace + ansible.builtin.file: + path: "{{ build_dir.path }}" + state: absent + +- name: Deploy TON HTTP API docker image + hosts: "{{ stack_name }}__http_api_cpp" + tags: [deploy] + vars: + image_tag: "{{ hostvars['localhost']['image_tag'] }}" + tasks: + - name: Ensure docker is installed + become: true + ansible.builtin.package: + name: docker + state: present + - name: Ensure deploy directory + become: true + ansible.builtin.file: + path: "{{ deploy_path }}" + state: directory + mode: '0755' + owner: "{{ ansible_user }}" + group: "{{ ansible_user }}" + - name: Copy docker image + ansible.builtin.copy: + src: "artifacts/{{ stack_name }}_{{ image_tag }}.tar" + dest: "{{ deploy_path }}/images/" + - name: Load docker image + community.docker.docker_image_load: + path: "{{ deploy_path }}/images/{{ stack_name }}_{{ image_tag }}.tar" + register: docker_image + - name: Render config file + ansible.builtin.copy: + dest: "{{ deploy_path }}/ton_global_config.json" + content: "{{ ton_global_config | to_nice_json }}" + mode: "0644" + - name: Run docker container + community.docker.docker_container: + name: "{{ stack_name }}_http_api_cpp" + image: "{{ stack_name }}_http_api_cpp:{{ image_tag }}" + env: + "THACPP_TONLIB_CONFIG_PATH": "/ton_global_config.json" + "THACPP_TONLIB_KEYSTORE_PATH": "/tmp" + "THACPP_TONLIB_BOC_ENDPOINTS": "{{ config.get('tonlib_boc_endpoints', []) | to_json }}" + "THACPP_TONLIB_THREADS": "{{ config.get('tonlib_threads', 4) | string }}" + "THACPP_MAIN_WORKER_THREADS": "{{ config.get('main_worker_threads', 4) | string }}" + "THACPP_FS_WORKER_THREADS": "{{ config.get('fs_worker_threads', 1) | string }}" + "THACPP_HTTP_WORKER_THREADS": "{{ config.get('http_worker_threads', 2) | string }}" + "THACPP_LOG_LEVEL": "{{ config.get('log_level', 'warning') | string }}" + "THACPP_LOG_PATH": "{{ config.get('log_path', '@stdout') | string }}" + "THACPP_SYSTEM_LOG_LEVEL": "{{ config.get('system_log_level', 'critical') | string }}" + "THACPP_SYSTEM_LOG_PATH": "{{ config.get('system_log_path', '/logs/system.log') | string }}" + "THACPP_JSONRPC_LOG_LEVEL": "{{ config.get('jsonrpc_log_level', 'info') | string }}" + "THACPP_JSONRPC_LOG_PATH": "{{ config.get('jsonrpc_log_path', '/logs/jsonrpc.log') | string }}" + "THACPP_LOG_FORMAT": "{{ config.get('log_format', 'json') | string }}" + "THACPP_HTTP_WORKER_USER_AGENT": "{{ config.get('http_worker_user_agent', 'ton-http-api-cpp') | string }}" + "THACPP_STATIC_CONTENT_DIR": "{{ config.get('static_content_dir', '/static') | string }}" + "THACPP_MAX_STACK_ENTRY_DEPTH": "{{ config.get('max_stack_entry_depth', 1000) | string }} " + volumes: + - "{{ deploy_path }}/ton_global_config.json:/ton_global_config.json" + - "{{ deploy_path }}/logs:/logs" + healthy_wait_timeout: 20 + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:8081/api/v2/healthcheck || exit 1"] + interval: 3s + retries: 3 + state: healthy + restart_policy: unless-stopped + detach: true + labels: + autoheal: 1 + ulimits: + - "memlock:-1" + - "stack:-1" + - "core:-1" + published_ports: + - "0.0.0.0:{{ api_port }}:8081" + - "0.0.0.0:{{ monitoring_port }}:8082" + - name: Ensure autoheal container + community.docker.docker_container: + name: "autoheal" + image: "willfarrell/autoheal" + env: + AUTOHEAL_CONTAINER_LABEL: autoheal + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + restart_policy: always + detach: true diff --git a/deploy-systemd.yaml b/deploy-systemd.yaml new file mode 100644 index 0000000..230b612 --- /dev/null +++ b/deploy-systemd.yaml @@ -0,0 +1,516 @@ +- name: Install dependencies on a builder + hosts: builder + tags: [prepare] + become: true + gather_facts: true + vars: + llvm_version: "21" + ubuntu_llvm_repo_releases: + "22.04": jammy + "24.04": noble + "26.04": resolute + clang_packages_by_ubuntu_version: + "22.04": + - "clang-{{ llvm_version }}" + - "clangd-{{ llvm_version }}" + - "clang-format-{{ llvm_version }}" + - "clang-tidy-{{ llvm_version }}" + - "lld-{{ llvm_version }}" + - "lldb-{{ llvm_version }}" + "24.04": + - "clang-{{ llvm_version }}" + - "clangd-{{ llvm_version }}" + - "clang-format-{{ llvm_version }}" + - "clang-tidy-{{ llvm_version }}" + - "lld-{{ llvm_version }}" + - "lldb-{{ llvm_version }}" + "26.04": + - clang + - clangd + - clang-format + - clang-tidy + - lld + - lldb + packages: + "common": + - libcctz-dev + - libxxhash-dev + - libsqlite3-dev + - python3-dev + - pkg-config + - lsb-release + - libre2-dev + - protobuf-compiler-grpc + - clang + - libsodium-dev + - libgmock-dev + - libsasl2-dev + - libhiredis-dev + - libpq-dev + - unixodbc-dev + - libgslcblas0 + - libmongoc-dev + - clang-format + - python3-protobuf + - libcrypto++-dev + - openssl + - libdouble-conversion-dev + - ragel + - libabsl-dev + - libjemalloc-dev + - libidn11-dev + - libssl-dev + - libzstd-dev + - libnghttp2-dev + - libgflags-dev + - zlib1g-dev + - libstdc++-12-dev + - libc6-dev + - wget + - libblas-dev + - gcc + - libpugixml-dev + - libsnappy-dev + - gperf + - netbase + - libyaml-cpp-dev + - g++ + - ccache + - git + - gdb + - build-essential + - libprotoc-dev + - libbenchmark-dev + - libbson-dev + - python3-venv + - libtool + - libkrb5-dev + - cmake-format + - libgtest-dev + - libev-dev + - odbc-postgresql + - libfmt-dev + - libmariadb-dev + - liblzma-dev + - python3-jinja2 + - yasm + - gnupg + - libgrpc-dev + - libcurl4-openssl-dev + - cmake + - software-properties-common + - libmicrohttpd-dev + - libldap2-dev + - python3-voluptuous + - libgsl-dev + - automake + - libgrpc++-dev + - libbz2-dev + - python3-yaml + - libc-ares-dev + - liblz4-dev + - librdkafka-dev + - curl + - ninja-build + - autoconf + - ccache + "22.04": + - libboost-stacktrace1.74-dev + - libgrpc++1 + - libboost1.74-dev + - libboost-program-options1.74-dev + - postgresql-server-dev-14 + - libboost-context1.74-dev + - libboost-filesystem1.74-dev + - libboost-iostreams1.74-dev + - libboost-coroutine1.74-dev + - libboost-locale1.74-dev + - libicu-dev + "24.04": + - librocksdb-dev + - libboost-program-options1.83-dev + - libboost1.83-dev + - libboost-context1.83-dev + - libssh2-1-dev + - libboost-filesystem1.83-dev + - libboost-iostreams1.83-dev + - libboost-stacktrace1.83-dev + - postgresql-server-dev-16 + - libboost-coroutine1.83-dev + - libboost-regex1.83-dev + - libyaml-cpp0.8 + - libboost-locale1.83-dev + - libjemalloc2 + "26.04": [] + tasks: + - name: Fail on non-Ubuntu systems + ansible.builtin.fail: + msg: "This role supports Ubuntu only" + when: ansible_facts.distribution != "Ubuntu" + - name: Fail on unsupported Ubuntu version + ansible.builtin.fail: + msg: "Unsupported Ubuntu version: {{ ansible_facts.distribution_version }}" + when: ansible_facts.distribution_version not in clang_packages_by_ubuntu_version +# - name: Install packages needed for external APT repos +# ansible.builtin.apt: +# name: +# - ca-certificates +# - gnupg +# state: present +# update_cache: true +# when: ansible_facts.distribution_version in ubuntu_llvm_repo_releases +# - name: Create APT keyrings directory +# ansible.builtin.file: +# path: /etc/apt/keyrings +# state: directory +# mode: "0755" +# when: ansible_facts.distribution_version in ubuntu_llvm_repo_releases +# - name: Add apt.llvm.org signing key +# ansible.builtin.get_url: +# url: https://apt.llvm.org/llvm-snapshot.gpg.key +# dest: /etc/apt/keyrings/apt.llvm.org.asc +# mode: "0644" +# when: ansible_facts.distribution_version in ubuntu_llvm_repo_releases +# - name: Add apt.llvm.org repository for Clang 21 +# ansible.builtin.apt_repository: +# repo: >- +# deb [signed-by=/etc/apt/keyrings/apt.llvm.org.asc] +# http://apt.llvm.org/{{ ubuntu_llvm_repo_releases[ansible_facts.distribution_version] }}/ +# llvm-toolchain-{{ ubuntu_llvm_repo_releases[ansible_facts.distribution_version] }}-{{ llvm_version }} +# main +# filename: "llvm-toolchain-{{ ubuntu_llvm_repo_releases[ansible_facts.distribution_version] }}-{{ llvm_version }}" +# state: present +# update_cache: true +# when: ansible_facts.distribution_version in ubuntu_llvm_repo_releases +# - name: Install Clang packages +# ansible.builtin.apt: +# name: "{{ clang_packages_by_ubuntu_version[ansible_facts.distribution_version] }}" +# state: present +# update_cache: true + - name: Debug + ansible.builtin.debug: + msg: "{{ packages['common'] + packages[ansible_facts['distribution_version']] }}" + - name: Install Ubuntu 22.04 packages + ansible.builtin.apt: + name: "{{ packages['common'] + packages['22.04'] }}" + state: present + update_cache: true + when: + - ansible_facts.distribution == "Ubuntu" + - ansible_facts.distribution_version == "22.04" + - name: Install Ubuntu 24.04 packages + ansible.builtin.apt: + name: "{{ packages['common'] + packages['24.04'] }}" + state: present + update_cache: true + when: + - ansible_facts['distribution'] == "Ubuntu" + - ansible_facts.distribution_version == "24.04" + - name: Install Ubuntu 26.04 packages + ansible.builtin.apt: + name: "{{ packages['common'] + packages['26.04'] }}" + state: present + update_cache: true + when: + - ansible_facts.distribution == "Ubuntu" + - ansible_facts.distribution_version == "26.04" + +- name: Compute version tag + hosts: localhost + connection: local + gather_facts: false + vars: + repo_dir: "{{ playbook_dir }}" + tasks: + - name: Get short git commit + ansible.builtin.command: git rev-parse --short HEAD + args: + chdir: "{{ repo_dir }}" + register: git_commit_short + changed_when: false + no_log: true + - name: Get tags pointing at current commit + ansible.builtin.command: git tag --points-at HEAD --sort=-creatordate + args: + chdir: "{{ repo_dir }}" + register: git_tags + changed_when: false + no_log: true + - name: Get latest git tag in current history + ansible.builtin.command: git describe --tags --abbrev=0 + args: + chdir: "{{ repo_dir }}" + register: git_latest_tag + changed_when: false + failed_when: false + - name: Set version_tag + ansible.builtin.set_fact: + version_tag: >- + {{ + git_tags.stdout_lines[0] + if git_tags.stdout_lines | length > 0 + else ( + git_latest_tag.stdout + '-' + git_commit_short.stdout + if git_latest_tag.rc == 0 and git_latest_tag.stdout | length > 0 + else git_commit_short.stdout + ) + }} + - name: Show version tag + ansible.builtin.debug: + var: version_tag + +- name: Build TON HTTP API binary + hosts: builder + tags: [build] + gather_facts: true + vars: + version_tag: "{{ hostvars['localhost']['version_tag'] }}" + tasks: + - name: Ensure shared caches exist + ansible.builtin.file: + path: "{{ item }}" + state: directory + mode: "0775" + loop: + - "{{ ansible_facts.env.HOME }}/.cache/ccache" + - "{{ ansible_facts.env.HOME }}/.cache/go-build" + - "{{ ansible_facts.env.HOME }}/.cache/gomod" + - name: Create temp workspace + ansible.builtin.tempfile: + state: directory + prefix: ton_http_api_cpp + suffix: "_{{ version_tag }}" + register: build_dir +# - name: Create temp workspace +# ansible.builtin.file: +# path: '/tmp/ton-http-api_build_debug' +# state: directory +# - name: Set build_dir +# ansible.builtin.set_fact: +# build_dir: +# path: '/tmp/ton-http-api_build_debug' + - block: + - name: Copy project to builder from . to {{ build_dir.path }} with rsync + ansible.builtin.synchronize: + src: "{{ playbook_dir }}/" + dest: "{{ build_dir.path }}" + rsync_opts: + - "--exclude=.git/" + - "--exclude=/artifacts/" + - "--exclude=/private/" + - "--exclude=/build/" + - "--exclude=/sandbox/" + - "--exclude=/ton-http-api/src/schemas/" + - "--exclude=/ton-http-api/static/openapi.json" + recursive: true + delete: false + - name: Ensure output directory + ansible.builtin.file: + path: "{{ build_dir.path }}/build" + state: directory + mode: '0755' + - name: Ensure artifacts directory + ansible.builtin.file: + path: "{{ build_dir.path }}/artifacts" + state: directory + mode: '0755' + - name: Build project + ansible.builtin.shell: | + set -e + touch {{ build_dir.path }}/suppression_mappings.txt + cmake -DCMAKE_BUILD_TYPE=Release \ + -S . -B "{{ build_dir.path }}/build" \ + -G Ninja -DPORTABLE=1 -DTON_ARCH= \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DAPI_VERSION_TAG={{ version_tag }} \ + -DTON_USE_STATIC_ZLIB=1 \ + -DUSERVER_DISABLE_PHDR_CACHE=1 \ + -DUSERVER_USE_STATIC_LIBS=1 \ + -DTONLIB_MULTICLIENT_EXAMPLES=0 \ + -DUSERVER_FEATURE_STACK_USAGE_MONITOR=0 \ + -DUSERVER_FEATURE_CRYPTOPP_BASE64_URL=1 \ + -DUSERVER_FEATURE_CRYPTOPP_BLAKE2=0 \ + -DBUILD_TON_PLAYGROUND=0 \ + -DPY_TONLIB_MULTICLIENT=0 \ + -DTONLIB_MULTICLIENT_EXAMPLES=0 \ + -DTON_USE_JEMALLOC=1 > {{ build_dir.path }}/artifacts/cmake.log 2>&1 + cmake --build "{{ build_dir.path }}/build" \ + --parallel {{ ansible_facts.processor_vcpus | default(2) }} \ + --target ton-http-api-cpp > {{ build_dir.path }}/artifacts/build.log 2>&1 + args: + chdir: "{{ build_dir.path }}" + environment: + CCACHE_DIR: "{{ ansible_facts.env.HOME }}/.cache/ccache" + CCACHE_BASEDIR: "{{ build_dir.path }}" + CCACHE_SLOPPINESS: "file_macro" + CC: clang-21 + CXX: clang++-21 + - name: Collect artifacts + ansible.builtin.fetch: + src: "{{ build_dir.path }}/{{ item }}" + dest: "artifacts/" + flat: true + loop: + - "build/ton-http-api/ton-http-api-cpp" + - "ton-http-api/static/openapi.json" + always: + - name: Collect logs + ansible.builtin.fetch: + src: "{{ build_dir.path }}/artifacts/{{ item }}" + dest: "artifacts/" + flat: true + loop: + - build.log + - cmake.log + - name: Cleanup workspace + ansible.builtin.file: + path: "{{ build_dir.path }}" + state: absent + +- name: Deploy TON HTTP API + hosts: "{{ stack_name }}__http_api_cpp" + tags: [deploy] + vars: + version_tag: "{{ hostvars['localhost']['version_tag'] }}" + packages: + "22.04": + - curl + - libcurl4 + - libfmt8 + - libsodium23 + - libcctz2 + - libatomic1 + - libicu70 + "24.04": + - curl + - libcurl4 + - libfmt9 + - libsodium23 + - libcctz2 + - libatomic1 + - libicu74 + "26.04": + - curl + - libcurl4 + - libfmt10 + - libsodium23 + - libcctz2.4 + - libatomic1 + - libicu78 + tasks: + - name: Ensure libraries are installed + become: true + ansible.builtin.package: + name: "{{ packages[ansible_facts['distribution_version']] }}" + state: present + update_cache: true + - name: Ensure deploy directory + become: true + ansible.builtin.file: + path: "{{ deploy_path }}" + state: directory + mode: '0755' + owner: "{{ ansible_user }}" + group: "{{ ansible_user }}" + - name: Copy static files + ansible.builtin.copy: + src: "{{ playbook_dir }}/ton-http-api/static/" + dest: "{{ deploy_path }}/static/" + owner: "{{ ansible_user }}" + group: "{{ ansible_user }}" + force: true + notify: Restart service + - name: Copy openapi.json + ansible.builtin.copy: + src: "{{ playbook_dir }}/artifacts/openapi.json" + dest: "{{ deploy_path }}/static/" + owner: "{{ ansible_user }}" + group: "{{ ansible_user }}" + force: true + notify: Restart service + - name: Copy binary + ansible.builtin.copy: + src: "{{ playbook_dir }}/artifacts/ton-http-api-cpp" + dest: "{{ deploy_path }}/ton-http-api-cpp" + owner: "{{ ansible_user }}" + group: "{{ ansible_user }}" + mode: '0755' + force: true + notify: Restart service + - name: Copy static config + ansible.builtin.copy: + src: "{{ playbook_dir }}/config/static_config.yaml" + dest: "{{ deploy_path }}/static_config.yaml" + owner: "{{ ansible_user }}" + group: "{{ ansible_user }}" + force: true + mode: '0644' + notify: Restart service + - name: Render blockchain global config + ansible.builtin.copy: + dest: "{{ deploy_path }}/ton_global_config.json" + content: "{{ ton_global_config | b64decode }}" + mode: "0644" + - name: Render config vars + ansible.builtin.template: + dest: "{{ deploy_path }}/config_vars.yaml" + src: "{{ playbook_dir }}/ansible/config_vars.yaml.j2" + owner: "{{ ansible_user }}" + group: "{{ ansible_user }}" + mode: "0644" + notify: Restart service + - name: Render systemd unit + ansible.builtin.template: + dest: "/etc/systemd/system/{{ stack_name }}_api_v2pp.service" + src: "{{ playbook_dir }}/ansible/api.service.j2" + owner: root + group: root + mode: "0644" + become: true + notify: + - Reload systemd + - Restart service + - name: Render healthcheck service + ansible.builtin.template: + src: "{{ playbook_dir }}/ansible/healthcheck.service.j2" + dest: "/etc/systemd/system/{{ stack_name }}_api_v2pp_healthcheck.service" + owner: root + group: root + mode: "0644" + become: true + notify: Reload systemd + - name: Render healthcheck timer + ansible.builtin.template: + src: "{{ playbook_dir }}/ansible/healthcheck.timer.j2" + dest: "/etc/systemd/system/{{ stack_name }}_api_v2pp_healthcheck.timer" + owner: root + group: root + mode: "0644" + become: true + notify: Reload systemd + - name: Enable and start service with healthcheck + ansible.builtin.systemd: + name: "{{ item }}" + enabled: true + state: started + daemon_reload: true + force: true + become: true + loop: + - "{{ stack_name }}_api_v2pp.service" + - "{{ stack_name }}_api_v2pp_healthcheck.timer" + handlers: + - name: Reload systemd + ansible.builtin.systemd: + daemon_reload: true + become: true + - name: Restart service + ansible.builtin.systemd: + name: "{{ item }}" + state: restarted + force: true + become: true + loop: + - "{{ stack_name }}_api_v2pp.service" + - "{{ stack_name }}_api_v2pp_healthcheck.timer" diff --git a/ton-http-api/CMakeLists.txt b/ton-http-api/CMakeLists.txt index d7efc71..44c6668 100644 --- a/ton-http-api/CMakeLists.txt +++ b/ton-http-api/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.16) project(ton-http-api-cpp CXX) +set(API_VERSION_TAG "2.1" CACHE STRING "API Version tag") +message("-- API version tag ${API_VERSION_TAG}") + userver_setup_environment() # userver custom types @@ -48,8 +51,8 @@ find_package(Python3 COMPONENTS Interpreter REQUIRED) add_custom_command( OUTPUT "${OPENAPI_JSON}" COMMAND "${Python3_EXECUTABLE}" -c - "import sys, json; import yaml; json.dump(yaml.safe_load(open(sys.argv[1],'r',encoding='utf-8')), open(sys.argv[2],'w',encoding='utf-8'), indent=2, ensure_ascii=False)" - "${OPENAPI_YAML}" "${OPENAPI_JSON}" + "import sys, json; import yaml; data = yaml.safe_load(open(sys.argv[1],'r',encoding='utf-8')); data['info']['version'] = sys.argv[3]; json.dump(data, open(sys.argv[2],'w',encoding='utf-8'), indent=2, ensure_ascii=False)" + "${OPENAPI_YAML}" "${OPENAPI_JSON}" "${API_VERSION_TAG}" DEPENDS "${OPENAPI_YAML}" VERBATIM ) @@ -120,14 +123,16 @@ set(TON_HTTP_API_CPP_SOURCE src/handlers/send/EstimateFeeHandler.cpp src/handlers/runmethod/RunGetMethodHandler.cpp src/handlers/accounts/GetShardAccountCellHandler.cpp - src/handlers/accounts/GetShardAccountCellHandler.h + src/middleware/VersionHeaderMiddleware.cpp ) add_executable(${PROJECT_NAME} ${TON_HTTP_API_CPP_SOURCE}) +configure_file(src/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/.. PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../external/userver PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../external/ton + PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/ ) add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}-tlbgen ${PROJECT_NAME}-chgen ${PROJECT_NAME}-openapi-gen) diff --git a/ton-http-api/src/handlers/TonlibRequestHandler.h b/ton-http-api/src/handlers/TonlibRequestHandler.h index 79f7419..bcee27a 100644 --- a/ton-http-api/src/handlers/TonlibRequestHandler.h +++ b/ton-http-api/src/handlers/TonlibRequestHandler.h @@ -1,4 +1,8 @@ #pragma once +#include +#include +#include + #include "components/TonlibComponent.h" #include "schemas/v2.hpp" #include "userver/cache/expirable_lru_cache.hpp" @@ -10,9 +14,6 @@ #include "userver/yaml_config/merge_schemas.hpp" #include "utils/exceptions.hpp" -#include -#include - // check std::variant template struct is_variant : std::false_type {}; @@ -42,8 +43,8 @@ class TonlibRequestHandler : public userver::server::handlers::HttpHandlerBase { using HttpRequest = userver::server::http::HttpRequest; using RequestContext = userver::server::request::RequestContext; - static constexpr std::string kSession = "session"; - static constexpr std::string kRequest = "request"; + static constexpr std::string_view kSession{"session"}; + static constexpr std::string_view kRequest{"request"}; struct Hash { std::size_t operator()(const Request& request) const noexcept { @@ -70,13 +71,13 @@ class TonlibRequestHandler : public userver::server::handlers::HttpHandlerBase { void ParseTonlibRequestThrow(const HttpRequest& request, RequestContext& context) const { if (request.GetMethod() == userver::server::http::HttpMethod::kGet) { try { - context.SetData(kRequest, ParseTonlibGetRequest(request, context)); + context.SetData(std::string{kRequest}, ParseTonlibGetRequest(request, context)); } catch (std::exception& exc) { throw utils::TonlibException(std::string("failed to parse get request: ") + exc.what(), 422); } } else if (request.GetMethod() == userver::server::http::HttpMethod::kPost) { try { - context.SetData(kRequest, ParseTonlibPostRequest(request, context)); + context.SetData(std::string{kRequest}, ParseTonlibPostRequest(request, context)); } catch (std::exception& exc) { throw utils::TonlibException(std::string("failed to parse post request: ") + exc.what(), 422); } @@ -160,7 +161,7 @@ class TonlibRequestHandler : public userver::server::handlers::HttpHandlerBase { std::string HandleRequestThrow(const HttpRequest& request, RequestContext& context) const override { auto session = tonlib_component_.GetNewSession(); - context.SetData(kSession, session); + context.SetData(std::string{kSession}, session); // parse request try { diff --git a/ton-http-api/src/main.cpp b/ton-http-api/src/main.cpp index 6002d7c..4713db2 100644 --- a/ton-http-api/src/main.cpp +++ b/ton-http-api/src/main.cpp @@ -44,6 +44,7 @@ #include "handlers/utils/DetectHashHandler.h" #include "handlers/utils/PackAddressHandler.h" #include "handlers/utils/UnpackAddressHandler.h" +#include "middleware/VersionHeaderMiddleware.h" #include "userver/clients/http/middlewares/pipeline_component.hpp" @@ -65,6 +66,8 @@ int main(int argc, char* argv[]) { component_list.Append(); component_list.Append(); component_list.Append(); + // middlewares + component_list.Append(); // // api handlers // diff --git a/ton-http-api/src/middleware/VersionHeaderMiddleware.cpp b/ton-http-api/src/middleware/VersionHeaderMiddleware.cpp new file mode 100644 index 0000000..65bc563 --- /dev/null +++ b/ton-http-api/src/middleware/VersionHeaderMiddleware.cpp @@ -0,0 +1,9 @@ +#include "VersionHeaderMiddleware.h" +#include "version.h" + +void ton_http::middleware::VersionHeaderMiddleware::HandleRequest( + userver::server::http::HttpRequest& request, userver::server::request::RequestContext& context +) const { + Next(request, context); + request.GetHttpResponse().SetHeader(kApiVersionHeader, std::string{Version}); +} \ No newline at end of file diff --git a/ton-http-api/src/middleware/VersionHeaderMiddleware.h b/ton-http-api/src/middleware/VersionHeaderMiddleware.h new file mode 100644 index 0000000..8575b43 --- /dev/null +++ b/ton-http-api/src/middleware/VersionHeaderMiddleware.h @@ -0,0 +1,19 @@ +#pragma once +#include "userver/http/predefined_header.hpp" +#include "userver/server/middlewares/http_middleware_base.hpp" +#include "userver/server/handlers/http_handler_base.hpp" + +namespace ton_http::middleware { +class VersionHeaderMiddleware final : public userver::server::middlewares::HttpMiddlewareBase { +public: + static constexpr std::string_view kName{"version-header-middleware"}; + explicit VersionHeaderMiddleware(const userver::server::handlers::HttpHandlerBase&) {} +private: + void HandleRequest( + userver::server::http::HttpRequest& request, userver::server::request::RequestContext& context + ) const override; + static constexpr userver::http::headers::PredefinedHeader kApiVersionHeader{"X-API-Version"}; +}; + +using VersionHeaderMiddlewareFactory = userver::server::middlewares::SimpleHttpMiddlewareFactory; +} diff --git a/ton-http-api/src/version.h.in b/ton-http-api/src/version.h.in new file mode 100644 index 0000000..2dc1039 --- /dev/null +++ b/ton-http-api/src/version.h.in @@ -0,0 +1,6 @@ +#pragma once +#include + +namespace ton_http { +static constexpr std::string_view Version="@API_VERSION_TAG@"; +} \ No newline at end of file diff --git a/ton-http-api/static/openapi.json b/ton-http-api/static/openapi.json deleted file mode 100644 index 611866e..0000000 --- a/ton-http-api/static/openapi.json +++ /dev/null @@ -1,7019 +0,0 @@ -{ - "openapi": "3.1.1", - "info": { - "title": "TON HTTP API C++", - "description": "This API enables HTTP access to TON blockchain - getting accounts and wallets information, looking up blocks and transactions, sending messages to the blockchain, calling get methods of smart contracts, and more.\n\nIn addition to REST API, all methods are available through [JSON-RPC endpoint](#json%20rpc) with `method` equal to method name and `params` passed as a dictionary.\n\nThe response contains a JSON object, which always has a boolean field `ok` and either `error` or `result`. If `ok` equals true, the request was successful and the result of the query can be found in the `result` field. In case of an unsuccessful request, `ok` equals false and the error is explained in the `error`.\n\nAPI Key should be sent either as `api_key` query parameter or `X-API-Key` header\n", - "version": "2.1.11" - }, - "paths": { - "/api/v2/jsonRPC": { - "post": { - "tags": [ - "rpc" - ], - "summary": "JSON-RPC endpoint", - "description": "Endpoint for JSON-RPC requests", - "operationId": "jsonRPC_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JsonRpcRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/detectAddress": { - "get": { - "tags": [ - "utils" - ], - "summary": "Detect address", - "description": "Get all possible address forms", - "operationId": "detectAddress_get", - "parameters": [ - { - "$ref": "#/components/parameters/address" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Detect address", - "description": "Get all possible address forms", - "operationId": "detectAddress_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DetectAddressRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/detectHash": { - "get": { - "tags": [ - "utils" - ], - "summary": "Detect hash", - "description": "Get all possible hash forms", - "operationId": "detectHash_get", - "parameters": [ - { - "$ref": "#/components/parameters/hash" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Detect hash", - "description": "Get all possible hash forms", - "operationId": "detectHash_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DetectHashRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/packAddress": { - "get": { - "tags": [ - "utils" - ], - "summary": "Pack address", - "description": "Pack address to base64 form", - "operationId": "packAddress_get", - "parameters": [ - { - "$ref": "#/components/parameters/address" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Pack address", - "description": "Pack address to base64 form", - "operationId": "packAddress_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PackAddressRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/unpackAddress": { - "get": { - "tags": [ - "utils" - ], - "summary": "Unpack address", - "description": "Unpack address from base64 form", - "operationId": "unpackAddress_get", - "parameters": [ - { - "$ref": "#/components/parameters/address" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Unpack address", - "description": "Unpack address from base64 form", - "operationId": "unpackAddress_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnpackAddressRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getAddressInformation": { - "get": { - "tags": [ - "accounts" - ], - "summary": "Get Address Information", - "description": "Get basic information about address", - "operationId": "getAddressInformation_get", - "parameters": [ - { - "$ref": "#/components/parameters/address" - }, - { - "$ref": "#/components/parameters/seqnoOptional" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Address Information", - "description": "Get basic information about address", - "operationId": "getAddressInformation_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddressInformationRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getExtendedAddressInformation": { - "get": { - "tags": [ - "accounts" - ], - "summary": "Get Extended Address Information", - "description": "Get extended information about address", - "operationId": "getExtendedAddressInformation_get", - "parameters": [ - { - "$ref": "#/components/parameters/address" - }, - { - "$ref": "#/components/parameters/seqnoOptional" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Extended Address Information", - "description": "Get extended information about address", - "operationId": "getExtendedAddressInformation_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExtendedAddressInformationRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getShardAccountCell": { - "get": { - "tags": [ - "accounts" - ], - "summary": "Get Shard Address Cell", - "description": "Get raw TVM cell with shard account", - "operationId": "getShardAccountCell_get", - "parameters": [ - { - "$ref": "#/components/parameters/address" - }, - { - "$ref": "#/components/parameters/seqnoOptional" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Shard Address Cell", - "description": "Get raw TVM cell with shard account", - "operationId": "getShardAccountCell_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ShardAccountCellRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getWalletInformation": { - "get": { - "tags": [ - "accounts" - ], - "summary": "Get Wallet Information", - "description": "Get wallet-specific information about address", - "operationId": "getWalletInformation_get", - "parameters": [ - { - "$ref": "#/components/parameters/address" - }, - { - "$ref": "#/components/parameters/seqnoOptional" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Wallet Information", - "description": "Get wallet-specific information about address", - "operationId": "getWalletInformation_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WalletInformationRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getAddressBalance": { - "get": { - "tags": [ - "accounts" - ], - "summary": "Get Address Balance", - "description": "Get address balance in nanotons", - "operationId": "getAddressBalance_get", - "parameters": [ - { - "$ref": "#/components/parameters/address" - }, - { - "$ref": "#/components/parameters/seqnoOptional" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Address Balance", - "description": "Get address balance in nanotons", - "operationId": "getAddressBalance_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddressBalanceRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getAddressState": { - "get": { - "tags": [ - "accounts" - ], - "summary": "Get Address State", - "description": "Get address state (active, uninitialized or frozen)", - "operationId": "getAddressState_get", - "parameters": [ - { - "$ref": "#/components/parameters/address" - }, - { - "$ref": "#/components/parameters/seqnoOptional" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Address State", - "description": "Get address state (active, uninitialized or frozen)", - "operationId": "getAddressState_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddressStateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getTokenData": { - "get": { - "tags": [ - "accounts" - ], - "summary": "Get Token Data", - "description": "Get Jetton/NFT metadata from token smart contract", - "operationId": "getTokenData_get", - "parameters": [ - { - "$ref": "#/components/parameters/address" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Token Data", - "description": "Get Jetton/NFT metadata from token smart contract", - "operationId": "getTokenData_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TokenDataRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getMasterchainInfo": { - "get": { - "tags": [ - "blocks" - ], - "summary": "Get Masterchain Info", - "description": "Get up-to-date masterchain state", - "operationId": "getMasterchainInfo_get", - "parameters": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Masterchain Info", - "description": "Get up-to-date masterchain state", - "operationId": "getMasterchainInfo_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MasterchainInfoRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getMasterchainBlockSignatures": { - "get": { - "tags": [ - "blocks" - ], - "summary": "Get Masterchain Block Signatures", - "description": "Get signatures of validators for masterchain block", - "operationId": "getMasterchainBlockSignatures_get", - "parameters": [ - { - "$ref": "#/components/parameters/seqno" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Masterchain Block Signatures", - "description": "Get signatures of validators for masterchain block", - "operationId": "getMasterchainBlockSignatures_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MasterchainBlockSignaturesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getShardBlockProof": { - "get": { - "tags": [ - "blocks" - ], - "summary": "Get Shard Block Proof", - "description": "Get merkle proof of shard block", - "operationId": "getShardBlockProof_get", - "parameters": [ - { - "$ref": "#/components/parameters/workchain" - }, - { - "$ref": "#/components/parameters/shard" - }, - { - "$ref": "#/components/parameters/seqno" - }, - { - "name": "from_seqno", - "in": "query", - "description": "Seqno of masterchain block starting from which proof is required. If not specified latest masterchain block is used", - "required": false, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Shard Block Proof", - "description": "Get merkle proof of shard block", - "operationId": "getShardBlockProof_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ShardBlockProofRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getConsensusBlock": { - "get": { - "tags": [ - "blocks" - ], - "summary": "Get Consensus Block", - "description": "Get block that was confirmed by consensus", - "operationId": "getConsensusBlock_get", - "parameters": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Consensus Block", - "description": "Get block that was confirmed by consensus", - "operationId": "getConsensusBlock_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConsensusBlockRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/lookupBlock": { - "get": { - "tags": [ - "blocks" - ], - "summary": "Lookup Block", - "description": "Look up block by seqno, shard and workchain", - "operationId": "lookupBlock_get", - "parameters": [ - { - "$ref": "#/components/parameters/workchain" - }, - { - "$ref": "#/components/parameters/shard" - }, - { - "$ref": "#/components/parameters/seqnoOptional" - }, - { - "name": "lt", - "in": "query", - "description": "Logical time of a block", - "required": false, - "schema": { - "type": "string", - "x-usrv-cpp-format": "std::int64_t" - } - }, - { - "name": "unixtime", - "in": "query", - "description": "UNIX timestamp of a block", - "required": false, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Lookup Block", - "description": "Look up block by seqno, shard and workchain", - "operationId": "lookupBlock_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LookupBlockRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getShards": { - "get": { - "tags": [ - "blocks" - ], - "summary": "Get Shards", - "description": "Get shards information by given masterchain block seqno", - "operationId": "getShards_get", - "parameters": [ - { - "$ref": "#/components/parameters/seqno", - "description": "Seqno of masterchain block" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Shards", - "description": "Get shards information", - "operationId": "getShards_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ShardsRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getBlockHeader": { - "get": { - "tags": [ - "blocks" - ], - "summary": "Get Block Header", - "description": "Get block header information", - "operationId": "getBlockHeader_get", - "parameters": [ - { - "$ref": "#/components/parameters/workchain" - }, - { - "$ref": "#/components/parameters/shard" - }, - { - "$ref": "#/components/parameters/seqno" - }, - { - "$ref": "#/components/parameters/rootHashOptional" - }, - { - "$ref": "#/components/parameters/fileHashOptional" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Block Header", - "description": "Get block header information", - "operationId": "getBlockHeader_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockHeaderRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getOutMsgQueueSize": { - "get": { - "tags": [ - "blocks" - ], - "summary": "Get Out Msg Queue Size", - "description": "Get size of outbound message queue", - "operationId": "getOutMsgQueueSize_get", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Out Msg Queue Size", - "description": "Get size of outbound message queue", - "operationId": "getOutMsgQueueSize_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OutMsgQueueSizeRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getBlockTransactions": { - "get": { - "tags": [ - "transactions" - ], - "summary": "Get Block Transactions", - "description": "Get transactions in specified block", - "operationId": "getBlockTransactions_get", - "parameters": [ - { - "$ref": "#/components/parameters/workchain" - }, - { - "$ref": "#/components/parameters/shard" - }, - { - "$ref": "#/components/parameters/seqno" - }, - { - "$ref": "#/components/parameters/rootHashOptional" - }, - { - "$ref": "#/components/parameters/fileHashOptional" - }, - { - "$ref": "#/components/parameters/afterLtOptional" - }, - { - "$ref": "#/components/parameters/afterAccountHashOptional" - }, - { - "$ref": "#/components/parameters/countOptional" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Block Transactions", - "description": "Get transactions in specified block", - "operationId": "getBlockTransactions_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockTransactionsRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getBlockTransactionsExt": { - "get": { - "tags": [ - "transactions" - ], - "summary": "Get Block Transactions Extended", - "description": "Get transactions in specified block with extended information", - "operationId": "getBlockTransactionsExt_get", - "parameters": [ - { - "$ref": "#/components/parameters/workchain" - }, - { - "$ref": "#/components/parameters/shard" - }, - { - "$ref": "#/components/parameters/seqno" - }, - { - "$ref": "#/components/parameters/rootHashOptional" - }, - { - "$ref": "#/components/parameters/fileHashOptional" - }, - { - "$ref": "#/components/parameters/afterLtOptional" - }, - { - "$ref": "#/components/parameters/afterAccountHashOptional" - }, - { - "$ref": "#/components/parameters/countOptional" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Block Transactions Extended", - "description": "Get transactions in specified block with extended information", - "operationId": "getBlockTransactionsExt_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockTransactionsExtRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getTransactions": { - "get": { - "tags": [ - "transactions" - ], - "summary": "Get Transactions", - "description": "Get transactions for specified address", - "operationId": "getTransactions_get", - "parameters": [ - { - "$ref": "#/components/parameters/address" - }, - { - "$ref": "#/components/parameters/limitOptional" - }, - { - "$ref": "#/components/parameters/ltOptional" - }, - { - "$ref": "#/components/parameters/hashOptional", - "description": "Transaction hash to start from" - }, - { - "$ref": "#/components/parameters/toLtOptional" - }, - { - "$ref": "#/components/parameters/archivalOptional" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Transactions", - "description": "Get transactions for specified address", - "operationId": "getTransactions_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransactionsRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getTransactionsStd": { - "get": { - "tags": [ - "transactions" - ], - "summary": "Get Transactions Std", - "description": "Standardized version of getTransactions", - "operationId": "getTransactionsStd_get", - "parameters": [ - { - "$ref": "#/components/parameters/address" - }, - { - "$ref": "#/components/parameters/limitOptional" - }, - { - "$ref": "#/components/parameters/ltOptional" - }, - { - "$ref": "#/components/parameters/hashOptional", - "description": "Transaction hash to start from" - }, - { - "$ref": "#/components/parameters/toLtOptional" - }, - { - "$ref": "#/components/parameters/archivalOptional" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Transactions Std", - "description": "Standardized version of getTransactions", - "operationId": "getTransactionsStd_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransactionsStdRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/tryLocateTx": { - "get": { - "tags": [ - "transactions" - ], - "summary": "Try Locate Transaction", - "description": "Try to locate outcoming transaction of __destination__ address by incoming message", - "operationId": "tryLocateTx_get", - "parameters": [ - { - "$ref": "#/components/parameters/sourceAddress" - }, - { - "$ref": "#/components/parameters/destinationAddress" - }, - { - "$ref": "#/components/parameters/createdLt" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Try Locate Transaction", - "description": "Try to locate transaction by incoming message parameters", - "operationId": "tryLocateTx_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TryLocateTxRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/tryLocateResultTx": { - "get": { - "tags": [ - "transactions" - ], - "summary": "Try Locate Result Transaction", - "description": "Same as previous. Try to locate outcoming transaction of destination address by incoming message", - "operationId": "tryLocateResultTx_get", - "parameters": [ - { - "$ref": "#/components/parameters/sourceAddress" - }, - { - "$ref": "#/components/parameters/destinationAddress" - }, - { - "$ref": "#/components/parameters/createdLt" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Try Locate Result Transaction", - "description": "Try to locate incoming transaction of source address by outcoming message", - "operationId": "tryLocateResultTx_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TryLocateResultTxRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/tryLocateSourceTx": { - "get": { - "tags": [ - "transactions" - ], - "summary": "Try Locate Source Transaction", - "description": "Try to locate source transaction by destination transaction parameters", - "operationId": "tryLocateSourceTx_get", - "parameters": [ - { - "$ref": "#/components/parameters/sourceAddress" - }, - { - "$ref": "#/components/parameters/destinationAddress" - }, - { - "$ref": "#/components/parameters/createdLt" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Try Locate Source Transaction", - "description": "Try to locate source transaction by destination transaction parameters", - "operationId": "tryLocateSourceTx_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TryLocateSourceTxRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getConfigParam": { - "get": { - "tags": [ - "configuration" - ], - "summary": "Get Config Parameter", - "description": "Get blockchain configuration parameter", - "operationId": "getConfigParam_get", - "parameters": [ - { - "name": "param", - "in": "query", - "description": "Parameter number", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "seqno", - "in": "query", - "description": "Block seqno", - "required": false, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Config Parameter", - "description": "Get blockchain configuration parameter", - "operationId": "getConfigParam_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfigParamRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getConfigAll": { - "get": { - "tags": [ - "configuration" - ], - "summary": "Get All Config", - "description": "Get all blockchain configuration parameters", - "operationId": "getConfigAll_get", - "parameters": [ - { - "name": "seqno", - "in": "query", - "description": "Block seqno", - "required": false, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get All Config", - "description": "Get all blockchain configuration parameters", - "operationId": "getConfigAll_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfigAllRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/getLibraries": { - "get": { - "tags": [ - "configuration" - ], - "summary": "Get Libraries", - "description": "Get library code by their hashes", - "operationId": "getLibraries_get", - "parameters": [ - { - "name": "libraries", - "in": "query", - "description": "Hashes of libraries", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "#/components/schemas/TonHash" - } - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - }, - "post": { - "tags": [ - "rpc" - ], - "summary": "Get Libraries", - "description": "Get library entries by their hashes", - "operationId": "getLibraries_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LibrariesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/runGetMethod": { - "post": { - "tags": [ - "run method", - "rpc" - ], - "summary": "Run Get Method", - "description": "Run get method of smart contract", - "operationId": "runGetMethod_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RunGetMethodRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/runGetMethodStd": { - "post": { - "tags": [ - "run method", - "rpc" - ], - "summary": "Run Get Method Std", - "description": "Run get method of smart contract", - "operationId": "runGetMethodStd_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RunGetMethodStdRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/sendBoc": { - "post": { - "tags": [ - "send", - "rpc" - ], - "summary": "Send BOC", - "description": "Send bag of cells to blockchain", - "operationId": "sendBoc_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SendBocRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/sendBocReturnHash": { - "post": { - "tags": [ - "send", - "rpc" - ], - "summary": "Send BOC Return Hash", - "description": "Send bag of cells to blockchain and return hash", - "operationId": "sendBocReturnHash_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SendBocRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - }, - "/api/v2/estimateFee": { - "post": { - "tags": [ - "send", - "rpc" - ], - "summary": "Estimate Fee", - "description": "Estimate fee for query", - "operationId": "estimateFee_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EstimateFeeRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/default" - } - }, - "security": [ - { - "APIKeyHeader": [] - }, - { - "APIKeyQuery": [] - } - ] - } - } - }, - "tags": [ - { - "name": "utils", - "description": "Some useful methods" - }, - { - "name": "accounts", - "description": "Information about accounts" - }, - { - "name": "blocks", - "description": "Information about blocks" - }, - { - "name": "transactions", - "description": "Fetching and locating transactions" - }, - { - "name": "configuration", - "description": "Information about blockchain config" - }, - { - "name": "run method", - "description": "Run get-method of smart contracts" - }, - { - "name": "send", - "description": "Send data to blockchain" - }, - { - "name": "rpc", - "description": "JSON-RPC and POST endpoints" - } - ], - "components": { - "parameters": { - "address": { - "name": "address", - "in": "query", - "description": "Identifier of target TON account in any form", - "required": true, - "schema": { - "$ref": "#/components/schemas/TonAddr" - } - }, - "hash": { - "name": "hash", - "in": "query", - "description": "The 256-bit hash in any form", - "required": true, - "schema": { - "$ref": "#/components/schemas/TonHash" - } - }, - "hashOptional": { - "name": "hash", - "in": "query", - "description": "The 256-bit hash in any form", - "required": false, - "schema": { - "$ref": "#/components/schemas/TonHash" - } - }, - "workchain": { - "name": "workchain", - "in": "query", - "description": "Workchain ID", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - "shard": { - "name": "shard", - "in": "query", - "description": "Shard ID", - "required": true, - "schema": { - "type": "string", - "x-usrv-cpp-type": "std::int64_t" - } - }, - "seqno": { - "name": "seqno", - "in": "query", - "description": "Seqno of a block", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - "seqnoOptional": { - "name": "seqno", - "in": "query", - "description": "Seqno of a block", - "required": false, - "schema": { - "type": "integer", - "format": "int32" - } - }, - "rootHashOptional": { - "name": "root_hash", - "in": "query", - "description": "Root hash of a block", - "required": false, - "schema": { - "type": "string", - "x-usrv-cpp-type": "#/components/schemas/TonHash" - } - }, - "fileHashOptional": { - "name": "file_hash", - "in": "query", - "description": "File hash of a block", - "required": false, - "schema": { - "type": "string", - "x-usrv-cpp-type": "#/components/schemas/TonHash" - } - }, - "afterLtOptional": { - "name": "after_lt", - "in": "query", - "description": "Logical time of transaction to read after", - "required": false, - "schema": { - "type": "string", - "x-usrv-cpp-format": "std::int64_t" - } - }, - "afterAccountHashOptional": { - "name": "after_hash", - "in": "query", - "description": "Hash of account in this block in hex or base64 representation, which indicates transaction to read after", - "required": false, - "schema": { - "type": "string", - "x-usrv-cpp-type": "#/components/schemas/TonAddrWithoutWorkchain" - } - }, - "countOptional": { - "name": "count", - "in": "query", - "description": "Maximum number of items in response", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "default": 40 - } - }, - "limitOptional": { - "name": "limit", - "in": "query", - "description": "Maximum number of items in response", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "default": 10 - } - }, - "ltOptional": { - "name": "lt", - "in": "query", - "description": "Logical time of the transaction to start from", - "required": false, - "schema": { - "type": "string", - "x-usrv-cpp-type": "std::int64_t" - } - }, - "toLtOptional": { - "name": "to_lt", - "in": "query", - "description": "Logical time to stop at", - "required": false, - "schema": { - "type": "string", - "x-usrv-cpp-type": "std::int64_t", - "default": 0 - } - }, - "archivalOptional": { - "name": "archival", - "in": "query", - "description": "Whether to use archival node", - "required": false, - "schema": { - "type": "boolean", - "default": false - } - }, - "sourceAddress": { - "name": "source", - "in": "query", - "description": "Source address", - "required": true, - "schema": { - "$ref": "#/components/schemas/TonAddr" - } - }, - "destinationAddress": { - "name": "destination", - "in": "query", - "description": "Destination address", - "required": true, - "schema": { - "$ref": "#/components/schemas/TonAddr" - } - }, - "createdLt": { - "name": "created_lt", - "in": "query", - "description": "Creation logical time of a message", - "required": true, - "schema": { - "type": "string", - "x-usrv-cpp-type": "std::int64_t" - } - } - }, - "responses": { - "default": { - "description": "Tonlib error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TonlibErrorResponse" - }, - "examples": { - "422": { - "summary": "Request validation error", - "value": { - "ok": false, - "code": 422, - "error": "...", - "@extra": "..." - } - }, - "504": { - "summary": "Tonlib timeout", - "value": { - "ok": false, - "code": 504, - "error": "...", - "@extra": "..." - } - }, - "429": { - "summary": "Ratelimit exceeded", - "value": { - "ok": false, - "code": 429, - "error": "...", - "@extra": "..." - } - }, - "409": { - "summary": "Not a token", - "value": { - "ok": false, - "code": 409, - "error": "Smart contract is not a Jetton or NFT", - "@extra": "..." - } - } - } - } - } - } - }, - "securitySchemes": { - "APIKeyHeader": { - "type": "apiKey", - "in": "header", - "name": "X-API-Key" - }, - "APIKeyQuery": { - "type": "apiKey", - "in": "query", - "name": "api_key" - } - }, - "schemas": { - "EmptyRequest": { - "type": "object", - "additionalProperties": false, - "required": [], - "properties": {} - }, - "AddressRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "address" - ], - "properties": { - "address": { - "$ref": "#/components/schemas/TonAddr" - } - } - }, - "AddressWithSeqnoRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "address" - ], - "properties": { - "address": { - "$ref": "#/components/schemas/TonAddr" - }, - "seqno": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - } - } - }, - "SeqnoRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "seqno" - ], - "properties": { - "seqno": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - } - } - }, - "DetectAddressRequest": { - "$ref": "#/components/schemas/AddressRequest" - }, - "DetectHashRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "hash" - ], - "properties": { - "hash": { - "$ref": "#/components/schemas/TonHash" - } - } - }, - "PackAddressRequest": { - "$ref": "#/components/schemas/AddressRequest" - }, - "UnpackAddressRequest": { - "$ref": "#/components/schemas/AddressRequest" - }, - "AddressInformationRequest": { - "$ref": "#/components/schemas/AddressWithSeqnoRequest" - }, - "ShardAccountCellRequest": { - "$ref": "#/components/schemas/AddressWithSeqnoRequest" - }, - "ExtendedAddressInformationRequest": { - "$ref": "#/components/schemas/AddressWithSeqnoRequest" - }, - "WalletInformationRequest": { - "$ref": "#/components/schemas/AddressWithSeqnoRequest" - }, - "AddressBalanceRequest": { - "$ref": "#/components/schemas/AddressWithSeqnoRequest" - }, - "AddressStateRequest": { - "$ref": "#/components/schemas/AddressWithSeqnoRequest" - }, - "TokenDataRequest": { - "$ref": "#/components/schemas/AddressWithSeqnoRequest" - }, - "MasterchainInfoRequest": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "MasterchainBlockSignaturesRequest": { - "$ref": "#/components/schemas/SeqnoRequest" - }, - "ShardBlockProofRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "workchain", - "shard", - "seqno" - ], - "properties": { - "workchain": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - }, - "shard": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64", - "x-usrv-cpp-type": "std::int64_t" - } - ], - "x-usrv-cpp-type": "std::int64_t" - }, - "seqno": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - }, - "from_seqno": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - } - } - }, - "ConsensusBlockRequest": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "LookupBlockRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "workchain", - "shard" - ], - "properties": { - "workchain": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - }, - "shard": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64", - "x-usrv-cpp-type": "std::int64_t" - } - ], - "x-usrv-cpp-type": "std::int64_t" - }, - "seqno": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - }, - "lt": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64", - "x-usrv-cpp-type": "std::int64_t" - } - ], - "x-usrv-cpp-type": "std::int64_t" - }, - "unixtime": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - } - } - }, - "ShardsRequest": { - "$ref": "#/components/schemas/SeqnoRequest" - }, - "BlockHeaderRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "workchain", - "shard", - "seqno" - ], - "properties": { - "workchain": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - }, - "shard": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64", - "x-usrv-cpp-type": "std::int64_t" - } - ], - "x-usrv-cpp-type": "std::int64_t" - }, - "seqno": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - }, - "root_hash": { - "$ref": "#/components/schemas/TonHash" - }, - "file_hash": { - "$ref": "#/components/schemas/TonHash" - } - } - }, - "OutMsgQueueSizeRequest": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "BlockTransactionsRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "workchain", - "shard", - "seqno" - ], - "properties": { - "workchain": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - }, - "shard": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64", - "x-usrv-cpp-type": "std::int64_t" - } - ], - "x-usrv-cpp-type": "std::int64_t" - }, - "seqno": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - }, - "root_hash": { - "$ref": "#/components/schemas/TonHash" - }, - "file_hash": { - "$ref": "#/components/schemas/TonHash" - }, - "after_lt": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64", - "x-usrv-cpp-type": "std::int64_t" - } - ], - "x-usrv-cpp-type": "std::int64_t" - }, - "after_hash": { - "$ref": "#/components/schemas/TonAddrWithoutWorkchain" - }, - "count": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64" - } - ], - "x-usrv-cpp-type": "std::int64_t" - } - } - }, - "BlockTransactionsExtRequest": { - "$ref": "#/components/schemas/BlockTransactionsRequest" - }, - "TransactionsRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "address" - ], - "properties": { - "address": { - "$ref": "#/components/schemas/TonAddr" - }, - "lt": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64", - "x-usrv-cpp-type": "std::int64_t" - } - ], - "x-usrv-cpp-type": "std::int64_t" - }, - "hash": { - "$ref": "#/components/schemas/TonHash" - }, - "to_lt": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64", - "x-usrv-cpp-type": "std::int64_t" - } - ], - "x-usrv-cpp-type": "std::int64_t" - }, - "archival": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - }, - { - "type": "boolean" - } - ], - "x-usrv-cpp-type": "bool" - }, - "limit": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64" - } - ], - "x-usrv-cpp-type": "std::int64_t" - } - } - }, - "TransactionsV2Request": { - "$ref": "#/components/schemas/TransactionsRequest" - }, - "TryLocateTxRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "source", - "destination", - "created_lt" - ], - "properties": { - "source": { - "$ref": "#/components/schemas/TonAddr" - }, - "destination": { - "$ref": "#/components/schemas/TonAddr" - }, - "created_lt": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64", - "x-usrv-cpp-type": "std::int64_t" - } - ], - "x-usrv-cpp-type": "std::int64_t" - } - } - }, - "TryLocateResultTxRequest": { - "$ref": "#/components/schemas/TryLocateTxRequest" - }, - "TryLocateSourceTxRequest": { - "$ref": "#/components/schemas/TryLocateTxRequest" - }, - "ConfigParamRequest": { - "type": "object", - "additionalProperties": false, - "properties": { - "config_id": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - }, - "param": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - }, - "seqno": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - } - } - }, - "ConfigAllRequest": { - "type": "object", - "additionalProperties": false, - "properties": { - "seqno": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ], - "x-usrv-cpp-type": "std::int32_t" - } - } - }, - "LibrariesRequest": { - "type": "object", - "additionalProperties": false, - "properties": { - "libraries": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TonHash" - } - } - } - }, - "SendBocRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "boc" - ], - "properties": { - "boc": { - "$ref": "#/components/schemas/Bytes" - } - } - }, - "EstimateFeeRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "address", - "body" - ], - "properties": { - "address": { - "$ref": "#/components/schemas/TonAddr" - }, - "body": { - "$ref": "#/components/schemas/Bytes" - }, - "init_code": { - "$ref": "#/components/schemas/Bytes" - }, - "init_data": { - "$ref": "#/components/schemas/Bytes" - }, - "ignore_chksig": { - "type": "boolean", - "default": true - } - } - }, - "JsonRpcRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "jsonrpc", - "id", - "method", - "params" - ], - "properties": { - "jsonrpc": { - "type": "string", - "default": "2.0" - }, - "id": { - "type": "string" - }, - "method": { - "type": "string" - }, - "params": { - "type": "object", - "additionalProperties": true - } - } - }, - "TonAddr": { - "type": "string", - "x-usrv-cpp-type": "ton_http::types::ton_addr" - }, - "TonAddrWithoutWorkchain": { - "type": "string", - "x-usrv-cpp-type": "ton_http::types::ton_addr_without_workchain" - }, - "TonHash": { - "type": "string", - "x-usrv-cpp-type": "ton_http::types::ton_hash" - }, - "TonHashHex": { - "type": "string", - "x-usrv-cpp-type": "ton_http::types::ton_hash_hex" - }, - "Int256": { - "type": "string", - "x-usrv-cpp-type": "ton_http::types::int256" - }, - "Bytes": { - "type": "string", - "x-usrv-cpp-type": "ton_http::types::bytes" - }, - "AccountAddress": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "accountAddress" - ], - "default": "accountAddress" - }, - "account_address": { - "type": "string", - "x-usrv-cpp-type": "ton_http::types::ton_addr" - } - } - }, - "TonBlockIdExt": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "ton.blockIdExt" - ], - "default": "ton.blockIdExt" - }, - "workchain": { - "type": "integer" - }, - "shard": { - "type": "string", - "x-usrv-cpp-type": "std::int64_t" - }, - "seqno": { - "type": "integer" - }, - "root_hash": { - "$ref": "#/components/schemas/TonHash" - }, - "file_hash": { - "$ref": "#/components/schemas/TonHash" - } - }, - "required": [ - "@type", - "workchain", - "shard", - "seqno", - "root_hash", - "file_hash" - ], - "description": "Extended block identifier." - }, - "DetectAddressBase64Variant": { - "type": "object", - "additionalProperties": false, - "description": "Base64 form of address variant", - "properties": { - "@type": { - "type": "string", - "enum": [ - "ext.utils.detectedAddressVariant" - ], - "default": "ext.utils.detectedAddressVariant" - }, - "b64": { - "type": "string" - }, - "b64url": { - "type": "string" - } - }, - "required": [ - "@type", - "b64", - "b64url" - ] - }, - "ExtraCurrencyBalance": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "extraCurrency" - ], - "default": "extraCurrency" - }, - "id": { - "type": "integer", - "format": "int32" - }, - "amount": { - "$ref": "#/components/schemas/Int256" - } - }, - "required": [ - "@type", - "id", - "amount" - ] - }, - "InternalTransactionId": { - "type": "object", - "additionalProperties": false, - "description": "Internal transaction identifier.", - "properties": { - "@type": { - "type": "string", - "enum": [ - "internal.transactionId" - ], - "default": "internal.transactionId" - }, - "lt": { - "type": "string", - "description": "Logical time", - "x-usrv-cpp-type": "std::int64_t" - }, - "hash": { - "$ref": "#/components/schemas/TonHash" - } - }, - "required": [ - "@type", - "lt", - "hash" - ] - }, - "AccountStateRaw": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "raw.accountState" - ], - "default": "raw.accountState" - }, - "code": { - "$ref": "#/components/schemas/Bytes" - }, - "data": { - "$ref": "#/components/schemas/Bytes" - }, - "frozen_hash": { - "$ref": "#/components/schemas/TonHash" - } - }, - "required": [ - "@type", - "code", - "data", - "frozen_hash" - ] - }, - "AccountStateWalletV3": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "wallet.v3.accountState" - ], - "default": "wallet.v3.accountState" - }, - "wallet_id": { - "type": "integer", - "format": "int64" - }, - "seqno": { - "type": "integer", - "format": "int32" - } - }, - "required": [ - "@type", - "wallet_id", - "seqno" - ] - }, - "AccountStateWalletV4": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "wallet.v4.accountState" - ], - "default": "wallet.v4.accountState" - }, - "wallet_id": { - "type": "integer", - "format": "int64" - }, - "seqno": { - "type": "integer", - "format": "int32" - } - }, - "required": [ - "@type", - "wallet_id", - "seqno" - ] - }, - "AccountStateWalletHighloadV1": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "wallet.highload.v1.accountState" - ], - "default": "wallet.highload.v1.accountState" - }, - "wallet_id": { - "type": "integer", - "format": "int64" - }, - "seqno": { - "type": "integer", - "format": "int32" - } - }, - "required": [ - "@type", - "wallet_id", - "seqno" - ] - }, - "AccountStateWalletHighloadV2": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "wallet.highload.v2.accountState" - ], - "default": "wallet.highload.v2.accountState" - }, - "wallet_id": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "@type", - "wallet_id" - ] - }, - "AccountStateDns": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "dns.accountState" - ], - "default": "dns.accountState" - }, - "wallet_id": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "@type", - "wallet_id" - ] - }, - "RWalletLimit": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "rwallet.limit" - ], - "default": "rwallet.limit" - }, - "seconds": { - "type": "integer", - "format": "int32" - }, - "value": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "@type", - "seconds", - "value" - ] - }, - "RWalletConfig": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "rwallet.config" - ], - "default": "rwallet.config" - }, - "start_at": { - "type": "integer", - "format": "int64" - }, - "limits": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RWalletLimit" - } - } - }, - "required": [ - "@type", - "start_at", - "limits" - ] - }, - "AccountStateRWallet": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "rwallet.accountState" - ], - "default": "rwallet.accountState" - }, - "wallet_id": { - "type": "integer", - "format": "int64" - }, - "seqno": { - "type": "integer", - "format": "int32" - }, - "unlocked_balance": { - "type": "integer", - "format": "int64" - }, - "config": { - "$ref": "#/components/schemas/RWalletConfig" - } - }, - "required": [ - "@type", - "wallet_id", - "seqno", - "unlocked_balance", - "config" - ] - }, - "PChanConfig": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "pchan.config" - ], - "default": "pchan.config" - }, - "alice_public_key": { - "type": "string" - }, - "alice_address": { - "$ref": "#/components/schemas/AccountAddress" - }, - "bob_public_key": { - "type": "string" - }, - "bob_address": { - "$ref": "#/components/schemas/AccountAddress" - }, - "init_timeout": { - "type": "integer", - "format": "int32" - }, - "close_timeout": { - "type": "integer", - "format": "int32" - }, - "channel_id": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "@type", - "alice_public_key", - "alice_address", - "bob_public_key", - "bob_address", - "init_timeout", - "close_timeout", - "channel_id" - ] - }, - "PChanStateInit": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "pchan.stateInit" - ], - "default": "pchan.stateInit" - }, - "signed_A": { - "type": "boolean" - }, - "signed_B": { - "type": "boolean" - }, - "min_A": { - "type": "integer", - "format": "int64" - }, - "min_B": { - "type": "integer", - "format": "int64" - }, - "expire_at": { - "type": "integer", - "format": "int64" - }, - "A": { - "type": "integer", - "format": "int64" - }, - "B": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "@type", - "signed_A", - "signed_B", - "min_A", - "min_B", - "expire_at", - "A", - "B" - ] - }, - "PChanStateClose": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "pchan.stateClose" - ], - "default": "pchan.stateClose" - }, - "signed_A": { - "type": "boolean" - }, - "signed_B": { - "type": "boolean" - }, - "min_A": { - "type": "integer", - "format": "int64" - }, - "min_B": { - "type": "integer", - "format": "int64" - }, - "expire_at": { - "type": "integer", - "format": "int64" - }, - "A": { - "type": "integer", - "format": "int64" - }, - "B": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "@type", - "signed_A", - "signed_B", - "min_A", - "min_B", - "expire_at", - "A", - "B" - ] - }, - "PChanStatePayout": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "pchan.statePayout" - ], - "default": "pchan.statePayout" - }, - "A": { - "type": "integer", - "format": "int64" - }, - "B": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "@type", - "A", - "B" - ] - }, - "PChanState": { - "oneOf": [ - { - "$ref": "#/components/schemas/PChanStateInit" - }, - { - "$ref": "#/components/schemas/PChanStateClose" - }, - { - "$ref": "#/components/schemas/PChanStatePayout" - } - ], - "discriminator": { - "propertyName": "@type", - "mapping": { - "pchan.stateInit": "#/components/schemas/PChanStateInit", - "pchan.stateClose": "#/components/schemas/PChanStateClose", - "pchan.statePayout": "#/components/schemas/PChanStatePayout" - } - } - }, - "AccountStatePChan": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "pchan.accountState" - ], - "default": "pchan.accountState" - }, - "config": { - "$ref": "#/components/schemas/PChanConfig" - }, - "state": { - "$ref": "#/components/schemas/PChanState" - }, - "description": { - "type": "string" - } - }, - "required": [ - "@type", - "config", - "state", - "description" - ] - }, - "AccountStateUninited": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "uninited.accountState" - ], - "default": "uninited.accountState" - }, - "frozen_hash": { - "$ref": "#/components/schemas/TonHash" - } - }, - "required": [ - "@type", - "frozen_hash" - ] - }, - "AccountState": { - "oneOf": [ - { - "$ref": "#/components/schemas/AccountStateRaw" - }, - { - "$ref": "#/components/schemas/AccountStateWalletV3" - }, - { - "$ref": "#/components/schemas/AccountStateWalletV4" - }, - { - "$ref": "#/components/schemas/AccountStateWalletHighloadV1" - }, - { - "$ref": "#/components/schemas/AccountStateWalletHighloadV2" - }, - { - "$ref": "#/components/schemas/AccountStateDns" - }, - { - "$ref": "#/components/schemas/AccountStateRWallet" - }, - { - "$ref": "#/components/schemas/AccountStatePChan" - }, - { - "$ref": "#/components/schemas/AccountStateUninited" - } - ], - "discriminator": { - "propertyName": "@type", - "mapping": { - "raw.accountState": "#/components/schemas/AccountStateRaw", - "wallet.v3.accountState": "#/components/schemas/AccountStateWalletV3", - "wallet.v4.accountState": "#/components/schemas/AccountStateWalletV4", - "wallet.highload.v1.accountState": "#/components/schemas/AccountStateWalletHighloadV1", - "wallet.highload.v2.accountState": "#/components/schemas/AccountStateWalletHighloadV2", - "dns.accountState": "#/components/schemas/AccountStateDns", - "rwallet.accountState": "#/components/schemas/AccountStateRWallet", - "pchan.accountState": "#/components/schemas/AccountStatePChan", - "uninited.accountState": "#/components/schemas/AccountStateUninited" - } - } - }, - "TokenContentDict": { - "type": "object", - "additionalProperties": true - }, - "DnsRecordStorageAddress": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "bag_id" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "dns_storage_address" - ], - "default": "dns_storage_address" - }, - "bag_id": { - "$ref": "#/components/schemas/TonHashHex" - } - } - }, - "DnsRecordAdnlAddress": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "adnl_addr" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "dns_adnl_address" - ], - "default": "dns_adnl_address" - }, - "adnl_addr": { - "$ref": "#/components/schemas/TonHashHex" - } - } - }, - "SmcAddr": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "workchain_id", - "address" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "addr_std" - ], - "default": "addr_std" - }, - "workchain_id": { - "type": "integer", - "format": "int32" - }, - "address": { - "$ref": "#/components/schemas/TonHashHex" - } - } - }, - "DnsRecordSmcAddress": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "smc_addr" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "dns_smc_address" - ], - "default": "dns_smc_address" - }, - "smc_addr": { - "$ref": "#/components/schemas/SmcAddr" - } - } - }, - "DnsRecordNextResolver": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "resolver" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "dns_next_resolver" - ], - "default": "dns_next_resolver" - }, - "resolver": { - "$ref": "#/components/schemas/SmcAddr" - } - } - }, - "DnsRecord": { - "oneOf": [ - { - "$ref": "#/components/schemas/DnsRecordStorageAddress" - }, - { - "$ref": "#/components/schemas/DnsRecordSmcAddress" - }, - { - "$ref": "#/components/schemas/DnsRecordAdnlAddress" - }, - { - "$ref": "#/components/schemas/DnsRecordNextResolver" - } - ], - "discriminator": { - "propertyName": "@type", - "mapping": { - "dns_storage_address": "#/components/schemas/DnsRecordStorageAddress", - "dns_smc_address": "#/components/schemas/DnsRecordSmcAddress", - "dns_adnl_address": "#/components/schemas/DnsRecordAdnlAddress", - "dns_next_resolver": "#/components/schemas/DnsRecordNextResolver" - } - } - }, - "DnsRecordSet": { - "type": "object", - "additionalProperties": true, - "properties": { - "dns_next_resolver": { - "$ref": "#/components/schemas/DnsRecord" - }, - "wallet": { - "$ref": "#/components/schemas/DnsRecord" - }, - "site": { - "$ref": "#/components/schemas/DnsRecord" - }, - "storage": { - "$ref": "#/components/schemas/DnsRecord" - } - } - }, - "DnsContent": { - "type": "object", - "additionalProperties": false, - "required": [ - "domain", - "data" - ], - "properties": { - "domain": { - "type": "string" - }, - "data": { - "$ref": "#/components/schemas/DnsRecordSet" - } - } - }, - "TokenContent": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "data" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "onchain", - "offchain" - ] - }, - "data": { - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/TokenContentDict" - } - ] - } - } - }, - "JettonMasterData": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "address", - "contract_type", - "total_supply", - "mintable", - "jetton_content", - "jetton_wallet_code" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "ext.tokens.jettonMasterData" - ], - "default": "ext.tokens.jettonMasterData" - }, - "address": { - "$ref": "#/components/schemas/TonAddr" - }, - "contract_type": { - "type": "string", - "enum": [ - "jetton_master" - ], - "default": "jetton_master" - }, - "total_supply": { - "$ref": "#/components/schemas/Int256" - }, - "mintable": { - "type": "boolean" - }, - "admin_address": { - "$ref": "#/components/schemas/TonAddr" - }, - "jetton_content": { - "$ref": "#/components/schemas/TokenContent" - }, - "jetton_wallet_code": { - "$ref": "#/components/schemas/Bytes" - } - } - }, - "JettonWalletData": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "address", - "contract_type", - "balance", - "owner", - "jetton", - "jetton_wallet_code" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "ext.tokens.jettonWalletData" - ], - "default": "ext.tokens.jettonWalletData" - }, - "address": { - "$ref": "#/components/schemas/TonAddr" - }, - "contract_type": { - "type": "string", - "enum": [ - "jetton_wallet" - ], - "default": "jetton_wallet" - }, - "balance": { - "$ref": "#/components/schemas/Int256" - }, - "owner": { - "$ref": "#/components/schemas/TonAddr" - }, - "jetton": { - "$ref": "#/components/schemas/TonAddr" - }, - "mintless_is_claimed": { - "type": "boolean" - }, - "jetton_wallet_code": { - "$ref": "#/components/schemas/Bytes" - } - } - }, - "NftCollectionData": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "address", - "contract_type", - "next_item_index", - "collection_content" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "ext.tokens.nftCollectionData" - ], - "default": "ext.tokens.nftCollectionData" - }, - "address": { - "$ref": "#/components/schemas/TonAddr" - }, - "contract_type": { - "type": "string", - "enum": [ - "nft_collection" - ], - "default": "nft_collection" - }, - "next_item_index": { - "$ref": "#/components/schemas/Int256" - }, - "owner_address": { - "$ref": "#/components/schemas/TonAddr" - }, - "collection_content": { - "$ref": "#/components/schemas/TokenContent" - } - } - }, - "NftItemData": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "address", - "contract_type", - "init", - "index", - "content" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "ext.tokens.nftItemData" - ], - "default": "ext.tokens.nftItemData" - }, - "address": { - "$ref": "#/components/schemas/TonAddr" - }, - "contract_type": { - "type": "string", - "enum": [ - "nft_item" - ], - "default": "nft_item" - }, - "init": { - "type": "boolean" - }, - "index": { - "$ref": "#/components/schemas/Int256" - }, - "collection_address": { - "$ref": "#/components/schemas/TonAddr" - }, - "owner_address": { - "$ref": "#/components/schemas/TonAddr" - }, - "content": { - "oneOf": [ - { - "$ref": "#/components/schemas/TokenContent" - }, - { - "$ref": "#/components/schemas/DnsContent" - } - ] - } - } - }, - "TokenData": { - "oneOf": [ - { - "$ref": "#/components/schemas/JettonMasterData" - }, - { - "$ref": "#/components/schemas/JettonWalletData" - }, - { - "$ref": "#/components/schemas/NftCollectionData" - }, - { - "$ref": "#/components/schemas/NftItemData" - } - ], - "discriminator": { - "propertyName": "@type", - "mapping": { - "ext.tokens.jettonMasterData": "#/components/schemas/JettonMasterData", - "ext.tokens.jettonWalletData": "#/components/schemas/JettonWalletData", - "ext.tokens.nftCollectionData": "#/components/schemas/NftCollectionData", - "ext.tokens.nftItemData": "#/components/schemas/NftItemData" - } - } - }, - "AccountStateEnum": { - "type": "string", - "enum": [ - "uninitialized", - "active", - "frozen" - ], - "description": "Computed from code/frozen_hash by the API server." - }, - "BlockSignature": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.signature" - ], - "default": "blocks.signature" - }, - "node_id_short": { - "$ref": "#/components/schemas/TonHash" - }, - "signature": { - "$ref": "#/components/schemas/Bytes" - } - }, - "required": [ - "@type", - "node_id_short", - "signature" - ] - }, - "ShardBlockLink": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.shardBlockLink" - ], - "default": "blocks.shardBlockLink" - }, - "id": { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "proof": { - "$ref": "#/components/schemas/Bytes" - } - }, - "required": [ - "@type", - "id", - "proof" - ] - }, - "BlockLinkBack": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.blockLinkBack" - ], - "default": "blocks.blockLinkBack" - }, - "to_key_block": { - "type": "boolean" - }, - "from": { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "to": { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "dest_proof": { - "$ref": "#/components/schemas/Bytes" - }, - "proof": { - "$ref": "#/components/schemas/Bytes" - }, - "state_proof": { - "$ref": "#/components/schemas/Bytes" - } - }, - "required": [ - "@type", - "to_key_block", - "from", - "to", - "dest_proof", - "proof", - "state_proof" - ] - }, - "OutMsgQueueSize": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.outMsgQueueSize" - ], - "default": "blocks.outMsgQueueSize" - }, - "id": { - "$ref": "#/components/schemas/TonBlockIdExt", - "description": "Block identifier for the shard." - }, - "size": { - "type": "integer", - "description": "Queue size for the shard." - } - }, - "required": [ - "@type", - "id", - "size" - ] - }, - "LibraryEntry": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "smc.libraryEntry" - ], - "default": "smc.libraryEntry" - }, - "hash": { - "$ref": "#/components/schemas/TonHash" - }, - "data": { - "$ref": "#/components/schemas/Bytes" - } - }, - "required": [ - "@type", - "hash", - "data" - ] - }, - "ShortTxId": { - "type": "object", - "additionalProperties": false, - "description": "Short transaction identifier", - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.shortTxId" - ], - "default": "blocks.shortTxId" - }, - "mode": { - "type": "integer", - "description": "Transaction mode flags" - }, - "account": { - "$ref": "#/components/schemas/TonAddr" - }, - "lt": { - "type": "string", - "description": "Logical time of the transaction", - "x-usrv-cpp-type": "std::int64_t" - }, - "hash": { - "$ref": "#/components/schemas/TonHash", - "description": "Base64 hash of the transaction" - } - }, - "required": [ - "@type", - "mode", - "account", - "lt", - "hash" - ] - }, - "MsgDataRaw": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "msg.dataRaw" - ], - "default": "msg.dataRaw" - }, - "body": { - "$ref": "#/components/schemas/Bytes" - }, - "init_state": { - "$ref": "#/components/schemas/Bytes" - } - } - }, - "MsgDataText": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "msg.dataText" - ], - "default": "msg.dataText" - }, - "text": { - "$ref": "#/components/schemas/Bytes" - } - } - }, - "MsgDataDecryptedText": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "msg.dataDecryptedText" - ], - "default": "msg.dataDecryptedText" - }, - "text": { - "$ref": "#/components/schemas/Bytes" - } - } - }, - "MsgDataEncryptedText": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "msg.dataEncryptedText" - ], - "default": "msg.dataEncryptedText" - }, - "text": { - "$ref": "#/components/schemas/Bytes" - } - } - }, - "MsgData": { - "oneOf": [ - { - "$ref": "#/components/schemas/MsgDataRaw" - }, - { - "$ref": "#/components/schemas/MsgDataText" - }, - { - "$ref": "#/components/schemas/MsgDataDecryptedText" - }, - { - "$ref": "#/components/schemas/MsgDataEncryptedText" - } - ], - "discriminator": { - "propertyName": "@type", - "mapping": { - "msg.dataRaw": "#/components/schemas/MsgDataRaw", - "msg.dataText": "#/components/schemas/MsgDataText", - "msg.dataDecryptedText": "#/components/schemas/MsgDataDecryptedText", - "msg.dataEncryptedText": "#/components/schemas/MsgDataEncryptedText" - } - } - }, - "MessageStd": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "raw.message" - ], - "default": "raw.message" - }, - "hash": { - "$ref": "#/components/schemas/TonHash" - }, - "source": { - "$ref": "#/components/schemas/AccountAddress" - }, - "destination": { - "$ref": "#/components/schemas/AccountAddress" - }, - "value": { - "$ref": "#/components/schemas/Int256" - }, - "extra_currencies": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ExtraCurrencyBalance" - } - }, - "fwd_fee": { - "$ref": "#/components/schemas/Int256" - }, - "ihr_fee": { - "$ref": "#/components/schemas/Int256" - }, - "created_lt": { - "type": "string", - "description": "Logical time of the transaction", - "x-usrv-cpp-type": "std::int64_t" - }, - "body_hash": { - "$ref": "#/components/schemas/TonHash" - }, - "msg_data": { - "$ref": "#/components/schemas/MsgData" - } - }, - "required": [ - "@type", - "hash", - "source", - "destination", - "value", - "extra_currencies", - "fwd_fee", - "ihr_fee", - "created_lt", - "body_hash", - "msg_data" - ] - }, - "TransactionStd": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "raw.transaction" - ], - "default": "raw.transaction" - }, - "address": { - "$ref": "#/components/schemas/AccountAddress" - }, - "utime": { - "type": "integer", - "description": "UNIX timestamp of transaction" - }, - "data": { - "$ref": "#/components/schemas/Bytes" - }, - "transaction_id": { - "$ref": "#/components/schemas/InternalTransactionId" - }, - "fee": { - "$ref": "#/components/schemas/Int256" - }, - "storage_fee": { - "$ref": "#/components/schemas/Int256" - }, - "other_fee": { - "$ref": "#/components/schemas/Int256" - }, - "in_msg": { - "$ref": "#/components/schemas/MessageStd" - }, - "out_msgs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MessageStd" - } - } - }, - "required": [ - "@type", - "address", - "utime", - "data", - "transaction_id", - "fee", - "storage_fee", - "other_fee", - "out_msgs" - ] - }, - "TransactionExt": { - "allOf": [ - { - "$ref": "#/components/schemas/TransactionStd" - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "raw.transactionExt" - ], - "default": "raw.transactionExt" - }, - "account": { - "$ref": "#/components/schemas/TonAddr" - } - } - } - ] - }, - "Message": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "ext.message" - ], - "default": "ext.message" - }, - "hash": { - "$ref": "#/components/schemas/TonHash" - }, - "source": { - "$ref": "#/components/schemas/TonAddr" - }, - "destination": { - "$ref": "#/components/schemas/TonAddr" - }, - "value": { - "$ref": "#/components/schemas/Int256" - }, - "extra_currencies": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ExtraCurrencyBalance" - } - }, - "fwd_fee": { - "$ref": "#/components/schemas/Int256" - }, - "ihr_fee": { - "$ref": "#/components/schemas/Int256" - }, - "created_lt": { - "type": "string", - "description": "Logical time of the transaction", - "x-usrv-cpp-type": "std::int64_t" - }, - "body_hash": { - "$ref": "#/components/schemas/TonHash" - }, - "msg_data": { - "$ref": "#/components/schemas/MsgData" - }, - "message": { - "type": "string" - }, - "message_decode_error": { - "type": "string" - } - }, - "required": [ - "@type", - "hash", - "source", - "destination", - "value", - "extra_currencies", - "fwd_fee", - "ihr_fee", - "created_lt", - "body_hash", - "msg_data" - ] - }, - "Transaction": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "ext.transaction" - ], - "default": "ext.transaction" - }, - "address": { - "$ref": "#/components/schemas/AccountAddress" - }, - "account": { - "$ref": "#/components/schemas/TonAddr" - }, - "utime": { - "type": "integer", - "description": "UNIX timestamp of transaction" - }, - "data": { - "$ref": "#/components/schemas/Bytes" - }, - "transaction_id": { - "$ref": "#/components/schemas/InternalTransactionId" - }, - "fee": { - "$ref": "#/components/schemas/Int256" - }, - "storage_fee": { - "$ref": "#/components/schemas/Int256" - }, - "other_fee": { - "$ref": "#/components/schemas/Int256" - }, - "in_msg": { - "$ref": "#/components/schemas/Message" - }, - "out_msgs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Message" - } - } - }, - "required": [ - "@type", - "address", - "account", - "utime", - "data", - "transaction_id", - "fee", - "storage_fee", - "other_fee", - "out_msgs" - ] - }, - "TonlibObject": { - "oneOf": [ - { - "$ref": "#/components/schemas/DetectAddress" - }, - { - "$ref": "#/components/schemas/DetectHash" - }, - { - "$ref": "#/components/schemas/AddressInformation" - }, - { - "$ref": "#/components/schemas/ExtendedAddressInformation" - }, - { - "$ref": "#/components/schemas/WalletInformation" - }, - { - "$ref": "#/components/schemas/JettonMasterData" - }, - { - "$ref": "#/components/schemas/JettonWalletData" - }, - { - "$ref": "#/components/schemas/NftCollectionData" - }, - { - "$ref": "#/components/schemas/NftItemData" - }, - { - "$ref": "#/components/schemas/MasterchainInfo" - }, - { - "$ref": "#/components/schemas/BlockSignatures" - }, - { - "$ref": "#/components/schemas/BlockSignaturesSimplex" - }, - { - "$ref": "#/components/schemas/ShardBlockProof" - }, - { - "$ref": "#/components/schemas/ConsensusBlock" - }, - { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - { - "$ref": "#/components/schemas/Shards" - }, - { - "$ref": "#/components/schemas/BlockHeader" - }, - { - "$ref": "#/components/schemas/OutMsgQueueSizes" - }, - { - "$ref": "#/components/schemas/BlockTransactions" - }, - { - "$ref": "#/components/schemas/BlockTransactionsExt" - }, - { - "$ref": "#/components/schemas/Transaction" - }, - { - "$ref": "#/components/schemas/TransactionsStd" - }, - { - "$ref": "#/components/schemas/ConfigInfo" - }, - { - "$ref": "#/components/schemas/LibraryResult" - }, - { - "$ref": "#/components/schemas/QueryFees" - }, - { - "$ref": "#/components/schemas/ExtMessageInfo" - }, - { - "$ref": "#/components/schemas/ResultOk" - }, - { - "$ref": "#/components/schemas/RunGetMethodStdResult" - }, - { - "$ref": "#/components/schemas/RunGetMethodResult" - }, - { - "$ref": "#/components/schemas/TvmCell" - } - ], - "discriminator": { - "propertyName": "@type", - "mapping": { - "ext.utils.detectAddress": "#/components/schemas/DetectAddress", - "ext.utils.detectedHash": "#/components/schemas/DetectHash", - "raw.fullAccountState": "#/components/schemas/AddressInformation", - "fullAccountState": "#/components/schemas/ExtendedAddressInformation", - "ext.accounts.walletInformation": "#/components/schemas/WalletInformation", - "ext.tokens.jettonMasterData": "#/components/schemas/JettonMasterData", - "ext.tokens.jettonWalletData": "#/components/schemas/JettonWalletData", - "ext.tokens.nftCollectionData": "#/components/schemas/NftCollectionData", - "ext.tokens.nftItemData": "#/components/schemas/NftItemData", - "blocks.masterchainInfo": "#/components/schemas/MasterchainInfo", - "blocks.blockSignatures": "#/components/schemas/BlockSignatures", - "blocks.blockSignatures.simplex": "#/components/schemas/BlockSignaturesSimplex", - "blocks.shardBlockProof": "#/components/schemas/ShardBlockProof", - "ext.blocks.consensusBlock": "#/components/schemas/ConsensusBlock", - "ton.blockIdExt": "#/components/schemas/TonBlockIdExt", - "blocks.shards": "#/components/schemas/Shards", - "blocks.header": "#/components/schemas/BlockHeader", - "blocks.outMsgQueueSizes": "#/components/schemas/OutMsgQueueSizes", - "blocks.transactions": "#/components/schemas/BlockTransactions", - "blocks.transactionsExt": "#/components/schemas/BlockTransactionsExt", - "ext.transaction": "#/components/schemas/Transaction", - "raw.transactions": "#/components/schemas/TransactionsStd", - "configInfo": "#/components/schemas/ConfigInfo", - "query.fees": "#/components/schemas/QueryFees", - "smc.libraryResult": "#/components/schemas/LibraryResult", - "raw.extMessageInfo": "#/components/schemas/ExtMessageInfo", - "ok": "#/components/schemas/ResultOk", - "smc.runResult": "#/components/schemas/RunGetMethodStdResult", - "ext.runResult": "#/components/schemas/RunGetMethodResult", - "tvm.cell": "#/components/schemas/TvmCell" - } - } - }, - "TonlibResponse": { - "type": "object", - "title": "TonlibResponse", - "additionalProperties": false, - "required": [ - "ok", - "result", - "@extra" - ], - "properties": { - "ok": { - "type": "boolean", - "title": "Ok", - "default": true - }, - "result": { - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/AccountStateEnum" - }, - { - "$ref": "#/components/schemas/TonlibObject" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/TonlibObject" - } - } - ] - }, - "@extra": { - "type": "string", - "title": "Extra information" - }, - "jsonrpc": { - "type": "string" - }, - "id": { - "type": "string" - } - } - }, - "TonlibErrorResponse": { - "type": "object", - "additionalProperties": false, - "title": "TonlibErrorResponse", - "required": [ - "ok", - "error", - "code" - ], - "properties": { - "ok": { - "type": "boolean", - "title": "Ok", - "default": false - }, - "error": { - "type": "string", - "title": "Error description" - }, - "code": { - "type": "integer", - "title": "Error code", - "minimum": 100, - "maximum": 600 - }, - "@extra": { - "type": "string", - "title": "Extra information" - }, - "jsonrpc": { - "type": "string" - }, - "id": { - "type": "string" - } - } - }, - "JsonRpcResponse": { - "allOf": [ - { - "type": "object", - "additionalProperties": false, - "required": [ - "jsonrpc", - "id" - ], - "properties": { - "jsonrpc": { - "type": "string", - "default": "2.0" - }, - "id": { - "type": "string" - } - } - }, - { - "$ref": "#/components/schemas/TonlibResponse" - } - ] - }, - "JsonRpcErrorResponse": { - "allOf": [ - { - "type": "object", - "additionalProperties": false, - "required": [ - "jsonrpc", - "id" - ], - "properties": { - "jsonrpc": { - "type": "string", - "default": "2.0" - }, - "id": { - "type": "string" - } - } - }, - { - "$ref": "#/components/schemas/TonlibErrorResponse" - } - ] - }, - "DetectAddress": { - "type": "object", - "additionalProperties": false, - "description": "Information about the address.", - "properties": { - "@type": { - "type": "string", - "enum": [ - "ext.utils.detectedAddress" - ], - "default": "ext.utils.detectedAddress" - }, - "raw_form": { - "type": "string" - }, - "bounceable": { - "$ref": "#/components/schemas/DetectAddressBase64Variant" - }, - "non_bounceable": { - "$ref": "#/components/schemas/DetectAddressBase64Variant" - }, - "given_type": { - "type": "string", - "enum": [ - "raw_form", - "friendly_bounceable", - "friendly_non_bounceable" - ] - }, - "test_only": { - "type": "boolean" - } - }, - "required": [ - "@type", - "raw_form", - "bounceable", - "non_bounceable", - "given_type", - "test_only" - ] - }, - "DetectHash": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "ext.utils.detectedHash" - ], - "default": "ext.utils.detectedHash" - }, - "b64": { - "type": "string", - "title": "base64 form" - }, - "b64url": { - "type": "string", - "title": "base64 url-safe form" - }, - "hex": { - "type": "string", - "title": "hex form" - } - }, - "required": [ - "@type", - "b64", - "b64url", - "hex" - ] - }, - "PackAddress": { - "type": "string", - "title": "Address packed in base64", - "x-usrv-cpp-type": "ton_http::types::bytes" - }, - "UnpackAddress": { - "type": "string", - "title": "Address unpacked to raw form" - }, - "AddressInformation": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "raw.fullAccountState" - ], - "default": "raw.fullAccountState" - }, - "balance": { - "$ref": "#/components/schemas/Int256" - }, - "extra_currencies": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ExtraCurrencyBalance" - } - }, - "last_transaction_id": { - "$ref": "#/components/schemas/InternalTransactionId" - }, - "block_id": { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "code": { - "$ref": "#/components/schemas/Bytes" - }, - "data": { - "$ref": "#/components/schemas/Bytes" - }, - "frozen_hash": { - "$ref": "#/components/schemas/TonHash" - }, - "sync_utime": { - "type": "integer", - "format": "int64" - }, - "state": { - "$ref": "#/components/schemas/AccountStateEnum" - }, - "suspended": { - "type": "boolean" - } - }, - "required": [ - "@type", - "balance", - "extra_currencies", - "code", - "data", - "last_transaction_id", - "block_id", - "frozen_hash", - "sync_utime", - "state" - ] - }, - "ExtendedAddressInformation": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "fullAccountState" - ], - "default": "fullAccountState" - }, - "address": { - "$ref": "#/components/schemas/AccountAddress" - }, - "balance": { - "$ref": "#/components/schemas/Int256" - }, - "extra_currencies": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ExtraCurrencyBalance" - } - }, - "last_transaction_id": { - "$ref": "#/components/schemas/InternalTransactionId" - }, - "block_id": { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "sync_utime": { - "type": "integer", - "format": "int64" - }, - "account_state": { - "$ref": "#/components/schemas/AccountState" - }, - "revision": { - "type": "integer" - } - }, - "required": [ - "@type", - "address", - "balance", - "extra_currencies", - "last_transaction_id", - "block_id", - "sync_utime", - "account_state", - "revision" - ] - }, - "WalletInformation": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "ext.accounts.walletInformation" - ], - "default": "ext.accounts.walletInformation" - }, - "wallet": { - "type": "boolean" - }, - "balance": { - "type": "string", - "x-usrv-cpp-type": "ton_http::types::int256" - }, - "account_state": { - "$ref": "#/components/schemas/AccountStateEnum" - }, - "last_transaction_id": { - "$ref": "#/components/schemas/InternalTransactionId" - }, - "wallet_type": { - "type": "string", - "enum": [ - "wallet v1 r1", - "wallet v1 r2", - "wallet v1 r3", - "wallet v2 r1", - "wallet v2 r2", - "wallet v3 r1", - "wallet v3 r2", - "wallet v4 r1", - "wallet v4 r2", - "wallet v5 beta", - "wallet v5 r1" - ] - }, - "seqno": { - "type": "integer", - "format": "int64" - }, - "wallet_id": { - "type": "integer" - }, - "is_signature_allowed": { - "type": "boolean" - } - }, - "required": [ - "@type", - "wallet", - "balance", - "account_state", - "last_transaction_id" - ] - }, - "AddressBalance": { - "$ref": "#/components/schemas/Int256" - }, - "AddressState": { - "$ref": "#/components/schemas/AccountStateEnum" - }, - "MasterchainInfo": { - "type": "object", - "additionalProperties": false, - "description": "Information about the latest masterchain block.", - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.masterchainInfo" - ], - "default": "blocks.masterchainInfo" - }, - "last": { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "state_root_hash": { - "$ref": "#/components/schemas/TonHash" - }, - "init": { - "$ref": "#/components/schemas/TonBlockIdExt" - } - }, - "required": [ - "@type", - "last", - "state_root_hash", - "init" - ] - }, - "BlockSignatures": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.blockSignatures" - ], - "default": "blocks.blockSignatures" - }, - "id": { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "signatures": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BlockSignature" - } - } - }, - "required": [ - "@type", - "id", - "signatures" - ] - }, - "BlockSignaturesSimplex": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.blockSignatures.simplex" - ], - "default": "blocks.blockSignatures.simplex" - }, - "id": { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "signatures": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BlockSignature" - } - }, - "session_id": { - "$ref": "#/components/schemas/TonHash" - }, - "slot": { - "type": "integer", - "format": "int32" - }, - "candidate": { - "$ref": "#/components/schemas/Bytes" - } - }, - "required": [ - "@type", - "id", - "signatures", - "session_id", - "slot", - "candidate" - ] - }, - "MasterchainBlockSignatures": { - "oneOf": [ - { - "$ref": "#/components/schemas/BlockSignatures" - }, - { - "$ref": "#/components/schemas/BlockSignaturesSimplex" - } - ], - "discriminator": { - "propertyName": "@type", - "mapping": { - "blocks.blockSignatures": "#/components/schemas/BlockSignatures", - "blocks.blockSignatures.simplex": "#/components/schemas/BlockSignaturesSimplex" - } - } - }, - "ShardBlockProof": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.shardBlockProof" - ], - "default": "blocks.shardBlockProof" - }, - "from": { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "mc_id": { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "links": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ShardBlockLink" - } - }, - "mc_proof": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BlockLinkBack" - } - } - }, - "required": [ - "@type", - "from", - "mc_id", - "links", - "mc_proof" - ] - }, - "ConsensusBlock": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "ext.blocks.consensusBlock" - ], - "default": "ext.blocks.consensusBlock" - }, - "consensus_block": { - "type": "integer", - "format": "int32" - }, - "timestamp": { - "type": "integer", - "format": "int32" - } - }, - "required": [ - "@type", - "consensus_block", - "timestamp" - ] - }, - "LookupBlock": { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "Shards": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.shards" - ], - "default": "blocks.shards" - }, - "shards": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TonBlockIdExt" - } - } - }, - "required": [ - "@type", - "shards" - ] - }, - "BlockHeader": { - "type": "object", - "additionalProperties": true, - "description": "Block header information.", - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.header" - ], - "default": "blocks.header" - }, - "id": { - "$ref": "#/components/schemas/TonBlockIdExt", - "description": "Extended identifier of the block." - }, - "global_id": { - "type": "integer", - "description": "Global network identifier." - }, - "version": { - "type": "integer", - "description": "Block format version." - }, - "after_merge": { - "type": "boolean", - "description": "True if block was created after a merge." - }, - "after_split": { - "type": "boolean", - "description": "True if block was created after a split." - }, - "before_split": { - "type": "boolean", - "description": "True if block was created before a split." - }, - "want_merge": { - "type": "boolean", - "description": "Indicates if validators wanted a merge." - }, - "want_split": { - "type": "boolean", - "description": "Indicates if validators wanted a split." - }, - "validator_list_hash_short": { - "type": "integer", - "description": "Short hash of validator list." - }, - "catchain_seqno": { - "type": "integer", - "description": "Catchain sequence number." - }, - "min_ref_mc_seqno": { - "type": "integer", - "description": "Minimum referenced masterchain seqno." - }, - "is_key_block": { - "type": "boolean", - "description": "True if this block is a key block." - }, - "prev_key_block_seqno": { - "type": "integer", - "description": "Previous key block sequence number." - }, - "start_lt": { - "type": "string", - "description": "Starting logical time.", - "x-usrv-cpp-type": "std::int64_t" - }, - "end_lt": { - "type": "string", - "description": "Ending logical time.", - "x-usrv-cpp-type": "std::int64_t" - }, - "gen_utime": { - "type": "integer", - "description": "Block generation UNIX timestamp." - }, - "prev_blocks": { - "type": "array", - "description": "List of previous block identifiers.", - "items": { - "$ref": "#/components/schemas/TonBlockIdExt" - } - } - }, - "required": [ - "@type", - "id", - "global_id", - "version", - "after_merge", - "after_split", - "before_split", - "want_merge", - "want_split", - "validator_list_hash_short", - "catchain_seqno", - "min_ref_mc_seqno", - "is_key_block", - "prev_key_block_seqno", - "start_lt", - "end_lt", - "gen_utime", - "prev_blocks" - ] - }, - "OutMsgQueueSizes": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.outMsgQueueSizes" - ], - "default": "blocks.outMsgQueueSizes" - }, - "shards": { - "type": "array", - "description": "List of outgoing message queue sizes per shard.", - "items": { - "$ref": "#/components/schemas/OutMsgQueueSize" - } - }, - "ext_msg_queue_size_limit": { - "type": "integer", - "description": "Limit for the external message queue size." - } - }, - "required": [ - "@type", - "shards", - "ext_msg_queue_size_limit" - ] - }, - "ConfigInfo": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "configInfo" - ], - "default": "configInfo" - }, - "config": { - "$ref": "#/components/schemas/TvmCell" - } - }, - "required": [ - "@type", - "config" - ] - }, - "LibraryResult": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "enum": [ - "smc.libraryResult" - ], - "default": "smc.libraryResult" - }, - "result": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LibraryEntry" - } - } - }, - "required": [ - "@type", - "result" - ] - }, - "BlockTransactions": { - "type": "object", - "additionalProperties": false, - "description": "Block transactions information", - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.transactions" - ], - "default": "blocks.transactions" - }, - "id": { - "description": "Identifier of the block containing the transactions", - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "req_count": { - "type": "integer", - "description": "Number of requested transactions" - }, - "incomplete": { - "type": "boolean", - "description": "Indicates if the transaction list is incomplete" - }, - "transactions": { - "type": "array", - "description": "List of short transaction identifiers", - "items": { - "$ref": "#/components/schemas/ShortTxId" - } - } - }, - "required": [ - "@type", - "id", - "req_count", - "incomplete", - "transactions" - ] - }, - "BlockTransactionsExt": { - "type": "object", - "additionalProperties": false, - "description": "Block transactions information", - "properties": { - "@type": { - "type": "string", - "enum": [ - "blocks.transactionsExt" - ], - "default": "blocks.transactionsExt" - }, - "id": { - "description": "Identifier of the block containing the transactions", - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "req_count": { - "type": "integer", - "description": "Number of requested transactions" - }, - "incomplete": { - "type": "boolean", - "description": "Indicates if the transaction list is incomplete" - }, - "transactions": { - "type": "array", - "description": "List of short transaction identifiers", - "items": { - "$ref": "#/components/schemas/TransactionExt" - } - } - }, - "required": [ - "@type", - "id", - "req_count", - "incomplete", - "transactions" - ] - }, - "Transactions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transaction" - } - }, - "TransactionsStd": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "transactions", - "previous_transaction_id" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "raw.transactions" - ], - "default": "raw.transactions" - }, - "transactions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransactionStd" - } - }, - "previous_transaction_id": { - "$ref": "#/components/schemas/InternalTransactionId" - } - } - }, - "ExtMessageInfo": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "hash", - "hash_norm" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "raw.extMessageInfo" - ], - "default": "raw.extMessageInfo" - }, - "hash": { - "$ref": "#/components/schemas/TonHash" - }, - "hash_norm": { - "$ref": "#/components/schemas/TonHash" - } - } - }, - "ResultOk": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "ok" - ], - "default": "ok" - } - } - }, - "SendBocResult": { - "oneOf": [ - { - "$ref": "#/components/schemas/ResultOk" - }, - { - "$ref": "#/components/schemas/ExtMessageInfo" - } - ], - "discriminator": { - "propertyName": "@type", - "mapping": { - "ok": "#/components/schemas/ResultOk", - "ext.messageInfo": "#/components/schemas/ExtMessageInfo" - } - } - }, - "Fees": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "in_fwd_fee", - "storage_fee", - "gas_fee", - "fwd_fee" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "fees" - ], - "default": "fees" - }, - "in_fwd_fee": { - "type": "integer", - "format": "int64" - }, - "storage_fee": { - "type": "integer", - "format": "int64" - }, - "gas_fee": { - "type": "integer", - "format": "int64" - }, - "fwd_fee": { - "type": "integer", - "format": "int64" - } - } - }, - "QueryFees": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "source_fees", - "destination_fees" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "query.fees" - ], - "default": "query.fees" - }, - "source_fees": { - "$ref": "#/components/schemas/Fees" - }, - "destination_fees": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Fees" - } - } - } - }, - "TvmStackEntrySlice": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "slice" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "tvm.stackEntrySlice" - ], - "default": "tvm.stackEntrySlice" - }, - "slice": { - "$ref": "#/components/schemas/TvmSlice" - } - } - }, - "TvmStackEntryCell": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "cell" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "tvm.stackEntryCell" - ], - "default": "tvm.stackEntryCell" - }, - "cell": { - "$ref": "#/components/schemas/TvmCell" - } - } - }, - "TvmStackEntryNumber": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "number" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "tvm.stackEntryNumber" - ], - "default": "tvm.stackEntryNumber" - }, - "number": { - "$ref": "#/components/schemas/TvmNumberDecimal" - } - } - }, - "TvmStackEntryTuple": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "tuple" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "tvm.stackEntryTuple" - ], - "default": "tvm.stackEntryTuple" - }, - "tuple": { - "$ref": "#/components/schemas/TvmTuple" - } - } - }, - "TvmStackEntryList": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "list" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "tvm.stackEntryList" - ], - "default": "tvm.stackEntryList" - }, - "list": { - "$ref": "#/components/schemas/TvmList" - } - } - }, - "TvmStackEntryUnsupported": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "tvm.stackEntryUnsupported" - ], - "default": "tvm.stackEntryUnsupported" - } - } - }, - "TvmSlice": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "bytes" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "tvm.slice" - ], - "default": "tvm.slice" - }, - "bytes": { - "$ref": "#/components/schemas/Bytes" - } - } - }, - "TvmCell": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "bytes" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "tvm.cell" - ], - "default": "tvm.cell" - }, - "bytes": { - "$ref": "#/components/schemas/Bytes" - } - } - }, - "TvmNumberDecimal": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "number" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "tvm.numberDecimal" - ], - "default": "tvm.numberDecimal" - }, - "number": { - "$ref": "#/components/schemas/Int256" - } - } - }, - "TvmTuple": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "elements" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "tvm.tuple" - ], - "default": "tvm.tuple" - }, - "elements": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TvmStackEntrySlice", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryCell", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryNumber", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryTuple", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryList", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryUnsupported", - "x-usrv-cpp-indirect": true - } - ], - "discriminator": { - "propertyName": "@type", - "mapping": { - "tvm.stackEntrySlice": "#/components/schemas/TvmStackEntrySlice", - "tvm.stackEntryCell": "#/components/schemas/TvmStackEntryCell", - "tvm.stackEntryNumber": "#/components/schemas/TvmStackEntryNumber", - "tvm.stackEntryTuple": "#/components/schemas/TvmStackEntryTuple", - "tvm.stackEntryList": "#/components/schemas/TvmStackEntryList", - "tvm.stackEntryUnsupported": "#/components/schemas/TvmStackEntryUnsupported" - } - } - } - } - } - }, - "TvmList": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "elements" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "tvm.list" - ], - "default": "tvm.list" - }, - "elements": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TvmStackEntrySlice", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryCell", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryNumber", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryTuple", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryList", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryUnsupported", - "x-usrv-cpp-indirect": true - } - ], - "discriminator": { - "propertyName": "@type", - "mapping": { - "tvm.stackEntrySlice": "#/components/schemas/TvmStackEntrySlice", - "tvm.stackEntryCell": "#/components/schemas/TvmStackEntryCell", - "tvm.stackEntryNumber": "#/components/schemas/TvmStackEntryNumber", - "tvm.stackEntryTuple": "#/components/schemas/TvmStackEntryTuple", - "tvm.stackEntryList": "#/components/schemas/TvmStackEntryList", - "tvm.stackEntryUnsupported": "#/components/schemas/TvmStackEntryUnsupported" - } - } - } - } - } - }, - "RunGetMethodStdRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "address", - "method", - "stack" - ], - "properties": { - "address": { - "$ref": "#/components/schemas/TonAddr" - }, - "method": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ] - }, - "stack": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TvmStackEntrySlice", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryCell", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryNumber", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryTuple", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryList", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryUnsupported", - "x-usrv-cpp-indirect": true - } - ], - "discriminator": { - "propertyName": "@type", - "mapping": { - "tvm.stackEntrySlice": "#/components/schemas/TvmStackEntrySlice", - "tvm.stackEntryCell": "#/components/schemas/TvmStackEntryCell", - "tvm.stackEntryNumber": "#/components/schemas/TvmStackEntryNumber", - "tvm.stackEntryTuple": "#/components/schemas/TvmStackEntryTuple", - "tvm.stackEntryList": "#/components/schemas/TvmStackEntryList", - "tvm.stackEntryUnsupported": "#/components/schemas/TvmStackEntryUnsupported" - } - } - } - }, - "seqno": { - "type": "integer" - } - } - }, - "RunGetMethodStdResult": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "gas_used", - "stack", - "exit_code" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "smc.runResult" - ], - "default": "smc.runResult" - }, - "gas_used": { - "type": "integer", - "format": "int64" - }, - "stack": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TvmStackEntrySlice", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryCell", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryNumber", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryTuple", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryList", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmStackEntryUnsupported", - "x-usrv-cpp-indirect": true - } - ], - "discriminator": { - "propertyName": "@type", - "mapping": { - "tvm.stackEntrySlice": "#/components/schemas/TvmStackEntrySlice", - "tvm.stackEntryCell": "#/components/schemas/TvmStackEntryCell", - "tvm.stackEntryNumber": "#/components/schemas/TvmStackEntryNumber", - "tvm.stackEntryTuple": "#/components/schemas/TvmStackEntryTuple", - "tvm.stackEntryList": "#/components/schemas/TvmStackEntryList", - "tvm.stackEntryUnsupported": "#/components/schemas/TvmStackEntryUnsupported" - } - } - } - }, - "exit_code": { - "type": "integer", - "format": "int32" - } - } - }, - "LegacyTvmCell": { - "type": "object", - "additionalProperties": false, - "required": [ - "data", - "refs", - "special" - ], - "properties": { - "data": { - "type": "object", - "additionalProperties": false, - "required": [ - "b64", - "len" - ], - "properties": { - "b64": { - "$ref": "#/components/schemas/Bytes" - }, - "len": { - "type": "integer", - "format": "int32" - } - } - }, - "refs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LegacyTvmCell" - } - }, - "special": { - "type": "boolean" - } - } - }, - "LegacyStackEntryCell": { - "type": "object", - "additionalProperties": false, - "required": [ - "bytes" - ], - "properties": { - "bytes": { - "$ref": "#/components/schemas/Bytes" - }, - "object": { - "$ref": "#/components/schemas/LegacyTvmCell" - } - } - }, - "LegacyStackEntry": { - "type": "array", - "items": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64" - }, - { - "$ref": "#/components/schemas/LegacyStackEntryCell" - }, - { - "$ref": "#/components/schemas/TvmTuple", - "x-usrv-cpp-indirect": true - }, - { - "$ref": "#/components/schemas/TvmList", - "x-usrv-cpp-indirect": true - } - ] - }, - "minItems": 2, - "maxItems": 2 - }, - "RunGetMethodRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "address", - "method", - "stack" - ], - "properties": { - "address": { - "$ref": "#/components/schemas/TonAddr" - }, - "method": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int32" - } - ] - }, - "stack": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LegacyStackEntry" - } - }, - "seqno": { - "type": "integer", - "format": "int32" - } - } - }, - "RunGetMethodResult": { - "type": "object", - "additionalProperties": false, - "required": [ - "@type", - "gas_used", - "stack", - "exit_code", - "block_id", - "last_transaction_id" - ], - "properties": { - "@type": { - "type": "string", - "enum": [ - "smc.runResult" - ], - "default": "smc.runResult" - }, - "gas_used": { - "type": "integer", - "format": "int64" - }, - "stack": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LegacyStackEntry" - } - }, - "exit_code": { - "type": "integer", - "format": "int32" - }, - "block_id": { - "$ref": "#/components/schemas/TonBlockIdExt" - }, - "last_transaction_id": { - "$ref": "#/components/schemas/InternalTransactionId" - } - } - } - } - } -} \ No newline at end of file