diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
new file mode 100644
index 00000000..4e330a36
--- /dev/null
+++ b/.github/workflows/CI.yml
@@ -0,0 +1,417 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - main
+ - master
+ tags:
+ - '*'
+ pull_request:
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ linux:
+ runs-on: ${{ matrix.platform.runner }}
+ timeout-minutes: 60
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - runner: ubuntu-22.04
+ target: x86_64
+ - runner: ubuntu-22.04
+ target: x86
+ - runner: ubuntu-22.04
+ target: aarch64
+ - runner: ubuntu-22.04
+ target: armv7
+ - runner: ubuntu-22.04
+ target: s390x
+ - runner: ubuntu-22.04
+ target: ppc64le
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: 3.x
+ - name: Build wheels
+ uses: PyO3/maturin-action@v1
+ with:
+ target: ${{ matrix.platform.target }}
+ args: --release --out dist
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ manylinux: 2_28
+ working-directory: BinaryOptionsToolsV2
+ env:
+ CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
+ CFLAGS_armv7_unknown_linux_gnueabihf: "-D__ARM_ARCH=7"
+ ASFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
+ ASFLAGS_armv7_unknown_linux_gnueabihf: "-D__ARM_ARCH=7"
+ - name: Build free-threaded wheels
+ uses: PyO3/maturin-action@v1
+ with:
+ target: ${{ matrix.platform.target }}
+ args: --release --out dist -i python3.13t
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ manylinux: 2_28
+ working-directory: BinaryOptionsToolsV2
+ env:
+ CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
+ CFLAGS_armv7_unknown_linux_gnueabihf: "-D__ARM_ARCH=7"
+ ASFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
+ ASFLAGS_armv7_unknown_linux_gnueabihf: "-D__ARM_ARCH=7"
+ - name: Upload wheels
+ uses: actions/upload-artifact@v4
+ with:
+ name: wheels-linux-${{ matrix.platform.target }}
+ path: BinaryOptionsToolsV2/dist
+ - name: pytest
+ if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
+ shell: bash
+ working-directory: BinaryOptionsToolsV2
+ run: |
+ set -e
+ python3 -m venv .venv
+ source .venv/bin/activate
+ pip install BinaryOptionsToolsV2 --find-links dist --force-reinstall
+ pip install pytest
+ mkdir test_run
+ cd test_run
+ pytest ../tests
+ - name: pytest
+ if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
+ uses: uraimo/run-on-arch-action@v2
+ with:
+ arch: ${{ matrix.platform.target }}
+ distro: ubuntu22.04
+ githubToken: ${{ github.token }}
+ install: |
+ apt-get update
+ apt-get install -y --no-install-recommends python3 python3-pip
+ pip3 install -U pip pytest
+ run: |
+ set -e
+ cd BinaryOptionsToolsV2
+ pip3 install BinaryOptionsToolsV2 --find-links dist --force-reinstall
+ mkdir test_run
+ cd test_run
+ pytest ../tests
+
+ musllinux:
+ runs-on: ${{ matrix.platform.runner }}
+ timeout-minutes: 60
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - runner: ubuntu-22.04
+ target: x86_64
+ - runner: ubuntu-22.04
+ target: x86
+ - runner: ubuntu-22.04
+ target: aarch64
+ - runner: ubuntu-22.04
+ target: armv7
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: 3.x
+ - name: Build wheels
+ uses: PyO3/maturin-action@v1
+ with:
+ target: ${{ matrix.platform.target }}
+ args: --release --out dist
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ manylinux: musllinux_1_2
+ working-directory: BinaryOptionsToolsV2
+ env:
+ CFLAGS_aarch64_unknown_linux_musl: "-D__ARM_ARCH=8"
+ CFLAGS_armv7_unknown_linux_musleabihf: "-D__ARM_ARCH=7"
+ ASFLAGS_aarch64_unknown_linux_musl: "-D__ARM_ARCH=8"
+ ASFLAGS_armv7_unknown_linux_musleabihf: "-D__ARM_ARCH=7"
+ - name: Build free-threaded wheels
+ uses: PyO3/maturin-action@v1
+ with:
+ target: ${{ matrix.platform.target }}
+ args: --release --out dist -i python3.13t
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ manylinux: musllinux_1_2
+ working-directory: BinaryOptionsToolsV2
+ env:
+ CFLAGS_aarch64_unknown_linux_musl: "-D__ARM_ARCH=8"
+ CFLAGS_armv7_unknown_linux_musleabihf: "-D__ARM_ARCH=7"
+ ASFLAGS_aarch64_unknown_linux_musl: "-D__ARM_ARCH=8"
+ ASFLAGS_armv7_unknown_linux_musleabihf: "-D__ARM_ARCH=7"
+ - name: Upload wheels
+ uses: actions/upload-artifact@v4
+ with:
+ name: wheels-musllinux-${{ matrix.platform.target }}
+ path: BinaryOptionsToolsV2/dist
+ - name: pytest
+ if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
+ uses: addnab/docker-run-action@v3
+ with:
+ image: alpine:latest
+ options: -v ${{ github.workspace }}:/io -w /io/BinaryOptionsToolsV2
+ run: |
+ set -e
+ apk add py3-pip py3-virtualenv
+ python3 -m virtualenv .venv
+ source .venv/bin/activate
+ pip install BinaryOptionsToolsV2 --no-index --find-links dist --force-reinstall
+ pip install pytest
+ mkdir test_run
+ cd test_run
+ pytest ../tests
+ - name: pytest
+ if: ${{ !startsWith(matrix.platform.target, 'x86') }}
+ uses: uraimo/run-on-arch-action@v2
+ with:
+ arch: ${{ matrix.platform.target }}
+ distro: alpine_latest
+ githubToken: ${{ github.token }}
+ install: |
+ apk add py3-virtualenv
+ run: |
+ set -e
+ cd BinaryOptionsToolsV2
+ python3 -m virtualenv .venv
+ source .venv/bin/activate
+ pip install pytest
+ pip install BinaryOptionsToolsV2 --find-links dist --force-reinstall
+ mkdir test_run
+ cd test_run
+ pytest ../tests
+
+ windows:
+ runs-on: ${{ matrix.platform.runner }}
+ timeout-minutes: 60
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - runner: windows-latest
+ target: x64
+ - runner: windows-latest
+ target: x86
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: 3.x
+ architecture: ${{ matrix.platform.target }}
+ - name: Build wheels
+ uses: PyO3/maturin-action@v1
+ with:
+ target: ${{ matrix.platform.target }}
+ args: --release --out dist
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ working-directory: BinaryOptionsToolsV2
+ - uses: actions/setup-python@v5
+ with:
+ python-version: 3.13t
+ architecture: ${{ matrix.platform.target }}
+ - name: Build free-threaded wheels
+ uses: PyO3/maturin-action@v1
+ with:
+ target: ${{ matrix.platform.target }}
+ args: --release --out dist -i python3.13t
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ working-directory: BinaryOptionsToolsV2
+ - name: Upload wheels
+ uses: actions/upload-artifact@v4
+ with:
+ name: wheels-windows-${{ matrix.platform.target }}
+ path: BinaryOptionsToolsV2/dist
+ - name: pytest
+ if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
+ shell: bash
+ working-directory: BinaryOptionsToolsV2
+ run: |
+ set -e
+ python3 -m venv .venv
+ source .venv/Scripts/activate
+ pip install BinaryOptionsToolsV2 --find-links dist --force-reinstall
+ pip install pytest
+ mkdir test_run
+ cd test_run
+ pytest ../tests
+
+ macos:
+ runs-on: ${{ matrix.platform.runner }}
+ timeout-minutes: 60
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - runner: macos-15-intel
+ target: x86_64
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: 3.x
+ - name: Build wheels
+ uses: PyO3/maturin-action@v1
+ with:
+ target: ${{ matrix.platform.target }}
+ args: --release --out dist
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ working-directory: BinaryOptionsToolsV2
+ - name: Build free-threaded wheels
+ uses: PyO3/maturin-action@v1
+ with:
+ target: ${{ matrix.platform.target }}
+ args: --release --out dist -i python3.13t
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ working-directory: BinaryOptionsToolsV2
+ - name: Upload wheels
+ uses: actions/upload-artifact@v4
+ with:
+ name: wheels-macos-${{ matrix.platform.target }}
+ path: BinaryOptionsToolsV2/dist
+ - name: pytest
+ working-directory: BinaryOptionsToolsV2
+ run: |
+ set -e
+ python3 -m venv .venv
+ source .venv/bin/activate
+ pip install BinaryOptionsToolsV2 --find-links dist --force-reinstall
+ pip install pytest
+ mkdir test_run
+ cd test_run
+ pytest ../tests
+
+ # emscripten:
+ # runs-on: ubuntu-22.04
+ # timeout-minutes: 60
+ # strategy:
+ # fail-fast: false
+ # steps:
+ # - uses: actions/checkout@v4
+
+ # - name: Set up Python for Pyodide tools
+ # uses: actions/setup-python@v5
+ # with:
+ # python-version: '3.12'
+
+ # - name: Get Emscripten and Python version info
+ # shell: bash
+ # run: |
+ # pip install pyodide-build
+ # echo "EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)" >> $GITHUB_ENV
+ # echo "PYTHON_VERSION=$(pyodide config get python_version | cut -d '.' -f 1-2)" >> $GITHUB_ENV
+ # pip uninstall -y pyodide-build
+
+ # - name: Setup Emscripten
+ # uses: mymindstorm/setup-emsdk@v14
+ # with:
+ # version: ${{ env.EMSCRIPTEN_VERSION }}
+ # cache-key: emscripten-${{ runner.os }}-${{ env.EMSCRIPTEN_VERSION }}-${{ github.ref_name }}
+
+ # - name: Setup Python for Build
+ # uses: actions/setup-python@v5
+ # with:
+ # python-version: ${{ env.PYTHON_VERSION }}
+
+ # - name: Build wheels
+ # uses: PyO3/maturin-action@v1
+ # with:
+ # target: wasm32-unknown-emscripten
+ # args: --release --out dist
+ # sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ # rust-toolchain: nightly
+ # working-directory: BinaryOptionsToolsV2
+
+ # - name: Build free-threaded wheels
+ # uses: PyO3/maturin-action@v1
+ # with:
+ # target: wasm32-unknown-emscripten
+ # args: --release --out dist -i python3.13t
+ # sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ # rust-toolchain: nightly
+ # working-directory: BinaryOptionsToolsV2
+
+ # - name: Upload wheels
+ # uses: actions/upload-artifact@v4
+ # with:
+ # name: wasm-wheels
+ # path: BinaryOptionsToolsV2/dist
+
+ # - uses: actions/setup-node@v4
+ # with:
+ # node-version: '20'
+
+ # - name: pytest
+ # working-directory: BinaryOptionsToolsV2
+ # run: |
+ # set -e
+ # pip install pyodide-build
+ # pyodide venv .venv
+ # source .venv/bin/activate
+ # pip install BinaryOptionsToolsV2 --find-links dist --force-reinstall
+ # pip install pytest
+ # mkdir test_run
+ # cd test_run
+ # python -m pytest ../tests
+
+ sdist:
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ steps:
+ - uses: actions/checkout@v4
+ - name: Build sdist
+ uses: PyO3/maturin-action@v1
+ with:
+ command: sdist
+ args: --out dist
+ working-directory: BinaryOptionsToolsV2
+ - name: Upload sdist
+ uses: actions/upload-artifact@v4
+ with:
+ name: wheels-sdist
+ path: BinaryOptionsToolsV2/dist
+
+ release:
+ name: Release
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' }}
+ needs: [linux, musllinux, windows, macos, sdist]
+ permissions:
+ id-token: write
+ contents: write
+ attestations: write
+ steps:
+ - uses: actions/download-artifact@v4
+ with:
+ # This downloads all artifacts.
+ # Each artifact is placed in a directory named after its name (e.g., wheels-linux-x86_64/)
+ path: .
+
+ - name: Generate artifact attestation
+ uses: actions/attest-build-provenance@v2
+ with:
+ subject-path: 'wheels-*/*'
+ # commented for six's fork
+ # - name: Publish to PyPI
+ # if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
+ # uses: PyO3/maturin-action@v1
+ # env:
+ # MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
+ # with:
+ # command: upload
+ # args: --non-interactive --skip-existing wheels-*/*
+
+ - name: Upload to GitHub Release
+ uses: softprops/action-gh-release@v2
+ with:
+ # This pattern catches all wheels and the sdist from all artifact folders
+ files: |
+ wheels-*/*
+ prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
diff --git a/BinaryOptionsToolsUni/Cargo.lock b/BinaryOptionsToolsUni/Cargo.lock
index 74fce6ed..a881b54f 100644
--- a/BinaryOptionsToolsUni/Cargo.lock
+++ b/BinaryOptionsToolsUni/Cargo.lock
@@ -126,6 +126,28 @@ version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
+[[package]]
+name = "aws-lc-rs"
+version = "1.15.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e84ce723ab67259cfeb9877c6a639ee9eb7a27b28123abd71db7f0d5d0cc9d86"
+dependencies = [
+ "aws-lc-sys",
+ "zeroize",
+]
+
+[[package]]
+name = "aws-lc-sys"
+version = "0.36.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "43a442ece363113bd4bd4c8b18977a7798dd4d3c3383f34fb61936960e8f4ad8"
+dependencies = [
+ "cc",
+ "cmake",
+ "dunce",
+ "fs_extra",
+]
+
[[package]]
name = "base64"
version = "0.22.1"
@@ -184,12 +206,13 @@ dependencies = [
"binary-options-tools-macros",
"chrono",
"futures-util",
- "native-tls",
"php_serde",
"rand 0.9.2",
"regex",
"reqwest",
"rust_decimal",
+ "rustls",
+ "rustls-native-certs",
"serde",
"serde-enum-str",
"serde_json",
@@ -332,11 +355,13 @@ dependencies = [
[[package]]
name = "cc"
-version = "1.2.44"
+version = "1.2.53"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37521ac7aabe3d13122dc382493e20c9416f299d2ccd5b3a5340a2570cdeb0f3"
+checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932"
dependencies = [
"find-msvc-tools",
+ "jobserver",
+ "libc",
"shlex",
]
@@ -363,7 +388,7 @@ dependencies = [
"num-traits",
"serde",
"wasm-bindgen",
- "windows-link 0.2.1",
+ "windows-link",
]
[[package]]
@@ -405,6 +430,15 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
+[[package]]
+name = "cmake"
+version = "0.1.57"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d"
+dependencies = [
+ "cc",
+]
+
[[package]]
name = "concurrent-queue"
version = "2.5.0"
@@ -416,9 +450,9 @@ dependencies = [
[[package]]
name = "core-foundation"
-version = "0.9.4"
+version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
+checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
dependencies = [
"core-foundation-sys",
"libc",
@@ -553,13 +587,10 @@ dependencies = [
]
[[package]]
-name = "encoding_rs"
-version = "0.8.35"
+name = "dunce"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
-dependencies = [
- "cfg-if",
-]
+checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "equivalent"
@@ -606,9 +637,9 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]]
name = "find-msvc-tools"
-version = "0.1.4"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127"
+checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
[[package]]
name = "fnv"
@@ -616,21 +647,6 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-[[package]]
-name = "foreign-types"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
-dependencies = [
- "foreign-types-shared",
-]
-
-[[package]]
-name = "foreign-types-shared"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
-
[[package]]
name = "form_urlencoded"
version = "1.2.2"
@@ -649,6 +665,12 @@ dependencies = [
"autocfg",
]
+[[package]]
+name = "fs_extra"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
+
[[package]]
name = "funty"
version = "2.0.0"
@@ -725,8 +747,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
dependencies = [
"cfg-if",
+ "js-sys",
"libc",
"wasi",
+ "wasm-bindgen",
]
[[package]]
@@ -736,9 +760,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
dependencies = [
"cfg-if",
+ "js-sys",
"libc",
"r-efi",
"wasip2",
+ "wasm-bindgen",
]
[[package]]
@@ -758,25 +784,6 @@ dependencies = [
"scroll",
]
-[[package]]
-name = "h2"
-version = "0.4.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386"
-dependencies = [
- "atomic-waker",
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "http",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
[[package]]
name = "hashbrown"
version = "0.12.3"
@@ -848,7 +855,6 @@ dependencies = [
"bytes",
"futures-channel",
"futures-core",
- "h2",
"http",
"http-body",
"httparse",
@@ -874,22 +880,7 @@ dependencies = [
"tokio",
"tokio-rustls",
"tower-service",
-]
-
-[[package]]
-name = "hyper-tls"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
-dependencies = [
- "bytes",
- "http-body-util",
- "hyper",
- "hyper-util",
- "native-tls",
- "tokio",
- "tokio-native-tls",
- "tower-service",
+ "webpki-roots",
]
[[package]]
@@ -911,11 +902,9 @@ dependencies = [
"percent-encoding",
"pin-project-lite",
"socket2",
- "system-configuration",
"tokio",
"tower-service",
"tracing",
- "windows-registry",
]
[[package]]
@@ -1084,6 +1073,16 @@ version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
+[[package]]
+name = "jobserver"
+version = "0.1.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33"
+dependencies = [
+ "getrandom 0.3.4",
+ "libc",
+]
+
[[package]]
name = "js-sys"
version = "0.3.82"
@@ -1144,16 +1143,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
[[package]]
-name = "memchr"
-version = "2.7.6"
+name = "lru-slab"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
+checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
[[package]]
-name = "mime"
-version = "0.3.17"
+name = "memchr"
+version = "2.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
+checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
[[package]]
name = "minimal-lexical"
@@ -1172,23 +1171,6 @@ dependencies = [
"windows-sys 0.61.2",
]
-[[package]]
-name = "native-tls"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e"
-dependencies = [
- "libc",
- "log",
- "openssl",
- "openssl-probe",
- "openssl-sys",
- "schannel",
- "security-framework",
- "security-framework-sys",
- "tempfile",
-]
-
[[package]]
name = "nom"
version = "7.1.3"
@@ -1223,49 +1205,11 @@ version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
-[[package]]
-name = "openssl"
-version = "0.10.74"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24ad14dd45412269e1a30f52ad8f0664f0f4f4a89ee8fe28c3b3527021ebb654"
-dependencies = [
- "bitflags",
- "cfg-if",
- "foreign-types",
- "libc",
- "once_cell",
- "openssl-macros",
- "openssl-sys",
-]
-
-[[package]]
-name = "openssl-macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.108",
-]
-
[[package]]
name = "openssl-probe"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
-
-[[package]]
-name = "openssl-sys"
-version = "0.9.110"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a9f0075ba3c21b09f8e8b2026584b1d18d49388648f2fbbf3c97ea8deced8e2"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
- "vcpkg",
-]
+checksum = "9f50d9b3dabb09ecd771ad0aa242ca6894994c130308ca3d7684634df8037391"
[[package]]
name = "parking"
@@ -1293,7 +1237,7 @@ dependencies = [
"libc",
"redox_syscall",
"smallvec",
- "windows-link 0.2.1",
+ "windows-link",
]
[[package]]
@@ -1325,12 +1269,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-[[package]]
-name = "pkg-config"
-version = "0.3.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
-
[[package]]
name = "plain"
version = "0.2.3"
@@ -1393,6 +1331,61 @@ dependencies = [
"syn 1.0.109",
]
+[[package]]
+name = "quinn"
+version = "0.11.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20"
+dependencies = [
+ "bytes",
+ "cfg_aliases",
+ "pin-project-lite",
+ "quinn-proto",
+ "quinn-udp",
+ "rustc-hash",
+ "rustls",
+ "socket2",
+ "thiserror",
+ "tokio",
+ "tracing",
+ "web-time",
+]
+
+[[package]]
+name = "quinn-proto"
+version = "0.11.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
+dependencies = [
+ "bytes",
+ "getrandom 0.3.4",
+ "lru-slab",
+ "rand 0.9.2",
+ "ring",
+ "rustc-hash",
+ "rustls",
+ "rustls-pki-types",
+ "slab",
+ "thiserror",
+ "tinyvec",
+ "tracing",
+ "web-time",
+]
+
+[[package]]
+name = "quinn-udp"
+version = "0.5.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd"
+dependencies = [
+ "cfg_aliases",
+ "libc",
+ "once_cell",
+ "socket2",
+ "tracing",
+ "windows-sys 0.60.2",
+]
+
[[package]]
name = "quote"
version = "1.0.41"
@@ -1528,29 +1521,26 @@ checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f"
dependencies = [
"base64",
"bytes",
- "encoding_rs",
"futures-core",
- "h2",
"http",
"http-body",
"http-body-util",
"hyper",
"hyper-rustls",
- "hyper-tls",
"hyper-util",
"js-sys",
"log",
- "mime",
- "native-tls",
"percent-encoding",
"pin-project-lite",
+ "quinn",
+ "rustls",
"rustls-pki-types",
"serde",
"serde_json",
"serde_urlencoded",
"sync_wrapper",
"tokio",
- "tokio-native-tls",
+ "tokio-rustls",
"tower",
"tower-http",
"tower-service",
@@ -1558,6 +1548,7 @@ dependencies = [
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
+ "webpki-roots",
]
[[package]]
@@ -1655,19 +1646,35 @@ version = "0.23.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a9586e9ee2b4f8fab52a0048ca7334d7024eef48e2cb9407e3497bb7cab7fa7"
dependencies = [
+ "aws-lc-rs",
+ "log",
"once_cell",
+ "ring",
"rustls-pki-types",
"rustls-webpki",
"subtle",
"zeroize",
]
+[[package]]
+name = "rustls-native-certs"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63"
+dependencies = [
+ "openssl-probe",
+ "rustls-pki-types",
+ "schannel",
+ "security-framework",
+]
+
[[package]]
name = "rustls-pki-types"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94182ad936a0c91c324cd46c6511b9510ed16af436d7b5bab34beab0afd55f7a"
dependencies = [
+ "web-time",
"zeroize",
]
@@ -1677,6 +1684,7 @@ version = "0.103.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52"
dependencies = [
+ "aws-lc-rs",
"ring",
"rustls-pki-types",
"untrusted",
@@ -1737,9 +1745,9 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
[[package]]
name = "security-framework"
-version = "2.11.1"
+version = "3.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
+checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef"
dependencies = [
"bitflags",
"core-foundation",
@@ -2003,27 +2011,6 @@ dependencies = [
"syn 2.0.108",
]
-[[package]]
-name = "system-configuration"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
-dependencies = [
- "bitflags",
- "core-foundation",
- "system-configuration-sys",
-]
-
-[[package]]
-name = "system-configuration-sys"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
[[package]]
name = "tap"
version = "1.0.1"
@@ -2108,9 +2095,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.48.0"
+version = "1.49.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408"
+checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
dependencies = [
"bytes",
"libc",
@@ -2134,16 +2121,6 @@ dependencies = [
"syn 2.0.108",
]
-[[package]]
-name = "tokio-native-tls"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
-dependencies = [
- "native-tls",
- "tokio",
-]
-
[[package]]
name = "tokio-rustls"
version = "0.26.4"
@@ -2162,25 +2139,14 @@ checksum = "d25a406cddcc431a75d3d9afc6a7c0f7428d4891dd973e4d54c56b46127bf857"
dependencies = [
"futures-util",
"log",
- "native-tls",
+ "rustls",
+ "rustls-native-certs",
+ "rustls-pki-types",
"tokio",
- "tokio-native-tls",
+ "tokio-rustls",
"tungstenite",
]
-[[package]]
-name = "tokio-util"
-version = "0.7.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "pin-project-lite",
- "tokio",
-]
-
[[package]]
name = "toml"
version = "0.9.8"
@@ -2279,9 +2245,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
[[package]]
name = "tracing"
-version = "0.1.41"
+version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
+checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647"
dependencies = [
"pin-project-lite",
"tracing-attributes",
@@ -2290,9 +2256,9 @@ dependencies = [
[[package]]
name = "tracing-attributes"
-version = "0.1.30"
+version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
+checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
dependencies = [
"proc-macro2",
"quote",
@@ -2301,9 +2267,9 @@ dependencies = [
[[package]]
name = "tracing-core"
-version = "0.1.34"
+version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
+checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c"
dependencies = [
"once_cell",
"valuable",
@@ -2364,8 +2330,9 @@ dependencies = [
"http",
"httparse",
"log",
- "native-tls",
"rand 0.9.2",
+ "rustls",
+ "rustls-pki-types",
"sha1",
"thiserror",
"utf-8",
@@ -2565,12 +2532,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
-[[package]]
-name = "vcpkg"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
-
[[package]]
name = "version_check"
version = "0.9.5"
@@ -2669,6 +2630,25 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "web-time"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "webpki-roots"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c"
+dependencies = [
+ "rustls-pki-types",
+]
+
[[package]]
name = "weedle2"
version = "5.0.0"
@@ -2686,9 +2666,9 @@ checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
dependencies = [
"windows-implement",
"windows-interface",
- "windows-link 0.2.1",
- "windows-result 0.4.1",
- "windows-strings 0.5.1",
+ "windows-link",
+ "windows-result",
+ "windows-strings",
]
[[package]]
@@ -2713,54 +2693,19 @@ dependencies = [
"syn 2.0.108",
]
-[[package]]
-name = "windows-link"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
-
[[package]]
name = "windows-link"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
-[[package]]
-name = "windows-registry"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e"
-dependencies = [
- "windows-link 0.1.3",
- "windows-result 0.3.4",
- "windows-strings 0.4.2",
-]
-
-[[package]]
-name = "windows-result"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
-dependencies = [
- "windows-link 0.1.3",
-]
-
[[package]]
name = "windows-result"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
dependencies = [
- "windows-link 0.2.1",
-]
-
-[[package]]
-name = "windows-strings"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
-dependencies = [
- "windows-link 0.1.3",
+ "windows-link",
]
[[package]]
@@ -2769,7 +2714,7 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
dependencies = [
- "windows-link 0.2.1",
+ "windows-link",
]
[[package]]
@@ -2796,7 +2741,7 @@ version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
dependencies = [
- "windows-link 0.2.1",
+ "windows-link",
]
[[package]]
@@ -2821,7 +2766,7 @@ version = "0.53.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
dependencies = [
- "windows-link 0.2.1",
+ "windows-link",
"windows_aarch64_gnullvm 0.53.1",
"windows_aarch64_msvc 0.53.1",
"windows_i686_gnu 0.53.1",
diff --git a/BinaryOptionsToolsUni/Cargo.toml b/BinaryOptionsToolsUni/Cargo.toml
index e0137cf5..a29b6c77 100644
--- a/BinaryOptionsToolsUni/Cargo.toml
+++ b/BinaryOptionsToolsUni/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "binary_options_tools_uni"
version = "0.1.0"
-edition = "2024"
+edition = "2021"
authors = ["ChipaDevTeam"]
repository = "https://github.com/ChipaDevTeam/BinaryOptionsTools-v2"
homepage = "https://chipadevteam.github.io/BinaryOptionsTools-v2/"
diff --git a/BinaryOptionsToolsUni/docs/TRADING_GUIDE.md b/BinaryOptionsToolsUni/docs/TRADING_GUIDE.md
index 4109be50..c15f8495 100644
--- a/BinaryOptionsToolsUni/docs/TRADING_GUIDE.md
+++ b/BinaryOptionsToolsUni/docs/TRADING_GUIDE.md
@@ -3,6 +3,7 @@
Complete guide to trading binary options using BinaryOptionsToolsUni across all supported languages.
## Table of Contents
+
- [Getting Started](#getting-started)
- [Trading Basics](#trading-basics)
- [Advanced Trading Strategies](#advanced-trading-strategies)
@@ -67,6 +68,7 @@ async def first_trade():
asyncio.run(first_trade())
```
+
@@ -110,6 +112,7 @@ suspend fun firstTrade() = coroutineScope {
client.shutdown()
}
```
+
---
@@ -119,6 +122,7 @@ suspend fun firstTrade() = coroutineScope {
### Trade Types
#### Call (Buy) Trade
+
Predict that the price will go **UP** at expiration.
```python
@@ -126,6 +130,7 @@ trade = await client.buy("EURUSD_otc", 60, 1.0)
```
#### Put (Sell) Trade
+
Predict that the price will go **DOWN** at expiration.
```python
@@ -427,6 +432,7 @@ async def batch_trade(client, signals):
**Problem**: Can't connect to PocketOption servers.
**Solutions**:
+
- Verify your SSID is correct and not expired
- Check internet connection
- Try reconnecting: `await client.reconnect()`
@@ -437,6 +443,7 @@ async def batch_trade(client, signals):
**Problem**: Trade placement fails.
**Solutions**:
+
- Check if market is open (avoid weekends for non-OTC assets)
- Verify asset name is correct (e.g., "EURUSD_otc")
- Ensure sufficient balance
@@ -447,6 +454,7 @@ async def batch_trade(client, signals):
**Problem**: Can't get trade result.
**Solutions**:
+
- Wait longer - trade may not have expired yet
- Use `result_with_timeout()` instead of `result()`
- Check trade ID is correct
@@ -457,6 +465,7 @@ async def batch_trade(client, signals):
**Problem**: API calls are very slow.
**Solutions**:
+
- Ensure 2-second initialization wait after creating client
- Don't create multiple clients - reuse one client
- Check network latency
diff --git a/BinaryOptionsToolsUni/out/python/binary_options_tools_uni.py b/BinaryOptionsToolsUni/out/python/binary_options_tools_uni.py
index 9deeb0d9..ed353e01 100644
--- a/BinaryOptionsToolsUni/out/python/binary_options_tools_uni.py
+++ b/BinaryOptionsToolsUni/out/python/binary_options_tools_uni.py
@@ -14,24 +14,24 @@
# helpers directly inline like we're doing here.
from __future__ import annotations
-import os
-import sys
+
+import asyncio
+import contextlib
import ctypes
-from dataclasses import dataclass
+import datetime
import enum
+import itertools
+import os
+import platform
import struct
-import contextlib
-import datetime
+import sys
import threading
-import itertools
import traceback
import typing
-import asyncio
-import platform
-
+from dataclasses import dataclass
# Used for default argument values
-_DEFAULT = object() # type: typing.Any
+_DEFAULT = object() # type: typing.Any
class _UniffiRustBuffer(ctypes.Structure):
@@ -47,20 +47,24 @@ def default():
@staticmethod
def alloc(size):
- return _uniffi_rust_call(_UniffiLib.ffi_binary_options_tools_uni_rustbuffer_alloc, size)
+ return _uniffi_rust_call(
+ _UniffiLib.ffi_binary_options_tools_uni_rustbuffer_alloc, size
+ )
@staticmethod
def reserve(rbuf, additional):
- return _uniffi_rust_call(_UniffiLib.ffi_binary_options_tools_uni_rustbuffer_reserve, rbuf, additional)
+ return _uniffi_rust_call(
+ _UniffiLib.ffi_binary_options_tools_uni_rustbuffer_reserve, rbuf, additional
+ )
def free(self):
- return _uniffi_rust_call(_UniffiLib.ffi_binary_options_tools_uni_rustbuffer_free, self)
+ return _uniffi_rust_call(
+ _UniffiLib.ffi_binary_options_tools_uni_rustbuffer_free, self
+ )
def __str__(self):
return "_UniffiRustBuffer(capacity={}, len={}, data={})".format(
- self.capacity,
- self.len,
- self.data[0:self.len]
+ self.capacity, self.len, self.data[0 : self.len]
)
@contextlib.contextmanager
@@ -88,7 +92,9 @@ def consume_with_stream(self):
s = _UniffiRustBufferStream.from_rust_buffer(self)
yield s
if s.remaining() != 0:
- raise RuntimeError(f"junk data left in buffer at end of consume_with_stream {s.remaining()}")
+ raise RuntimeError(
+ f"junk data left in buffer at end of consume_with_stream {s.remaining()}"
+ )
finally:
self.free()
@@ -102,7 +108,10 @@ def read_with_stream(self):
s = _UniffiRustBufferStream.from_rust_buffer(self)
yield s
if s.remaining() != 0:
- raise RuntimeError(f"junk data left in buffer at end of read_with_stream {s.remaining()}")
+ raise RuntimeError(
+ f"junk data left in buffer at end of read_with_stream {s.remaining()}"
+ )
+
class _UniffiForeignBytes(ctypes.Structure):
_fields_ = [
@@ -111,7 +120,9 @@ class _UniffiForeignBytes(ctypes.Structure):
]
def __str__(self):
- return "_UniffiForeignBytes(len={}, data={})".format(self.len, self.data[0:self.len])
+ return "_UniffiForeignBytes(len={}, data={})".format(
+ self.len, self.data[0 : self.len]
+ )
class _UniffiRustBufferStream:
@@ -134,14 +145,14 @@ def remaining(self):
def _unpack_from(self, size, format):
if self.offset + size > self.len:
raise InternalError("read past end of rust buffer")
- value = struct.unpack(format, self.data[self.offset:self.offset+size])[0]
+ value = struct.unpack(format, self.data[self.offset : self.offset + size])[0]
self.offset += size
return value
def read(self, size):
if self.offset + size > self.len:
raise InternalError("read past end of rust buffer")
- data = self.data[self.offset:self.offset+size]
+ data = self.data[self.offset : self.offset + size]
self.offset += size
return data
@@ -176,6 +187,7 @@ def read_float(self):
def read_double(self):
return self._unpack_from(8, ">d")
+
class _UniffiRustBufferBuilder:
"""
Helper for structured writing of bytes into a _UniffiRustBuffer.
@@ -244,17 +256,22 @@ def write_double(self, v):
self._pack_into(8, ">d", v)
def write_c_size_t(self, v):
- self._pack_into(ctypes.sizeof(ctypes.c_size_t) , "@N", v)
+ self._pack_into(ctypes.sizeof(ctypes.c_size_t), "@N", v)
+
+
# A handful of classes and functions to support the generated data structures.
# This would be a good candidate for isolating in its own ffi-support lib.
+
class InternalError(Exception):
pass
+
class _UniffiRustCallStatus(ctypes.Structure):
"""
Error runtime.
"""
+
_fields_ = [
("code", ctypes.c_int8),
("error_buf", _UniffiRustBuffer),
@@ -267,7 +284,10 @@ class _UniffiRustCallStatus(ctypes.Structure):
@staticmethod
def default():
- return _UniffiRustCallStatus(code=_UniffiRustCallStatus.CALL_SUCCESS, error_buf=_UniffiRustBuffer.default())
+ return _UniffiRustCallStatus(
+ code=_UniffiRustCallStatus.CALL_SUCCESS,
+ error_buf=_UniffiRustBuffer.default(),
+ )
def __str__(self):
if self.code == _UniffiRustCallStatus.CALL_SUCCESS:
@@ -279,10 +299,12 @@ def __str__(self):
else:
return "_UniffiRustCallStatus()"
+
def _uniffi_rust_call(fn, *args):
# Call a rust function
return _uniffi_rust_call_with_error(None, fn, *args)
+
def _uniffi_rust_call_with_error(error_ffi_converter, fn, *args):
# Call a rust function and handle any errors
#
@@ -295,13 +317,16 @@ def _uniffi_rust_call_with_error(error_ffi_converter, fn, *args):
_uniffi_check_call_status(error_ffi_converter, call_status)
return result
+
def _uniffi_check_call_status(error_ffi_converter, call_status):
if call_status.code == _UniffiRustCallStatus.CALL_SUCCESS:
pass
elif call_status.code == _UniffiRustCallStatus.CALL_ERROR:
if error_ffi_converter is None:
call_status.error_buf.free()
- raise InternalError("_uniffi_rust_call_with_error: CALL_ERROR, but error_ffi_converter is None")
+ raise InternalError(
+ "_uniffi_rust_call_with_error: CALL_ERROR, but error_ffi_converter is None"
+ )
else:
raise error_ffi_converter.lift(call_status.error_buf)
elif call_status.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR:
@@ -314,8 +339,10 @@ def _uniffi_check_call_status(error_ffi_converter, call_status):
msg = "Unknown rust panic"
raise InternalError(msg)
else:
- raise InternalError("Invalid _UniffiRustCallStatus code: {}".format(
- call_status.code))
+ raise InternalError(
+ "Invalid _UniffiRustCallStatus code: {}".format(call_status.code)
+ )
+
def _uniffi_trait_interface_call(call_status, make_call, write_return_value):
try:
@@ -324,7 +351,10 @@ def _uniffi_trait_interface_call(call_status, make_call, write_return_value):
call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR
call_status.error_buf = _UniffiFfiConverterString.lower(repr(e))
-def _uniffi_trait_interface_call_with_error(call_status, make_call, write_return_value, error_type, lower_error):
+
+def _uniffi_trait_interface_call_with_error(
+ call_status, make_call, write_return_value, error_type, lower_error
+):
try:
try:
return write_return_value(make_call())
@@ -334,11 +364,14 @@ def _uniffi_trait_interface_call_with_error(call_status, make_call, write_return
except Exception as e:
call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR
call_status.error_buf = _UniffiFfiConverterString.lower(repr(e))
-# Initial value and increment amount for handles.
+
+
+# Initial value and increment amount for handles.
# These ensure that Python-generated handles always have the lowest bit set
_UNIFFI_HANDLEMAP_INITIAL = 1
_UNIFFI_HANDLEMAP_DELTA = 2
+
class _UniffiHandleMap:
"""
A map where inserting, getting and removing data is synchronized with a lock.
@@ -355,6 +388,7 @@ def insert(self, obj):
return self._insert(obj)
"""Low-level insert, this assumes `self._lock` is held."""
+
def _insert(self, obj):
handle = self._counter
self._counter += _UNIFFI_HANDLEMAP_DELTA
@@ -385,6 +419,8 @@ def remove(self, handle):
def __len__(self):
return len(self._map)
+
+
# Types conforming to `_UniffiConverterPrimitive` pass themselves directly over the FFI.
class _UniffiConverterPrimitive:
@classmethod
@@ -395,17 +431,29 @@ def lift(cls, value):
def lower(cls, value):
return value
+
class _UniffiConverterPrimitiveInt(_UniffiConverterPrimitive):
@classmethod
def check_lower(cls, value):
try:
value = value.__index__()
except Exception:
- raise TypeError("'{}' object cannot be interpreted as an integer".format(type(value).__name__))
+ raise TypeError(
+ "'{}' object cannot be interpreted as an integer".format(
+ type(value).__name__
+ )
+ )
if not isinstance(value, int):
- raise TypeError("__index__ returned non-int (type {})".format(type(value).__name__))
+ raise TypeError(
+ "__index__ returned non-int (type {})".format(type(value).__name__)
+ )
if not cls.VALUE_MIN <= value < cls.VALUE_MAX:
- raise ValueError("{} requires {} <= value < {}".format(cls.CLASS_NAME, cls.VALUE_MIN, cls.VALUE_MAX))
+ raise ValueError(
+ "{} requires {} <= value < {}".format(
+ cls.CLASS_NAME, cls.VALUE_MIN, cls.VALUE_MAX
+ )
+ )
+
class _UniffiConverterPrimitiveFloat(_UniffiConverterPrimitive):
@classmethod
@@ -415,7 +463,10 @@ def check_lower(cls, value):
except Exception:
raise TypeError("must be real number, not {}".format(type(value).__name__))
if not isinstance(value, float):
- raise TypeError("__float__ returned non-float (type {})".format(type(value).__name__))
+ raise TypeError(
+ "__float__ returned non-float (type {})".format(type(value).__name__)
+ )
+
# Helper class for wrapper types that will always go through a _UniffiRustBuffer.
# Classes should inherit from this and implement the `read` and `write` static methods.
@@ -431,6 +482,7 @@ def lower(cls, value):
cls.write(value, builder)
return builder.finalize()
+
# Contains loading, initialization code, and the FFI Function declarations.
# Define some ctypes FFI types that we use in the library
@@ -439,12 +491,14 @@ def lower(cls, value):
"""
_UNIFFI_RUST_TASK = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int8)
+
def _uniffi_future_callback_t(return_type):
"""
Factory function to create callback function types for async functions
"""
return ctypes.CFUNCTYPE(None, ctypes.c_uint64, return_type, _UniffiRustCallStatus)
+
def _uniffi_load_indirect():
"""
This is how we find and load the dynamic library provided by the component.
@@ -470,91 +524,270 @@ def _uniffi_load_indirect():
lib = ctypes.cdll.LoadLibrary(path)
return lib
+
def _uniffi_check_contract_api_version(lib):
# Get the bindings contract version from our ComponentInterface
bindings_contract_version = 30
# Get the scaffolding contract version by calling the into the dylib
- scaffolding_contract_version = lib.ffi_binary_options_tools_uni_uniffi_contract_version()
+ scaffolding_contract_version = (
+ lib.ffi_binary_options_tools_uni_uniffi_contract_version()
+ )
if bindings_contract_version != scaffolding_contract_version:
- raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project")
+ raise InternalError(
+ "UniFFI contract version mismatch: try cleaning and rebuilding your project"
+ )
+
def _uniffi_check_api_checksums(lib):
- if lib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_init() != 50054:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_new() != 31315:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_new_with_url() != 40992:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_assets() != 48493:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_balance() != 26020:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_init()
+ != 50054
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_new()
+ != 31315
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_new_with_url()
+ != 40992
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_assets()
+ != 48493
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_balance()
+ != 26020
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_buy() != 63032:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_clear_closed_deals() != 9178:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_create_raw_handler() != 34256:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_candles() != 23490:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_candles_advanced() != 27509:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_closed_deals() != 47785:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_opened_deals() != 27985:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_history() != 27093:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_is_demo() != 19411:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_payout() != 5344:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_reconnect() != 9220:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_clear_closed_deals()
+ != 9178
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_create_raw_handler()
+ != 34256
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_candles()
+ != 23490
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_candles_advanced()
+ != 27509
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_closed_deals()
+ != 47785
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_opened_deals()
+ != 27985
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_history()
+ != 27093
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_is_demo()
+ != 19411
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_payout()
+ != 5344
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_reconnect()
+ != 9220
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_result() != 594:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_result_with_timeout() != 56468:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_result_with_timeout()
+ != 56468
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_sell() != 61157:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_server_time() != 10589:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_shutdown() != 51452:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_subscribe() != 23382:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_trade() != 14619:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_unsubscribe() != 29837:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_and_wait() != 12420:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_binary() != 12514:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_text() != 41075:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_wait_next() != 65338:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_method_subscriptionstream_next() != 13448:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_all() != 22652:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_server_time()
+ != 10589
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_shutdown()
+ != 51452
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_subscribe()
+ != 23382
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_trade()
+ != 14619
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_unsubscribe()
+ != 29837
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_and_wait()
+ != 12420
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_binary()
+ != 12514
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_text()
+ != 41075
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_wait_next()
+ != 65338
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_method_subscriptionstream_next()
+ != 13448
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_all()
+ != 22652
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
if lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_any() != 239:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_contains() != 4008:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_ends_with() != 3462:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_contains()
+ != 4008
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_ends_with()
+ != 3462
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
if lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_ne() != 13897:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_new() != 49602:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_regex() != 42529:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
- if lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_starts_with() != 32570:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_new()
+ != 49602
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_regex()
+ != 42529
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+ if (
+ lib.uniffi_binary_options_tools_uni_checksum_constructor_validator_starts_with()
+ != 32570
+ ):
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
if lib.uniffi_binary_options_tools_uni_checksum_method_validator_check() != 57297:
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ raise InternalError(
+ "UniFFI API checksum mismatch: try cleaning and rebuilding your project"
+ )
+
# A ctypes library to expose the extern-C FFI definitions.
# This is an implementation detail which will be called internally by the public API.
@@ -569,7 +802,9 @@ def _uniffi_check_api_checksums(lib):
_UniffiForeignBytes,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.ffi_binary_options_tools_uni_rustbuffer_from_bytes.restype = _UniffiRustBuffer
+_UniffiLib.ffi_binary_options_tools_uni_rustbuffer_from_bytes.restype = (
+ _UniffiRustBuffer
+)
_UniffiLib.ffi_binary_options_tools_uni_rustbuffer_free.argtypes = (
_UniffiRustBuffer,
ctypes.POINTER(_UniffiRustCallStatus),
@@ -581,15 +816,24 @@ def _uniffi_check_api_checksums(lib):
ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_binary_options_tools_uni_rustbuffer_reserve.restype = _UniffiRustBuffer
-_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_int8,
+_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK = ctypes.CFUNCTYPE(
+ None,
+ ctypes.c_uint64,
+ ctypes.c_int8,
)
-_UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64,
+_UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK = ctypes.CFUNCTYPE(
+ None,
+ ctypes.c_uint64,
)
+
+
class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
_fields_ = [
("handle", ctypes.c_uint64),
("free", _UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK),
]
+
+
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_u8.argtypes = (
ctypes.c_uint64,
_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
@@ -642,7 +886,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_u16.restype = ctypes.c_uint16
+_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_u16.restype = (
+ ctypes.c_uint16
+)
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_u16.argtypes = (
ctypes.c_uint64,
)
@@ -661,7 +907,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_i16.restype = ctypes.c_int16
+_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_i16.restype = (
+ ctypes.c_int16
+)
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_i16.argtypes = (
ctypes.c_uint64,
)
@@ -680,7 +928,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_u32.restype = ctypes.c_uint32
+_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_u32.restype = (
+ ctypes.c_uint32
+)
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_u32.argtypes = (
ctypes.c_uint64,
)
@@ -699,7 +949,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_i32.restype = ctypes.c_int32
+_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_i32.restype = (
+ ctypes.c_int32
+)
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_i32.argtypes = (
ctypes.c_uint64,
)
@@ -718,7 +970,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_u64.restype = ctypes.c_uint64
+_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_u64.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_u64.argtypes = (
ctypes.c_uint64,
)
@@ -737,7 +991,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_i64.restype = ctypes.c_int64
+_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_i64.restype = (
+ ctypes.c_int64
+)
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_i64.argtypes = (
ctypes.c_uint64,
)
@@ -756,7 +1012,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_f32.restype = ctypes.c_float
+_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_f32.restype = (
+ ctypes.c_float
+)
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_f32.argtypes = (
ctypes.c_uint64,
)
@@ -775,7 +1033,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_f64.restype = ctypes.c_double
+_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_f64.restype = (
+ ctypes.c_double
+)
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_f64.argtypes = (
ctypes.c_uint64,
)
@@ -794,7 +1054,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer.restype = _UniffiRustBuffer
+_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer.restype = (
+ _UniffiRustBuffer
+)
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer.argtypes = (
ctypes.c_uint64,
)
@@ -822,7 +1084,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_clone_pocketoption.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_clone_pocketoption.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_free_pocketoption.argtypes = (
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
@@ -842,7 +1106,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_clone_subscriptionstream.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_clone_subscriptionstream.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_free_subscriptionstream.argtypes = (
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
@@ -861,11 +1127,15 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_pocketoption_init.argtypes = (
_UniffiRustBuffer,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_pocketoption_init.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_pocketoption_init.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_pocketoption_new.argtypes = (
_UniffiRustBuffer,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_pocketoption_new.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_pocketoption_new.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_pocketoption_new_with_url.argtypes = (
_UniffiRustBuffer,
_UniffiRustBuffer,
@@ -874,18 +1144,24 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_assets.argtypes = (
ctypes.c_uint64,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_assets.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_assets.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_balance.argtypes = (
ctypes.c_uint64,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_balance.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_balance.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_buy.argtypes = (
ctypes.c_uint64,
_UniffiRustBuffer,
ctypes.c_uint32,
ctypes.c_double,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_buy.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_buy.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_clear_closed_deals.argtypes = (
ctypes.c_uint64,
)
@@ -924,26 +1200,36 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
_UniffiRustBuffer,
ctypes.c_uint32,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_history.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_history.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_is_demo.argtypes = (
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_is_demo.restype = ctypes.c_int8
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_is_demo.restype = (
+ ctypes.c_int8
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_payout.argtypes = (
ctypes.c_uint64,
_UniffiRustBuffer,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_payout.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_payout.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_reconnect.argtypes = (
ctypes.c_uint64,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_reconnect.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_reconnect.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_result.argtypes = (
ctypes.c_uint64,
_UniffiRustBuffer,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_result.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_result.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_result_with_timeout.argtypes = (
ctypes.c_uint64,
_UniffiRustBuffer,
@@ -956,7 +1242,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint32,
ctypes.c_double,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_sell.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_sell.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_server_time.argtypes = (
ctypes.c_uint64,
)
@@ -964,13 +1252,17 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_shutdown.argtypes = (
ctypes.c_uint64,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_shutdown.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_shutdown.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_subscribe.argtypes = (
ctypes.c_uint64,
_UniffiRustBuffer,
ctypes.c_uint64,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_subscribe.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_subscribe.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_trade.argtypes = (
ctypes.c_uint64,
_UniffiRustBuffer,
@@ -978,7 +1270,9 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint32,
ctypes.c_double,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_trade.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_trade.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_unsubscribe.argtypes = (
ctypes.c_uint64,
_UniffiRustBuffer,
@@ -993,35 +1287,49 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
_UniffiRustBuffer,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_send_binary.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_send_binary.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_send_text.argtypes = (
ctypes.c_uint64,
_UniffiRustBuffer,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_send_text.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_send_text.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_wait_next.argtypes = (
ctypes.c_uint64,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_wait_next.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_wait_next.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_method_subscriptionstream_next.argtypes = (
ctypes.c_uint64,
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_subscriptionstream_next.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_subscriptionstream_next.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_all.argtypes = (
_UniffiRustBuffer,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_all.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_all.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_any.argtypes = (
_UniffiRustBuffer,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_any.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_any.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_contains.argtypes = (
_UniffiRustBuffer,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_contains.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_contains.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_ends_with.argtypes = (
_UniffiRustBuffer,
ctypes.POINTER(_UniffiRustCallStatus),
@@ -1031,16 +1339,22 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_ne.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_ne.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_new.argtypes = (
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_new.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_new.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_regex.argtypes = (
_UniffiRustBuffer,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_regex.restype = ctypes.c_uint64
+_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_regex.restype = (
+ ctypes.c_uint64
+)
_UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_validator_starts_with.argtypes = (
_UniffiRustBuffer,
ctypes.POINTER(_UniffiRustCallStatus),
@@ -1051,124 +1365,97 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
_UniffiRustBuffer,
ctypes.POINTER(_UniffiRustCallStatus),
)
-_UniffiLib.uniffi_binary_options_tools_uni_fn_method_validator_check.restype = ctypes.c_int8
-_UniffiLib.ffi_binary_options_tools_uni_uniffi_contract_version.argtypes = (
+_UniffiLib.uniffi_binary_options_tools_uni_fn_method_validator_check.restype = (
+ ctypes.c_int8
)
-_UniffiLib.ffi_binary_options_tools_uni_uniffi_contract_version.restype = ctypes.c_uint32
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_init.argtypes = (
+_UniffiLib.ffi_binary_options_tools_uni_uniffi_contract_version.argtypes = ()
+_UniffiLib.ffi_binary_options_tools_uni_uniffi_contract_version.restype = (
+ ctypes.c_uint32
)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_init.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_init.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_new.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_new.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_new.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_new_with_url.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_new_with_url.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_pocketoption_new_with_url.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_assets.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_assets.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_assets.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_balance.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_balance.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_balance.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_buy.argtypes = (
-)
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_buy.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_clear_closed_deals.argtypes = (
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_buy.argtypes = ()
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_buy.restype = (
+ ctypes.c_uint16
)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_clear_closed_deals.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_clear_closed_deals.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_create_raw_handler.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_create_raw_handler.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_create_raw_handler.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_candles.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_candles.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_candles.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_candles_advanced.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_candles_advanced.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_candles_advanced.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_closed_deals.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_closed_deals.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_closed_deals.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_opened_deals.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_opened_deals.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_get_opened_deals.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_history.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_history.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_history.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_is_demo.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_is_demo.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_is_demo.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_payout.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_payout.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_payout.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_reconnect.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_reconnect.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_reconnect.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_result.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_result.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_result.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_result_with_timeout.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_result_with_timeout.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_result_with_timeout.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_sell.argtypes = (
-)
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_sell.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_server_time.argtypes = (
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_sell.argtypes = ()
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_sell.restype = (
+ ctypes.c_uint16
)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_server_time.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_server_time.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_shutdown.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_shutdown.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_shutdown.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_subscribe.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_subscribe.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_subscribe.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_trade.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_trade.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_trade.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_unsubscribe.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_unsubscribe.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_pocketoption_unsubscribe.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_and_wait.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_and_wait.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_and_wait.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_binary.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_binary.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_binary.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_text.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_text.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_send_text.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_wait_next.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_wait_next.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_rawhandler_wait_next.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_subscriptionstream_next.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_subscriptionstream_next.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_subscriptionstream_next.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_all.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_all.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_all.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_any.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_any.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_any.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_contains.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_contains.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_contains.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_ends_with.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_ends_with.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_ends_with.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_ne.argtypes = (
-)
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_ne.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_new.argtypes = (
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_ne.argtypes = ()
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_ne.restype = (
+ ctypes.c_uint16
)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_new.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_new.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_regex.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_regex.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_regex.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_starts_with.argtypes = (
-)
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_starts_with.argtypes = ()
_UniffiLib.uniffi_binary_options_tools_uni_checksum_constructor_validator_starts_with.restype = ctypes.c_uint16
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_validator_check.argtypes = (
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_validator_check.argtypes = ()
+_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_validator_check.restype = (
+ ctypes.c_uint16
)
-_UniffiLib.uniffi_binary_options_tools_uni_checksum_method_validator_check.restype = ctypes.c_uint16
_uniffi_check_contract_api_version(_UniffiLib)
# _uniffi_check_api_checksums(_UniffiLib)
@@ -1194,16 +1481,20 @@ class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
In this case, we need an event loop to run the Python async function, but there's no eventloop set
for the thread. Use `uniffi_set_event_loop` to force an eventloop to be used in this case.
"""
+
+
def uniffi_set_event_loop(eventloop: asyncio.BaseEventLoop):
global _UNIFFI_GLOBAL_EVENT_LOOP
_UNIFFI_GLOBAL_EVENT_LOOP = eventloop
+
def _uniffi_get_event_loop():
if _UNIFFI_GLOBAL_EVENT_LOOP is not None:
return _UNIFFI_GLOBAL_EVENT_LOOP
else:
return asyncio.get_running_loop()
+
# Continuation callback for async functions
# lift the return value or error and resolve the future, causing the async function to resume.
@_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK
@@ -1211,11 +1502,15 @@ def _uniffi_continuation_callback(future_ptr, poll_code):
(eventloop, future) = _UniffiContinuationHandleMap.remove(future_ptr)
eventloop.call_soon_threadsafe(_uniffi_set_future_result, future, poll_code)
+
def _uniffi_set_future_result(future, poll_code):
if not future.cancelled():
future.set_result(poll_code)
-async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, lift_func, error_ffi_converter):
+
+async def _uniffi_rust_call_async(
+ rust_future, ffi_poll, ffi_complete, ffi_free, lift_func, error_ffi_converter
+):
try:
eventloop = _uniffi_get_event_loop()
@@ -1237,12 +1532,13 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free,
finally:
ffi_free(rust_future)
+
# Public interface members begin here.
class _UniffiFfiConverterInt32(_UniffiConverterPrimitiveInt):
CLASS_NAME = "i32"
- VALUE_MIN = -2**31
+ VALUE_MIN = -(2**31)
VALUE_MAX = 2**31
@staticmethod
@@ -1253,6 +1549,7 @@ def read(buf):
def write(value, buf):
buf.write_i32(value)
+
class _UniffiFfiConverterString:
@staticmethod
def check_lower(value):
@@ -1285,6 +1582,7 @@ def lower(value):
builder.write(value.encode("utf-8"))
return builder.finalize()
+
class _UniffiFfiConverterBoolean:
@classmethod
def check_lower(cls, value):
@@ -1306,6 +1604,7 @@ def read(cls, buf):
def write(cls, value, buf):
buf.write_u8(value)
+
class _UniffiFfiConverterUInt32(_UniffiConverterPrimitiveInt):
CLASS_NAME = "u32"
VALUE_MIN = 0
@@ -1319,6 +1618,7 @@ def read(buf):
def write(value, buf):
buf.write_u32(value)
+
@dataclass
class CandleLength:
"""
@@ -1335,20 +1635,20 @@ class CandleLength:
five_second_candle = CandleLength(time=5)
```
-"""
- def __init__(self, *, time:int):
+ """
+
+ def __init__(self, *, time: int):
self.time = time
-
-
-
def __str__(self):
return "CandleLength(time={})".format(self.time)
+
def __eq__(self, other):
if self.time != other.time:
return False
return True
+
class _UniffiFfiConverterTypeCandleLength(_UniffiConverterRustBuffer):
@staticmethod
def read(buf):
@@ -1364,6 +1664,7 @@ def check_lower(value):
def write(value, buf):
_UniffiFfiConverterUInt32.write(value.time, buf)
+
class _UniffiFfiConverterSequenceTypeCandleLength(_UniffiConverterRustBuffer):
@classmethod
def check_lower(cls, value):
@@ -1383,13 +1684,7 @@ def read(cls, buf):
if count < 0:
raise InternalError("Unexpected negative sequence length")
- return [
- _UniffiFfiConverterTypeCandleLength.read(buf) for i in range(count)
- ]
-
-
-
-
+ return [_UniffiFfiConverterTypeCandleLength.read(buf) for i in range(count)]
class AssetType(enum.Enum):
@@ -1407,18 +1702,17 @@ class AssetType(enum.Enum):
asset_type = AssetType.CURRENCY
```
-"""
-
+ """
+
STOCK = 0
-
+
CURRENCY = 1
-
+
COMMODITY = 2
-
+
CRYPTOCURRENCY = 3
-
+
INDEX = 4
-
class _UniffiFfiConverterTypeAssetType(_UniffiConverterRustBuffer):
@@ -1465,7 +1759,6 @@ def write(value, buf):
buf.write_i32(5)
-
@dataclass
class Asset:
"""
@@ -1485,8 +1778,20 @@ class Asset:
eurusd = Asset(id=1, name="EUR/USD", symbol="EURUSD_otc", is_otc=True, is_active=True, payout=85, allowed_candles=[], asset_type=AssetType.CURRENCY)
print(eurusd.name)
```
-"""
- def __init__(self, *, id:int, name:str, symbol:str, is_otc:bool, is_active:bool, payout:int, allowed_candles:typing.List[CandleLength], asset_type:AssetType):
+ """
+
+ def __init__(
+ self,
+ *,
+ id: int,
+ name: str,
+ symbol: str,
+ is_otc: bool,
+ is_active: bool,
+ payout: int,
+ allowed_candles: typing.List[CandleLength],
+ asset_type: AssetType,
+ ):
self.id = id
self.name = name
self.symbol = symbol
@@ -1495,12 +1800,19 @@ def __init__(self, *, id:int, name:str, symbol:str, is_otc:bool, is_active:bool,
self.payout = payout
self.allowed_candles = allowed_candles
self.asset_type = asset_type
-
-
-
def __str__(self):
- return "Asset(id={}, name={}, symbol={}, is_otc={}, is_active={}, payout={}, allowed_candles={}, asset_type={})".format(self.id, self.name, self.symbol, self.is_otc, self.is_active, self.payout, self.allowed_candles, self.asset_type)
+ return "Asset(id={}, name={}, symbol={}, is_otc={}, is_active={}, payout={}, allowed_candles={}, asset_type={})".format(
+ self.id,
+ self.name,
+ self.symbol,
+ self.is_otc,
+ self.is_active,
+ self.payout,
+ self.allowed_candles,
+ self.asset_type,
+ )
+
def __eq__(self, other):
if self.id != other.id:
return False
@@ -1520,6 +1832,7 @@ def __eq__(self, other):
return False
return True
+
class _UniffiFfiConverterTypeAsset(_UniffiConverterRustBuffer):
@staticmethod
def read(buf):
@@ -1556,9 +1869,10 @@ def write(value, buf):
_UniffiFfiConverterSequenceTypeCandleLength.write(value.allowed_candles, buf)
_UniffiFfiConverterTypeAssetType.write(value.asset_type, buf)
+
class _UniffiFfiConverterInt64(_UniffiConverterPrimitiveInt):
CLASS_NAME = "i64"
- VALUE_MIN = -2**63
+ VALUE_MIN = -(2**63)
VALUE_MAX = 2**63
@staticmethod
@@ -1569,6 +1883,7 @@ def read(buf):
def write(value, buf):
buf.write_i64(value)
+
class _UniffiFfiConverterFloat64(_UniffiConverterPrimitiveFloat):
@staticmethod
def read(buf):
@@ -1578,6 +1893,7 @@ def read(buf):
def write(value, buf):
buf.write_double(value)
+
class _UniffiFfiConverterOptionalFloat64(_UniffiConverterRustBuffer):
@classmethod
def check_lower(cls, value):
@@ -1603,6 +1919,7 @@ def read(cls, buf):
else:
raise InternalError("Unexpected flag byte for optional type")
+
@dataclass
class Candle:
"""
@@ -1622,8 +1939,19 @@ class Candle:
candle = ... # receive from api.get_candles() or stream.next()
print(f"Candle for {candle.symbol} at {candle.timestamp}: O={candle.open}, H={candle.high}, L={candle.low}, C={candle.close}")
```
-"""
- def __init__(self, *, symbol:str, timestamp:int, open:float, high:float, low:float, close:float, volume:typing.Optional[float]):
+ """
+
+ def __init__(
+ self,
+ *,
+ symbol: str,
+ timestamp: int,
+ open: float,
+ high: float,
+ low: float,
+ close: float,
+ volume: typing.Optional[float],
+ ):
self.symbol = symbol
self.timestamp = timestamp
self.open = open
@@ -1631,12 +1959,18 @@ def __init__(self, *, symbol:str, timestamp:int, open:float, high:float, low:flo
self.low = low
self.close = close
self.volume = volume
-
-
-
def __str__(self):
- return "Candle(symbol={}, timestamp={}, open={}, high={}, low={}, close={}, volume={})".format(self.symbol, self.timestamp, self.open, self.high, self.low, self.close, self.volume)
+ return "Candle(symbol={}, timestamp={}, open={}, high={}, low={}, close={}, volume={})".format(
+ self.symbol,
+ self.timestamp,
+ self.open,
+ self.high,
+ self.low,
+ self.close,
+ self.volume,
+ )
+
def __eq__(self, other):
if self.symbol != other.symbol:
return False
@@ -1654,6 +1988,7 @@ def __eq__(self, other):
return False
return True
+
class _UniffiFfiConverterTypeCandle(_UniffiConverterRustBuffer):
@staticmethod
def read(buf):
@@ -1687,6 +2022,7 @@ def write(value, buf):
_UniffiFfiConverterFloat64.write(value.close, buf)
_UniffiFfiConverterOptionalFloat64.write(value.volume, buf)
+
class _UniffiFfiConverterUInt64(_UniffiConverterPrimitiveInt):
CLASS_NAME = "u64"
VALUE_MIN = 0
@@ -1700,6 +2036,7 @@ def read(buf):
def write(value, buf):
buf.write_u64(value)
+
class _UniffiFfiConverterOptionalString(_UniffiConverterRustBuffer):
@classmethod
def check_lower(cls, value):
@@ -1725,6 +2062,7 @@ def read(cls, buf):
else:
raise InternalError("Unexpected flag byte for optional type")
+
class _UniffiFfiConverterOptionalInt32(_UniffiConverterRustBuffer):
@classmethod
def check_lower(cls, value):
@@ -1750,6 +2088,7 @@ def read(cls, buf):
else:
raise InternalError("Unexpected flag byte for optional type")
+
class _UniffiFfiConverterOptionalBoolean(_UniffiConverterRustBuffer):
@classmethod
def check_lower(cls, value):
@@ -1775,6 +2114,7 @@ def read(cls, buf):
else:
raise InternalError("Unexpected flag byte for optional type")
+
@dataclass
class Deal:
"""
@@ -1795,8 +2135,38 @@ class Deal:
deal = ... # receive from api.result()
print(f"Trade {deal.id} on {deal.asset} resulted in a profit of {deal.profit}")
```
-"""
- def __init__(self, *, id:str, open_time:str, close_time:str, open_timestamp:int, close_timestamp:int, uid:int, request_id:typing.Optional[str], amount:float, profit:float, percent_profit:int, percent_loss:int, open_price:float, close_price:float, command:int, asset:str, is_demo:int, copy_ticket:str, open_ms:int, close_ms:typing.Optional[int], option_type:int, is_rollover:typing.Optional[bool], is_copy_signal:typing.Optional[bool], is_ai:typing.Optional[bool], currency:str, amount_usd:typing.Optional[float], amount_usd2:typing.Optional[float]):
+ """
+
+ def __init__(
+ self,
+ *,
+ id: str,
+ open_time: str,
+ close_time: str,
+ open_timestamp: int,
+ close_timestamp: int,
+ uid: int,
+ request_id: typing.Optional[str],
+ amount: float,
+ profit: float,
+ percent_profit: int,
+ percent_loss: int,
+ open_price: float,
+ close_price: float,
+ command: int,
+ asset: str,
+ is_demo: int,
+ copy_ticket: str,
+ open_ms: int,
+ close_ms: typing.Optional[int],
+ option_type: int,
+ is_rollover: typing.Optional[bool],
+ is_copy_signal: typing.Optional[bool],
+ is_ai: typing.Optional[bool],
+ currency: str,
+ amount_usd: typing.Optional[float],
+ amount_usd2: typing.Optional[float],
+ ):
self.id = id
self.open_time = open_time
self.close_time = close_time
@@ -1823,12 +2193,37 @@ def __init__(self, *, id:str, open_time:str, close_time:str, open_timestamp:int,
self.currency = currency
self.amount_usd = amount_usd
self.amount_usd2 = amount_usd2
-
-
-
def __str__(self):
- return "Deal(id={}, open_time={}, close_time={}, open_timestamp={}, close_timestamp={}, uid={}, request_id={}, amount={}, profit={}, percent_profit={}, percent_loss={}, open_price={}, close_price={}, command={}, asset={}, is_demo={}, copy_ticket={}, open_ms={}, close_ms={}, option_type={}, is_rollover={}, is_copy_signal={}, is_ai={}, currency={}, amount_usd={}, amount_usd2={})".format(self.id, self.open_time, self.close_time, self.open_timestamp, self.close_timestamp, self.uid, self.request_id, self.amount, self.profit, self.percent_profit, self.percent_loss, self.open_price, self.close_price, self.command, self.asset, self.is_demo, self.copy_ticket, self.open_ms, self.close_ms, self.option_type, self.is_rollover, self.is_copy_signal, self.is_ai, self.currency, self.amount_usd, self.amount_usd2)
+ return "Deal(id={}, open_time={}, close_time={}, open_timestamp={}, close_timestamp={}, uid={}, request_id={}, amount={}, profit={}, percent_profit={}, percent_loss={}, open_price={}, close_price={}, command={}, asset={}, is_demo={}, copy_ticket={}, open_ms={}, close_ms={}, option_type={}, is_rollover={}, is_copy_signal={}, is_ai={}, currency={}, amount_usd={}, amount_usd2={})".format(
+ self.id,
+ self.open_time,
+ self.close_time,
+ self.open_timestamp,
+ self.close_timestamp,
+ self.uid,
+ self.request_id,
+ self.amount,
+ self.profit,
+ self.percent_profit,
+ self.percent_loss,
+ self.open_price,
+ self.close_price,
+ self.command,
+ self.asset,
+ self.is_demo,
+ self.copy_ticket,
+ self.open_ms,
+ self.close_ms,
+ self.option_type,
+ self.is_rollover,
+ self.is_copy_signal,
+ self.is_ai,
+ self.currency,
+ self.amount_usd,
+ self.amount_usd2,
+ )
+
def __eq__(self, other):
if self.id != other.id:
return False
@@ -1884,6 +2279,7 @@ def __eq__(self, other):
return False
return True
+
class _UniffiFfiConverterTypeDeal(_UniffiConverterRustBuffer):
@staticmethod
def read(buf):
@@ -1975,10 +2371,6 @@ def write(value, buf):
_UniffiFfiConverterOptionalFloat64.write(value.amount_usd2, buf)
-
-
-
-
class Action(enum.Enum):
"""
Represents the action to take in a trade.
@@ -2027,12 +2419,11 @@ class Action(enum.Enum):
var buyAction = binaryoptionstoolsuni.ActionCall
var sellAction = binaryoptionstoolsuni.ActionPut
```
-"""
-
+ """
+
CALL = 0
-
+
PUT = 1
-
class _UniffiFfiConverterTypeAction(_UniffiConverterRustBuffer):
@@ -2061,9 +2452,6 @@ def write(value, buf):
buf.write_i32(2)
-
-
-
# UniError
# We want to define each variant as a nested class that's also a subclass,
# which is tricky in Python. To accomplish this we're going to create each
@@ -2073,17 +2461,19 @@ def write(value, buf):
class UniError(Exception):
pass
+
_UniffiTempUniError = UniError
+
class UniError: # type: ignore
-
class BinaryOptions(_UniffiTempUniError):
-
def __init__(self, *values):
if len(values) != 1:
raise TypeError(f"Expected 1 arguments, found {len(values)}")
if not isinstance(values[0], str):
- raise TypeError(f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'")
+ raise TypeError(
+ f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'"
+ )
super().__init__(", ".join(map(repr, values)))
self._values = values
@@ -2092,14 +2482,17 @@ def __getitem__(self, index):
def __repr__(self):
return "UniError.BinaryOptions({})".format(str(self))
- _UniffiTempUniError.BinaryOptions = BinaryOptions # type: ignore
+
+ _UniffiTempUniError.BinaryOptions = BinaryOptions # type: ignore
+
class PocketOption(_UniffiTempUniError):
-
def __init__(self, *values):
if len(values) != 1:
raise TypeError(f"Expected 1 arguments, found {len(values)}")
if not isinstance(values[0], str):
- raise TypeError(f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'")
+ raise TypeError(
+ f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'"
+ )
super().__init__(", ".join(map(repr, values)))
self._values = values
@@ -2108,14 +2501,17 @@ def __getitem__(self, index):
def __repr__(self):
return "UniError.PocketOption({})".format(str(self))
- _UniffiTempUniError.PocketOption = PocketOption # type: ignore
+
+ _UniffiTempUniError.PocketOption = PocketOption # type: ignore
+
class Uuid(_UniffiTempUniError):
-
def __init__(self, *values):
if len(values) != 1:
raise TypeError(f"Expected 1 arguments, found {len(values)}")
if not isinstance(values[0], str):
- raise TypeError(f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'")
+ raise TypeError(
+ f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'"
+ )
super().__init__(", ".join(map(repr, values)))
self._values = values
@@ -2124,14 +2520,17 @@ def __getitem__(self, index):
def __repr__(self):
return "UniError.Uuid({})".format(str(self))
- _UniffiTempUniError.Uuid = Uuid # type: ignore
+
+ _UniffiTempUniError.Uuid = Uuid # type: ignore
+
class Validator(_UniffiTempUniError):
-
def __init__(self, *values):
if len(values) != 1:
raise TypeError(f"Expected 1 arguments, found {len(values)}")
if not isinstance(values[0], str):
- raise TypeError(f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'")
+ raise TypeError(
+ f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'"
+ )
super().__init__(", ".join(map(repr, values)))
self._values = values
@@ -2140,9 +2539,11 @@ def __getitem__(self, index):
def __repr__(self):
return "UniError.Validator({})".format(str(self))
- _UniffiTempUniError.Validator = Validator # type: ignore
-UniError = _UniffiTempUniError # type: ignore
+ _UniffiTempUniError.Validator = Validator # type: ignore
+
+
+UniError = _UniffiTempUniError # type: ignore
del _UniffiTempUniError
@@ -2198,6 +2599,7 @@ def write(value, buf):
buf.write_i32(4)
_UniffiFfiConverterString.write(value._values[0], buf)
+
class _UniffiFfiConverterSequenceTypeAsset(_UniffiConverterRustBuffer):
@classmethod
def check_lower(cls, value):
@@ -2217,9 +2619,8 @@ def read(cls, buf):
if count < 0:
raise InternalError("Unexpected negative sequence length")
- return [
- _UniffiFfiConverterTypeAsset.read(buf) for i in range(count)
- ]
+ return [_UniffiFfiConverterTypeAsset.read(buf) for i in range(count)]
+
class _UniffiFfiConverterOptionalSequenceTypeAsset(_UniffiConverterRustBuffer):
@classmethod
@@ -2253,8 +2654,8 @@ class ValidatorProtocol(typing.Protocol):
Provides various methods to validate messages using different strategies
like regex matching, prefix/suffix checking, and logical combinations.
-"""
-
+ """
+
def check(self, message: str) -> bool:
"""
Checks if a message matches this validator's conditions.
@@ -2266,18 +2667,20 @@ def check(self, message: str) -> bool:
# Returns
True if message matches the validator's conditions, False otherwise
-"""
+ """
raise NotImplementedError
+
class Validator(ValidatorProtocol):
"""
Validator for filtering WebSocket messages.
Provides various methods to validate messages using different strategies
like regex matching, prefix/suffix checking, and logical combinations.
-"""
-
+ """
+
_handle: ctypes.c_uint64
+
@classmethod
def all(cls, validators: typing.List[Validator]) -> Validator:
"""
@@ -2299,8 +2702,8 @@ def all(cls, validators: typing.List[Validator]) -> Validator:
assert v.check("Hello Beautiful World") == True
assert v.check("Hello Beautiful") == False
```
-"""
-
+ """
+
_UniffiFfiConverterSequenceTypeValidator.check_lower(validators)
_uniffi_lowered_args = (
_UniffiFfiConverterSequenceTypeValidator.lower(validators),
@@ -2313,6 +2716,7 @@ def all(cls, validators: typing.List[Validator]) -> Validator:
*_uniffi_lowered_args,
)
return cls._uniffi_make_instance(_uniffi_ffi_result)
+
@classmethod
def any(cls, validators: typing.List[Validator]) -> Validator:
"""
@@ -2335,8 +2739,8 @@ def any(cls, validators: typing.List[Validator]) -> Validator:
assert v.check("task completed") == True
assert v.check("in progress") == False
```
-"""
-
+ """
+
_UniffiFfiConverterSequenceTypeValidator.check_lower(validators)
_uniffi_lowered_args = (
_UniffiFfiConverterSequenceTypeValidator.lower(validators),
@@ -2349,6 +2753,7 @@ def any(cls, validators: typing.List[Validator]) -> Validator:
*_uniffi_lowered_args,
)
return cls._uniffi_make_instance(_uniffi_ffi_result)
+
@classmethod
def contains(cls, substring: str) -> Validator:
"""
@@ -2357,12 +2762,10 @@ def contains(cls, substring: str) -> Validator:
# Arguments
* `substring` - String that should be present in messages
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(substring)
- _uniffi_lowered_args = (
- _UniffiFfiConverterString.lower(substring),
- )
+ _uniffi_lowered_args = (_UniffiFfiConverterString.lower(substring),)
_uniffi_lift_return = _UniffiFfiConverterTypeValidator.lift
_uniffi_error_converter = None
_uniffi_ffi_result = _uniffi_rust_call_with_error(
@@ -2371,6 +2774,7 @@ def contains(cls, substring: str) -> Validator:
*_uniffi_lowered_args,
)
return cls._uniffi_make_instance(_uniffi_ffi_result)
+
@classmethod
def ends_with(cls, suffix: str) -> Validator:
"""
@@ -2379,12 +2783,10 @@ def ends_with(cls, suffix: str) -> Validator:
# Arguments
* `suffix` - String that messages should end with
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(suffix)
- _uniffi_lowered_args = (
- _UniffiFfiConverterString.lower(suffix),
- )
+ _uniffi_lowered_args = (_UniffiFfiConverterString.lower(suffix),)
_uniffi_lift_return = _UniffiFfiConverterTypeValidator.lift
_uniffi_error_converter = None
_uniffi_ffi_result = _uniffi_rust_call_with_error(
@@ -2393,6 +2795,7 @@ def ends_with(cls, suffix: str) -> Validator:
*_uniffi_lowered_args,
)
return cls._uniffi_make_instance(_uniffi_ffi_result)
+
@classmethod
def ne(cls, validator: Validator) -> Validator:
"""
@@ -2411,12 +2814,10 @@ def ne(cls, validator: Validator) -> Validator:
assert v.check("success message") == True
assert v.check("error occurred") == False
```
-"""
-
+ """
+
_UniffiFfiConverterTypeValidator.check_lower(validator)
- _uniffi_lowered_args = (
- _UniffiFfiConverterTypeValidator.lower(validator),
- )
+ _uniffi_lowered_args = (_UniffiFfiConverterTypeValidator.lower(validator),)
_uniffi_lift_return = _UniffiFfiConverterTypeValidator.lift
_uniffi_error_converter = None
_uniffi_ffi_result = _uniffi_rust_call_with_error(
@@ -2425,12 +2826,14 @@ def ne(cls, validator: Validator) -> Validator:
*_uniffi_lowered_args,
)
return cls._uniffi_make_instance(_uniffi_ffi_result)
- def __init__(self, ):
+
+ def __init__(
+ self,
+ ):
"""
Creates a default validator that accepts all messages.
-"""
- _uniffi_lowered_args = (
- )
+ """
+ _uniffi_lowered_args = ()
_uniffi_lift_return = _UniffiFfiConverterTypeValidator.lift
_uniffi_error_converter = None
_uniffi_ffi_result = _uniffi_rust_call_with_error(
@@ -2439,6 +2842,7 @@ def __init__(self, ):
*_uniffi_lowered_args,
)
self._handle = _uniffi_ffi_result
+
@classmethod
def regex(cls, pattern: str) -> Validator:
"""
@@ -2457,12 +2861,10 @@ def regex(cls, pattern: str) -> Validator:
assert validator.check("123 message") == True
assert validator.check("abc") == False
```
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(pattern)
- _uniffi_lowered_args = (
- _UniffiFfiConverterString.lower(pattern),
- )
+ _uniffi_lowered_args = (_UniffiFfiConverterString.lower(pattern),)
_uniffi_lift_return = _UniffiFfiConverterTypeValidator.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
_uniffi_ffi_result = _uniffi_rust_call_with_error(
@@ -2471,6 +2873,7 @@ def regex(cls, pattern: str) -> Validator:
*_uniffi_lowered_args,
)
return cls._uniffi_make_instance(_uniffi_ffi_result)
+
@classmethod
def starts_with(cls, prefix: str) -> Validator:
"""
@@ -2479,12 +2882,10 @@ def starts_with(cls, prefix: str) -> Validator:
# Arguments
* `prefix` - String that messages should start with
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(prefix)
- _uniffi_lowered_args = (
- _UniffiFfiConverterString.lower(prefix),
- )
+ _uniffi_lowered_args = (_UniffiFfiConverterString.lower(prefix),)
_uniffi_lift_return = _UniffiFfiConverterTypeValidator.lift
_uniffi_error_converter = None
_uniffi_ffi_result = _uniffi_rust_call_with_error(
@@ -2498,10 +2899,14 @@ def __del__(self):
# In case of partial initialization of instances.
handle = getattr(self, "_handle", None)
if handle is not None:
- _uniffi_rust_call(_UniffiLib.uniffi_binary_options_tools_uni_fn_free_validator, handle)
+ _uniffi_rust_call(
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_free_validator, handle
+ )
def _uniffi_clone_handle(self):
- return _uniffi_rust_call(_UniffiLib.uniffi_binary_options_tools_uni_fn_clone_validator, self._handle)
+ return _uniffi_rust_call(
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_clone_validator, self._handle
+ )
# Used by alternative constructors or any methods which return this type.
@classmethod
@@ -2511,6 +2916,7 @@ def _uniffi_make_instance(cls, handle):
inst = cls.__new__(cls)
inst._handle = handle
return inst
+
def check(self, message: str) -> bool:
"""
Checks if a message matches this validator's conditions.
@@ -2522,8 +2928,8 @@ def check(self, message: str) -> bool:
# Returns
True if message matches the validator's conditions, False otherwise
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(message)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -2539,9 +2945,6 @@ def check(self, message: str) -> bool:
return _uniffi_lift_return(_uniffi_ffi_result)
-
-
-
class _UniffiFfiConverterTypeValidator:
@staticmethod
def lift(value: int) -> Validator:
@@ -2550,7 +2953,9 @@ def lift(value: int) -> Validator:
@staticmethod
def check_lower(value: Validator):
if not isinstance(value, Validator):
- raise TypeError("Expected Validator instance, {} found".format(type(value).__name__))
+ raise TypeError(
+ "Expected Validator instance, {} found".format(type(value).__name__)
+ )
@staticmethod
def lower(value: Validator) -> ctypes.c_uint64:
@@ -2567,6 +2972,7 @@ def read(cls, buf: _UniffiRustBuffer) -> Validator:
def write(cls, value: Validator, buf: _UniffiRustBuffer):
buf.write_u64(cls.lower(value))
+
class _UniffiFfiConverterBytes(_UniffiConverterRustBuffer):
@staticmethod
def read(buf):
@@ -2580,7 +2986,9 @@ def check_lower(value):
try:
memoryview(value)
except TypeError:
- raise TypeError("a bytes-like object is required, not {!r}".format(type(value).__name__))
+ raise TypeError(
+ "a bytes-like object is required, not {!r}".format(type(value).__name__)
+ )
@staticmethod
def write(value, buf):
@@ -2594,8 +3002,8 @@ class RawHandlerProtocol(typing.Protocol):
Provides low-level access to send messages and receive filtered responses
based on a validator. Each handler maintains its own message stream.
-"""
-
+ """
+
async def send_and_wait(self, message: str) -> str:
"""
Send a message and wait for the next matching response.
@@ -2615,8 +3023,9 @@ async def send_and_wait(self, message: str) -> str:
response = await handler.send_and_wait('42["getBalance"]')
data = json.loads(response)
```
-"""
+ """
raise NotImplementedError
+
async def send_binary(self, data: bytes) -> None:
"""
Send a binary message through this handler.
@@ -2631,8 +3040,9 @@ async def send_binary(self, data: bytes) -> None:
```python
await handler.send_binary(b'\\x00\\x01\\x02')
```
-"""
+ """
raise NotImplementedError
+
async def send_text(self, message: str) -> None:
"""
Send a text message through this handler.
@@ -2647,9 +3057,12 @@ async def send_text(self, message: str) -> None:
```python
await handler.send_text('42["ping"]')
```
-"""
+ """
raise NotImplementedError
- async def wait_next(self, ) -> str:
+
+ async def wait_next(
+ self,
+ ) -> str:
"""
Wait for the next message that matches this handler's validator.
@@ -2664,19 +3077,20 @@ async def wait_next(self, ) -> str:
message = await handler.wait_next()
print(f"Received: {message}")
```
-"""
+ """
raise NotImplementedError
+
class RawHandler(RawHandlerProtocol):
"""
Handler for advanced raw WebSocket message operations.
Provides low-level access to send messages and receive filtered responses
based on a validator. Each handler maintains its own message stream.
-"""
-
+ """
+
_handle: ctypes.c_uint64
-
+
def __init__(self, *args, **kwargs):
raise ValueError("This class has no default constructor")
@@ -2684,10 +3098,14 @@ def __del__(self):
# In case of partial initialization of instances.
handle = getattr(self, "_handle", None)
if handle is not None:
- _uniffi_rust_call(_UniffiLib.uniffi_binary_options_tools_uni_fn_free_rawhandler, handle)
+ _uniffi_rust_call(
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_free_rawhandler, handle
+ )
def _uniffi_clone_handle(self):
- return _uniffi_rust_call(_UniffiLib.uniffi_binary_options_tools_uni_fn_clone_rawhandler, self._handle)
+ return _uniffi_rust_call(
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_clone_rawhandler, self._handle
+ )
# Used by alternative constructors or any methods which return this type.
@classmethod
@@ -2697,6 +3115,7 @@ def _uniffi_make_instance(cls, handle):
inst = cls.__new__(cls)
inst._handle = handle
return inst
+
async def send_and_wait(self, message: str) -> str:
"""
Send a message and wait for the next matching response.
@@ -2716,8 +3135,8 @@ async def send_and_wait(self, message: str) -> str:
response = await handler.send_and_wait('42["getBalance"]')
data = json.loads(response)
```
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(message)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -2726,13 +3145,16 @@ async def send_and_wait(self, message: str) -> str:
_uniffi_lift_return = _UniffiFfiConverterString.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_send_and_wait(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_send_and_wait(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
+
async def send_binary(self, data: bytes) -> None:
"""
Send a binary message through this handler.
@@ -2747,8 +3169,8 @@ async def send_binary(self, data: bytes) -> None:
```python
await handler.send_binary(b'\\x00\\x01\\x02')
```
-"""
-
+ """
+
_UniffiFfiConverterBytes.check_lower(data)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -2757,13 +3179,16 @@ async def send_binary(self, data: bytes) -> None:
_uniffi_lift_return = lambda val: None
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_send_binary(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_send_binary(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_void,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_void,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_void,
_uniffi_lift_return,
_uniffi_error_converter,
)
+
async def send_text(self, message: str) -> None:
"""
Send a text message through this handler.
@@ -2778,8 +3203,8 @@ async def send_text(self, message: str) -> None:
```python
await handler.send_text('42["ping"]')
```
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(message)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -2788,14 +3213,19 @@ async def send_text(self, message: str) -> None:
_uniffi_lift_return = lambda val: None
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_send_text(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_send_text(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_void,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_void,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_void,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def wait_next(self, ) -> str:
+
+ async def wait_next(
+ self,
+ ) -> str:
"""
Wait for the next message that matches this handler's validator.
@@ -2810,14 +3240,14 @@ async def wait_next(self, ) -> str:
message = await handler.wait_next()
print(f"Received: {message}")
```
-"""
- _uniffi_lowered_args = (
- self._uniffi_clone_handle(),
- )
+ """
+ _uniffi_lowered_args = (self._uniffi_clone_handle(),)
_uniffi_lift_return = _UniffiFfiConverterString.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_wait_next(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_rawhandler_wait_next(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
@@ -2826,9 +3256,6 @@ async def wait_next(self, ) -> str:
)
-
-
-
class _UniffiFfiConverterTypeRawHandler:
@staticmethod
def lift(value: int) -> RawHandler:
@@ -2837,7 +3264,9 @@ def lift(value: int) -> RawHandler:
@staticmethod
def check_lower(value: RawHandler):
if not isinstance(value, RawHandler):
- raise TypeError("Expected RawHandler instance, {} found".format(type(value).__name__))
+ raise TypeError(
+ "Expected RawHandler instance, {} found".format(type(value).__name__)
+ )
@staticmethod
def lower(value: RawHandler) -> ctypes.c_uint64:
@@ -2854,6 +3283,7 @@ def read(cls, buf: _UniffiRustBuffer) -> RawHandler:
def write(cls, value: RawHandler, buf: _UniffiRustBuffer):
buf.write_u64(cls.lower(value))
+
class _UniffiFfiConverterSequenceTypeCandle(_UniffiConverterRustBuffer):
@classmethod
def check_lower(cls, value):
@@ -2873,9 +3303,8 @@ def read(cls, buf):
if count < 0:
raise InternalError("Unexpected negative sequence length")
- return [
- _UniffiFfiConverterTypeCandle.read(buf) for i in range(count)
- ]
+ return [_UniffiFfiConverterTypeCandle.read(buf) for i in range(count)]
+
class _UniffiFfiConverterSequenceTypeDeal(_UniffiConverterRustBuffer):
@classmethod
@@ -2896,9 +3325,7 @@ def read(cls, buf):
if count < 0:
raise InternalError("Unexpected negative sequence length")
- return [
- _UniffiFfiConverterTypeDeal.read(buf) for i in range(count)
- ]
+ return [_UniffiFfiConverterTypeDeal.read(buf) for i in range(count)]
class SubscriptionStreamProtocol(typing.Protocol):
@@ -2912,9 +3339,11 @@ class SubscriptionStreamProtocol(typing.Protocol):
Since UniFFI does not support streams directly, this wrapper provides a way to
consume the stream by repeatedly calling the `next` method.
-"""
-
- async def next(self, ) -> Candle:
+ """
+
+ async def next(
+ self,
+ ) -> Candle:
"""
Retrieves the next item from the stream.
@@ -2953,9 +3382,10 @@ async def main():
}
}
```
-"""
+ """
raise NotImplementedError
+
class SubscriptionStream(SubscriptionStreamProtocol):
"""
Represents a stream of subscription data.
@@ -2967,10 +3397,10 @@ class SubscriptionStream(SubscriptionStreamProtocol):
Since UniFFI does not support streams directly, this wrapper provides a way to
consume the stream by repeatedly calling the `next` method.
-"""
-
+ """
+
_handle: ctypes.c_uint64
-
+
def __init__(self, *args, **kwargs):
raise ValueError("This class has no default constructor")
@@ -2978,10 +3408,16 @@ def __del__(self):
# In case of partial initialization of instances.
handle = getattr(self, "_handle", None)
if handle is not None:
- _uniffi_rust_call(_UniffiLib.uniffi_binary_options_tools_uni_fn_free_subscriptionstream, handle)
+ _uniffi_rust_call(
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_free_subscriptionstream,
+ handle,
+ )
def _uniffi_clone_handle(self):
- return _uniffi_rust_call(_UniffiLib.uniffi_binary_options_tools_uni_fn_clone_subscriptionstream, self._handle)
+ return _uniffi_rust_call(
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_clone_subscriptionstream,
+ self._handle,
+ )
# Used by alternative constructors or any methods which return this type.
@classmethod
@@ -2991,7 +3427,10 @@ def _uniffi_make_instance(cls, handle):
inst = cls.__new__(cls)
inst._handle = handle
return inst
- async def next(self, ) -> Candle:
+
+ async def next(
+ self,
+ ) -> Candle:
"""
Retrieves the next item from the stream.
@@ -3030,14 +3469,14 @@ async def main():
}
}
```
-"""
- _uniffi_lowered_args = (
- self._uniffi_clone_handle(),
- )
+ """
+ _uniffi_lowered_args = (self._uniffi_clone_handle(),)
_uniffi_lift_return = _UniffiFfiConverterTypeCandle.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_subscriptionstream_next(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_subscriptionstream_next(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
@@ -3046,9 +3485,6 @@ async def main():
)
-
-
-
class _UniffiFfiConverterTypeSubscriptionStream:
@staticmethod
def lift(value: int) -> SubscriptionStream:
@@ -3057,7 +3493,11 @@ def lift(value: int) -> SubscriptionStream:
@staticmethod
def check_lower(value: SubscriptionStream):
if not isinstance(value, SubscriptionStream):
- raise TypeError("Expected SubscriptionStream instance, {} found".format(type(value).__name__))
+ raise TypeError(
+ "Expected SubscriptionStream instance, {} found".format(
+ type(value).__name__
+ )
+ )
@staticmethod
def lower(value: SubscriptionStream) -> ctypes.c_uint64:
@@ -3089,18 +3529,23 @@ class PocketOptionProtocol(typing.Protocol):
This struct wraps the underlying `binary_options_tools::pocketoption::PocketOption` client,
exposing its functionality in a way that is compatible with UniFFI for creating
multi-language bindings.
-"""
-
- async def assets(self, ) -> typing.Optional[typing.List[Asset]]:
+ """
+
+ async def assets(
+ self,
+ ) -> typing.Optional[typing.List[Asset]]:
"""
Gets the list of available assets for trading.
# Returns
A list of `Asset` objects, or `None` if the assets have not been loaded yet.
-"""
+ """
raise NotImplementedError
- async def balance(self, ) -> float:
+
+ async def balance(
+ self,
+ ) -> float:
"""
Gets the current balance of the account.
@@ -3109,21 +3554,28 @@ async def balance(self, ) -> float:
# Returns
The current balance as a floating-point number.
-"""
+ """
raise NotImplementedError
- async def buy(self, asset: str,time: int,amount: float) -> Deal:
+
+ async def buy(self, asset: str, time: int, amount: float) -> Deal:
"""
Places a "Call" (buy) trade.
This is a convenience method that calls `trade` with `Action.Call`.
-"""
+ """
raise NotImplementedError
- async def clear_closed_deals(self, ) -> None:
+
+ async def clear_closed_deals(
+ self,
+ ) -> None:
"""
Clears the list of closed deals from the client's state.
-"""
+ """
raise NotImplementedError
- async def create_raw_handler(self, validator: Validator,keep_alive: typing.Optional[str]) -> RawHandler:
+
+ async def create_raw_handler(
+ self, validator: Validator, keep_alive: typing.Optional[str]
+ ) -> RawHandler:
"""
Creates a raw handler for advanced WebSocket message operations.
@@ -3155,42 +3607,59 @@ async def create_raw_handler(self, validator: Validator,keep_alive: typing.Optio
response = await handler.wait_next()
print(f"Received: {response}")
```
-"""
+ """
raise NotImplementedError
- async def get_candles(self, asset: str,period: int,offset: int) -> typing.List[Candle]:
+
+ async def get_candles(
+ self, asset: str, period: int, offset: int
+ ) -> typing.List[Candle]:
"""
Gets historical candle data for a specific asset.
-"""
+ """
raise NotImplementedError
- async def get_candles_advanced(self, asset: str,period: int,time: int,offset: int) -> typing.List[Candle]:
+
+ async def get_candles_advanced(
+ self, asset: str, period: int, time: int, offset: int
+ ) -> typing.List[Candle]:
"""
Gets historical candle data for a specific asset with advanced parameters.
-"""
+ """
raise NotImplementedError
- async def get_closed_deals(self, ) -> typing.List[Deal]:
+
+ async def get_closed_deals(
+ self,
+ ) -> typing.List[Deal]:
"""
Gets the list of currently closed deals.
-"""
+ """
raise NotImplementedError
- async def get_opened_deals(self, ) -> typing.List[Deal]:
+
+ async def get_opened_deals(
+ self,
+ ) -> typing.List[Deal]:
"""
Gets the list of currently opened deals.
-"""
+ """
raise NotImplementedError
- async def history(self, asset: str,period: int) -> typing.List[Candle]:
+
+ async def history(self, asset: str, period: int) -> typing.List[Candle]:
"""
Gets historical candle data for a specific asset and period.
-"""
+ """
raise NotImplementedError
- def is_demo(self, ) -> bool:
+
+ def is_demo(
+ self,
+ ) -> bool:
"""
Checks if the current session is a demo account.
# Returns
`true` if the account is a demo account, `false` otherwise.
-"""
+ """
raise NotImplementedError
+
async def payout(self, asset: str) -> typing.Optional[float]:
"""
Gets the payout percentage for a specific asset.
@@ -3217,13 +3686,17 @@ async def payout(self, asset: str) -> typing.Optional[float]:
else:
print("Asset not available")
```
-"""
+ """
raise NotImplementedError
- async def reconnect(self, ) -> None:
+
+ async def reconnect(
+ self,
+ ) -> None:
"""
Disconnects and reconnects the client.
-"""
+ """
raise NotImplementedError
+
async def result(self, id: str) -> Deal:
"""
Checks the result of a trade by its ID.
@@ -3235,9 +3708,10 @@ async def result(self, id: str) -> Deal:
# Returns
A `Deal` object representing the completed trade.
-"""
+ """
raise NotImplementedError
- async def result_with_timeout(self, id: str,timeout_secs: int) -> Deal:
+
+ async def result_with_timeout(self, id: str, timeout_secs: int) -> Deal:
"""
Checks the result of a trade by its ID with a timeout.
@@ -3249,29 +3723,37 @@ async def result_with_timeout(self, id: str,timeout_secs: int) -> Deal:
# Returns
A `Deal` object representing the completed trade.
-"""
+ """
raise NotImplementedError
- async def sell(self, asset: str,time: int,amount: float) -> Deal:
+
+ async def sell(self, asset: str, time: int, amount: float) -> Deal:
"""
Places a "Put" (sell) trade.
This is a convenience method that calls `trade` with `Action.Put`.
-"""
+ """
raise NotImplementedError
- async def server_time(self, ) -> int:
+
+ async def server_time(
+ self,
+ ) -> int:
"""
Gets the current server time as a Unix timestamp.
-"""
+ """
raise NotImplementedError
- async def shutdown(self, ) -> None:
+
+ async def shutdown(
+ self,
+ ) -> None:
"""
Shuts down the client and stops all background tasks.
This method should be called when you are finished with the client
to ensure a graceful shutdown.
-"""
+ """
raise NotImplementedError
- async def subscribe(self, asset: str,duration_secs: int) -> SubscriptionStream:
+
+ async def subscribe(self, asset: str, duration_secs: int) -> SubscriptionStream:
"""
Subscribes to real-time candle data for a specific asset.
@@ -3283,9 +3765,10 @@ async def subscribe(self, asset: str,duration_secs: int) -> SubscriptionStream:
# Returns
A `SubscriptionStream` object that can be used to receive candle data.
-"""
+ """
raise NotImplementedError
- async def trade(self, asset: str,action: Action,time: int,amount: float) -> Deal:
+
+ async def trade(self, asset: str, action: Action, time: int, amount: float) -> Deal:
"""
Places a trade.
@@ -3301,14 +3784,16 @@ async def trade(self, asset: str,action: Action,time: int,amount: float) -> Deal
# Returns
A `Deal` object representing the completed trade.
-"""
+ """
raise NotImplementedError
+
async def unsubscribe(self, asset: str) -> None:
"""
Unsubscribes from real-time candle data for a specific asset.
-"""
+ """
raise NotImplementedError
+
class PocketOption(PocketOptionProtocol):
"""
The main client for interacting with the PocketOption platform.
@@ -3323,9 +3808,10 @@ class PocketOption(PocketOptionProtocol):
This struct wraps the underlying `binary_options_tools::pocketoption::PocketOption` client,
exposing its functionality in a way that is compatible with UniFFI for creating
multi-language bindings.
-"""
-
+ """
+
_handle: ctypes.c_uint64
+
@classmethod
async def init(cls, ssid: str) -> PocketOption:
"""
@@ -3353,26 +3839,28 @@ async def main():
asyncio.run(main())
```
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(ssid)
- _uniffi_lowered_args = (
- _UniffiFfiConverterString.lower(ssid),
- )
+ _uniffi_lowered_args = (_UniffiFfiConverterString.lower(ssid),)
_uniffi_lift_return = _UniffiFfiConverterTypePocketOption.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_pocketoption_init(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_pocketoption_init(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_u64,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_u64,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_u64,
_uniffi_lift_return,
_uniffi_error_converter,
)
+
def __init__(self, *args, **kw):
raise ValueError("async constructors not supported.")
+
@classmethod
- async def new_with_url(cls, ssid: str,url: str) -> PocketOption:
+ async def new_with_url(cls, ssid: str, url: str) -> PocketOption:
"""
Creates a new instance of the PocketOption client with a custom WebSocket URL.
@@ -3383,10 +3871,10 @@ async def new_with_url(cls, ssid: str,url: str) -> PocketOption:
* `ssid` - The session ID for your PocketOption account.
* `url` - The custom WebSocket URL to connect to.
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(ssid)
-
+
_UniffiFfiConverterString.check_lower(url)
_uniffi_lowered_args = (
_UniffiFfiConverterString.lower(ssid),
@@ -3395,7 +3883,9 @@ async def new_with_url(cls, ssid: str,url: str) -> PocketOption:
_uniffi_lift_return = _UniffiFfiConverterTypePocketOption.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_pocketoption_new_with_url(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_constructor_pocketoption_new_with_url(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_u64,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_u64,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_u64,
@@ -3407,10 +3897,15 @@ def __del__(self):
# In case of partial initialization of instances.
handle = getattr(self, "_handle", None)
if handle is not None:
- _uniffi_rust_call(_UniffiLib.uniffi_binary_options_tools_uni_fn_free_pocketoption, handle)
+ _uniffi_rust_call(
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_free_pocketoption, handle
+ )
def _uniffi_clone_handle(self):
- return _uniffi_rust_call(_UniffiLib.uniffi_binary_options_tools_uni_fn_clone_pocketoption, self._handle)
+ return _uniffi_rust_call(
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_clone_pocketoption,
+ self._handle,
+ )
# Used by alternative constructors or any methods which return this type.
@classmethod
@@ -3420,28 +3915,34 @@ def _uniffi_make_instance(cls, handle):
inst = cls.__new__(cls)
inst._handle = handle
return inst
- async def assets(self, ) -> typing.Optional[typing.List[Asset]]:
+
+ async def assets(
+ self,
+ ) -> typing.Optional[typing.List[Asset]]:
"""
Gets the list of available assets for trading.
# Returns
A list of `Asset` objects, or `None` if the assets have not been loaded yet.
-"""
- _uniffi_lowered_args = (
- self._uniffi_clone_handle(),
- )
+ """
+ _uniffi_lowered_args = (self._uniffi_clone_handle(),)
_uniffi_lift_return = _UniffiFfiConverterOptionalSequenceTypeAsset.lift
_uniffi_error_converter = None
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_assets(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_assets(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def balance(self, ) -> float:
+
+ async def balance(
+ self,
+ ) -> float:
"""
Gets the current balance of the account.
@@ -3450,31 +3951,32 @@ async def balance(self, ) -> float:
# Returns
The current balance as a floating-point number.
-"""
- _uniffi_lowered_args = (
- self._uniffi_clone_handle(),
- )
+ """
+ _uniffi_lowered_args = (self._uniffi_clone_handle(),)
_uniffi_lift_return = _UniffiFfiConverterFloat64.lift
_uniffi_error_converter = None
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_balance(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_balance(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_f64,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_f64,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_f64,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def buy(self, asset: str,time: int,amount: float) -> Deal:
+
+ async def buy(self, asset: str, time: int, amount: float) -> Deal:
"""
Places a "Call" (buy) trade.
This is a convenience method that calls `trade` with `Action.Call`.
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(asset)
-
+
_UniffiFfiConverterUInt32.check_lower(time)
-
+
_UniffiFfiConverterFloat64.check_lower(amount)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -3485,31 +3987,39 @@ async def buy(self, asset: str,time: int,amount: float) -> Deal:
_uniffi_lift_return = _UniffiFfiConverterTypeDeal.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_buy(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_buy(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def clear_closed_deals(self, ) -> None:
+
+ async def clear_closed_deals(
+ self,
+ ) -> None:
"""
Clears the list of closed deals from the client's state.
-"""
- _uniffi_lowered_args = (
- self._uniffi_clone_handle(),
- )
+ """
+ _uniffi_lowered_args = (self._uniffi_clone_handle(),)
_uniffi_lift_return = lambda val: None
_uniffi_error_converter = None
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_clear_closed_deals(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_clear_closed_deals(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_void,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_void,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_void,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def create_raw_handler(self, validator: Validator,keep_alive: typing.Optional[str]) -> RawHandler:
+
+ async def create_raw_handler(
+ self, validator: Validator, keep_alive: typing.Optional[str]
+ ) -> RawHandler:
"""
Creates a raw handler for advanced WebSocket message operations.
@@ -3541,10 +4051,10 @@ async def create_raw_handler(self, validator: Validator,keep_alive: typing.Optio
response = await handler.wait_next()
print(f"Received: {response}")
```
-"""
-
+ """
+
_UniffiFfiConverterTypeValidator.check_lower(validator)
-
+
_UniffiFfiConverterOptionalString.check_lower(keep_alive)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -3554,22 +4064,27 @@ async def create_raw_handler(self, validator: Validator,keep_alive: typing.Optio
_uniffi_lift_return = _UniffiFfiConverterTypeRawHandler.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_create_raw_handler(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_create_raw_handler(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_u64,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_u64,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_u64,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def get_candles(self, asset: str,period: int,offset: int) -> typing.List[Candle]:
+
+ async def get_candles(
+ self, asset: str, period: int, offset: int
+ ) -> typing.List[Candle]:
"""
Gets historical candle data for a specific asset.
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(asset)
-
+
_UniffiFfiConverterInt64.check_lower(period)
-
+
_UniffiFfiConverterInt64.check_lower(offset)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -3580,24 +4095,29 @@ async def get_candles(self, asset: str,period: int,offset: int) -> typing.List[C
_uniffi_lift_return = _UniffiFfiConverterSequenceTypeCandle.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_get_candles(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_get_candles(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def get_candles_advanced(self, asset: str,period: int,time: int,offset: int) -> typing.List[Candle]:
+
+ async def get_candles_advanced(
+ self, asset: str, period: int, time: int, offset: int
+ ) -> typing.List[Candle]:
"""
Gets historical candle data for a specific asset with advanced parameters.
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(asset)
-
+
_UniffiFfiConverterInt64.check_lower(period)
-
+
_UniffiFfiConverterInt64.check_lower(time)
-
+
_UniffiFfiConverterInt64.check_lower(offset)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -3609,54 +4129,63 @@ async def get_candles_advanced(self, asset: str,period: int,time: int,offset: in
_uniffi_lift_return = _UniffiFfiConverterSequenceTypeCandle.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_get_candles_advanced(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_get_candles_advanced(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def get_closed_deals(self, ) -> typing.List[Deal]:
+
+ async def get_closed_deals(
+ self,
+ ) -> typing.List[Deal]:
"""
Gets the list of currently closed deals.
-"""
- _uniffi_lowered_args = (
- self._uniffi_clone_handle(),
- )
+ """
+ _uniffi_lowered_args = (self._uniffi_clone_handle(),)
_uniffi_lift_return = _UniffiFfiConverterSequenceTypeDeal.lift
_uniffi_error_converter = None
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_get_closed_deals(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_get_closed_deals(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def get_opened_deals(self, ) -> typing.List[Deal]:
+
+ async def get_opened_deals(
+ self,
+ ) -> typing.List[Deal]:
"""
Gets the list of currently opened deals.
-"""
- _uniffi_lowered_args = (
- self._uniffi_clone_handle(),
- )
+ """
+ _uniffi_lowered_args = (self._uniffi_clone_handle(),)
_uniffi_lift_return = _UniffiFfiConverterSequenceTypeDeal.lift
_uniffi_error_converter = None
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_get_opened_deals(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_get_opened_deals(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def history(self, asset: str,period: int) -> typing.List[Candle]:
+
+ async def history(self, asset: str, period: int) -> typing.List[Candle]:
"""
Gets historical candle data for a specific asset and period.
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(asset)
-
+
_UniffiFfiConverterUInt32.check_lower(period)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -3666,24 +4195,27 @@ async def history(self, asset: str,period: int) -> typing.List[Candle]:
_uniffi_lift_return = _UniffiFfiConverterSequenceTypeCandle.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_history(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_history(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
- def is_demo(self, ) -> bool:
+
+ def is_demo(
+ self,
+ ) -> bool:
"""
Checks if the current session is a demo account.
# Returns
`true` if the account is a demo account, `false` otherwise.
-"""
- _uniffi_lowered_args = (
- self._uniffi_clone_handle(),
- )
+ """
+ _uniffi_lowered_args = (self._uniffi_clone_handle(),)
_uniffi_lift_return = _UniffiFfiConverterBoolean.lift
_uniffi_error_converter = None
_uniffi_ffi_result = _uniffi_rust_call_with_error(
@@ -3692,6 +4224,7 @@ def is_demo(self, ) -> bool:
*_uniffi_lowered_args,
)
return _uniffi_lift_return(_uniffi_ffi_result)
+
async def payout(self, asset: str) -> typing.Optional[float]:
"""
Gets the payout percentage for a specific asset.
@@ -3718,8 +4251,8 @@ async def payout(self, asset: str) -> typing.Optional[float]:
else:
print("Asset not available")
```
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(asset)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -3728,30 +4261,36 @@ async def payout(self, asset: str) -> typing.Optional[float]:
_uniffi_lift_return = _UniffiFfiConverterOptionalFloat64.lift
_uniffi_error_converter = None
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_payout(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_payout(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def reconnect(self, ) -> None:
+
+ async def reconnect(
+ self,
+ ) -> None:
"""
Disconnects and reconnects the client.
-"""
- _uniffi_lowered_args = (
- self._uniffi_clone_handle(),
- )
+ """
+ _uniffi_lowered_args = (self._uniffi_clone_handle(),)
_uniffi_lift_return = lambda val: None
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_reconnect(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_reconnect(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_void,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_void,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_void,
_uniffi_lift_return,
_uniffi_error_converter,
)
+
async def result(self, id: str) -> Deal:
"""
Checks the result of a trade by its ID.
@@ -3763,8 +4302,8 @@ async def result(self, id: str) -> Deal:
# Returns
A `Deal` object representing the completed trade.
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(id)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -3773,14 +4312,17 @@ async def result(self, id: str) -> Deal:
_uniffi_lift_return = _UniffiFfiConverterTypeDeal.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_result(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_result(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def result_with_timeout(self, id: str,timeout_secs: int) -> Deal:
+
+ async def result_with_timeout(self, id: str, timeout_secs: int) -> Deal:
"""
Checks the result of a trade by its ID with a timeout.
@@ -3792,10 +4334,10 @@ async def result_with_timeout(self, id: str,timeout_secs: int) -> Deal:
# Returns
A `Deal` object representing the completed trade.
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(id)
-
+
_UniffiFfiConverterUInt64.check_lower(timeout_secs)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -3805,24 +4347,27 @@ async def result_with_timeout(self, id: str,timeout_secs: int) -> Deal:
_uniffi_lift_return = _UniffiFfiConverterTypeDeal.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_result_with_timeout(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_result_with_timeout(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def sell(self, asset: str,time: int,amount: float) -> Deal:
+
+ async def sell(self, asset: str, time: int, amount: float) -> Deal:
"""
Places a "Put" (sell) trade.
This is a convenience method that calls `trade` with `Action.Put`.
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(asset)
-
+
_UniffiFfiConverterUInt32.check_lower(time)
-
+
_UniffiFfiConverterFloat64.check_lower(amount)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -3833,51 +4378,60 @@ async def sell(self, asset: str,time: int,amount: float) -> Deal:
_uniffi_lift_return = _UniffiFfiConverterTypeDeal.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_sell(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_sell(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def server_time(self, ) -> int:
+
+ async def server_time(
+ self,
+ ) -> int:
"""
Gets the current server time as a Unix timestamp.
-"""
- _uniffi_lowered_args = (
- self._uniffi_clone_handle(),
- )
+ """
+ _uniffi_lowered_args = (self._uniffi_clone_handle(),)
_uniffi_lift_return = _UniffiFfiConverterInt64.lift
_uniffi_error_converter = None
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_server_time(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_server_time(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_i64,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_i64,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_i64,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def shutdown(self, ) -> None:
+
+ async def shutdown(
+ self,
+ ) -> None:
"""
Shuts down the client and stops all background tasks.
This method should be called when you are finished with the client
to ensure a graceful shutdown.
-"""
- _uniffi_lowered_args = (
- self._uniffi_clone_handle(),
- )
+ """
+ _uniffi_lowered_args = (self._uniffi_clone_handle(),)
_uniffi_lift_return = lambda val: None
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_shutdown(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_shutdown(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_void,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_void,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_void,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def subscribe(self, asset: str,duration_secs: int) -> SubscriptionStream:
+
+ async def subscribe(self, asset: str, duration_secs: int) -> SubscriptionStream:
"""
Subscribes to real-time candle data for a specific asset.
@@ -3889,10 +4443,10 @@ async def subscribe(self, asset: str,duration_secs: int) -> SubscriptionStream:
# Returns
A `SubscriptionStream` object that can be used to receive candle data.
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(asset)
-
+
_UniffiFfiConverterUInt64.check_lower(duration_secs)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -3902,14 +4456,17 @@ async def subscribe(self, asset: str,duration_secs: int) -> SubscriptionStream:
_uniffi_lift_return = _UniffiFfiConverterTypeSubscriptionStream.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_subscribe(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_subscribe(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_u64,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_u64,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_u64,
_uniffi_lift_return,
_uniffi_error_converter,
)
- async def trade(self, asset: str,action: Action,time: int,amount: float) -> Deal:
+
+ async def trade(self, asset: str, action: Action, time: int, amount: float) -> Deal:
"""
Places a trade.
@@ -3925,14 +4482,14 @@ async def trade(self, asset: str,action: Action,time: int,amount: float) -> Deal
# Returns
A `Deal` object representing the completed trade.
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(asset)
-
+
_UniffiFfiConverterTypeAction.check_lower(action)
-
+
_UniffiFfiConverterUInt32.check_lower(time)
-
+
_UniffiFfiConverterFloat64.check_lower(amount)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -3944,18 +4501,21 @@ async def trade(self, asset: str,action: Action,time: int,amount: float) -> Deal
_uniffi_lift_return = _UniffiFfiConverterTypeDeal.lift
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_trade(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_trade(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_rust_buffer,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_rust_buffer,
_uniffi_lift_return,
_uniffi_error_converter,
)
+
async def unsubscribe(self, asset: str) -> None:
"""
Unsubscribes from real-time candle data for a specific asset.
-"""
-
+ """
+
_UniffiFfiConverterString.check_lower(asset)
_uniffi_lowered_args = (
self._uniffi_clone_handle(),
@@ -3964,7 +4524,9 @@ async def unsubscribe(self, asset: str) -> None:
_uniffi_lift_return = lambda val: None
_uniffi_error_converter = _UniffiFfiConverterTypeUniError
return await _uniffi_rust_call_async(
- _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_unsubscribe(*_uniffi_lowered_args),
+ _UniffiLib.uniffi_binary_options_tools_uni_fn_method_pocketoption_unsubscribe(
+ *_uniffi_lowered_args
+ ),
_UniffiLib.ffi_binary_options_tools_uni_rust_future_poll_void,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_complete_void,
_UniffiLib.ffi_binary_options_tools_uni_rust_future_free_void,
@@ -3973,9 +4535,6 @@ async def unsubscribe(self, asset: str) -> None:
)
-
-
-
class _UniffiFfiConverterTypePocketOption:
@staticmethod
def lift(value: int) -> PocketOption:
@@ -3984,7 +4543,9 @@ def lift(value: int) -> PocketOption:
@staticmethod
def check_lower(value: PocketOption):
if not isinstance(value, PocketOption):
- raise TypeError("Expected PocketOption instance, {} found".format(type(value).__name__))
+ raise TypeError(
+ "Expected PocketOption instance, {} found".format(type(value).__name__)
+ )
@staticmethod
def lower(value: PocketOption) -> ctypes.c_uint64:
@@ -4001,6 +4562,7 @@ def read(cls, buf: _UniffiRustBuffer) -> PocketOption:
def write(cls, value: PocketOption, buf: _UniffiRustBuffer):
buf.write_u64(cls.lower(value))
+
class _UniffiFfiConverterUInt8(_UniffiConverterPrimitiveInt):
CLASS_NAME = "u8"
VALUE_MIN = 0
@@ -4014,6 +4576,7 @@ def read(buf):
def write(value, buf):
buf.write_u8(value)
+
class _UniffiFfiConverterSequenceTypeValidator(_UniffiConverterRustBuffer):
@classmethod
def check_lower(cls, value):
@@ -4033,9 +4596,8 @@ def read(cls, buf):
if count < 0:
raise InternalError("Unexpected negative sequence length")
- return [
- _UniffiFfiConverterTypeValidator.read(buf) for i in range(count)
- ]
+ return [_UniffiFfiConverterTypeValidator.read(buf) for i in range(count)]
+
__all__ = [
"InternalError",
@@ -4054,4 +4616,4 @@ def read(cls, buf):
"SubscriptionStreamProtocol",
"PocketOption",
"PocketOptionProtocol",
-]
\ No newline at end of file
+]
diff --git a/BinaryOptionsToolsUni/out/python/setup_.py b/BinaryOptionsToolsUni/out/python/setup_.py
index 2e15e3fe..ce307878 100644
--- a/BinaryOptionsToolsUni/out/python/setup_.py
+++ b/BinaryOptionsToolsUni/out/python/setup_.py
@@ -1,5 +1,4 @@
-from setuptools import setup, find_packages
-
+from setuptools import find_packages, setup
setup(
name="binary-options-tools-uni",
diff --git a/BinaryOptionsToolsUni/src/platforms/pocketoption/client.rs b/BinaryOptionsToolsUni/src/platforms/pocketoption/client.rs
index 176e7d2d..197d427a 100644
--- a/BinaryOptionsToolsUni/src/platforms/pocketoption/client.rs
+++ b/BinaryOptionsToolsUni/src/platforms/pocketoption/client.rs
@@ -472,4 +472,33 @@ impl PocketOption {
let asset_info = assets.0.get(&asset)?;
Some(asset_info.payout as f64 / 100.0)
}
+
+ /// Gets the trade history.
+ ///
+ /// This is an alias for `get_closed_deals`.
+ #[uniffi::method]
+ pub async fn get_trade_history(&self) -> Vec {
+ self.get_closed_deals().await
+ }
+
+ /// Gets the end time of a deal by its ID.
+ ///
+ /// # Arguments
+ ///
+ /// * `id` - The ID of the deal to check.
+ ///
+ /// # Returns
+ ///
+ /// The close timestamp as a Unix timestamp, or `None` if the deal is not found.
+ #[uniffi::method]
+ pub async fn get_deal_end_time(&self, id: String) -> Option {
+ let deal_id = Uuid::parse_str(&id).ok()?;
+ if let Some(d) = self.inner.get_closed_deal(deal_id).await {
+ return Some(d.close_timestamp.timestamp());
+ }
+ self.inner
+ .get_opened_deal(deal_id)
+ .await
+ .map(|d| d.close_timestamp.timestamp())
+ }
}
diff --git a/BinaryOptionsToolsUni/src/platforms/pocketoption/validator.rs b/BinaryOptionsToolsUni/src/platforms/pocketoption/validator.rs
index 9cce21ac..330b246e 100644
--- a/BinaryOptionsToolsUni/src/platforms/pocketoption/validator.rs
+++ b/BinaryOptionsToolsUni/src/platforms/pocketoption/validator.rs
@@ -181,7 +181,8 @@ impl Validator {
&self.inner
}
- /// Creates a Validator from an inner validator
+ /// Creates a Validator from an inner validator which is used internally when converting `InnerValidator` to `Arc`, in such we need the dead code allowance.
+ #[allow(dead_code)]
pub(crate) fn from_inner(inner: InnerValidator) -> Arc {
Arc::new(Self { inner })
}
diff --git a/BinaryOptionsToolsV2/.github/workflows/CI.yml b/BinaryOptionsToolsV2/.github/workflows/CI.yml
deleted file mode 100644
index 0e66a341..00000000
--- a/BinaryOptionsToolsV2/.github/workflows/CI.yml
+++ /dev/null
@@ -1,169 +0,0 @@
-# This file is autogenerated by maturin v1.7.0
-# To update, run
-#
-# maturin generate-ci github
-#
-name: CI
-
-on:
- push:
- branches:
- - main
- - master
- tags:
- - '*'
- pull_request:
- workflow_dispatch:
-
-permissions:
- contents: read
-
-jobs:
- linux:
- runs-on: ${{ matrix.platform.runner }}
- strategy:
- matrix:
- platform:
- - runner: ubuntu-latest
- target: x86_64
- - runner: ubuntu-latest
- target: x86
- - runner: ubuntu-latest
- target: aarch64
- - runner: ubuntu-latest
- target: armv7
- - runner: ubuntu-latest
- target: s390x
- - runner: ubuntu-latest
- target: ppc64le
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- with:
- python-version: 3.x
- - name: Build wheels
- uses: PyO3/maturin-action@v1
- with:
- target: ${{ matrix.platform.target }}
- args: --release --out dist --find-interpreter
- sccache: 'true'
- manylinux: auto
- - name: Upload wheels
- uses: actions/upload-artifact@v4
- with:
- name: wheels-linux-${{ matrix.platform.target }}
- path: dist
-
- musllinux:
- runs-on: ${{ matrix.platform.runner }}
- strategy:
- matrix:
- platform:
- - runner: ubuntu-latest
- target: x86_64
- - runner: ubuntu-latest
- target: x86
- - runner: ubuntu-latest
- target: aarch64
- - runner: ubuntu-latest
- target: armv7
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- with:
- python-version: 3.x
- - name: Build wheels
- uses: PyO3/maturin-action@v1
- with:
- target: ${{ matrix.platform.target }}
- args: --release --out dist --find-interpreter
- sccache: 'true'
- manylinux: musllinux_1_2
- - name: Upload wheels
- uses: actions/upload-artifact@v4
- with:
- name: wheels-musllinux-${{ matrix.platform.target }}
- path: dist
-
- windows:
- runs-on: ${{ matrix.platform.runner }}
- strategy:
- matrix:
- platform:
- - runner: windows-latest
- target: x64
- - runner: windows-latest
- target: x86
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- with:
- python-version: 3.x
- architecture: ${{ matrix.platform.target }}
- - name: Build wheels
- uses: PyO3/maturin-action@v1
- with:
- target: ${{ matrix.platform.target }}
- args: --release --out dist --find-interpreter
- sccache: 'true'
- - name: Upload wheels
- uses: actions/upload-artifact@v4
- with:
- name: wheels-windows-${{ matrix.platform.target }}
- path: dist
-
- macos:
- runs-on: ${{ matrix.platform.runner }}
- strategy:
- matrix:
- platform:
- - runner: macos-12
- target: x86_64
- - runner: macos-14
- target: aarch64
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- with:
- python-version: 3.x
- - name: Build wheels
- uses: PyO3/maturin-action@v1
- with:
- target: ${{ matrix.platform.target }}
- args: --release --out dist --find-interpreter
- sccache: 'true'
- - name: Upload wheels
- uses: actions/upload-artifact@v4
- with:
- name: wheels-macos-${{ matrix.platform.target }}
- path: dist
-
- sdist:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - name: Build sdist
- uses: PyO3/maturin-action@v1
- with:
- command: sdist
- args: --out dist
- - name: Upload sdist
- uses: actions/upload-artifact@v4
- with:
- name: wheels-sdist
- path: dist
-
- release:
- name: Release
- runs-on: ubuntu-latest
- if: "startsWith(github.ref, 'refs/tags/')"
- needs: [linux, musllinux, windows, macos, sdist]
- steps:
- - uses: actions/download-artifact@v4
- - name: Publish to PyPI
- uses: PyO3/maturin-action@v1
- env:
- MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
- with:
- command: upload
- args: --non-interactive --skip-existing wheels-*/*
diff --git a/BinaryOptionsToolsV2/.gitignore b/BinaryOptionsToolsV2/.gitignore
index 53049c24..f388f4f3 100644
--- a/BinaryOptionsToolsV2/.gitignore
+++ b/BinaryOptionsToolsV2/.gitignore
@@ -1,5 +1,3 @@
-/target
-
# Byte-compiled / optimized / DLL files
__pycache__/
.pytest_cache/
@@ -14,20 +12,8 @@ __pycache__/
env/
bin/
build/
-develop-eggs/
dist/
-eggs/
-lib/
-lib64/
-parts/
-sdist/
-var/
-include/
-man/
venv/
-*.egg-info/
-.installed.cfg
-*.egg
# Installer logs
pip-log.txt
@@ -41,35 +27,10 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
-
-# Translations
-*.mo
-
-# Mr Developer
-.mr.developer.cfg
-.project
-.pydevproject
-
-# Rope
-.ropeproject
-
-# Django stuff:
-*.log
-*.pot
-
.DS_Store
-# Sphinx documentation
-docs/_build/
-
-# PyCharm
-.idea/
-
-# VSCode
-.vscode/
-
-# Pyenv
-.python-version
-
-BinaryOptionsToolsV2/example_usage.py
-BinaryOptionsToolsV2/test_config.py
\ No newline at end of file
+# maturin builds
+/target/maturin
+/target/release
+/target
+.rustc_info.json
\ No newline at end of file
diff --git a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/__init__.py b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/__init__.py
index a814009c..54a4538e 100644
--- a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/__init__.py
+++ b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/__init__.py
@@ -1,10 +1,10 @@
-from .BinaryOptionsToolsV2 import * # noqa: F403
+from . import tracing, validator
# optional: include the documentation from the Rust module
+from .BinaryOptionsToolsV2 import * # noqa: F403
from .BinaryOptionsToolsV2 import __doc__ # noqa: F401
-
+from .BinaryOptionsToolsV2 import __all__ as __core_all__ # noqa: F401
+from .pocketoption import *
from .pocketoption import __all__ as __pocket_all__
-from . import tracing
-from . import validator
-__all__ = __pocket_all__ + ["tracing", "validator"]
+__all__ = __pocket_all__ + ["tracing", "validator"] + __core_all__
diff --git a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/config.py b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/config.py
index 2a5eb602..ab9dcdc1 100644
--- a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/config.py
+++ b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/config.py
@@ -1,8 +1,7 @@
# from BinaryOptionsToolsV2 import PyConfig
-from typing import Dict, Any, List
-from dataclasses import dataclass
-
import json
+from dataclasses import dataclass, field
+from typing import Any, Dict, List
class PyConfig:
@@ -63,8 +62,6 @@ class Config:
"""
Python wrapper around PyConfig that provides additional functionality
for configuration management.
-
- Warning: This version of the `PocketOption` and `PocketOptionAsync` classes doesn't use `Config`
"""
max_allowed_loops: int = 100
@@ -72,7 +69,7 @@ class Config:
reconnect_time: int = 5
connection_initialization_timeout_secs: int = 30
timeout_secs: int = 30
- urls: List[str] = None
+ urls: List[str] = field(default_factory=list)
# Extra duration, used by functions like `check_win`
extra_duration: int = 5
diff --git a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/__init__.py b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/__init__.py
index 1cbddfd6..bc50ad68 100644
--- a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/__init__.py
+++ b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/__init__.py
@@ -6,14 +6,14 @@
"""
__all__ = [
- "asyncronous",
- "syncronous",
+ "asynchronous",
+ "synchronous",
"PocketOptionAsync",
"PocketOption",
"RawHandler",
"RawHandlerSync",
]
-from . import asyncronous, syncronous
-from .asyncronous import PocketOptionAsync, RawHandler
-from .syncronous import PocketOption, RawHandlerSync
+from . import asynchronous, synchronous
+from .asynchronous import PocketOptionAsync, RawHandler
+from .synchronous import PocketOption, RawHandlerSync
diff --git a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asyncronous.py b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asynchronous.py
similarity index 94%
rename from BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asyncronous.py
rename to BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asynchronous.py
index d6b711a0..cd0b3a81 100644
--- a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asyncronous.py
+++ b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asynchronous.py
@@ -1,17 +1,16 @@
-from BinaryOptionsToolsV2.validator import Validator
-from BinaryOptionsToolsV2.config import Config
-from BinaryOptionsToolsV2 import RawPocketOption, Logger
-from datetime import timedelta
-
-
import asyncio
import json
import sys
+from datetime import timedelta
+
+from BinaryOptionsToolsV2 import Logger, RawPocketOption
+from BinaryOptionsToolsV2.config import Config
+from BinaryOptionsToolsV2.validator import Validator
class AsyncSubscription:
def __init__(self, subscription):
- """Asyncronous Iterator over json objects"""
+ """Asynchronous Iterator over json objects"""
self.subscription = subscription
def __aiter__(self):
@@ -24,7 +23,7 @@ async def __anext__(self):
class RawHandler:
"""
Handler for advanced raw WebSocket message operations.
-
+
Provides low-level access to send messages and receive filtered responses
based on a validator. Each handler maintains its own message stream.
"""
@@ -32,7 +31,7 @@ class RawHandler:
def __init__(self, rust_handler):
"""
Initialize RawHandler with a Rust handler instance.
-
+
Args:
rust_handler: The underlying RawHandlerRust instance from PyO3
"""
@@ -41,10 +40,10 @@ def __init__(self, rust_handler):
async def send_text(self, message: str) -> None:
"""
Send a text message through this handler.
-
+
Args:
message: Text message to send
-
+
Example:
```python
await handler.send_text('42["ping"]')
@@ -55,10 +54,10 @@ async def send_text(self, message: str) -> None:
async def send_binary(self, data: bytes) -> None:
"""
Send a binary message through this handler.
-
+
Args:
data: Binary data to send
-
+
Example:
```python
await handler.send_binary(b'\\x00\\x01\\x02')
@@ -69,13 +68,13 @@ async def send_binary(self, data: bytes) -> None:
async def send_and_wait(self, message: str) -> str:
"""
Send a message and wait for the next matching response.
-
+
Args:
message: Message to send
-
+
Returns:
str: The first response that matches this handler's validator
-
+
Example:
```python
response = await handler.send_and_wait('42["getBalance"]')
@@ -87,10 +86,10 @@ async def send_and_wait(self, message: str) -> str:
async def wait_next(self) -> str:
"""
Wait for the next message that matches this handler's validator.
-
+
Returns:
str: The next matching message
-
+
Example:
```python
message = await handler.wait_next()
@@ -102,10 +101,10 @@ async def wait_next(self) -> str:
async def subscribe(self):
"""
Subscribe to messages matching this handler's validator.
-
+
Returns:
AsyncIterator[str]: Stream of matching messages
-
+
Example:
```python
stream = await handler.subscribe()
@@ -119,7 +118,7 @@ async def subscribe(self):
def id(self) -> str:
"""
Get the unique ID of this handler.
-
+
Returns:
str: Handler UUID
"""
@@ -174,7 +173,6 @@ def __init__(
Warning: This class is designed for asynchronous operations and should be used within an async context.
- This version doesn't support the `Config` class.
Note:
- The configuration becomes locked once initialized and cannot be modified afterwards
- Custom URLs provided in the `url` parameter take precedence over URLs in the configuration
@@ -195,7 +193,7 @@ def __init__(
if url is not None:
self.client = RawPocketOption.new_with_url(ssid, url)
else:
- self.client = RawPocketOption(ssid, config)
+ self.client = RawPocketOption(ssid)
else:
self.config = Config()
if url is not None:
@@ -290,17 +288,20 @@ async def check_win(self, id: str) -> dict:
ValueError: If trade_id is invalid
TimeoutError: If result check times out
"""
- # end_time = await self.client.get_deal_end_time(id)
+ end_time = await self.client.get_deal_end_time(id)
+
+ if end_time is not None:
+ # Import time here since it might not be at top level
+ import time as py_time
- # if end_time is not None:
- # duration = end_time - int(time.time())
- # if duration <= 0:
- # duration = 5 # If duration is less than 0 then the trade is closed and the function should take less than 5 seconds to run
- # else:
- # duration = 5
- # duration += self.config.extra_duration
+ duration = end_time - int(py_time.time())
+ if duration <= 0:
+ duration = 5 # If duration is less than 0 then the trade is closed and the function should take less than 5 seconds to run
+ else:
+ duration = self.config.timeout_secs
+ duration += self.config.extra_duration
- # self.logger.debug(f"Timeout set to: {duration} (6 extra seconds)")
+ # self.logger.debug(f"Timeout set to: {duration} (extra seconds included)")
async def check(id):
trade = await self.client.check_win(id)
trade = json.loads(trade)
@@ -313,7 +314,7 @@ async def check(id):
trade["result"] = "loss"
return trade
- return await check(id)
+ return await _timeout(check(id), duration)
async def get_candles(self, asset: str, period: int, offset: int) -> list[dict]:
"""
@@ -404,7 +405,7 @@ async def clear_closed_deals(self) -> None:
async def payout(
self, asset: None | str | list[str] = None
- ) -> dict | list[int] | int:
+ ) -> dict[str, int | None] | list[int | None] | int | None:
"""
Retrieves current payout percentages for all assets.
@@ -521,6 +522,18 @@ async def get_server_time(self) -> int:
"""Returns the current server time as a UNIX timestamp"""
return await self.client.get_server_time()
+ async def wait_for_assets(self, timeout: float = 30.0) -> None:
+ """
+ Waits for the assets to be loaded from the server.
+
+ Args:
+ timeout (float): The maximum time to wait in seconds. Default is 30.0.
+
+ Raises:
+ TimeoutError: If the assets are not loaded within the timeout period.
+ """
+ await self.client.wait_for_assets(timeout)
+
def is_demo(self) -> bool:
"""
Checks if the current account is a demo account.
@@ -616,24 +629,24 @@ async def create_raw_handler(
) -> "RawHandler":
"""
Creates a raw handler for advanced WebSocket message handling.
-
+
Args:
validator: Validator instance to filter incoming messages
keep_alive: Optional message to send on reconnection
-
+
Returns:
RawHandler: Handler instance for sending/receiving messages
-
+
Example:
```python
from BinaryOptionsToolsV2.validator import Validator
-
+
validator = Validator.starts_with('42["signals"')
handler = await client.create_raw_handler(validator)
-
+
# Send and wait for response
response = await handler.send_and_wait('42["signals/subscribe"]')
-
+
# Or subscribe to stream
async for message in handler.subscribe():
print(message)
diff --git a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/syncronous.py b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/synchronous.py
similarity index 96%
rename from BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/syncronous.py
rename to BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/synchronous.py
index cfc651bf..5380bc39 100644
--- a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/syncronous.py
+++ b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/synchronous.py
@@ -1,10 +1,11 @@
-from .asyncronous import PocketOptionAsync
+import asyncio
+import json
+from datetime import timedelta
+
from BinaryOptionsToolsV2.config import Config
from BinaryOptionsToolsV2.validator import Validator
-from datetime import timedelta
-import asyncio
-import json
+from .asynchronous import PocketOptionAsync
class SyncSubscription:
@@ -21,7 +22,7 @@ def __next__(self):
class RawHandlerSync:
"""
Synchronous handler for advanced raw WebSocket message operations.
-
+
Provides low-level access to send messages and receive filtered responses
based on a validator. Each handler maintains its own message stream.
"""
@@ -29,7 +30,7 @@ class RawHandlerSync:
def __init__(self, async_handler, loop):
"""
Initialize RawHandlerSync with an async handler and event loop.
-
+
Args:
async_handler: The underlying async RawHandler instance
loop: Event loop for running async operations
@@ -40,10 +41,10 @@ def __init__(self, async_handler, loop):
def send_text(self, message: str) -> None:
"""
Send a text message through this handler.
-
+
Args:
message: Text message to send
-
+
Example:
```python
handler.send_text('42["ping"]')
@@ -54,10 +55,10 @@ def send_text(self, message: str) -> None:
def send_binary(self, data: bytes) -> None:
"""
Send a binary message through this handler.
-
+
Args:
data: Binary data to send
-
+
Example:
```python
handler.send_binary(b'\\x00\\x01\\x02')
@@ -68,13 +69,13 @@ def send_binary(self, data: bytes) -> None:
def send_and_wait(self, message: str) -> str:
"""
Send a message and wait for the next matching response.
-
+
Args:
message: Message to send
-
+
Returns:
str: The first response that matches this handler's validator
-
+
Example:
```python
response = handler.send_and_wait('42["getBalance"]')
@@ -86,10 +87,10 @@ def send_and_wait(self, message: str) -> str:
def wait_next(self) -> str:
"""
Wait for the next message that matches this handler's validator.
-
+
Returns:
str: The next matching message
-
+
Example:
```python
message = handler.wait_next()
@@ -101,10 +102,10 @@ def wait_next(self) -> str:
def subscribe(self):
"""
Subscribe to messages matching this handler's validator.
-
+
Returns:
Iterator[str]: Stream of matching messages
-
+
Example:
```python
stream = handler.subscribe()
@@ -120,7 +121,7 @@ def subscribe(self):
def id(self) -> str:
"""
Get the unique ID of this handler.
-
+
Returns:
str: Handler UUID
"""
@@ -150,7 +151,9 @@ def __next__(self):
class PocketOption:
- def __init__(self, ssid: str, config: Config | dict | str = None, **_):
+ def __init__(
+ self, ssid: str, url: str | None = None, config: Config | dict | str = None, **_
+ ):
"""
Initializes a new PocketOption instance.
@@ -207,11 +210,9 @@ def __init__(self, ssid: str, config: Config | dict | str = None, **_):
- Invalid configuration values will raise appropriate exceptions
- The event loop is automatically closed when the instance is deleted
- All async operations are wrapped to provide a synchronous interface
-
- Warning: This class does not use the `Config` class for configuration management.
"""
self.loop = asyncio.new_event_loop()
- self._client = PocketOptionAsync(ssid, config)
+ self._client = PocketOptionAsync(ssid, url=url, config=config)
def __del__(self):
self.loop.close()
@@ -303,7 +304,9 @@ def clear_closed_deals(self) -> None:
"Removes all the closed deals from memory, this function doesn't return anything"
self.loop.run_until_complete(self._client.clear_closed_deals())
- def payout(self, asset: None | str | list[str] = None) -> dict | list[str] | int:
+ def payout(
+ self, asset: None | str | list[str] = None
+ ) -> dict[str, int | None] | list[int | None] | int | None:
"Returns a dict of asset | payout for each asset, if 'asset' is not None then it will return the payout of the asset or a list of the payouts for each asset it was passed"
return self.loop.run_until_complete(self._client.payout(asset))
@@ -450,24 +453,24 @@ def create_raw_handler(
) -> "RawHandlerSync":
"""
Creates a raw handler for advanced WebSocket message handling.
-
+
Args:
validator: Validator instance to filter incoming messages
keep_alive: Optional message to send on reconnection
-
+
Returns:
RawHandlerSync: Sync handler instance for sending/receiving messages
-
+
Example:
```python
from BinaryOptionsToolsV2.validator import Validator
-
+
validator = Validator.starts_with('42["signals"')
handler = client.create_raw_handler(validator)
-
+
# Send and wait for response
response = handler.send_and_wait('42["signals/subscribe"]')
-
+
# Or subscribe to stream
for message in handler.subscribe():
print(message)
diff --git a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/tracing.py b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/tracing.py
index a2c68da3..da5a1c49 100644
--- a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/tracing.py
+++ b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/tracing.py
@@ -1,10 +1,10 @@
import json
-from BinaryOptionsToolsV2 import start_tracing
-from BinaryOptionsToolsV2 import Logger as RustLogger
-from BinaryOptionsToolsV2 import LogBuilder as RustLogBuilder
-
from datetime import timedelta
+from .BinaryOptionsToolsV2 import LogBuilder as RustLogBuilder
+from .BinaryOptionsToolsV2 import Logger as RustLogger
+from .BinaryOptionsToolsV2 import start_tracing
+
class LogSubscription:
def __init__(self, subscription):
@@ -118,7 +118,7 @@ def create_logs_iterator(
timeout (None | timedelta): Optional timeout for the iterator.
Returns:
- StreamLogsIterator: A new StreamLogsIterator instance that supports both asyncronous and syncronous iterators.
+ StreamLogsIterator: A new StreamLogsIterator instance that supports both asynchronous and synchronousiterators.
"""
return LogSubscription(self.builder.create_logs_iterator(level, timeout))
diff --git a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/validator.py b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/validator.py
index c22f6cba..6ee9fa96 100644
--- a/BinaryOptionsToolsV2/BinaryOptionsToolsV2/validator.py
+++ b/BinaryOptionsToolsV2/BinaryOptionsToolsV2/validator.py
@@ -24,7 +24,7 @@ class Validator:
def __init__(self):
"""Creates a default validator that accepts all messages."""
- from BinaryOptionsToolsV2 import RawValidator
+ from .BinaryOptionsToolsV2 import RawValidator
self._validator = RawValidator()
@@ -47,7 +47,7 @@ def regex(pattern: str) -> "Validator":
assert validator.check("abc") == False
```
"""
- from BinaryOptionsToolsV2 import RawValidator
+ from .BinaryOptionsToolsV2 import RawValidator
v = Validator()
v._validator = RawValidator.regex(pattern)
@@ -64,7 +64,7 @@ def starts_with(prefix: str) -> "Validator":
Returns:
Validator that matches messages starting with prefix
"""
- from BinaryOptionsToolsV2 import RawValidator
+ from .BinaryOptionsToolsV2 import RawValidator
v = Validator()
v._validator = RawValidator.starts_with(prefix)
@@ -81,7 +81,7 @@ def ends_with(suffix: str) -> "Validator":
Returns:
Validator that matches messages ending with suffix
"""
- from BinaryOptionsToolsV2 import RawValidator
+ from .BinaryOptionsToolsV2 import RawValidator
v = Validator()
v._validator = RawValidator.ends_with(suffix)
@@ -98,7 +98,7 @@ def contains(substring: str) -> "Validator":
Returns:
Validator that matches messages containing substring
"""
- from BinaryOptionsToolsV2 import RawValidator
+ from .BinaryOptionsToolsV2 import RawValidator
v = Validator()
v._validator = RawValidator.contains(substring)
@@ -123,7 +123,7 @@ def ne(validator: "Validator") -> "Validator":
assert v.check("error occurred") == False
```
"""
- from BinaryOptionsToolsV2 import RawValidator
+ from .BinaryOptionsToolsV2 import RawValidator
v = Validator()
v._validator = RawValidator.ne(validator._validator)
@@ -151,10 +151,10 @@ def all(validators: List["Validator"]) -> "Validator":
assert v.check("Hello Beautiful") == False
```
"""
- from BinaryOptionsToolsV2 import RawValidator
+ from .BinaryOptionsToolsV2 import RawValidator
v = Validator()
- v._validator = RawValidator.all([v._validator for v in validators])
+ v._validator = RawValidator.all([item._validator for item in validators])
return v
@staticmethod
@@ -180,10 +180,10 @@ def any(validators: List["Validator"]) -> "Validator":
assert v.check("in progress") == False
```
"""
- from BinaryOptionsToolsV2 import RawValidator
+ from .BinaryOptionsToolsV2 import RawValidator
v = Validator()
- v._validator = RawValidator.any([v._validator for v in validators])
+ v._validator = RawValidator.any([item._validator for item in validators])
return v
@staticmethod
@@ -249,7 +249,7 @@ def will_crash(msg: str) -> bool:
print("This will never be reached")
```
"""
- from BinaryOptionsToolsV2 import RawValidator
+ from .BinaryOptionsToolsV2 import RawValidator
v = Validator()
v._validator = RawValidator.custom(func)
diff --git a/BinaryOptionsToolsV2/Cargo.lock b/BinaryOptionsToolsV2/Cargo.lock
index 68e35cbd..0a802013 100644
--- a/BinaryOptionsToolsV2/Cargo.lock
+++ b/BinaryOptionsToolsV2/Cargo.lock
@@ -4,7 +4,7 @@ version = 4
[[package]]
name = "BinaryOptionsToolsV2"
-version = "0.2.1"
+version = "0.2.2"
dependencies = [
"async-stream",
"binary_options_tools",
@@ -110,18 +110,34 @@ dependencies = [
"syn 2.0.101",
]
-[[package]]
-name = "atomic-waker"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
-
[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
+[[package]]
+name = "aws-lc-rs"
+version = "1.15.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e84ce723ab67259cfeb9877c6a639ee9eb7a27b28123abd71db7f0d5d0cc9d86"
+dependencies = [
+ "aws-lc-sys",
+ "zeroize",
+]
+
+[[package]]
+name = "aws-lc-sys"
+version = "0.36.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "43a442ece363113bd4bd4c8b18977a7798dd4d3c3383f34fb61936960e8f4ad8"
+dependencies = [
+ "cc",
+ "cmake",
+ "dunce",
+ "fs_extra",
+]
+
[[package]]
name = "base64"
version = "0.22.1"
@@ -171,12 +187,13 @@ dependencies = [
"binary-options-tools-macros",
"chrono",
"futures-util",
- "native-tls",
"php_serde",
"rand 0.9.2",
"regex",
"reqwest",
"rust_decimal",
+ "rustls",
+ "rustls-native-certs",
"serde",
"serde-enum-str",
"serde_json",
@@ -279,10 +296,13 @@ checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9"
[[package]]
name = "cc"
-version = "1.2.13"
+version = "1.2.53"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda"
+checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932"
dependencies = [
+ "find-msvc-tools",
+ "jobserver",
+ "libc",
"shlex",
]
@@ -312,6 +332,15 @@ dependencies = [
"windows-link 0.2.1",
]
+[[package]]
+name = "cmake"
+version = "0.1.57"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d"
+dependencies = [
+ "cc",
+]
+
[[package]]
name = "concurrent-queue"
version = "2.5.0"
@@ -323,9 +352,9 @@ dependencies = [
[[package]]
name = "core-foundation"
-version = "0.9.4"
+version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
+checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
dependencies = [
"core-foundation-sys",
"libc",
@@ -460,13 +489,10 @@ dependencies = [
]
[[package]]
-name = "encoding_rs"
-version = "0.8.35"
+name = "dunce"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
-dependencies = [
- "cfg-if",
-]
+checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "equivalent"
@@ -474,16 +500,6 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
-[[package]]
-name = "errno"
-version = "0.3.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
-dependencies = [
- "libc",
- "windows-sys 0.59.0",
-]
-
[[package]]
name = "event-listener"
version = "5.4.0"
@@ -506,10 +522,10 @@ dependencies = [
]
[[package]]
-name = "fastrand"
-version = "2.3.0"
+name = "find-msvc-tools"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
+checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
[[package]]
name = "fnv"
@@ -517,21 +533,6 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-[[package]]
-name = "foreign-types"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
-dependencies = [
- "foreign-types-shared",
-]
-
-[[package]]
-name = "foreign-types-shared"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
-
[[package]]
name = "form_urlencoded"
version = "1.2.2"
@@ -541,6 +542,12 @@ dependencies = [
"percent-encoding",
]
+[[package]]
+name = "fs_extra"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
+
[[package]]
name = "funty"
version = "2.0.0"
@@ -653,8 +660,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
dependencies = [
"cfg-if",
+ "js-sys",
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
+ "wasm-bindgen",
]
[[package]]
@@ -664,30 +673,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8"
dependencies = [
"cfg-if",
+ "js-sys",
"libc",
"wasi 0.13.3+wasi-0.2.2",
+ "wasm-bindgen",
"windows-targets 0.52.6",
]
-[[package]]
-name = "h2"
-version = "0.4.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e"
-dependencies = [
- "atomic-waker",
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "http",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
[[package]]
name = "hashbrown"
version = "0.12.3"
@@ -758,7 +750,6 @@ dependencies = [
"bytes",
"futures-channel",
"futures-util",
- "h2",
"http",
"http-body",
"httparse",
@@ -784,22 +775,7 @@ dependencies = [
"tokio",
"tokio-rustls",
"tower-service",
-]
-
-[[package]]
-name = "hyper-tls"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
-dependencies = [
- "bytes",
- "http-body-util",
- "hyper",
- "hyper-util",
- "native-tls",
- "tokio",
- "tokio-native-tls",
- "tower-service",
+ "webpki-roots 0.26.11",
]
[[package]]
@@ -1017,6 +993,15 @@ version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
+[[package]]
+name = "jobserver"
+version = "0.1.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0"
+dependencies = [
+ "libc",
+]
+
[[package]]
name = "js-sys"
version = "0.3.77"
@@ -1049,12 +1034,6 @@ version = "0.2.175"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
-[[package]]
-name = "linux-raw-sys"
-version = "0.4.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
-
[[package]]
name = "litemap"
version = "0.7.4"
@@ -1077,6 +1056,12 @@ version = "0.4.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
+[[package]]
+name = "lru-slab"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
+
[[package]]
name = "matchers"
version = "0.2.0"
@@ -1118,23 +1103,6 @@ dependencies = [
"windows-sys 0.52.0",
]
-[[package]]
-name = "native-tls"
-version = "0.2.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c"
-dependencies = [
- "libc",
- "log",
- "openssl",
- "openssl-probe",
- "openssl-sys",
- "schannel",
- "security-framework",
- "security-framework-sys",
- "tempfile",
-]
-
[[package]]
name = "nu-ansi-term"
version = "0.50.3"
@@ -1159,49 +1127,11 @@ version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
-[[package]]
-name = "openssl"
-version = "0.10.70"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61cfb4e166a8bb8c9b55c500bc2308550148ece889be90f609377e58140f42c6"
-dependencies = [
- "bitflags",
- "cfg-if",
- "foreign-types",
- "libc",
- "once_cell",
- "openssl-macros",
- "openssl-sys",
-]
-
-[[package]]
-name = "openssl-macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.101",
-]
-
[[package]]
name = "openssl-probe"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
-
-[[package]]
-name = "openssl-sys"
-version = "0.9.105"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b22d5b84be05a8d6947c7cb71f7c849aa0f112acd4bf51c2a7c1c988ac0a9dc"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
- "vcpkg",
-]
+checksum = "9f50d9b3dabb09ecd771ad0aa242ca6894994c130308ca3d7684634df8037391"
[[package]]
name = "parking"
@@ -1261,12 +1191,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-[[package]]
-name = "pkg-config"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
-
[[package]]
name = "portable-atomic"
version = "1.10.0"
@@ -1395,6 +1319,61 @@ dependencies = [
"syn 2.0.101",
]
+[[package]]
+name = "quinn"
+version = "0.11.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20"
+dependencies = [
+ "bytes",
+ "cfg_aliases",
+ "pin-project-lite",
+ "quinn-proto",
+ "quinn-udp",
+ "rustc-hash",
+ "rustls",
+ "socket2 0.6.0",
+ "thiserror",
+ "tokio",
+ "tracing",
+ "web-time",
+]
+
+[[package]]
+name = "quinn-proto"
+version = "0.11.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
+dependencies = [
+ "bytes",
+ "getrandom 0.3.1",
+ "lru-slab",
+ "rand 0.9.2",
+ "ring",
+ "rustc-hash",
+ "rustls",
+ "rustls-pki-types",
+ "slab",
+ "thiserror",
+ "tinyvec",
+ "tracing",
+ "web-time",
+]
+
+[[package]]
+name = "quinn-udp"
+version = "0.5.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd"
+dependencies = [
+ "cfg_aliases",
+ "libc",
+ "once_cell",
+ "socket2 0.6.0",
+ "tracing",
+ "windows-sys 0.59.0",
+]
+
[[package]]
name = "quote"
version = "1.0.40"
@@ -1525,53 +1504,51 @@ checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb"
dependencies = [
"base64",
"bytes",
- "encoding_rs",
"futures-core",
"futures-util",
- "h2",
"http",
"http-body",
"http-body-util",
"hyper",
"hyper-rustls",
- "hyper-tls",
"hyper-util",
"ipnet",
"js-sys",
"log",
"mime",
- "native-tls",
"once_cell",
"percent-encoding",
"pin-project-lite",
+ "quinn",
+ "rustls",
"rustls-pemfile",
+ "rustls-pki-types",
"serde",
"serde_json",
"serde_urlencoded",
"sync_wrapper",
- "system-configuration",
"tokio",
- "tokio-native-tls",
+ "tokio-rustls",
"tower",
"tower-service",
"url",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
+ "webpki-roots 0.26.11",
"windows-registry",
]
[[package]]
name = "ring"
-version = "0.17.8"
+version = "0.17.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d"
+checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
dependencies = [
"cc",
"cfg-if",
"getrandom 0.2.15",
"libc",
- "spin",
"untrusted",
"windows-sys 0.52.0",
]
@@ -1633,17 +1610,10 @@ dependencies = [
]
[[package]]
-name = "rustix"
-version = "0.38.44"
+name = "rustc-hash"
+version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
-dependencies = [
- "bitflags",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys 0.59.0",
-]
+checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
[[package]]
name = "rustls"
@@ -1651,13 +1621,28 @@ version = "0.23.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7"
dependencies = [
+ "aws-lc-rs",
+ "log",
"once_cell",
+ "ring",
"rustls-pki-types",
"rustls-webpki",
"subtle",
"zeroize",
]
+[[package]]
+name = "rustls-native-certs"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63"
+dependencies = [
+ "openssl-probe",
+ "rustls-pki-types",
+ "schannel",
+ "security-framework",
+]
+
[[package]]
name = "rustls-pemfile"
version = "2.2.0"
@@ -1672,6 +1657,9 @@ name = "rustls-pki-types"
version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c"
+dependencies = [
+ "web-time",
+]
[[package]]
name = "rustls-webpki"
@@ -1679,6 +1667,7 @@ version = "0.102.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9"
dependencies = [
+ "aws-lc-rs",
"ring",
"rustls-pki-types",
"untrusted",
@@ -1719,9 +1708,9 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
[[package]]
name = "security-framework"
-version = "2.11.1"
+version = "3.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
+checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef"
dependencies = [
"bitflags",
"core-foundation",
@@ -1732,9 +1721,9 @@ dependencies = [
[[package]]
name = "security-framework-sys"
-version = "2.14.0"
+version = "2.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32"
+checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0"
dependencies = [
"core-foundation-sys",
"libc",
@@ -1901,12 +1890,6 @@ dependencies = [
"windows-sys 0.59.0",
]
-[[package]]
-name = "spin"
-version = "0.9.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
-
[[package]]
name = "stable_deref_trait"
version = "1.2.0"
@@ -1967,27 +1950,6 @@ dependencies = [
"syn 2.0.101",
]
-[[package]]
-name = "system-configuration"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
-dependencies = [
- "bitflags",
- "core-foundation",
- "system-configuration-sys",
-]
-
-[[package]]
-name = "system-configuration-sys"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
[[package]]
name = "tap"
version = "1.0.1"
@@ -2000,20 +1962,6 @@ version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a"
-[[package]]
-name = "tempfile"
-version = "3.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91"
-dependencies = [
- "cfg-if",
- "fastrand",
- "getrandom 0.3.1",
- "once_cell",
- "rustix",
- "windows-sys 0.59.0",
-]
-
[[package]]
name = "thiserror"
version = "2.0.17"
@@ -2071,9 +2019,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.48.0"
+version = "1.49.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408"
+checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
dependencies = [
"bytes",
"libc",
@@ -2097,16 +2045,6 @@ dependencies = [
"syn 2.0.101",
]
-[[package]]
-name = "tokio-native-tls"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
-dependencies = [
- "native-tls",
- "tokio",
-]
-
[[package]]
name = "tokio-rustls"
version = "0.26.1"
@@ -2125,25 +2063,14 @@ checksum = "d25a406cddcc431a75d3d9afc6a7c0f7428d4891dd973e4d54c56b46127bf857"
dependencies = [
"futures-util",
"log",
- "native-tls",
+ "rustls",
+ "rustls-native-certs",
+ "rustls-pki-types",
"tokio",
- "tokio-native-tls",
+ "tokio-rustls",
"tungstenite",
]
-[[package]]
-name = "tokio-util"
-version = "0.7.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "pin-project-lite",
- "tokio",
-]
-
[[package]]
name = "toml_datetime"
version = "0.7.2"
@@ -2203,9 +2130,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
[[package]]
name = "tracing"
-version = "0.1.41"
+version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
+checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647"
dependencies = [
"pin-project-lite",
"tracing-attributes",
@@ -2214,9 +2141,9 @@ dependencies = [
[[package]]
name = "tracing-attributes"
-version = "0.1.28"
+version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d"
+checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
dependencies = [
"proc-macro2",
"quote",
@@ -2225,9 +2152,9 @@ dependencies = [
[[package]]
name = "tracing-core"
-version = "0.1.33"
+version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c"
+checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c"
dependencies = [
"once_cell",
"valuable",
@@ -2256,9 +2183,9 @@ dependencies = [
[[package]]
name = "tracing-subscriber"
-version = "0.3.20"
+version = "0.3.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
+checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e"
dependencies = [
"matchers",
"nu-ansi-term",
@@ -2292,8 +2219,9 @@ dependencies = [
"http",
"httparse",
"log",
- "native-tls",
"rand 0.9.2",
+ "rustls",
+ "rustls-pki-types",
"sha1",
"thiserror",
"utf-8",
@@ -2371,12 +2299,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
-[[package]]
-name = "vcpkg"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
-
[[package]]
name = "version_check"
version = "0.9.5"
@@ -2488,6 +2410,34 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "web-time"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "webpki-roots"
+version = "0.26.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9"
+dependencies = [
+ "webpki-roots 1.0.5",
+]
+
+[[package]]
+name = "webpki-roots"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c"
+dependencies = [
+ "rustls-pki-types",
+]
+
[[package]]
name = "windows-core"
version = "0.52.0"
diff --git a/BinaryOptionsToolsV2/Cargo.toml b/BinaryOptionsToolsV2/Cargo.toml
index f6284512..fdcea5ee 100644
--- a/BinaryOptionsToolsV2/Cargo.toml
+++ b/BinaryOptionsToolsV2/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "BinaryOptionsToolsV2"
-version = "0.2.1"
-edition = "2024"
+version = "0.2.2"
+edition = "2021"
authors = ["ChipaDevTeam"]
description = "Python bindings for binary-options-tools. High-performance library for PocketOption trading automation with async/sync support, real-time data streaming, and WebSocket API access."
license-file = "LICENSE"
@@ -32,9 +32,9 @@ serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.142"
uuid = "1.18.0"
tracing = "0.1.41"
-tokio = "1.48.0"
+tokio = "1.49.0"
futures-util = "0.3.31"
-tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
+tracing-subscriber = { version = "0.3.22", features = ["env-filter"] }
chrono = "0.4.42"
url = "2.5.7"
regex = "1.12.2"
diff --git a/BinaryOptionsToolsV2/LICENSE b/BinaryOptionsToolsV2/LICENSE
index bc94d24a..5f9720c5 100644
--- a/BinaryOptionsToolsV2/LICENSE
+++ b/BinaryOptionsToolsV2/LICENSE
@@ -6,64 +6,67 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. DEFINITIONS
-"Software" refers to BinaryOptionsTools v2 and all associated documentation,
+"Software" refers to BinaryOptionsTools v2 and all associated documentation,
source code, binaries, and related materials.
-"Personal Use" means use by individuals for non-commercial, educational,
+"Personal Use" means use by individuals for non-commercial, educational,
research, or personal trading purposes.
-"Commercial Use" means use of the Software in any manner primarily intended
-for commercial advantage or monetary compensation, including but not limited
-to: selling access to the Software, using the Software as part of a paid
+"Commercial Use" means use of the Software in any manner primarily intended
+for commercial advantage or monetary compensation, including but not limited
+to: selling access to the Software, using the Software as part of a paid
service, or integrating the Software into commercial products.
-2. GRANT OF LICENSE
+1. GRANT OF LICENSE
2.1 Personal Use License
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this Software, to use, copy, modify, and distribute the Software for
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this Software, to use, copy, modify, and distribute the Software for
Personal Use only, subject to the following conditions:
-a) The above copyright notice and this permission notice shall be included in
+a) The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
b) This Software is provided "AS IS" for Personal Use only.
2.2 Commercial Use License
-Commercial Use of this Software requires explicit written permission from
+Commercial Use of this Software requires explicit written permission from
ChipaDevTeam. To request permission for Commercial Use, contact us at:
-- Discord: https://discord.gg/p7YyFqSmAz
-- GitHub: https://github.com/ChipaDevTeam
-3. DISCLAIMER OF WARRANTY
+- Discord:
+- GitHub:
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+1. DISCLAIMER OF WARRANTY
-4. LIMITATION OF LIABILITY
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS, OR CHIPADEVTEAM BE LIABLE
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+1. LIMITATION OF LIABILITY
+
+IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS, OR CHIPADEVTEAM BE LIABLE
+FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The authors and ChipaDevTeam are not responsible for:
+
- Any financial losses incurred from using this Software
- Any trading decisions made using this Software
- Any bugs, errors, or issues in the Software
-- Any consequences of using this Software for trading binary options or
+- Any consequences of using this Software for trading binary options or
other financial instruments
-5. RISK WARNING
+1. RISK WARNING
-Binary options trading carries significant risk. This Software is provided
+Binary options trading carries significant risk. This Software is provided
for educational and personal use only. Users should:
+
- Never risk more than they can afford to lose
- Understand the risks involved in binary options trading
- Comply with all applicable laws and regulations
- Use the Software at their own risk
-6. DISTRIBUTION
+1. DISTRIBUTION
You may distribute copies of the Software for Personal Use, provided that:
a) You include this license file
@@ -71,7 +74,7 @@ b) You clearly indicate this is for Personal Use only
c) You do not charge for distribution
d) You preserve all copyright notices
-7. MODIFICATIONS
+1. MODIFICATIONS
You may modify the Software for Personal Use. Modified versions:
a) Must retain this license
@@ -79,18 +82,19 @@ b) Must clearly indicate they are modified versions
c) Cannot be used for Commercial Use without permission
d) Cannot remove or modify copyright notices
-8. TERMINATION
+1. TERMINATION
-This license automatically terminates if you violate any of its terms. Upon
+This license automatically terminates if you violate any of its terms. Upon
termination, you must destroy all copies of the Software in your possession.
-9. CONTACT
+1. CONTACT
For Commercial Use licensing, questions, or permissions:
-- Discord: https://discord.gg/p7YyFqSmAz
-- GitHub: https://github.com/ChipaDevTeam/BinaryOptionsTools-v2
+
+- Discord:
+- GitHub:
---
-By using this Software, you acknowledge that you have read this license,
-understand it, and agree to be bound by its terms and conditions.
\ No newline at end of file
+By using this Software, you acknowledge that you have read this license,
+understand it, and agree to be bound by its terms and conditions.
diff --git a/BinaryOptionsToolsV2/MANIFEST.in b/BinaryOptionsToolsV2/MANIFEST.in
new file mode 100644
index 00000000..8180955b
--- /dev/null
+++ b/BinaryOptionsToolsV2/MANIFEST.in
@@ -0,0 +1,2 @@
+exclude BinaryOptionsToolsV2/Dockerfile
+exclude BinaryOptionsToolsV2/BinaryOptionsToolsV2/Dockerfile
\ No newline at end of file
diff --git a/BinaryOptionsToolsV2/PYTHON_API_REFERENCE.md b/BinaryOptionsToolsV2/PYTHON_API_REFERENCE.md
index 61ef4a35..79ab1b7c 100644
--- a/BinaryOptionsToolsV2/PYTHON_API_REFERENCE.md
+++ b/BinaryOptionsToolsV2/PYTHON_API_REFERENCE.md
@@ -3,6 +3,7 @@
Complete reference guide for all features and methods available in the BinaryOptionsToolsV2 Python library.
## Table of Contents
+
- [Trading Operations](#trading-operations)
- [Account Management](#account-management)
- [Market Data](#market-data)
@@ -21,6 +22,7 @@ Complete reference guide for all features and methods available in the BinaryOpt
| **Check Trade Result** | `await client.check_win(trade_id)` | `client.check_win(trade_id)` | Checks if a trade won, lost, or drew. Returns dict with `result` ("win"/"loss"/"draw") and `profit`. |
### Trading Example
+
```python
# Async
import asyncio
@@ -54,6 +56,7 @@ print(f"Result: {trade['result']}, Profit: {trade['profit']}")
| **Clear Closed Deals** | `await client.clear_closed_deals()` | `client.clear_closed_deals()` | Removes all closed deals from memory. Returns nothing. |
### Account Management Example
+
```python
# Async
import asyncio
@@ -91,6 +94,7 @@ closed_trades = client.closed_deals()
| **Get Server Time** | `await client.get_server_time()` | `client.get_server_time()` | Returns current server time as UNIX timestamp (int). |
### Market Data Example
+
```python
# Async
import asyncio
@@ -117,6 +121,7 @@ server_time = client.get_server_time()
```
### Candle Data Structure
+
```python
{
"time": "2025-01-01T12:00:00Z", # ISO format timestamp
@@ -142,6 +147,7 @@ server_time = client.get_server_time()
### Subscription Examples
#### Async Subscriptions
+
```python
import asyncio
from datetime import timedelta
@@ -174,6 +180,7 @@ await client.unsubscribe("EURUSD_otc")
```
#### Sync Subscriptions
+
```python
import time
from datetime import timedelta
@@ -208,6 +215,7 @@ client.unsubscribe("EURUSD_otc")
| **Reconnect** | `await client.reconnect()` | `client.reconnect()` | Disconnects and immediately reconnects. Useful for resetting connection state. |
### Connection Management Example
+
```python
# Async
import asyncio
@@ -259,6 +267,7 @@ The Raw Handler API provides low-level WebSocket access for custom protocol impl
### Raw Handler Examples
#### Async Raw Handler
+
```python
import asyncio
from BinaryOptionsToolsV2 import PocketOptionAsync, Validator
@@ -288,6 +297,7 @@ print(f"Handler ID: {handler_id}")
```
#### Sync Raw Handler
+
```python
import time
from BinaryOptionsToolsV2 import PocketOption, Validator
@@ -326,6 +336,7 @@ Validators filter incoming WebSocket messages. Create complex filters using the
| **Any (OR)** | `Validator.any([validator1, validator2, ...])` | Matches if ANY validator matches (logical OR). |
#### Validator Examples
+
```python
from BinaryOptionsToolsV2 import Validator
@@ -374,32 +385,27 @@ client = PocketOption(
```
**Use cases for custom URLs:**
+
- Testing with custom/mock servers
- Using proxy servers
- Connecting to alternative regional endpoints
- Development and debugging
-### ⚠️ Config Class (Currently Not Functional)
+### Config Class
+
+**Important**: The `Config` class exists in the Python codebase.
-**Important**: The `Config` class exists in the Python codebase but is **NOT currently used** by the library. The Rust backend does not accept configuration parameters, and all settings use internal defaults.
+**Note:** Configuration parameters are currently ignored by the underlying Rust client. This feature will be enabled in a future release.
```python
-# This code will NOT have any effect:
+# This code will have effect:
from BinaryOptionsToolsV2 import Config
config = Config.from_dict({"timeout_secs": 60})
-client = PocketOptionAsync(ssid, config=config) # config parameter is ignored
+client = PocketOptionAsync(ssid, config=config)
```
-**Current Behavior:**
-- ❌ Config parameter is accepted but ignored
-- ❌ All configuration values use hardcoded defaults
-- ✅ Only the `url` parameter actually works
-- ✅ Built-in automatic reconnection with exponential backoff
-- ✅ Built-in connection and operation timeouts
-- ✅ Built-in WebSocket keepalive
-
-**Planned Configuration Parameters** (not yet implemented):
+**Configuration Parameters**:
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
@@ -411,6 +417,7 @@ client = PocketOptionAsync(ssid, config=config) # config parameter is ignored
| `urls` | List[str] | Platform defaults | List of WebSocket URLs for fallback |
If you need custom configuration options, please:
+
- Open an issue on [GitHub](https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/issues)
- Contact us on [Discord](https://discord.gg/p7YyFqSmAz)
@@ -419,6 +426,7 @@ If you need custom configuration options, please:
## Complete Usage Examples
### Basic Trading Bot (Async)
+
```python
import asyncio
from BinaryOptionsToolsV2 import PocketOptionAsync
@@ -451,6 +459,7 @@ asyncio.run(main())
```
### Basic Trading Bot (Sync)
+
```python
import time
from BinaryOptionsToolsV2 import PocketOption
@@ -471,6 +480,7 @@ client.disconnect()
```
### Real-time Data Monitoring (Async)
+
```python
import asyncio
from datetime import timedelta
@@ -502,6 +512,7 @@ asyncio.run(monitor_price())
```
### Advanced Strategy with Raw Handler (Async)
+
```python
import asyncio
import json
@@ -543,6 +554,7 @@ asyncio.run(advanced_strategy())
```
### Multi-Asset Monitoring (Sync)
+
```python
import time
from datetime import timedelta
@@ -616,6 +628,7 @@ asyncio.run(safe_trading())
## Best Practices
### 1. Always Close Connections
+
```python
# Async - use try/finally
import asyncio
@@ -639,6 +652,7 @@ finally:
```
### 2. Use Demo Account for Testing
+
```python
import time
@@ -651,6 +665,7 @@ if not client.is_demo():
```
### 3. Handle Connection Issues
+
```python
import asyncio
@@ -670,6 +685,7 @@ except TimeoutError:
```
### 4. Unsubscribe When Done
+
```python
import asyncio
@@ -686,6 +702,7 @@ await client.unsubscribe("EURUSD_otc")
```
### 5. Validate Assets Before Trading
+
```python
import asyncio
diff --git a/BinaryOptionsToolsV2/Readme.md b/BinaryOptionsToolsV2/Readme.md
index f962c80d..767c9a76 100644
--- a/BinaryOptionsToolsV2/Readme.md
+++ b/BinaryOptionsToolsV2/Readme.md
@@ -8,6 +8,7 @@ Python bindings for BinaryOptionsTools - A powerful library for automated binary
## Current Status
**Available Features**:
+
- Authentication and secure connection
- Buy/Sell trading operations
- Balance retrieval
@@ -17,37 +18,44 @@ Python bindings for BinaryOptionsTools - A powerful library for automated binary
- Opened deals management
- Asset information and validation
- Automatic reconnection handling
+- Historical candle data (`get_candles`, `get_candles_advanced`)
+- Advanced validators
**Temporarily Unavailable Features** (returning "work in progress" errors):
-- Historical candle data (`get_candles`, `get_candles_advanced`)
+
- Trade history (`history`)
- Closed deals management
- Payout information retrieval
- Raw message sending
-- Advanced validators
- Deal end time queries
We're actively working to restore all functionality with improved stability and performance.
## How to install
+
Install it with PyPi using the following command:
+
```bash
-pip install binaryoptionstoolsv2==0.1.6a3
+pip install binaryoptionstoolsv2
```
## Supported OS
+
Currently, only support for Windows is available.
## Supported Python versions
+
Currently, only Python 3.9 to 3.12 is supported.
## Compile from source (Not recommended)
-* Make sure you have `rust` and `cargo` installed (Check here)
-* Install [`maturin`](https://www.maturin.rs/installation) in order to compile the library
+- Make sure you have `rust` and `cargo` installed (Check here)
+
+- Install [`maturin`](https://www.maturin.rs/installation) in order to compile the library
-* Once the source is downloaded (using `git clone https://github.com/ChipaDevTeam/BinaryOptionsTools-v2.git`) execute the following commands:
+- Once the source is downloaded (using `git clone https://github.com/ChipaDevTeam/BinaryOptionsTools-v2.git`) execute the following commands:
To create the `.whl` file
+
```bash
// Inside the root folder
cd BinaryOptionsToolsV2
@@ -58,6 +66,7 @@ pip install path/to/file.whl
```
To install the library in a local virtual environment
+
```bash
// Inside the root folder
cd BinaryOptionsToolsV2
@@ -69,42 +78,44 @@ maturin develop
```
## Docs
-Comprehensive Documentation for BinaryOptionsToolsV2
-1. `__init__.py`
+Comprehensive Documentation for BinaryOptionsToolsV2
+
+1. `__init__.py`
-This file initializes the Python module and organizes the imports for both synchronous and asynchronous functionality.
+This file initializes the Python module and organizes the imports for both synchronous and asynchronous functionality.
-Key Details
+Key Details
-- **Imports `BinaryOptionsToolsV2`**: Imports all elements and documentation from the Rust module.
-- **Includes Submodules**: Imports and exposes `pocketoption` and `tracing` modules for user convenience.
+- **Imports `BinaryOptionsToolsV2`**: Imports all elements and documentation from the Rust module.
+- **Includes Submodules**: Imports and exposes `pocketoption` and `tracing` modules for user convenience.
-Purpose
+Purpose
-Serves as the entry point for the package, exposing all essential components of the library.
+Serves as the entry point for the package, exposing all essential components of the library.
### Inside the `pocketoption` folder there are 2 main files
-2. `asynchronous.py`
-This file implements the `PocketOptionAsync` class, which provides an asynchronous interface to interact with Pocket Option.
+1. `asynchronous.py`
-Key Features of PocketOptionAsync
+This file implements the `PocketOptionAsync` class, which provides an asynchronous interface to interact with Pocket Option.
-- **Trade Operations**:
- - `buy()`: Places a buy trade asynchronously.
- - `sell()`: Places a sell trade asynchronously.
- - `check_win()`: Checks the outcome of a trade ('win', 'draw', or 'loss').
-- **Market Data**:
- - ~~`get_candles()`: Fetches historical candle data.~~ (Work in Progress)
+Key Features of PocketOptionAsync
+
+- **Trade Operations**:
+ - `buy()`: Places a buy trade asynchronously.
+ - `sell()`: Places a sell trade asynchronously.
+ - `check_win()`: Checks the outcome of a trade ('win', 'draw', or 'loss').
+- **Market Data**:
+ - `get_candles()`: Fetches historical candle data.
- ~~`history()`: Retrieves recent data for a specific asset.~~ (Work in Progress)
-- **Account Management**:
- - `balance()`: Returns the current account balance.
- - `opened_deals()`: Lists all open trades.
+- **Account Management**:
+ - `balance()`: Returns the current account balance.
+ - `opened_deals()`: Lists all open trades.
- ~~`closed_deals()`: Lists all closed trades.~~ (Work in Progress)
- ~~`payout()`: Returns payout percentages.~~ (Work in Progress)
-- **Real-Time Data**:
- - `subscribe_symbol()`: Provides an asynchronous iterator for real-time candle updates.
+- **Real-Time Data**:
+ - `subscribe_symbol()`: Provides an asynchronous iterator for real-time candle updates.
- `subscribe_symbol_timed()`: Provides an asynchronous iterator for timed real-time candle updates.
- `subscribe_symbol_chunked()`: Provides an asynchronous iterator for chunked real-time candle updates.
- **Server Information**:
@@ -113,11 +124,11 @@ Key Features of PocketOptionAsync
- `reconnect()`: Manually reconnect to the server.
- `shutdown()`: Properly close the connection.
-Helper Class - `AsyncSubscription`
+Helper Class - `AsyncSubscription`
-Facilitates asynchronous iteration over live data streams, enabling non-blocking operations.
+Facilitates asynchronous iteration over live data streams, enabling non-blocking operations.
-Example Usage
+Example Usage
```python
from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync
@@ -148,28 +159,28 @@ async def main():
break # Just print one candle for demo
asyncio.run(main())
-```
+```
-3. `synchronous.py`
+1. `synchronous.py`
-This file implements the `PocketOption` class, a synchronous wrapper around the asynchronous interface provided by `PocketOptionAsync`.
+This file implements the `PocketOption` class, a synchronous wrapper around the asynchronous interface provided by `PocketOptionAsync`.
-Key Features of PocketOption
+Key Features of PocketOption
-- **Trade Operations**:
- - `buy()`: Places a buy trade using synchronous execution.
- - `sell()`: Places a sell trade.
- - `check_win()`: Checks the trade outcome synchronously.
-- **Market Data**:
- - ~~`get_candles()`: Fetches historical candle data.~~ (Work in Progress)
+- **Trade Operations**:
+ - `buy()`: Places a buy trade using synchronous execution.
+ - `sell()`: Places a sell trade.
+ - `check_win()`: Checks the trade outcome synchronously.
+- **Market Data**:
+ - `get_candles()`: Fetches historical candle data.
- ~~`history()`: Retrieves recent data for a specific asset.~~ (Work in Progress)
-- **Account Management**:
- - `balance()`: Retrieves account balance.
- - `opened_deals()`: Lists all open trades.
+- **Account Management**:
+ - `balance()`: Retrieves account balance.
+ - `opened_deals()`: Lists all open trades.
- ~~`closed_deals()`: Lists all closed trades.~~ (Work in Progress)
- ~~`payout()`: Returns payout percentages.~~ (Work in Progress)
-- **Real-Time Data**:
- - `subscribe_symbol()`: Provides a synchronous iterator for live data updates.
+- **Real-Time Data**:
+ - `subscribe_symbol()`: Provides a synchronous iterator for live data updates.
- `subscribe_symbol_timed()`: Provides a synchronous iterator for timed real-time candle updates.
- `subscribe_symbol_chunked()`: Provides a synchronous iterator for chunked real-time candle updates.
- **Server Information**:
@@ -178,11 +189,11 @@ Key Features of PocketOption
- `reconnect()`: Manually reconnect to the server.
- `shutdown()`: Properly close the connection.
-Helper Class - `SyncSubscription`
+Helper Class - `SyncSubscription`
-Allows synchronous iteration over real-time data streams for compatibility with simpler scripts.
+Allows synchronous iteration over real-time data streams for compatibility with simpler scripts.
-Example Usage
+Example Usage
```python
from BinaryOptionsToolsV2.pocketoption import PocketOption
@@ -213,13 +224,13 @@ for candle in stream:
break # Just print one candle for demo
```
-4. Differences Between PocketOption and PocketOptionAsync
+1. Differences Between PocketOption and PocketOptionAsync
-| Feature | PocketOption (Synchronous) | PocketOptionAsync (Asynchronous) |
-|------------------------|----------------------------|----------------------------------|
-| **Execution Type** | Blocking | Non-blocking |
-| **Use Case** | Simpler scripts | High-frequency or real-time tasks |
-| **Performance** | Slower for concurrent tasks | Scales well with concurrent operations |
+| Feature | PocketOption (Synchronous) | PocketOptionAsync (Asynchronous) |
+|------------------------|----------------------------|----------------------------------|
+| **Execution Type** | Blocking | Non-blocking |
+| **Use Case** | Simpler scripts | High-frequency or real-time tasks |
+| **Performance** | Slower for concurrent tasks | Scales well with concurrent operations |
### Tracing
diff --git a/BinaryOptionsToolsV2/pyproject.toml b/BinaryOptionsToolsV2/pyproject.toml
index cbe59dcb..56a56f42 100644
--- a/BinaryOptionsToolsV2/pyproject.toml
+++ b/BinaryOptionsToolsV2/pyproject.toml
@@ -9,7 +9,7 @@ authors = [
{name = "ChipaDevTeam"},
{name = "Rick-29"}
]
-license = {text = "BSD"}
+license = { file = "LICENSE" }
readme = "Readme.md"
requires-python = ">=3.8"
keywords = ["binary options", "trading", "pocketoption", "finance", "async"]
diff --git a/BinaryOptionsToolsV2/src/lib.rs b/BinaryOptionsToolsV2/src/lib.rs
index 8f171375..fdb23a94 100644
--- a/BinaryOptionsToolsV2/src/lib.rs
+++ b/BinaryOptionsToolsV2/src/lib.rs
@@ -16,8 +16,7 @@ use validator::RawValidator;
use crate::pocketoption::RawHandlerRust;
-#[pymodule]
-#[pyo3(name = "BinaryOptionsToolsV2")]
+#[pymodule(name = "BinaryOptionsToolsV2")]
fn BinaryOptionsTools(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::()?;
m.add_class::()?;
diff --git a/BinaryOptionsToolsV2/src/logs.rs b/BinaryOptionsToolsV2/src/logs.rs
index 27328f84..15bfc257 100644
--- a/BinaryOptionsToolsV2/src/logs.rs
+++ b/BinaryOptionsToolsV2/src/logs.rs
@@ -63,11 +63,11 @@ pub fn start_tracing(
);
if terminal {
- subscriber
+ let _ = subscriber
.with(fmt::Layer::default().with_filter(level))
- .init();
+ .try_init();
} else {
- subscriber.init()
+ let _ = subscriber.try_init();
}
Ok(())
@@ -265,7 +265,8 @@ mod tests {
#[test]
fn test_start_tracing() {
- start_tracing(".".to_string(), "DEBUG".to_string(), true, vec![]).unwrap();
+ start_tracing(".".to_string(), "DEBUG".to_string(), true, vec![])
+ .expect("Failed to start tracing in test");
info!("Test")
}
@@ -289,7 +290,8 @@ mod tests {
#[tokio::test]
async fn test_start_tracing_stream() {
let (layer, receiver) = create_logs_iterator_test("ERROR".to_string());
- start_tracing(".".to_string(), "DEBUG".to_string(), false, vec![layer]).unwrap();
+ start_tracing(".".to_string(), "DEBUG".to_string(), false, vec![layer])
+ .expect("Failed to initialize tracing for test");
async fn log() {
let mut num = 0;
@@ -301,13 +303,18 @@ mod tests {
info!(num, "Test info");
warn!(num, "Test warning");
error!(num, "Test error");
+ if num > 10 {
+ break;
+ }
}
}
async fn reciever_fn(reciever: StreamLogsIterator) {
let mut stream = reciever.stream.lock().await;
- while let Some(Ok(message)) = stream.next().await {
+ while let Ok(Some(Ok(message))) =
+ tokio::time::timeout(Duration::from_secs(15), stream.next()).await
+ {
let text = match message {
Message::Text(text) => text.to_string(),
Message::Binary(data) => String::from_utf8_lossy(&data).to_string(),
diff --git a/BinaryOptionsToolsV2/src/pocketoption.rs b/BinaryOptionsToolsV2/src/pocketoption.rs
index 7b4e5aca..ce2c046d 100644
--- a/BinaryOptionsToolsV2/src/pocketoption.rs
+++ b/BinaryOptionsToolsV2/src/pocketoption.rs
@@ -117,10 +117,15 @@ impl RawHandlerRust {
}
/// Send a message and wait for the next matching response
- pub fn send_and_wait<'py>(&self, py: Python<'py>, message: String) -> PyResult> {
+ pub fn send_and_wait<'py>(
+ &self,
+ py: Python<'py>,
+ message: String,
+ ) -> PyResult> {
let handler = self.handler.clone();
future_into_py(py, async move {
- let outgoing = binary_options_tools::pocketoption::modules::raw::Outgoing::Text(message);
+ let outgoing =
+ binary_options_tools::pocketoption::modules::raw::Outgoing::Text(message);
let response = handler
.lock()
.await
@@ -206,6 +211,22 @@ impl RawPocketOption {
})
}
+ pub fn wait_for_assets<'py>(
+ &self,
+ py: Python<'py>,
+ timeout_secs: f64,
+ ) -> PyResult> {
+ let client = self.client.clone();
+ let duration = Duration::from_secs_f64(timeout_secs);
+ future_into_py(py, async move {
+ client
+ .wait_for_assets(duration)
+ .await
+ .map_err(BinaryErrorPy::from)?;
+ Python::attach(|py| py.None().into_py_any(py))
+ })
+ }
+
pub fn is_demo(&self) -> bool {
self.client.is_demo()
}
@@ -368,7 +389,13 @@ impl RawPocketOption {
let payouts: HashMap<&String, i32> = assets
.0
.iter()
- .filter_map(|(asset, symbol)| if symbol.is_active { Some((asset, symbol.payout)) } else { None })
+ .filter_map(|(asset, symbol)| {
+ if symbol.is_active {
+ Some((asset, symbol.payout))
+ } else {
+ None
+ }
+ })
.collect();
Ok(serde_json::to_string(&payouts).map_err(BinaryErrorPy::from)?)
}
@@ -692,7 +719,10 @@ impl RawPocketOption {
pub fn unsubscribe<'py>(&self, py: Python<'py>, asset: String) -> PyResult> {
let client = self.client.clone();
future_into_py(py, async move {
- client.unsubscribe(asset).await.map_err(BinaryErrorPy::from)?;
+ client
+ .unsubscribe(asset)
+ .await
+ .map_err(BinaryErrorPy::from)?;
Python::attach(|py| py.None().into_py_any(py))
})
}
@@ -708,9 +738,8 @@ impl RawPocketOption {
let validator = validator.get().clone();
future_into_py(py, async move {
let crate_validator: CrateValidator = validator.into();
- let keep_alive_msg = keep_alive.map(|msg| {
- binary_options_tools::pocketoption::modules::raw::Outgoing::Text(msg)
- });
+ let keep_alive_msg = keep_alive
+ .map(|msg| binary_options_tools::pocketoption::modules::raw::Outgoing::Text(msg));
let handler = client
.create_raw_handler(crate_validator, keep_alive_msg)
.await
diff --git a/BinaryOptionsToolsV2/src/validator.rs b/BinaryOptionsToolsV2/src/validator.rs
index 2859a8d5..3816fcb7 100644
--- a/BinaryOptionsToolsV2/src/validator.rs
+++ b/BinaryOptionsToolsV2/src/validator.rs
@@ -3,7 +3,7 @@
use std::sync::Arc;
use pyo3::{
- Bound, PyResult, pyclass, pymethods, Py, PyAny,
+ Bound, Py, PyAny, PyResult, pyclass, pymethods,
types::{PyAnyMethods, PyList},
};
use regex::Regex;
@@ -35,6 +35,23 @@ pub struct PyCustom {
#[pyclass]
#[derive(Clone)]
+/// `RawValidator` provides a flexible way to filter WebSocket messages
+/// within the Python API. It encapsulates various validation strategies,
+/// including regular expressions, substring checks, and custom Python
+/// callables.
+///
+/// This class is designed to be used with `RawHandler` to define which
+/// incoming messages should be processed.
+///
+/// # Python Custom Validator Behavior
+/// When using the `RawValidator.custom()` constructor:
+/// - The provided Python callable (`func`) must accept exactly one string
+/// argument, which will be the incoming WebSocket message data.
+/// - The callable should return a boolean value (`True` or `False`).
+/// - If the callable raises an exception, or if its return value cannot
+/// be interpreted as a boolean, the validation will silently fail and
+/// be treated as `False`. No Python exception will be propagated back
+/// to the calling Python code at the point of validation.
pub enum RawValidator {
None(),
Regex(RegexValidator),
@@ -155,18 +172,55 @@ impl RawValidator {
}
#[staticmethod]
+ /// Creates a custom validator using a Python callable.
+ ///
+ /// The `func` callable will be invoked with the incoming WebSocket message
+ /// as a single string argument. It must return `True` to validate the message
+ /// or `False` otherwise.
+ ///
+ /// **Behavior on Error/Invalid Return:**
+ /// If `func` raises an exception or returns a non-boolean value,
+ /// the validation will silently fail and be treated as `False`.
+ /// No exception will be propagated.
+ ///
+ /// # Arguments
+ /// * `func` - A Python callable that accepts one string argument and returns a boolean.
pub fn custom(func: Py) -> Self {
Self::Custom(PyCustom {
custom: Arc::new(func),
})
}
- pub fn check(&self, _msg: String) -> bool {
- // TODO: Restore validation logic when the new API supports it
- // For now, return true as a placeholder
- true
- // let raw = RawWebsocketMessage::from(msg);
- // self.validate(&raw)
+ pub fn check(&self, msg: String) -> bool {
+ let validator: CrateValidator = self.clone().into();
+ validator.call(&msg)
+ }
+}
+
+impl RawValidator {
+ fn call(&self, data: &str) -> bool {
+ match self {
+ RawValidator::None() => true,
+ RawValidator::Regex(validator) => validator.regex.is_match(data),
+ RawValidator::StartsWith(prefix) => data.starts_with(prefix),
+ RawValidator::EndsWith(suffix) => data.ends_with(suffix),
+ RawValidator::Contains(substring) => data.contains(substring),
+ RawValidator::All(validators) => validators.0.iter().all(|v| v.call(data)),
+ RawValidator::Any(validators) => validators.0.iter().any(|v| v.call(data)),
+ RawValidator::Not(validator) => !validator.0.call(data),
+ RawValidator::Custom(py_custom) => Python::attach(|py| {
+ let func = py_custom.custom.as_ref();
+ match func.call1(py, (data,)) {
+ Ok(result) => {
+ match result.extract::(py) {
+ Ok(b) => b,
+ Err(_) => false, // If we can't extract a bool, return false
+ }
+ }
+ Err(_) => false, // If the function call fails, return false
+ }
+ }),
+ }
}
}
diff --git a/BinaryOptionsToolsV2/tests/test.py b/BinaryOptionsToolsV2/tests/test.py
index 8daca294..90c4bfa8 100644
--- a/BinaryOptionsToolsV2/tests/test.py
+++ b/BinaryOptionsToolsV2/tests/test.py
@@ -1,15 +1,16 @@
import asyncio
+
+# print(BinaryOptionsToolsV2)
+from BinaryOptionsToolsV2.BinaryOptionsToolsV2.pocketoption.asynchronous import (
+ PocketOptionAsync,
+)
+
# import pandas as pd # type: ignore
# import json
# import BinaryOptionsToolsV2
# from BinaryOptionsToolsV2 import connect
-# print(BinaryOptionsToolsV2)
-from BinaryOptionsToolsV2.BinaryOptionsToolsV2.pocketoption.asyncronous import (
- PocketOptionAsync,
-)
-
# async def main(ssid):
# api = await async_connect(ssid)
diff --git a/BinaryOptionsToolsV2/tests/test_basic.py b/BinaryOptionsToolsV2/tests/test_basic.py
new file mode 100644
index 00000000..a85c5af4
--- /dev/null
+++ b/BinaryOptionsToolsV2/tests/test_basic.py
@@ -0,0 +1,13 @@
+import pytest
+import BinaryOptionsToolsV2
+
+def test_module_import():
+ """Verify that the module can be imported and exposes expected attributes."""
+ assert BinaryOptionsToolsV2 is not None
+ # Check for some expected classes or modules based on __init__.py and lib.rs
+ assert hasattr(BinaryOptionsToolsV2, "PocketOption")
+ assert hasattr(BinaryOptionsToolsV2, "PocketOptionAsync")
+
+def test_simple_math():
+ """A dummy test to ensure pytest is working."""
+ assert 1 + 1 == 2
diff --git a/BinaryOptionsToolsV2/tests/test_sync.py b/BinaryOptionsToolsV2/tests/test_sync.py
index 3f0f9414..86677f90 100644
--- a/BinaryOptionsToolsV2/tests/test_sync.py
+++ b/BinaryOptionsToolsV2/tests/test_sync.py
@@ -1,8 +1,7 @@
-from BinaryOptionsToolsV2.BinaryOptionsToolsV2.pocketoption.syncronous import (
- PocketOption,
-)
import time
+from BinaryOptionsToolsV2 import PocketOption
+
def main(ssid):
api = PocketOption(ssid)
diff --git a/LICENSE b/LICENSE
index bc94d24a..5f9720c5 100644
--- a/LICENSE
+++ b/LICENSE
@@ -6,64 +6,67 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. DEFINITIONS
-"Software" refers to BinaryOptionsTools v2 and all associated documentation,
+"Software" refers to BinaryOptionsTools v2 and all associated documentation,
source code, binaries, and related materials.
-"Personal Use" means use by individuals for non-commercial, educational,
+"Personal Use" means use by individuals for non-commercial, educational,
research, or personal trading purposes.
-"Commercial Use" means use of the Software in any manner primarily intended
-for commercial advantage or monetary compensation, including but not limited
-to: selling access to the Software, using the Software as part of a paid
+"Commercial Use" means use of the Software in any manner primarily intended
+for commercial advantage or monetary compensation, including but not limited
+to: selling access to the Software, using the Software as part of a paid
service, or integrating the Software into commercial products.
-2. GRANT OF LICENSE
+1. GRANT OF LICENSE
2.1 Personal Use License
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this Software, to use, copy, modify, and distribute the Software for
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this Software, to use, copy, modify, and distribute the Software for
Personal Use only, subject to the following conditions:
-a) The above copyright notice and this permission notice shall be included in
+a) The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
b) This Software is provided "AS IS" for Personal Use only.
2.2 Commercial Use License
-Commercial Use of this Software requires explicit written permission from
+Commercial Use of this Software requires explicit written permission from
ChipaDevTeam. To request permission for Commercial Use, contact us at:
-- Discord: https://discord.gg/p7YyFqSmAz
-- GitHub: https://github.com/ChipaDevTeam
-3. DISCLAIMER OF WARRANTY
+- Discord:
+- GitHub:
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+1. DISCLAIMER OF WARRANTY
-4. LIMITATION OF LIABILITY
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS, OR CHIPADEVTEAM BE LIABLE
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+1. LIMITATION OF LIABILITY
+
+IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS, OR CHIPADEVTEAM BE LIABLE
+FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The authors and ChipaDevTeam are not responsible for:
+
- Any financial losses incurred from using this Software
- Any trading decisions made using this Software
- Any bugs, errors, or issues in the Software
-- Any consequences of using this Software for trading binary options or
+- Any consequences of using this Software for trading binary options or
other financial instruments
-5. RISK WARNING
+1. RISK WARNING
-Binary options trading carries significant risk. This Software is provided
+Binary options trading carries significant risk. This Software is provided
for educational and personal use only. Users should:
+
- Never risk more than they can afford to lose
- Understand the risks involved in binary options trading
- Comply with all applicable laws and regulations
- Use the Software at their own risk
-6. DISTRIBUTION
+1. DISTRIBUTION
You may distribute copies of the Software for Personal Use, provided that:
a) You include this license file
@@ -71,7 +74,7 @@ b) You clearly indicate this is for Personal Use only
c) You do not charge for distribution
d) You preserve all copyright notices
-7. MODIFICATIONS
+1. MODIFICATIONS
You may modify the Software for Personal Use. Modified versions:
a) Must retain this license
@@ -79,18 +82,19 @@ b) Must clearly indicate they are modified versions
c) Cannot be used for Commercial Use without permission
d) Cannot remove or modify copyright notices
-8. TERMINATION
+1. TERMINATION
-This license automatically terminates if you violate any of its terms. Upon
+This license automatically terminates if you violate any of its terms. Upon
termination, you must destroy all copies of the Software in your possession.
-9. CONTACT
+1. CONTACT
For Commercial Use licensing, questions, or permissions:
-- Discord: https://discord.gg/p7YyFqSmAz
-- GitHub: https://github.com/ChipaDevTeam/BinaryOptionsTools-v2
+
+- Discord:
+- GitHub:
---
-By using this Software, you acknowledge that you have read this license,
-understand it, and agree to be bound by its terms and conditions.
\ No newline at end of file
+By using this Software, you acknowledge that you have read this license,
+understand it, and agree to be bound by its terms and conditions.
diff --git a/BinaryOptionsToolsV2/CI.yml b/MOVETOGITHUBWORKFLOW/CICorrectedForChipaReleases.yml
similarity index 52%
rename from BinaryOptionsToolsV2/CI.yml
rename to MOVETOGITHUBWORKFLOW/CICorrectedForChipaReleases.yml
index bb8ae0db..4f9a7006 100644
--- a/BinaryOptionsToolsV2/CI.yml
+++ b/MOVETOGITHUBWORKFLOW/CICorrectedForChipaReleases.yml
@@ -1,8 +1,3 @@
-# This file is autogenerated by maturin v1.9.4
-# To update, run
-#
-# maturin generate-ci github --pytest --platform all
-#
name: CI
on:
@@ -21,7 +16,9 @@ permissions:
jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
+ timeout-minutes: 60
strategy:
+ fail-fast: false
matrix:
platform:
- runner: ubuntu-22.04
@@ -47,29 +44,44 @@ jobs:
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- manylinux: auto
+ manylinux: 2_28
+ working-directory: BinaryOptionsToolsV2
+ env:
+ CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
+ CFLAGS_armv7_unknown_linux_gnueabihf: "-D__ARM_ARCH=7"
+ ASFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
+ ASFLAGS_armv7_unknown_linux_gnueabihf: "-D__ARM_ARCH=7"
- name: Build free-threaded wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist -i python3.13t
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- manylinux: auto
+ manylinux: 2_28
+ working-directory: BinaryOptionsToolsV2
+ env:
+ CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
+ CFLAGS_armv7_unknown_linux_gnueabihf: "-D__ARM_ARCH=7"
+ ASFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
+ ASFLAGS_armv7_unknown_linux_gnueabihf: "-D__ARM_ARCH=7"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
- path: dist
+ path: BinaryOptionsToolsV2/dist
- name: pytest
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
shell: bash
+ working-directory: BinaryOptionsToolsV2
run: |
set -e
python3 -m venv .venv
source .venv/bin/activate
pip install BinaryOptionsToolsV2 --find-links dist --force-reinstall
pip install pytest
- pytest
+ mkdir test_run
+ cd test_run
+ pytest ../tests
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
uses: uraimo/run-on-arch-action@v2
@@ -83,12 +95,17 @@ jobs:
pip3 install -U pip pytest
run: |
set -e
+ cd BinaryOptionsToolsV2
pip3 install BinaryOptionsToolsV2 --find-links dist --force-reinstall
- pytest
+ mkdir test_run
+ cd test_run
+ pytest ../tests
musllinux:
runs-on: ${{ matrix.platform.runner }}
+ timeout-minutes: 60
strategy:
+ fail-fast: false
matrix:
platform:
- runner: ubuntu-22.04
@@ -111,6 +128,12 @@ jobs:
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: musllinux_1_2
+ working-directory: BinaryOptionsToolsV2
+ env:
+ CFLAGS_aarch64_unknown_linux_musl: "-D__ARM_ARCH=8"
+ CFLAGS_armv7_unknown_linux_musleabihf: "-D__ARM_ARCH=7"
+ ASFLAGS_aarch64_unknown_linux_musl: "-D__ARM_ARCH=8"
+ ASFLAGS_armv7_unknown_linux_musleabihf: "-D__ARM_ARCH=7"
- name: Build free-threaded wheels
uses: PyO3/maturin-action@v1
with:
@@ -118,17 +141,23 @@ jobs:
args: --release --out dist -i python3.13t
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: musllinux_1_2
+ working-directory: BinaryOptionsToolsV2
+ env:
+ CFLAGS_aarch64_unknown_linux_musl: "-D__ARM_ARCH=8"
+ CFLAGS_armv7_unknown_linux_musleabihf: "-D__ARM_ARCH=7"
+ ASFLAGS_aarch64_unknown_linux_musl: "-D__ARM_ARCH=8"
+ ASFLAGS_armv7_unknown_linux_musleabihf: "-D__ARM_ARCH=7"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-musllinux-${{ matrix.platform.target }}
- path: dist
+ path: BinaryOptionsToolsV2/dist
- name: pytest
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
uses: addnab/docker-run-action@v3
with:
image: alpine:latest
- options: -v ${{ github.workspace }}:/io -w /io
+ options: -v ${{ github.workspace }}:/io -w /io/BinaryOptionsToolsV2
run: |
set -e
apk add py3-pip py3-virtualenv
@@ -136,7 +165,9 @@ jobs:
source .venv/bin/activate
pip install BinaryOptionsToolsV2 --no-index --find-links dist --force-reinstall
pip install pytest
- pytest
+ mkdir test_run
+ cd test_run
+ pytest ../tests
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'x86') }}
uses: uraimo/run-on-arch-action@v2
@@ -148,15 +179,20 @@ jobs:
apk add py3-virtualenv
run: |
set -e
+ cd BinaryOptionsToolsV2
python3 -m virtualenv .venv
source .venv/bin/activate
pip install pytest
pip install BinaryOptionsToolsV2 --find-links dist --force-reinstall
- pytest
+ mkdir test_run
+ cd test_run
+ pytest ../tests
windows:
runs-on: ${{ matrix.platform.runner }}
+ timeout-minutes: 60
strategy:
+ fail-fast: false
matrix:
platform:
- runner: windows-latest
@@ -175,6 +211,7 @@ jobs:
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ working-directory: BinaryOptionsToolsV2
- uses: actions/setup-python@v5
with:
python-version: 3.13t
@@ -185,31 +222,35 @@ jobs:
target: ${{ matrix.platform.target }}
args: --release --out dist -i python3.13t
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ working-directory: BinaryOptionsToolsV2
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.platform.target }}
- path: dist
+ path: BinaryOptionsToolsV2/dist
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
shell: bash
+ working-directory: BinaryOptionsToolsV2
run: |
set -e
python3 -m venv .venv
source .venv/Scripts/activate
pip install BinaryOptionsToolsV2 --find-links dist --force-reinstall
pip install pytest
- pytest
+ mkdir test_run
+ cd test_run
+ pytest ../tests
macos:
runs-on: ${{ matrix.platform.runner }}
+ timeout-minutes: 60
strategy:
+ fail-fast: false
matrix:
platform:
- - runner: macos-13
+ - runner: macos-15-intel
target: x86_64
- - runner: macos-14
- target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
@@ -221,83 +262,107 @@ jobs:
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ working-directory: BinaryOptionsToolsV2
- name: Build free-threaded wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist -i python3.13t
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ working-directory: BinaryOptionsToolsV2
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}
- path: dist
+ path: BinaryOptionsToolsV2/dist
- name: pytest
+ working-directory: BinaryOptionsToolsV2
run: |
set -e
python3 -m venv .venv
source .venv/bin/activate
pip install BinaryOptionsToolsV2 --find-links dist --force-reinstall
pip install pytest
- pytest
+ mkdir test_run
+ cd test_run
+ pytest ../tests
- emscripten:
- runs-on: ${{ matrix.platform.runner }}
- strategy:
- matrix:
- platform:
- - runner: ubuntu-22.04
- target: wasm32-unknown-emscripten
- steps:
- - uses: actions/checkout@v4
- - run: pip install pyodide-build
- - name: Get Emscripten and Python version info
- shell: bash
- run: |
- echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
- echo PYTHON_VERSION=$(pyodide config get python_version | cut -d '.' -f 1-2) >> $GITHUB_ENV
- pip uninstall -y pyodide-build
- - uses: mymindstorm/setup-emsdk@v12
- with:
- version: ${{ env.EMSCRIPTEN_VERSION }}
- actions-cache-folder: emsdk-cache
- - uses: actions/setup-python@v5
- with:
- python-version: ${{ env.PYTHON_VERSION }}
- - run: pip install pyodide-build
- - name: Build wheels
- uses: PyO3/maturin-action@v1
- with:
- target: ${{ matrix.platform.target }}
- args: --release --out dist
- sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- rust-toolchain: nightly
- - name: Build free-threaded wheels
- uses: PyO3/maturin-action@v1
- with:
- target: ${{ matrix.platform.target }}
- args: --release --out dist -i python3.13t
- sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- rust-toolchain: nightly
- - name: Upload wheels
- uses: actions/upload-artifact@v4
- with:
- name: wasm-wheels
- path: dist
- - uses: actions/setup-node@v3
- with:
- node-version: '18'
- - name: pytest
- run: |
- set -e
- pyodide venv .venv
- source .venv/bin/activate
- pip install BinaryOptionsToolsV2 --find-links dist --force-reinstall
- pip install pytest
- python -m pytest
+ # emscripten:
+ # runs-on: ubuntu-22.04
+ # timeout-minutes: 60
+ # strategy:
+ # fail-fast: false
+ # steps:
+ # - uses: actions/checkout@v4
+
+ # - name: Set up Python for Pyodide tools
+ # uses: actions/setup-python@v5
+ # with:
+ # python-version: '3.12'
+
+ # - name: Get Emscripten and Python version info
+ # shell: bash
+ # run: |
+ # pip install pyodide-build
+ # echo "EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)" >> $GITHUB_ENV
+ # echo "PYTHON_VERSION=$(pyodide config get python_version | cut -d '.' -f 1-2)" >> $GITHUB_ENV
+ # pip uninstall -y pyodide-build
+
+ # - name: Setup Emscripten
+ # uses: mymindstorm/setup-emsdk@v14
+ # with:
+ # version: ${{ env.EMSCRIPTEN_VERSION }}
+ # cache-key: emscripten-${{ runner.os }}-${{ env.EMSCRIPTEN_VERSION }}-${{ github.ref_name }}
+
+ # - name: Setup Python for Build
+ # uses: actions/setup-python@v5
+ # with:
+ # python-version: ${{ env.PYTHON_VERSION }}
+
+ # - name: Build wheels
+ # uses: PyO3/maturin-action@v1
+ # with:
+ # target: wasm32-unknown-emscripten
+ # args: --release --out dist
+ # sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ # rust-toolchain: nightly
+ # working-directory: BinaryOptionsToolsV2
+
+ # - name: Build free-threaded wheels
+ # uses: PyO3/maturin-action@v1
+ # with:
+ # target: wasm32-unknown-emscripten
+ # args: --release --out dist -i python3.13t
+ # sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
+ # rust-toolchain: nightly
+ # working-directory: BinaryOptionsToolsV2
+
+ # - name: Upload wheels
+ # uses: actions/upload-artifact@v4
+ # with:
+ # name: wasm-wheels
+ # path: BinaryOptionsToolsV2/dist
+
+ # - uses: actions/setup-node@v4
+ # with:
+ # node-version: '20'
+
+ # - name: pytest
+ # working-directory: BinaryOptionsToolsV2
+ # run: |
+ # set -e
+ # pip install pyodide-build
+ # pyodide venv .venv
+ # source .venv/bin/activate
+ # pip install BinaryOptionsToolsV2 --find-links dist --force-reinstall
+ # pip install pytest
+ # mkdir test_run
+ # cd test_run
+ # python -m pytest ../tests
sdist:
runs-on: ubuntu-latest
+ timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Build sdist
@@ -305,41 +370,48 @@ jobs:
with:
command: sdist
args: --out dist
+ working-directory: BinaryOptionsToolsV2
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
- path: dist
+ path: BinaryOptionsToolsV2/dist
release:
- name: Release
- runs-on: ubuntu-latest
- if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
- needs: [linux, musllinux, windows, macos, emscripten, sdist]
- permissions:
- # Use to sign the release artifacts
- id-token: write
- # Used to upload release artifacts
- contents: write
- # Used to generate artifact attestation
- attestations: write
- steps:
- - uses: actions/download-artifact@v4
- - name: Generate artifact attestation
- uses: actions/attest-build-provenance@v2
- with:
- subject-path: 'wheels-*/*'
- - name: Publish to PyPI
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
- uses: PyO3/maturin-action@v1
- env:
- MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
- with:
- command: upload
- args: --non-interactive --skip-existing wheels-*/*
- - name: Upload to GitHub Release
- uses: softprops/action-gh-release@v1
- with:
- files: |
- wasm-wheels/*.whl
- prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
\ No newline at end of file
+ name: Release
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' }}
+ needs: [linux, musllinux, windows, macos, sdist]
+ permissions:
+ id-token: write
+ contents: write
+ attestations: write
+ steps:
+ - uses: actions/download-artifact@v4
+ with:
+ # This downloads all artifacts.
+ # Each artifact is placed in a directory named after its name (e.g., wheels-linux-x86_64/)
+ path: .
+
+ - name: Generate artifact attestation
+ uses: actions/attest-build-provenance@v2
+ with:
+ subject-path: 'wheels-*/*'
+
+ - name: Publish to PyPI
+ if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
+ uses: PyO3/maturin-action@v1
+ env:
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
+ with:
+ command: upload
+ args: --non-interactive --skip-existing wheels-*/*
+
+ - name: Upload to GitHub Release
+ uses: softprops/action-gh-release@v2
+ with:
+ # This pattern catches all wheels and the sdist from all artifact folders
+ files: |
+ wheels-*/*
+ prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
diff --git a/README.md b/README.md
index 7baa7475..098f7f69 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,7 @@ A high-performance, cross-platform library for binary options trading automation
## Overview
BinaryOptionsTools v2 is a complete rewrite of the original library, featuring:
+
- **Rust Core**: Built with Rust for maximum performance and memory safety
- **Python Bindings**: Easy-to-use Python API via PyO3
- **WebSocket Support**: Real-time market data streaming and trade execution
@@ -18,27 +19,55 @@ BinaryOptionsTools v2 is a complete rewrite of the original library, featuring:
Currently supporting **PocketOption** (Quick Trading Mode) with both real and demo accounts.
+## Current Status
+
+**Available Features**:
+
+- Authentication and secure connection
+- Buy/Sell trading operations
+- Balance retrieval
+- Server time synchronization
+- Symbol subscriptions with different types (real-time, time-aligned, chunked)
+- Trade result checking
+- Opened deals management
+- Asset information and validation
+- Automatic reconnection handling
+- Historical candle data (`get_candles`, `get_candles_advanced`)
+- Advanced validators
+
+**Temporarily Unavailable Features**:
+
+- Trade history (`history`)
+- Payout information retrieval
+- Deal end time queries
+
+We're working to restore all functionality with improved stability and performance.
+
## Features
### Trading Operations
+
- **Trade Execution**: Place buy/sell orders on any available asset
- **Trade Monitoring**: Check trade results with configurable timeouts
- **Balance Management**: Real-time account balance retrieval
-- **Open/Closed Deals**: Access detailed trade history and active positions
+- **Open/Closed Deals**: Access active positions and closed deals
### Market Data
+
- **Real-time Candle Streaming**: Subscribe to live price data with multiple timeframes (1s, 5s, 15s, 30s, 60s, 300s)
- **Historical Candles**: Fetch historical OHLC data for backtesting and analysis
- **Time-Aligned Subscriptions**: Get perfectly aligned candle data for strategy execution
- **Payout Information**: Retrieve current payout percentages for all assets
### Connection Management
+
- **Automatic Reconnection**: Built-in connection recovery with exponential backoff
- **Connection Control**: Manual connect/disconnect/reconnect methods
- **Subscription Management**: Unsubscribe from specific assets or handlers
- **WebSocket Health Monitoring**: Automatic ping/pong keepalive
### Advanced Features
+
- **Raw Handler API**: Low-level WebSocket access for custom protocol implementations
- **Message Validation**: Built-in validator system for response filtering
- **Async/Sync Support**: Both asynchronous and synchronous Python APIs
@@ -88,9 +117,12 @@ pip install "https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/releases/down
pip install "https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/releases/download/BinaryOptionsToolsV2-0.2.1/BinaryOptionsToolsV2-0.2.1-cp38-abi3-macosx_11_0_arm64.whl"
```
-**Requirements**: Python 3.8 or higher
+**Requirements**:
+- **OS**: Windows, Linux, macOS
+- **Python**: 3.8 - 3.12
+
+#### Building from Source
-#### Building from Source:
```bash
# Clone the repository
git clone https://github.com/ChipaDevTeam/BinaryOptionsTools-v2.git
@@ -106,6 +138,7 @@ maturin develop --release
### Rust
Add to your `Cargo.toml`:
+
```toml
[dependencies]
binary_options_tools = { path = "crates/binary_options_tools" }
@@ -121,7 +154,8 @@ import asyncio
async def main():
# Initialize client with SSID
- client = PocketOptionAsync(ssid="your_ssid_here")
+ client = PocketOptionAsync(ssid="your-session-id")
+ await client.connect() # Wait for connection to be established
# Get account balance
balance = await client.balance()
@@ -130,14 +164,15 @@ async def main():
# Place a trade
asset = "EURUSD_otc"
amount = 1.0 # $1
- action = "call" # or "put"
duration = 60 # 60 seconds
- order_id = await client.trade(asset, action, amount, duration)
- print(f"Order placed: {order_id}")
+ # The `buy` function is used for "call" trades. For "put" trades, use the `sell` method.
+ trade_id, deal = await client.buy(asset, amount, duration)
+ # trade_id, deal = await client.sell(asset, amount, duration)
+ print(f"Trade placed: {deal}")
# Check if trade won
- result = await client.check_win(order_id)
+ result = await client.check_win(trade_id)
print(f"Trade result: {result}")
# Disconnect
@@ -150,13 +185,18 @@ asyncio.run(main())
```python
from BinaryOptionsToolsV2 import PocketOption
+import time
# Initialize client
-client = PocketOption(ssid="your_ssid_here")
+client = PocketOption(ssid="your-session-id")
+client.connect() # Wait for connection to be established
# Place trade (blocking)
-order_id = client.trade("EURUSD_otc", "call", 1.0, 60)
-result = client.check_win(order_id)
+# The `buy` function is used for "call" trades. For "put" trades, use the `sell` method.
+trade_id, deal = client.buy("EURUSD_otc", 1.0, 60)
+# trade_id, deal = client.sell("EURUSD_otc", 1.0, 60)
+print(f"Trade placed: {deal}")
+result = client.check_win(trade_id)
print(f"Trade result: {result}")
# Disconnect
@@ -268,23 +308,25 @@ pytest tests/
## Roadmap
### Planned Features
-- [ ] Pending order support
+
- [ ] Expert Options platform integration
- [ ] JavaScript/TypeScript native bindings
- [ ] WebAssembly support for browser usage
-- [ ] Advanced order types (stop-loss, take-profit)
+- [ ] Advanced order types (stop-loss, take-profit) - Only available for Forex accounts, not Quick Trading (QT) accounts
- [ ] Historical data export tools
- [ ] Strategy backtesting framework
### Platform Support
-- [x] PocketOption (Quick Trading)
-- [ ] PocketOption (Pending Orders)
+
+- [x] PocketOption Quick Trading
+- [x] PocketOption Pending Orders (BETA)
- [ ] Expert Options
- [ ] IQ Option (planned)
## Contributing
Contributions are welcome! Please ensure:
+
1. Code follows Rust and Python best practices
2. All tests pass (`cargo test` and `pytest`)
3. New features include documentation and examples
@@ -298,7 +340,8 @@ Contributions are welcome! Please ensure:
See the full [LICENSE](LICENSE) file for complete terms and conditions.
-### Key Points:
+### Key Points
+
- ✅ **Free** for personal use, learning, and private trading
- ✅ **Open source** - modify and distribute for personal use
- ⚠️ **Commercial use requires permission** - Contact us first
@@ -313,12 +356,14 @@ See the full [LICENSE](LICENSE) file for complete terms and conditions.
## Disclaimer
**IMPORTANT**: This software is provided "AS IS" without any warranty. The authors and ChipaDevTeam are NOT responsible for:
+
- Any financial losses incurred from using this software
- Any trading decisions made using this software
- Any bugs, errors, or issues in the software
- Any consequences of using this software for trading
**Risk Warning**: Binary options trading carries significant financial risk. This software is for educational and personal use only. You should:
+
- Never risk more than you can afford to lose
- Understand the risks involved in binary options trading
- Comply with all applicable laws and regulations in your jurisdiction
diff --git a/crates/binary_options_tools/Cargo.lock b/crates/binary_options_tools/Cargo.lock
index 61681581..b854b292 100644
--- a/crates/binary_options_tools/Cargo.lock
+++ b/crates/binary_options_tools/Cargo.lock
@@ -66,18 +66,34 @@ dependencies = [
"syn 2.0.108",
]
-[[package]]
-name = "atomic-waker"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
-
[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
+[[package]]
+name = "aws-lc-rs"
+version = "1.15.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e84ce723ab67259cfeb9877c6a639ee9eb7a27b28123abd71db7f0d5d0cc9d86"
+dependencies = [
+ "aws-lc-sys",
+ "zeroize",
+]
+
+[[package]]
+name = "aws-lc-sys"
+version = "0.36.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "43a442ece363113bd4bd4c8b18977a7798dd4d3c3383f34fb61936960e8f4ad8"
+dependencies = [
+ "cc",
+ "cmake",
+ "dunce",
+ "fs_extra",
+]
+
[[package]]
name = "base64"
version = "0.22.1"
@@ -127,19 +143,22 @@ dependencies = [
"binary-options-tools-macros",
"chrono",
"futures-util",
- "native-tls",
"php_serde",
"rand 0.9.2",
"regex",
"reqwest",
"rust_decimal",
+ "rustls",
+ "rustls-native-certs",
"serde",
"serde-enum-str",
"serde_json",
"thiserror",
"tokio",
+ "tokio-tungstenite",
"tracing",
"tracing-subscriber",
+ "tracing-test",
"url",
"uuid",
]
@@ -236,10 +255,13 @@ checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9"
[[package]]
name = "cc"
-version = "1.2.16"
+version = "1.2.53"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c"
+checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932"
dependencies = [
+ "find-msvc-tools",
+ "jobserver",
+ "libc",
"shlex",
]
@@ -266,7 +288,16 @@ dependencies = [
"num-traits",
"serde",
"wasm-bindgen",
- "windows-link 0.2.1",
+ "windows-link",
+]
+
+[[package]]
+name = "cmake"
+version = "0.1.57"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d"
+dependencies = [
+ "cc",
]
[[package]]
@@ -280,9 +311,9 @@ dependencies = [
[[package]]
name = "core-foundation"
-version = "0.9.4"
+version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
+checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
dependencies = [
"core-foundation-sys",
"libc",
@@ -417,13 +448,10 @@ dependencies = [
]
[[package]]
-name = "encoding_rs"
-version = "0.8.35"
+name = "dunce"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
-dependencies = [
- "cfg-if",
-]
+checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "equivalent"
@@ -431,16 +459,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
-[[package]]
-name = "errno"
-version = "0.3.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
-dependencies = [
- "libc",
- "windows-sys 0.59.0",
-]
-
[[package]]
name = "event-listener"
version = "5.4.0"
@@ -463,10 +481,10 @@ dependencies = [
]
[[package]]
-name = "fastrand"
-version = "2.3.0"
+name = "find-msvc-tools"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
+checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
[[package]]
name = "fnv"
@@ -474,21 +492,6 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-[[package]]
-name = "foreign-types"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
-dependencies = [
- "foreign-types-shared",
-]
-
-[[package]]
-name = "foreign-types-shared"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
-
[[package]]
name = "form_urlencoded"
version = "1.2.2"
@@ -498,6 +501,12 @@ dependencies = [
"percent-encoding",
]
+[[package]]
+name = "fs_extra"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
+
[[package]]
name = "funty"
version = "2.0.0"
@@ -574,8 +583,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
dependencies = [
"cfg-if",
+ "js-sys",
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
+ "wasm-bindgen",
]
[[package]]
@@ -585,30 +596,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8"
dependencies = [
"cfg-if",
+ "js-sys",
"libc",
"wasi 0.13.3+wasi-0.2.2",
+ "wasm-bindgen",
"windows-targets 0.52.6",
]
-[[package]]
-name = "h2"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2"
-dependencies = [
- "atomic-waker",
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "http",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
[[package]]
name = "hashbrown"
version = "0.12.3"
@@ -673,7 +667,6 @@ dependencies = [
"bytes",
"futures-channel",
"futures-util",
- "h2",
"http",
"http-body",
"httparse",
@@ -699,22 +692,7 @@ dependencies = [
"tokio",
"tokio-rustls",
"tower-service",
-]
-
-[[package]]
-name = "hyper-tls"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
-dependencies = [
- "bytes",
- "http-body-util",
- "hyper",
- "hyper-util",
- "native-tls",
- "tokio",
- "tokio-native-tls",
- "tower-service",
+ "webpki-roots 0.26.11",
]
[[package]]
@@ -736,11 +714,9 @@ dependencies = [
"percent-encoding",
"pin-project-lite",
"socket2",
- "system-configuration",
"tokio",
"tower-service",
"tracing",
- "windows-registry",
]
[[package]]
@@ -943,6 +919,15 @@ version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
+[[package]]
+name = "jobserver"
+version = "0.1.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0"
+dependencies = [
+ "libc",
+]
+
[[package]]
name = "js-sys"
version = "0.3.77"
@@ -975,12 +960,6 @@ version = "0.2.177"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976"
-[[package]]
-name = "linux-raw-sys"
-version = "0.4.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
-
[[package]]
name = "litemap"
version = "0.7.5"
@@ -1004,16 +983,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e"
[[package]]
-name = "memchr"
-version = "2.7.4"
+name = "lru-slab"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
+checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
+
+[[package]]
+name = "matchers"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9"
+dependencies = [
+ "regex-automata",
+]
[[package]]
-name = "mime"
-version = "0.3.17"
+name = "memchr"
+version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
+checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "mio"
@@ -1026,23 +1014,6 @@ dependencies = [
"windows-sys 0.52.0",
]
-[[package]]
-name = "native-tls"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e"
-dependencies = [
- "libc",
- "log",
- "openssl",
- "openssl-probe",
- "openssl-sys",
- "schannel",
- "security-framework",
- "security-framework-sys",
- "tempfile",
-]
-
[[package]]
name = "nu-ansi-term"
version = "0.50.3"
@@ -1067,49 +1038,11 @@ version = "1.20.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e"
-[[package]]
-name = "openssl"
-version = "0.10.71"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd"
-dependencies = [
- "bitflags",
- "cfg-if",
- "foreign-types",
- "libc",
- "once_cell",
- "openssl-macros",
- "openssl-sys",
-]
-
-[[package]]
-name = "openssl-macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.108",
-]
-
[[package]]
name = "openssl-probe"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
-
-[[package]]
-name = "openssl-sys"
-version = "0.9.106"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
- "vcpkg",
-]
+checksum = "9f50d9b3dabb09ecd771ad0aa242ca6894994c130308ca3d7684634df8037391"
[[package]]
name = "parking"
@@ -1169,12 +1102,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-[[package]]
-name = "pkg-config"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
-
[[package]]
name = "ppv-lite86"
version = "0.2.20"
@@ -1222,6 +1149,61 @@ dependencies = [
"syn 1.0.109",
]
+[[package]]
+name = "quinn"
+version = "0.11.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20"
+dependencies = [
+ "bytes",
+ "cfg_aliases",
+ "pin-project-lite",
+ "quinn-proto",
+ "quinn-udp",
+ "rustc-hash",
+ "rustls",
+ "socket2",
+ "thiserror",
+ "tokio",
+ "tracing",
+ "web-time",
+]
+
+[[package]]
+name = "quinn-proto"
+version = "0.11.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
+dependencies = [
+ "bytes",
+ "getrandom 0.3.1",
+ "lru-slab",
+ "rand 0.9.2",
+ "ring",
+ "rustc-hash",
+ "rustls",
+ "rustls-pki-types",
+ "slab",
+ "thiserror",
+ "tinyvec",
+ "tracing",
+ "web-time",
+]
+
+[[package]]
+name = "quinn-udp"
+version = "0.5.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd"
+dependencies = [
+ "cfg_aliases",
+ "libc",
+ "once_cell",
+ "socket2",
+ "tracing",
+ "windows-sys 0.60.2",
+]
+
[[package]]
name = "quote"
version = "1.0.41"
@@ -1352,29 +1334,26 @@ checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f"
dependencies = [
"base64",
"bytes",
- "encoding_rs",
"futures-core",
- "h2",
"http",
"http-body",
"http-body-util",
"hyper",
"hyper-rustls",
- "hyper-tls",
"hyper-util",
"js-sys",
"log",
- "mime",
- "native-tls",
"percent-encoding",
"pin-project-lite",
+ "quinn",
+ "rustls",
"rustls-pki-types",
"serde",
"serde_json",
"serde_urlencoded",
"sync_wrapper",
"tokio",
- "tokio-native-tls",
+ "tokio-rustls",
"tower",
"tower-http",
"tower-service",
@@ -1382,13 +1361,14 @@ dependencies = [
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
+ "webpki-roots 1.0.5",
]
[[package]]
name = "ring"
-version = "0.17.11"
+version = "0.17.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73"
+checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
dependencies = [
"cc",
"cfg-if",
@@ -1455,17 +1435,10 @@ dependencies = [
]
[[package]]
-name = "rustix"
-version = "0.38.44"
+name = "rustc-hash"
+version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
-dependencies = [
- "bitflags",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys 0.59.0",
-]
+checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
[[package]]
name = "rustls"
@@ -1473,18 +1446,36 @@ version = "0.23.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395"
dependencies = [
+ "aws-lc-rs",
+ "log",
"once_cell",
+ "ring",
"rustls-pki-types",
"rustls-webpki",
"subtle",
"zeroize",
]
+[[package]]
+name = "rustls-native-certs"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63"
+dependencies = [
+ "openssl-probe",
+ "rustls-pki-types",
+ "schannel",
+ "security-framework",
+]
+
[[package]]
name = "rustls-pki-types"
version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c"
+dependencies = [
+ "web-time",
+]
[[package]]
name = "rustls-webpki"
@@ -1492,6 +1483,7 @@ version = "0.102.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9"
dependencies = [
+ "aws-lc-rs",
"ring",
"rustls-pki-types",
"untrusted",
@@ -1532,9 +1524,9 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
[[package]]
name = "security-framework"
-version = "2.11.1"
+version = "3.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
+checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef"
dependencies = [
"bitflags",
"core-foundation",
@@ -1545,9 +1537,9 @@ dependencies = [
[[package]]
name = "security-framework-sys"
-version = "2.14.0"
+version = "2.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32"
+checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0"
dependencies = [
"core-foundation-sys",
"libc",
@@ -1764,47 +1756,12 @@ dependencies = [
"syn 2.0.108",
]
-[[package]]
-name = "system-configuration"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
-dependencies = [
- "bitflags",
- "core-foundation",
- "system-configuration-sys",
-]
-
-[[package]]
-name = "system-configuration-sys"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
[[package]]
name = "tap"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
-[[package]]
-name = "tempfile"
-version = "3.17.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230"
-dependencies = [
- "cfg-if",
- "fastrand",
- "getrandom 0.3.1",
- "once_cell",
- "rustix",
- "windows-sys 0.59.0",
-]
-
[[package]]
name = "thiserror"
version = "2.0.17"
@@ -1862,9 +1819,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.48.0"
+version = "1.49.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408"
+checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
dependencies = [
"bytes",
"io-uring",
@@ -1890,16 +1847,6 @@ dependencies = [
"syn 2.0.108",
]
-[[package]]
-name = "tokio-native-tls"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
-dependencies = [
- "native-tls",
- "tokio",
-]
-
[[package]]
name = "tokio-rustls"
version = "0.26.1"
@@ -1918,25 +1865,14 @@ checksum = "d25a406cddcc431a75d3d9afc6a7c0f7428d4891dd973e4d54c56b46127bf857"
dependencies = [
"futures-util",
"log",
- "native-tls",
+ "rustls",
+ "rustls-native-certs",
+ "rustls-pki-types",
"tokio",
- "tokio-native-tls",
+ "tokio-rustls",
"tungstenite",
]
-[[package]]
-name = "tokio-util"
-version = "0.7.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "pin-project-lite",
- "tokio",
-]
-
[[package]]
name = "toml_datetime"
version = "0.7.3"
@@ -2014,9 +1950,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
[[package]]
name = "tracing"
-version = "0.1.41"
+version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
+checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647"
dependencies = [
"pin-project-lite",
"tracing-attributes",
@@ -2025,9 +1961,9 @@ dependencies = [
[[package]]
name = "tracing-attributes"
-version = "0.1.28"
+version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d"
+checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
dependencies = [
"proc-macro2",
"quote",
@@ -2036,9 +1972,9 @@ dependencies = [
[[package]]
name = "tracing-core"
-version = "0.1.33"
+version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c"
+checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c"
dependencies = [
"once_cell",
"valuable",
@@ -2067,21 +2003,46 @@ dependencies = [
[[package]]
name = "tracing-subscriber"
-version = "0.3.20"
+version = "0.3.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
+checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e"
dependencies = [
+ "matchers",
"nu-ansi-term",
+ "once_cell",
+ "regex-automata",
"serde",
"serde_json",
"sharded-slab",
"smallvec",
"thread_local",
+ "tracing",
"tracing-core",
"tracing-log",
"tracing-serde",
]
+[[package]]
+name = "tracing-test"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "557b891436fe0d5e0e363427fc7f217abf9ccd510d5136549847bdcbcd011d68"
+dependencies = [
+ "tracing-core",
+ "tracing-subscriber",
+ "tracing-test-macro",
+]
+
+[[package]]
+name = "tracing-test-macro"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568"
+dependencies = [
+ "quote",
+ "syn 2.0.108",
+]
+
[[package]]
name = "try-lock"
version = "0.2.5"
@@ -2099,8 +2060,9 @@ dependencies = [
"http",
"httparse",
"log",
- "native-tls",
"rand 0.9.2",
+ "rustls",
+ "rustls-pki-types",
"sha1",
"thiserror",
"utf-8",
@@ -2172,12 +2134,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
-[[package]]
-name = "vcpkg"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
-
[[package]]
name = "version_check"
version = "0.9.5"
@@ -2290,54 +2246,47 @@ dependencies = [
]
[[package]]
-name = "windows-core"
-version = "0.52.0"
+name = "web-time"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
+checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
dependencies = [
- "windows-targets 0.52.6",
+ "js-sys",
+ "wasm-bindgen",
]
[[package]]
-name = "windows-link"
-version = "0.1.0"
+name = "webpki-roots"
+version = "0.26.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3"
-
-[[package]]
-name = "windows-link"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
+checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9"
+dependencies = [
+ "webpki-roots 1.0.5",
+]
[[package]]
-name = "windows-registry"
-version = "0.5.0"
+name = "webpki-roots"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c44a98275e31bfd112bb06ba96c8ab13c03383a3753fdddd715406a1824c7e0"
+checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c"
dependencies = [
- "windows-link 0.1.0",
- "windows-result",
- "windows-strings",
+ "rustls-pki-types",
]
[[package]]
-name = "windows-result"
-version = "0.3.1"
+name = "windows-core"
+version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189"
+checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
- "windows-link 0.1.0",
+ "windows-targets 0.52.6",
]
[[package]]
-name = "windows-strings"
-version = "0.3.1"
+name = "windows-link"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319"
-dependencies = [
- "windows-link 0.1.0",
-]
+checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
[[package]]
name = "windows-sys"
@@ -2372,7 +2321,7 @@ version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
dependencies = [
- "windows-link 0.2.1",
+ "windows-link",
]
[[package]]
@@ -2397,7 +2346,7 @@ version = "0.53.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
dependencies = [
- "windows-link 0.2.1",
+ "windows-link",
"windows_aarch64_gnullvm 0.53.1",
"windows_aarch64_msvc 0.53.1",
"windows_i686_gnu 0.53.1",
diff --git a/crates/binary_options_tools/Cargo.toml b/crates/binary_options_tools/Cargo.toml
index 264fcaff..338eeb2e 100644
--- a/crates/binary_options_tools/Cargo.toml
+++ b/crates/binary_options_tools/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "binary_options_tools"
version = "0.1.9"
-edition = "2024"
+edition = "2021"
authors = ["ChipaDevTeam"]
repository = "https://github.com/ChipaDevTeam/BinaryOptionsTools-v2"
homepage = "https://chipadevteam.github.io/BinaryOptionsTools-v2/"
@@ -27,15 +27,16 @@ async-channel = "2.5.0"
async-trait = "0.1.85"
chrono = { version = "0.4.42", features = ["serde"] }
futures-util = "0.3.31"
-native-tls = "0.2.12"
php_serde = "0.6.0"
rand = "0.9.2"
-reqwest = { version = "0.12.15", features = ["json"] }
+reqwest = { version = "0.12.15", default-features = false, features = ["json", "rustls-tls"] }
+rustls = "0.23"
+rustls-native-certs = "0.8"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.145"
thiserror = "2.0.12"
-tokio = { version = "1.44.2", features = ["full"] }
-tracing = "0.1.41"
+tokio = { version = "1.49.0", features = ["full"] }
+tracing = "0.1.43"
# url = { version = "2.5.4", features = ["serde"] }
uuid = { version = "1.16.0", features = ["serde", "v4"] }
url = "2.5.7"
@@ -44,4 +45,6 @@ rust_decimal = { version = "1.37.2", features = ["macros", "serde-float"] }
regex = "1.11.1"
[dev-dependencies]
-tracing-subscriber = "0.3.20"
+tracing-subscriber = "0.3.22"
+tokio-tungstenite = "0.28.0"
+tracing-test = "0.2.5"
diff --git a/crates/binary_options_tools/Readme.md b/crates/binary_options_tools/Readme.md
index 8ee7571f..93a1ea56 100644
--- a/crates/binary_options_tools/Readme.md
+++ b/crates/binary_options_tools/Readme.md
@@ -38,10 +38,12 @@ The core library is written in Rust for performance and safety, and it serves as
- Manual reconnection support
## TODO Features
+- Additional trading platforms (Expert Options, etc.)
+
+## Implemented Features
- Historical candle data retrieval
- Closed deals management and history
- Pending trades support
-- Additional trading platforms (Expert Options, etc.)
## Installation
diff --git a/crates/binary_options_tools/src/expertoptions/client.rs b/crates/binary_options_tools/src/expertoptions/client.rs
index 2d176e26..4bd270b8 100644
--- a/crates/binary_options_tools/src/expertoptions/client.rs
+++ b/crates/binary_options_tools/src/expertoptions/client.rs
@@ -108,9 +108,11 @@ mod tests {
#[tokio::test]
async fn test_expert_options_connection() {
- tracing_subscriber::fmt::init();
+ let _ = tracing_subscriber::fmt::try_init();
- let token = "759c67788715ca4e2e64c9ebb39e1c65";
+ // Use environment variable or fallback to a default (possibly a public demo token)
+ let token = std::env::var("EXPERT_OPTIONS_TOKEN")
+ .unwrap_or_else(|_| "759c67788715ca4e2e64c9ebb39e1c65".to_string());
let demo = true;
let expert_options = ExpertOptions::new(token, demo).await;
@@ -123,7 +125,9 @@ mod tests {
#[tokio::test]
async fn test_expert_options_change_account_type() {
- let token = "759c67788715ca4e2e64c9ebb39e1c65";
+ // Use environment variable or fallback to a default (possibly a public demo token)
+ let token = std::env::var("EXPERT_OPTIONS_TOKEN")
+ .unwrap_or_else(|_| "759c67788715ca4e2e64c9ebb39e1c65".to_string());
let demo = true;
let expert_options = ExpertOptions::new(token, demo).await;
diff --git a/crates/binary_options_tools/src/expertoptions/connect.rs b/crates/binary_options_tools/src/expertoptions/connect.rs
index 030f8457..b4acd098 100644
--- a/crates/binary_options_tools/src/expertoptions/connect.rs
+++ b/crates/binary_options_tools/src/expertoptions/connect.rs
@@ -13,6 +13,7 @@ use tracing::{info, warn};
use url::Url;
use crate::expertoptions::{regions::Regions, state::State};
+use crate::utils::init_crypto_provider;
#[derive(Clone)]
pub struct ExpertConnect;
@@ -59,11 +60,17 @@ pub async fn try_connect(
agent: String,
url: String,
) -> ConnectorResult>> {
- let tls_connector: native_tls::TlsConnector = native_tls::TlsConnector::builder()
- .build()
- .map_err(|e| ConnectorError::Tls(e.to_string()))?;
+ init_crypto_provider();
+ let mut root_store = rustls::RootCertStore::empty();
+ let certs_result = rustls_native_certs::load_native_certs();
+ for cert in certs_result.certs {
+ root_store.add(cert).ok();
+ }
+ let tls_config = rustls::ClientConfig::builder()
+ .with_root_certificates(root_store)
+ .with_no_client_auth();
- let connector = Connector::NativeTls(tls_connector);
+ let connector = Connector::Rustls(std::sync::Arc::new(tls_config));
let t_url = Url::parse(&url).map_err(|e| ConnectorError::UrlParsing(e.to_string()))?;
let host = t_url
diff --git a/crates/binary_options_tools/src/expertoptions/modules/profile.rs b/crates/binary_options_tools/src/expertoptions/modules/profile.rs
index a46a8530..7df83dc5 100644
--- a/crates/binary_options_tools/src/expertoptions/modules/profile.rs
+++ b/crates/binary_options_tools/src/expertoptions/modules/profile.rs
@@ -274,7 +274,11 @@ impl ApiModule for ProfileModule {
}
fn callback(
- &self,
+ _shared_state: Arc,
+ _command_receiver: AsyncReceiver,
+ _command_responder: AsyncSender,
+ _message_receiver: AsyncReceiver>,
+ _to_ws_sender: AsyncSender,
) -> binary_options_tools_core_pre::error::CoreResult