Private Node API
Place Order
The Place Order
method is used to execute a transaction that places an order on a market.
This function takes parameters for wallet authentication, various order details, and optional transaction options to manage specific order types and behaviors.
Method Declaration
async def place_order(
self,
wallet: Wallet,
order: Order,
tx_options: Optional[TxOptions] = None,
)
Unification Plan
- Use a convenient
Wallet
andOrder
pair for all clients - TypeScript doesn't use authenticators
- In Python we use them explicitly
- Consider to do the same like in Rust (set it automatically)
Parameters
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
wallet | query | Wallet | true | The wallet to use for signing the transaction. |
order | query | Order | true | The order to place. |
tx_options | query | TxOptions | false | Options for transaction to support authenticators. |
Response
Status | Meaning | Schema |
---|---|---|
200 | OK | TxHash |
Examples: Python | TypeScript | Rust
Cancel Order
The Cancel Order
method terminates an existing order using the provided order_id
and related parameters, such as block validity periods and transaction options. This method supports asynchronous operations for efficient order cancellation across different platforms.
Method Declaration
async def cancel_order(
self,
wallet: Wallet,
order_id: OrderId,
good_til_block: int = None,
good_til_block_time: int = None,
tx_options: Optional[TxOptions] = None,
)
Unification Plan
- Check the
marketId
is really needed (used inTypeScript
)
Parameters
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
wallet | query | Wallet | true | The wallet to use for signing the transaction. |
order_id | query | OrderId | true | The ID of the order to cancel. |
good_til_block | query | i32 | false | The block number until which the order is valid. Defaults to None. |
good_til_block_time | query | i32 | false | The block time until which the order is valid. Defaults to None. |
tx_options | query | TxOptions | false | Options for transaction to support authenticators. |
:::
Response
Status | Meaning | Schema |
---|---|---|
200 | [OK] | TxHash |
Examples: Rust
Send Token
The Send Token
function is used to transfer a specified token from one blockchain address to another.
It requires details such as the wallet for signing the transaction, sender and recipient addresses, and the quantum amount or denomination of the token.
Method Declaration
async def send_token(
self,
wallet: Wallet,
sender: str,
recipient: str,
quantums: int,
denomination: str,
)
Unification Plan
- All the types are different, revision is needed
- Standard types like strings are used
- Broadcast mode?
- Zero fee?
Parameters
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
wallet | query | Wallet | true | The wallet to use for signing the transaction. |
sender | query | String | true | The sender address. |
recipient | query | String | true | The recipient address. |
quantums | query | i32 | true | The amount of quantums to send. |
denomination | query | i32 | true | The denomination of the token. |
Response
Status | Meaning | Schema |
---|---|---|
200 | OK | TxHash |
Examples: Rust
Simulate
The Simulate
function allows for the pre-execution simulation of a transaction, predicting its execution cost and resource usage without committing any changes.
This method typically returns information like estimated gas fees or other transaction-related metrics to anticipate the impact of operations before they are executed on the blockchain.
Method Declaration
async def simulate(self, transaction: Tx)
Unification Plan
- Some extra parameters in TypeScript? What to do with them?
Parameters
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
transaction | query | Tx | true | The transaction to simulate. |
Response
Status | Meaning | Schema |
---|---|---|
200 | OK | GasInfo |
Examples: Python | TypeScript | Rust
Broadcast Transaction
The Broadcast Transaction
method is used to send a transaction to the network for processing.
The key parameters include the transaction itself and the mode of broadcasting, which is optional and defaults to synchronous broadcasting mode.
Method Declaration
async def broadcast(self, transaction: Tx, mode=BroadcastMode.BROADCAST_MODE_SYNC)
Unification Plan
Parameters
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
transaction | query | Tx | true | The transaction to broadcast. |
mode | query | BroadcastMode | false | The broadcast mode. Defaults to BroadcastMode.BROADCAST_MODE_SYNC. |
:::
Response
Status | Meaning | Schema |
---|---|---|
200 | OK | TxHash |
Examples: Rust