
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
This is the Python SDK for the Vertex Protocol API.
See SDK docs to get started.
You can install the SDK via pip:
pip install vertex-protocol
from vertex_protocol.client import create_vertex_client, VertexClientMode
from vertex_protocol.contracts.types import DepositCollateralParams
from vertex_protocol.engine_client.types.execute import (
OrderParams,
PlaceOrderParams,
SubaccountParams
)
from vertex_protocol.utils.expiration import OrderType, get_expiration_timestamp
from vertex_protocol.utils.math import to_pow_10, to_x18
from vertex_protocol.utils.nonce import gen_order_nonce
print("setting up vertex client...")
private_key = "xxx"
client = create_vertex_client(VertexClientMode.MAINNET, private_key)
# Depositing collaterals
print("approving allowance...")
approve_allowance_tx_hash = client.spot.approve_allowance(0, to_pow_10(100000, 6))
print("approve allowance tx hash:", approve_allowance_tx_hash)
print("querying my allowance...")
token_allowance = client.spot.get_token_allowance(0, client.context.signer.address)
print("token allowance:", token_allowance)
print("depositing collateral...")
deposit_tx_hash = client.spot.deposit(
DepositCollateralParams(
subaccount_name="default", product_id=0, amount=to_pow_10(100000, 6)
)
)
print("deposit collateral tx hash:", deposit_tx_hash)
# Placing orders
print("placing order...")
owner = client.context.engine_client.signer.address
product_id = 1
order = OrderParams(
sender=SubaccountParams(
subaccount_owner=owner,
subaccount_name="default",
),
priceX18=to_x18(20000),
amount=to_pow_10(1, 17),
expiration=get_expiration_timestamp(OrderType.POST_ONLY, int(time.time()) + 40),
nonce=gen_order_nonce(),
)
res = client.market.place_order({"product_id": product_id, "order": order})
print("order result:", res.json(indent=2))
See Getting Started for more.
Clone github repo
Install poetry
$ curl -sSL https://install.python-poetry.org | python3 -
$ python3 -m venv venv
$ source ./venv/bin/activate
poetry install
.env
file and set the following envvarsCLIENT_MODE='mainnet|sepolia-testnet|devnet'
SIGNER_PRIVATE_KEY="0x..."
LINKED_SIGNER_PRIVATE_KEY="0x..." # not required
$ poetry run test
poetry run client-sanity
: runs sanity checks for the top-level client.poetry run engine-sanity
: runs sanity checks for the engine-client
.poetry run indexer-sanity
: runs sanity checks for the indexer-client
.poetry run contracts-sanity
: runs sanity checks for the contracts module.To build the docs locally run:
$ poetry run sphinx-build docs/source docs/build
FAQs
Vertex Protocol SDK
We found that vertex-protocol demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.