Skip to main content

SearchLimitOrders

Searches limit orders using flexible filtering criteria.

Supports filtering by token, account, and populating live ledger data.

Method Options​

Authorisation specification of the SearchLimitOrders method.

TypeMETHOD_TYPE_READ
Access LevelMETHOD_ACCESS_LEVEL_AUTHORISED
Roles
  • ROLE_TRADING_ADMIN
  • ROLE_TRADING_VIEWER
  • ROLE_TRADING_LIMIT_ORDER_ADMIN
  • ROLE_TRADING_LIMIT_ORDER_VIEWER

Parameters​

Request and response parameter message overview:

Input: SearchLimitOrdersRequest Message​

FieldTypeRequiredDescription
Token

string

False

Filter by token (optional).

Account

string

False

Filter by account (optional). Format: accounts/{ULIDv2}.

States

meshtrade.trading.limit_order.v1.LimitOrderState[]

False

Filter by states (optional).

LiveLedgerData

bool

False

When true, fetches live ledger data for matching orders. When false, returns only stored metadata.

Returns: SearchLimitOrdersResponse Message​

FieldTypeDescription
LimitOrders

meshtrade.trading.limit_order.v1.LimitOrder[]

Collection of limit orders matching the search criteria.

Code Examples​

Select supported SDK in the language of your choice for a full example of how to invoke the this method:

package main

import (
"context"
"log"

limit_orderv1 "github.com/meshtrade/api/go/trading/limit_order/v1"
)

func main() {
ctx := context.Background()

// Default configuration is used and credentials come from MESH_API_CREDENTIALS
// environment variable or default discovery methods. Zero config required
// unless you want custom configuration.
service, err := limit_orderv1.NewLimitOrderService()
if err != nil {
log.Fatalf("Failed to create service: %v", err)
}
defer service.Close()

// Search limit orders with optional filters
// Replace with an actual account resource name from your system
accountName := "accounts/01HQVBZ9F8X2T3K4M5N6P7Q8R9"

request := &limit_orderv1.SearchLimitOrdersRequest{
// Optional: Filter by token code
Token: "USDC",
// Optional: Filter by account (returns only orders for this account)
Account: accountName,
// Optional: Set to true to enrich with live ledger status
LiveLedgerData: true,
}

// Call the SearchLimitOrders method
response, err := service.SearchLimitOrders(ctx, request)
if err != nil {
log.Fatalf("SearchLimitOrders failed: %v", err)
}

// Response contains filtered list of limit orders
log.Printf("✓ Found %d limit orders matching filters:", len(response.LimitOrders))
for i, order := range response.LimitOrders {
log.Printf("\n Order #%d:", i+1)
log.Printf(" Resource name: %s", order.Name)
log.Printf(" Account: %s", order.Account)
log.Printf(" External ref: %s", order.ExternalReference)
log.Printf(" Side: %s", order.Side)
log.Printf(" State: %s", order.State)
log.Printf(" Limit price: %s %s", order.LimitPrice.Value.Value, order.LimitPrice.Token.Code)
log.Printf(" Quantity: %s %s", order.Quantity.Value.Value, order.Quantity.Token.Code)
}
}

Advanced Configuration​

For advanced client configuration options (custom endpoints, TLS settings, timeouts), see the SDK Configuration Guide.

Other Methods​