SteelSwapV2Client
Client for the SteelSwap v2 API — order tracking and partner address management.
The v2 API uses Bearer token authentication and snake_case field names.
Constructor
import { SteelSwapV2Client } from '@steelswap/steelswap-sdk'
const client = new SteelSwapV2Client({
bearerToken: 'your-v2-bearer-token',
})See Configuration for all options.
Order Methods
getOpenOrders(params?)
Get open orders, optionally filtered by DEX and/or wallet addresses.
const orders = await client.getOpenOrders({
addresses: ['addr1...'],
dex: 'minswap', // optional
})Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
addresses | string[] | No | Filter by wallet addresses |
dex | string | No | Filter by DEX name |
Returns: Promise<OrderOutput[]>
getOrderHistory(params)
Get order history for the given wallet addresses.
const history = await client.getOrderHistory({
addresses: ['addr1...'],
})Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
addresses | string[] | Yes | Wallet addresses to query |
Returns: Promise<OrderOutput[]>
getOrderDetails(txHash)
Get order details by transaction hash.
const details = await client.getOrderDetails('abc123...')Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
txHash | string | Yes | Transaction hash |
Returns: Promise<OrderOutput[]>
Partner Management
getPartnerAddresses()
Get the list of addresses registered for the authenticated partner.
const result = await client.getPartnerAddresses()
console.log(result.partner_id)
console.log(result.addresses)Returns: Promise<AddressListResponse> — { partner_id: string, addresses: string[] }
addPartnerAddress(address)
Add an address to the authenticated partner's address list.
const result = await client.addPartnerAddress('addr1...')Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Cardano address to add |
Returns: Promise<AddressListResponse>
removePartnerAddress(address)
Remove an address from the authenticated partner's address list.
const result = await client.removePartnerAddress('addr1...')Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Cardano address to remove |
Returns: Promise<AddressListResponse>
OrderOutput Type
All order methods return OrderOutput[] with the following fields:
interface OrderOutput {
tx_hash: string
tx_index: number
block_slot: number
clazz: string
token_offer: string
amount_offer: number
token_ask: string
amount_ask: number
status: 'MEMPOOL' | 'OPEN' | 'FILLED' | 'CANCELLED'
datum_cbor: string
execution_pool_state_id?: string | null
execution_tx_hash?: string | null
amount_received?: number | null
}Error Handling
The v2 client throws the same error types as the v1 client:
import { SteelSwapError, SteelSwapValidationError } from '@steelswap/steelswap-sdk'
try {
await client.getOpenOrders()
} catch (error) {
if (error instanceof SteelSwapValidationError) {
console.log('Validation failed:', error.endpoint)
} else if (error instanceof SteelSwapError) {
console.log('API error:', error.statusCode)
}
}