Objects

AssetOraclePrice

Represents a collection of signed oracle prices of a single synthetic asset and their median price value. The median price is stored in the base class.

The definition of a legal median value x: half the values are ≤ x and half of them are ≥ x.

Parameters

  • price(int) – The median price value. The definition of a legal median value x: half the values are ≤ x and half of them are ≥ x.

  • signed_prices(Mapping[int,SignedOraclePrice]) – A dictionary from the public key of the signer to a signed oracle price object.

FundingIndicesState

Represents a collection of timestamped global funding indices for all assets.

Parameters

  • indices(Mapping[int,int_]_) – Maps each synthetic asset to its funding index in quantized units of the collateral token, such as USDC. A 64-bit fixed-point signed number, with 32 bits after the decimal point.

  • timestamp(int) – The new system time, in seconds since the Unix epoch. Specifies seconds since the Unix epoch. A 32-bit number.

Order

Parameters

  • order_type(OrderType) – order type.

  • nonce(int) – Unique nonce issued by the caller.

  • public_key(int) – Public key of the party as registered on the StarkEx contract.

  • amount_synthetic(int) – Amount of synthetic asset in the order, after applying the resolution factor.

  • amount_collateral(int) – Amount of collateral asset in the order, after applying the resolution factor.

  • amount_fee(int) – The fee limit for this order.

  • asset_id_synthetic(int) – The asset ID of the synthetic asset participating in this order, as registered on the contract.

  • asset_id_collateral(int) – The asset ID of the collateral participating in this order, as registered on the contract,

  • position_id(int) – Position ID used for the trade.

  • is_buying_synthetic(int) – A flag to indicate whether the order is for buying the synthetic amount or selling the synthetic amount.

  • expiration_timestamp(int) – The timestamp after which this request is no longer valid. Specifies hours since the Unix epoch. A 32-bit number.

  • signature(Signature) – Signature of the party that issued this order.

OrderType

An enumeration.

Example

LIMIT_ORDER_WITH_FEES=0

Signature

Represents a STARK-friendly ECDSA signature.

Parameters

  • r(int) – 1st ECDSA signature component.

  • s(int) – 2nd ECDSA signature component.

SignedOraclePrice

Represents a single signed Oracle Price per unit.

Parameters

  • price(int) – The signed price.

  • timestamped_signature(TimestampedSignature) – Represents a timestamped STARK-friendly ECDSA signature.

  • external_asset_id(int) – Concatenation of the asset name and the oracle name (both in hex encoding).

TimestampedSignature

Represents a STARK-friendly ECDSA signature which was signed at a certain timestamp.

Parameters

  • signature(Signature) – Represents a STARK-friendly ECDSA signature.

  • timestamp(int) – The time the signature was created. Specifies seconds since the Unix epoch. A 32-bit number.

AlternativeEndpointSettingRequest

In order to use this request, StarkWare must configure your setup to support dynamically configuring the endpoint for alternative transactions.

AlternativeEndpointSettingRequest is sent from the client to the gateway when the configuration of the alternative transaction request endpoint is changed. The client should provide either of the following: A bearer token, or client and server certificates.

Parameters

  • url(str) – The URL of the endpoint.

  • failure_description_url(str) – The URL address that receives the failure description.

  • bearer_token(Optional[str_]_) – The Bearer token.

  • server_certificate(Optional[str_]_) – The server certificate.

  • client_certificate(Optional[str_]_) – The client certificate.

  • client_key(Optional[str_]_) – The client private key.