@nadohq/engine-client 0.1.0-alpha.1 → 0.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EngineExecuteBuilder.cjs +12 -12
- package/dist/EngineExecuteBuilder.cjs.map +1 -1
- package/dist/EngineExecuteBuilder.d.cts +8 -8
- package/dist/EngineExecuteBuilder.d.ts +8 -8
- package/dist/EngineExecuteBuilder.js +12 -12
- package/dist/EngineExecuteBuilder.js.map +1 -1
- package/dist/EngineExecuteClient.cjs +6 -6
- package/dist/EngineExecuteClient.cjs.map +1 -1
- package/dist/EngineExecuteClient.d.cts +2 -2
- package/dist/EngineExecuteClient.d.ts +2 -2
- package/dist/EngineExecuteClient.js +6 -6
- package/dist/EngineExecuteClient.js.map +1 -1
- package/dist/EngineQueryClient.cjs +3 -3
- package/dist/EngineQueryClient.cjs.map +1 -1
- package/dist/EngineQueryClient.d.cts +3 -3
- package/dist/EngineQueryClient.d.ts +3 -3
- package/dist/EngineQueryClient.js +3 -3
- package/dist/EngineQueryClient.js.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/types/clientExecuteTypes.cjs.map +1 -1
- package/dist/types/clientExecuteTypes.d.cts +6 -6
- package/dist/types/clientExecuteTypes.d.ts +6 -6
- package/dist/types/clientQueryTypes.cjs.map +1 -1
- package/dist/types/clientQueryTypes.d.cts +3 -3
- package/dist/types/clientQueryTypes.d.ts +3 -3
- package/dist/types/index.d.cts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/dist/types/serverExecuteTypes.cjs.map +1 -1
- package/dist/types/serverExecuteTypes.d.cts +5 -5
- package/dist/types/serverExecuteTypes.d.ts +5 -5
- package/dist/types/serverQueryTypes.cjs.map +1 -1
- package/dist/types/serverQueryTypes.d.cts +5 -5
- package/dist/types/serverQueryTypes.d.ts +5 -5
- package/package.json +4 -4
- package/src/EngineExecuteBuilder.ts +16 -16
- package/src/EngineExecuteClient.ts +6 -6
- package/src/EngineQueryClient.ts +7 -7
- package/src/types/clientExecuteTypes.ts +8 -8
- package/src/types/clientQueryTypes.ts +2 -2
- package/src/types/serverExecuteTypes.ts +6 -6
- package/src/types/serverQueryTypes.ts +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/serverQueryTypes.ts"],"sourcesContent":["import { HealthStatus } from '@nadohq/contracts';\nimport {\n EngineServerHealthBreakdown,\n EngineServerPerpBalance,\n EngineServerPerpProduct,\n EngineServerProductType,\n EngineServerSpotBalance,\n EngineServerSpotProduct,\n} from './serverQueryModelTypes';\n\nexport interface EngineServerNoncesParams {\n address: string;\n}\n\nexport interface EngineServerSubaccountInfoQueryParams {\n subaccount: string;\n txns?: Array<{\n apply_delta: {\n product_id: number;\n subaccount: string;\n amount_delta: string;\n v_quote_delta: string;\n };\n }>;\n}\n\nexport interface EngineServerIsolatedPositionsQueryParams {\n subaccount: string;\n}\n\nexport interface EngineServerSymbolsQueryParams {\n product_type?: EngineServerProductType;\n product_ids?: number[];\n}\n\nexport interface EngineServerMarketPriceQueryParams {\n product_id: number;\n}\n\nexport interface EngineServerMarketPricesQueryParams {\n product_ids: number[];\n}\n\nexport interface EngineServerGetOrderQueryParams {\n product_id: number;\n digest: string;\n}\n\nexport interface EngineServerValidateOrderQueryParams {\n product_id: number;\n // Bytes for order, does not need to be signed\n order: string;\n}\n\nexport interface EngineServerOrdersQueryParams {\n sender: string;\n product_ids: number[];\n}\n\nexport interface EngineServerSubaccountOrdersQueryParams {\n sender: string;\n product_id: number;\n}\n\nexport interface EngineServerSubaccountFeeRatesParams {\n sender: string;\n}\n\nexport interface EngineServerMarketLiquidityQueryParams {\n product_id: number;\n depth: number;\n}\n\nexport interface EngineServerMaxWithdrawableQueryParams {\n sender: string;\n product_id: number;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n}\n\nexport interface EngineServerMaxOrderSizeQueryParams {\n sender: string;\n product_id: number;\n price_x18: string;\n // Note: When `reduce_only` is true, `direction` must be opposite of the current position, otherwise it returns 0.\n direction: 'long' | 'short';\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n // If not given, engine defaults to false. If true, the max order size will be capped to the subaccount's current position size;\n // If no position exists, it will return 0.\n reduce_only: string | null;\n}\n\nexport interface EngineServerLinkedSignerParams {\n subaccount: string;\n}\n\nexport interface EngineServerMaxMintVlpQueryParams {\n sender: string;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n}\n\nexport interface EngineServerQueryRequestByType {\n all_products: Record<string, never>;\n contracts: Record<string, never>;\n edge_all_products: Record<string, never>;\n fee_rates: EngineServerSubaccountFeeRatesParams;\n health_groups: Record<string, never>;\n insurance: Record<string, never>;\n isolated_positions: EngineServerIsolatedPositionsQueryParams;\n linked_signer: EngineServerLinkedSignerParams;\n market_liquidity: EngineServerMarketLiquidityQueryParams;\n market_price: EngineServerMarketPriceQueryParams;\n market_prices: EngineServerMarketPricesQueryParams;\n max_vlp_mintable: EngineServerMaxMintVlpQueryParams;\n max_order_size: EngineServerMaxOrderSizeQueryParams;\n max_withdrawable: EngineServerMaxWithdrawableQueryParams;\n min_deposit_rates: Record<string, never>;\n nonces: EngineServerNoncesParams;\n order: EngineServerGetOrderQueryParams;\n orders: EngineServerOrdersQueryParams;\n status: Record<string, never>;\n subaccount_info: Omit<EngineServerSubaccountInfoQueryParams, 'txns'> & {\n // JSON serialized txns\n txns?: string;\n };\n subaccount_orders: EngineServerSubaccountOrdersQueryParams;\n symbols: EngineServerSymbolsQueryParams;\n validate_order: EngineServerValidateOrderQueryParams;\n}\n\nexport type EngineServerQueryRequestType = keyof EngineServerQueryRequestByType;\n\nexport type EngineServerQueryRequest<\n TRequestType extends EngineServerQueryRequestType,\n> = {\n type: TRequestType;\n} & EngineServerQueryRequestByType[TRequestType];\n\nexport interface EngineServerContractsResponse {\n chain_id: string;\n endpoint_addr: string;\n // Index is product ID\n book_addrs: string[];\n}\n\n// Unless in active state, engine is not fully operational\nexport type EngineServerStatusResponse =\n | 'started'\n | 'active'\n | 'stopping'\n | 'syncing'\n | 'live_syncing'\n | 'failed';\n\nexport interface EngineServerNoncesResponse {\n order_nonce: string;\n tx_nonce: string;\n}\n\nexport interface EngineServerSubaccountInfoResponse {\n exists: boolean;\n subaccount: string;\n healths: [\n initial: EngineServerHealthBreakdown,\n maintenance: EngineServerHealthBreakdown,\n unweighted: EngineServerHealthBreakdown,\n ];\n // First index is product ID, each subarray is of length 3 [initial, maintenance, unweighted]\n health_contributions: string[][];\n spot_count: number;\n perp_count: number;\n spot_balances: EngineServerSpotBalance[];\n perp_balances: EngineServerPerpBalance[];\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n}\n\nexport interface EngineServerIsolatedPosition {\n subaccount: string;\n healths: [\n initial: HealthStatus,\n maintenance: HealthStatus,\n unweighted: HealthStatus,\n ];\n quote_healths: [initial: string, maintenance: string, unweighted: string];\n base_healths: [initial: string, maintenance: string, unweighted: string];\n quote_balance: EngineServerSpotBalance;\n base_balance: EngineServerPerpBalance;\n quote_product: EngineServerSpotProduct;\n base_product: EngineServerPerpProduct;\n}\n\nexport type EngineServerIsolatedPositionsResponse = {\n isolated_positions: EngineServerIsolatedPosition[];\n};\n\nexport interface EngineServerSymbol {\n type: EngineServerProductType;\n product_id: number;\n symbol: string;\n price_increment_x18: string;\n size_increment: string;\n min_size: string;\n min_depth_x18: string;\n max_spread_rate_x18: string;\n maker_fee_rate_x18: string;\n taker_fee_rate_x18: string;\n long_weight_initial_x18: string;\n long_weight_maintenance_x18: string;\n}\n\nexport interface EngineServerSymbolsResponse {\n symbols: Record<string, EngineServerSymbol>;\n}\n\nexport interface EngineServerAllProductsResponse {\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n}\n\nexport interface EngineServerHealthGroupsResponse {\n health_groups: [spotProductId: number, perpProductId: number][];\n}\n\n// Price, liquidity pairs\nexport type EngineServerPriceTickLiquidity = [\n priceX18: string,\n liquidity: string,\n];\n\nexport interface EngineServerMarketLiquidityResponse {\n bids: EngineServerPriceTickLiquidity[];\n asks: EngineServerPriceTickLiquidity[];\n}\n\nexport interface EngineServerSubaccountOrders {\n sender: string;\n product_id: number;\n orders: EngineServerOrder[];\n}\n\nexport type EngineServerSubaccountOrdersResponse = EngineServerSubaccountOrders;\n\nexport interface EngineServerProductOrdersResponse {\n sender: string;\n product_orders: EngineServerSubaccountOrders[];\n}\n\nexport interface EngineServerFeeRatesResponse {\n liquidation_sequencer_fee: string;\n health_check_sequencer_fee: string;\n taker_sequencer_fee: string;\n // Product ID is the index\n withdraw_sequencer_fees: string[];\n taker_fee_rates_x18: string[];\n maker_fee_rates_x18: string[];\n}\n\nexport interface EngineServerMarketPrice {\n product_id: number;\n bid_x18: string;\n ask_x18: string;\n}\n\nexport type EngineServerMarketPriceResponse = EngineServerMarketPrice;\n\nexport interface EngineServerMarketPricesResponse {\n market_prices: EngineServerMarketPrice[];\n}\n\nexport interface EngineServerOrder {\n product_id: number;\n sender: string;\n price_x18: string;\n amount: string;\n expiration: string;\n nonce: string;\n unfilled_amount: string;\n digest: string;\n placed_at: number;\n order_type: string;\n margin: string | null;\n}\n\nexport type EngineServerOrderResponse = EngineServerOrder;\n\nexport interface EngineServerValidateOrderResponse {\n product_id: number;\n order: string;\n valid: boolean;\n}\n\nexport interface EngineServerMaxOrderSizeResponse {\n max_order_size: string;\n}\n\nexport interface EngineServerMaxWithdrawableResponse {\n max_withdrawable: string;\n}\n\nexport type EngineServerTimeResponse = number;\n\nexport interface EngineServerIpBlockResponse {\n blocked: boolean;\n reason: string;\n}\n\nexport interface EngineServerLinkedSignerResponse {\n linked_signer: string;\n}\n\nexport interface EngineInsuranceResponse {\n insurance: string;\n}\n\nexport interface EngineServerMinDepositRate {\n product_id: number;\n min_deposit_rate_x18: string;\n}\n\nexport interface EngineServerMinDepositRatesResponse {\n // product_id -> EngineServerMinDepositRate\n min_deposit_rates: Record<number, EngineServerMinDepositRate>;\n}\n\nexport interface EngineServerEdgeAllProductsResponse {\n // chain_id -> EngineServerAllProductsResponse\n edge_all_products: Record<number, EngineServerAllProductsResponse>;\n}\n\nexport interface EngineServerMaxMintVlpResponse {\n max_quote_amount: string;\n}\n\nexport interface EngineServerQueryResponseByType {\n all_products: EngineServerAllProductsResponse;\n contracts: EngineServerContractsResponse;\n edge_all_products: EngineServerEdgeAllProductsResponse;\n fee_rates: EngineServerFeeRatesResponse;\n health_groups: EngineServerHealthGroupsResponse;\n insurance: EngineInsuranceResponse;\n isolated_positions: EngineServerIsolatedPositionsResponse;\n linked_signer: EngineServerLinkedSignerResponse;\n market_liquidity: EngineServerMarketLiquidityResponse;\n market_price: EngineServerMarketPriceResponse;\n market_prices: EngineServerMarketPricesResponse;\n max_vlp_mintable: EngineServerMaxMintVlpResponse;\n max_order_size: EngineServerMaxOrderSizeResponse;\n max_withdrawable: EngineServerMaxWithdrawableResponse;\n min_deposit_rates: EngineServerMinDepositRatesResponse;\n nonces: EngineServerNoncesResponse;\n order: EngineServerOrderResponse;\n orders: EngineServerProductOrdersResponse;\n status: EngineServerStatusResponse;\n subaccount_info: EngineServerSubaccountInfoResponse;\n subaccount_orders: EngineServerSubaccountOrdersResponse;\n symbols: EngineServerSymbolsResponse;\n validate_order: EngineServerValidateOrderResponse;\n}\n\nexport interface EngineServerQuerySuccessResponse<\n TQueryType extends\n keyof EngineServerQueryResponseByType = EngineServerQueryRequestType,\n> {\n status: 'success';\n data: EngineServerQueryResponseByType[TQueryType];\n}\n\nexport interface EngineServerQueryFailureResponse {\n status: 'failure';\n error: string;\n error_code: number;\n}\n\nexport type EngineServerQueryResponse<\n TQueryType extends\n keyof EngineServerQueryResponseByType = EngineServerQueryRequestType,\n> =\n | EngineServerQuerySuccessResponse<TQueryType>\n | EngineServerQueryFailureResponse;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/types/serverQueryTypes.ts"],"sourcesContent":["import { HealthStatus } from '@nadohq/contracts';\nimport {\n EngineServerHealthBreakdown,\n EngineServerPerpBalance,\n EngineServerPerpProduct,\n EngineServerProductType,\n EngineServerSpotBalance,\n EngineServerSpotProduct,\n} from './serverQueryModelTypes';\n\nexport interface EngineServerNoncesParams {\n address: string;\n}\n\nexport interface EngineServerSubaccountInfoQueryParams {\n subaccount: string;\n txns?: Array<{\n apply_delta: {\n product_id: number;\n subaccount: string;\n amount_delta: string;\n v_quote_delta: string;\n };\n }>;\n}\n\nexport interface EngineServerIsolatedPositionsQueryParams {\n subaccount: string;\n}\n\nexport interface EngineServerSymbolsQueryParams {\n product_type?: EngineServerProductType;\n product_ids?: number[];\n}\n\nexport interface EngineServerMarketPriceQueryParams {\n product_id: number;\n}\n\nexport interface EngineServerMarketPricesQueryParams {\n product_ids: number[];\n}\n\nexport interface EngineServerGetOrderQueryParams {\n product_id: number;\n digest: string;\n}\n\nexport interface EngineServerValidateOrderQueryParams {\n product_id: number;\n // Bytes for order, does not need to be signed\n order: string;\n}\n\nexport interface EngineServerOrdersQueryParams {\n sender: string;\n product_ids: number[];\n}\n\nexport interface EngineServerSubaccountOrdersQueryParams {\n sender: string;\n product_id: number;\n}\n\nexport interface EngineServerSubaccountFeeRatesParams {\n sender: string;\n}\n\nexport interface EngineServerMarketLiquidityQueryParams {\n product_id: number;\n depth: number;\n}\n\nexport interface EngineServerMaxWithdrawableQueryParams {\n sender: string;\n product_id: number;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n}\n\nexport interface EngineServerMaxOrderSizeQueryParams {\n sender: string;\n product_id: number;\n price_x18: string;\n // Note: When `reduce_only` is true, `direction` must be opposite of the current position, otherwise it returns 0.\n direction: 'long' | 'short';\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n // If not given, engine defaults to false. If true, the max order size will be capped to the subaccount's current position size;\n // If no position exists, it will return 0.\n reduce_only: string | null;\n}\n\nexport interface EngineServerLinkedSignerParams {\n subaccount: string;\n}\n\nexport interface EngineServerMaxMintNlpQueryParams {\n sender: string;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n}\n\nexport interface EngineServerQueryRequestByType {\n all_products: Record<string, never>;\n contracts: Record<string, never>;\n edge_all_products: Record<string, never>;\n fee_rates: EngineServerSubaccountFeeRatesParams;\n health_groups: Record<string, never>;\n insurance: Record<string, never>;\n isolated_positions: EngineServerIsolatedPositionsQueryParams;\n linked_signer: EngineServerLinkedSignerParams;\n market_liquidity: EngineServerMarketLiquidityQueryParams;\n market_price: EngineServerMarketPriceQueryParams;\n market_prices: EngineServerMarketPricesQueryParams;\n max_nlp_mintable: EngineServerMaxMintNlpQueryParams;\n max_order_size: EngineServerMaxOrderSizeQueryParams;\n max_withdrawable: EngineServerMaxWithdrawableQueryParams;\n min_deposit_rates: Record<string, never>;\n nonces: EngineServerNoncesParams;\n order: EngineServerGetOrderQueryParams;\n orders: EngineServerOrdersQueryParams;\n status: Record<string, never>;\n subaccount_info: Omit<EngineServerSubaccountInfoQueryParams, 'txns'> & {\n // JSON serialized txns\n txns?: string;\n };\n subaccount_orders: EngineServerSubaccountOrdersQueryParams;\n symbols: EngineServerSymbolsQueryParams;\n validate_order: EngineServerValidateOrderQueryParams;\n}\n\nexport type EngineServerQueryRequestType = keyof EngineServerQueryRequestByType;\n\nexport type EngineServerQueryRequest<\n TRequestType extends EngineServerQueryRequestType,\n> = {\n type: TRequestType;\n} & EngineServerQueryRequestByType[TRequestType];\n\nexport interface EngineServerContractsResponse {\n chain_id: string;\n endpoint_addr: string;\n // Index is product ID\n book_addrs: string[];\n}\n\n// Unless in active state, engine is not fully operational\nexport type EngineServerStatusResponse =\n | 'started'\n | 'active'\n | 'stopping'\n | 'syncing'\n | 'live_syncing'\n | 'failed';\n\nexport interface EngineServerNoncesResponse {\n order_nonce: string;\n tx_nonce: string;\n}\n\nexport interface EngineServerSubaccountInfoResponse {\n exists: boolean;\n subaccount: string;\n healths: [\n initial: EngineServerHealthBreakdown,\n maintenance: EngineServerHealthBreakdown,\n unweighted: EngineServerHealthBreakdown,\n ];\n // First index is product ID, each subarray is of length 3 [initial, maintenance, unweighted]\n health_contributions: string[][];\n spot_count: number;\n perp_count: number;\n spot_balances: EngineServerSpotBalance[];\n perp_balances: EngineServerPerpBalance[];\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n}\n\nexport interface EngineServerIsolatedPosition {\n subaccount: string;\n healths: [\n initial: HealthStatus,\n maintenance: HealthStatus,\n unweighted: HealthStatus,\n ];\n quote_healths: [initial: string, maintenance: string, unweighted: string];\n base_healths: [initial: string, maintenance: string, unweighted: string];\n quote_balance: EngineServerSpotBalance;\n base_balance: EngineServerPerpBalance;\n quote_product: EngineServerSpotProduct;\n base_product: EngineServerPerpProduct;\n}\n\nexport type EngineServerIsolatedPositionsResponse = {\n isolated_positions: EngineServerIsolatedPosition[];\n};\n\nexport interface EngineServerSymbol {\n type: EngineServerProductType;\n product_id: number;\n symbol: string;\n price_increment_x18: string;\n size_increment: string;\n min_size: string;\n min_depth_x18: string;\n max_spread_rate_x18: string;\n maker_fee_rate_x18: string;\n taker_fee_rate_x18: string;\n long_weight_initial_x18: string;\n long_weight_maintenance_x18: string;\n}\n\nexport interface EngineServerSymbolsResponse {\n symbols: Record<string, EngineServerSymbol>;\n}\n\nexport interface EngineServerAllProductsResponse {\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n}\n\nexport interface EngineServerHealthGroupsResponse {\n health_groups: [spotProductId: number, perpProductId: number][];\n}\n\n// Price, liquidity pairs\nexport type EngineServerPriceTickLiquidity = [\n priceX18: string,\n liquidity: string,\n];\n\nexport interface EngineServerMarketLiquidityResponse {\n bids: EngineServerPriceTickLiquidity[];\n asks: EngineServerPriceTickLiquidity[];\n}\n\nexport interface EngineServerSubaccountOrders {\n sender: string;\n product_id: number;\n orders: EngineServerOrder[];\n}\n\nexport type EngineServerSubaccountOrdersResponse = EngineServerSubaccountOrders;\n\nexport interface EngineServerProductOrdersResponse {\n sender: string;\n product_orders: EngineServerSubaccountOrders[];\n}\n\nexport interface EngineServerFeeRatesResponse {\n liquidation_sequencer_fee: string;\n health_check_sequencer_fee: string;\n taker_sequencer_fee: string;\n // Product ID is the index\n withdraw_sequencer_fees: string[];\n taker_fee_rates_x18: string[];\n maker_fee_rates_x18: string[];\n}\n\nexport interface EngineServerMarketPrice {\n product_id: number;\n bid_x18: string;\n ask_x18: string;\n}\n\nexport type EngineServerMarketPriceResponse = EngineServerMarketPrice;\n\nexport interface EngineServerMarketPricesResponse {\n market_prices: EngineServerMarketPrice[];\n}\n\nexport interface EngineServerOrder {\n product_id: number;\n sender: string;\n price_x18: string;\n amount: string;\n expiration: string;\n nonce: string;\n unfilled_amount: string;\n digest: string;\n placed_at: number;\n order_type: string;\n margin: string | null;\n}\n\nexport type EngineServerOrderResponse = EngineServerOrder;\n\nexport interface EngineServerValidateOrderResponse {\n product_id: number;\n order: string;\n valid: boolean;\n}\n\nexport interface EngineServerMaxOrderSizeResponse {\n max_order_size: string;\n}\n\nexport interface EngineServerMaxWithdrawableResponse {\n max_withdrawable: string;\n}\n\nexport type EngineServerTimeResponse = number;\n\nexport interface EngineServerIpBlockResponse {\n blocked: boolean;\n reason: string;\n}\n\nexport interface EngineServerLinkedSignerResponse {\n linked_signer: string;\n}\n\nexport interface EngineInsuranceResponse {\n insurance: string;\n}\n\nexport interface EngineServerMinDepositRate {\n product_id: number;\n min_deposit_rate_x18: string;\n}\n\nexport interface EngineServerMinDepositRatesResponse {\n // product_id -> EngineServerMinDepositRate\n min_deposit_rates: Record<number, EngineServerMinDepositRate>;\n}\n\nexport interface EngineServerEdgeAllProductsResponse {\n // chain_id -> EngineServerAllProductsResponse\n edge_all_products: Record<number, EngineServerAllProductsResponse>;\n}\n\nexport interface EngineServerMaxMintNlpResponse {\n max_quote_amount: string;\n}\n\nexport interface EngineServerQueryResponseByType {\n all_products: EngineServerAllProductsResponse;\n contracts: EngineServerContractsResponse;\n edge_all_products: EngineServerEdgeAllProductsResponse;\n fee_rates: EngineServerFeeRatesResponse;\n health_groups: EngineServerHealthGroupsResponse;\n insurance: EngineInsuranceResponse;\n isolated_positions: EngineServerIsolatedPositionsResponse;\n linked_signer: EngineServerLinkedSignerResponse;\n market_liquidity: EngineServerMarketLiquidityResponse;\n market_price: EngineServerMarketPriceResponse;\n market_prices: EngineServerMarketPricesResponse;\n max_nlp_mintable: EngineServerMaxMintNlpResponse;\n max_order_size: EngineServerMaxOrderSizeResponse;\n max_withdrawable: EngineServerMaxWithdrawableResponse;\n min_deposit_rates: EngineServerMinDepositRatesResponse;\n nonces: EngineServerNoncesResponse;\n order: EngineServerOrderResponse;\n orders: EngineServerProductOrdersResponse;\n status: EngineServerStatusResponse;\n subaccount_info: EngineServerSubaccountInfoResponse;\n subaccount_orders: EngineServerSubaccountOrdersResponse;\n symbols: EngineServerSymbolsResponse;\n validate_order: EngineServerValidateOrderResponse;\n}\n\nexport interface EngineServerQuerySuccessResponse<\n TQueryType extends\n keyof EngineServerQueryResponseByType = EngineServerQueryRequestType,\n> {\n status: 'success';\n data: EngineServerQueryResponseByType[TQueryType];\n}\n\nexport interface EngineServerQueryFailureResponse {\n status: 'failure';\n error: string;\n error_code: number;\n}\n\nexport type EngineServerQueryResponse<\n TQueryType extends\n keyof EngineServerQueryResponseByType = EngineServerQueryRequestType,\n> =\n | EngineServerQuerySuccessResponse<TQueryType>\n | EngineServerQueryFailureResponse;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -67,7 +67,7 @@ interface EngineServerMaxOrderSizeQueryParams {
|
|
|
67
67
|
interface EngineServerLinkedSignerParams {
|
|
68
68
|
subaccount: string;
|
|
69
69
|
}
|
|
70
|
-
interface
|
|
70
|
+
interface EngineServerMaxMintNlpQueryParams {
|
|
71
71
|
sender: string;
|
|
72
72
|
spot_leverage: string | null;
|
|
73
73
|
}
|
|
@@ -83,7 +83,7 @@ interface EngineServerQueryRequestByType {
|
|
|
83
83
|
market_liquidity: EngineServerMarketLiquidityQueryParams;
|
|
84
84
|
market_price: EngineServerMarketPriceQueryParams;
|
|
85
85
|
market_prices: EngineServerMarketPricesQueryParams;
|
|
86
|
-
|
|
86
|
+
max_nlp_mintable: EngineServerMaxMintNlpQueryParams;
|
|
87
87
|
max_order_size: EngineServerMaxOrderSizeQueryParams;
|
|
88
88
|
max_withdrawable: EngineServerMaxWithdrawableQueryParams;
|
|
89
89
|
min_deposit_rates: Record<string, never>;
|
|
@@ -250,7 +250,7 @@ interface EngineServerMinDepositRatesResponse {
|
|
|
250
250
|
interface EngineServerEdgeAllProductsResponse {
|
|
251
251
|
edge_all_products: Record<number, EngineServerAllProductsResponse>;
|
|
252
252
|
}
|
|
253
|
-
interface
|
|
253
|
+
interface EngineServerMaxMintNlpResponse {
|
|
254
254
|
max_quote_amount: string;
|
|
255
255
|
}
|
|
256
256
|
interface EngineServerQueryResponseByType {
|
|
@@ -265,7 +265,7 @@ interface EngineServerQueryResponseByType {
|
|
|
265
265
|
market_liquidity: EngineServerMarketLiquidityResponse;
|
|
266
266
|
market_price: EngineServerMarketPriceResponse;
|
|
267
267
|
market_prices: EngineServerMarketPricesResponse;
|
|
268
|
-
|
|
268
|
+
max_nlp_mintable: EngineServerMaxMintNlpResponse;
|
|
269
269
|
max_order_size: EngineServerMaxOrderSizeResponse;
|
|
270
270
|
max_withdrawable: EngineServerMaxWithdrawableResponse;
|
|
271
271
|
min_deposit_rates: EngineServerMinDepositRatesResponse;
|
|
@@ -289,4 +289,4 @@ interface EngineServerQueryFailureResponse {
|
|
|
289
289
|
}
|
|
290
290
|
type EngineServerQueryResponse<TQueryType extends keyof EngineServerQueryResponseByType = EngineServerQueryRequestType> = EngineServerQuerySuccessResponse<TQueryType> | EngineServerQueryFailureResponse;
|
|
291
291
|
|
|
292
|
-
export type { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse,
|
|
292
|
+
export type { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse, EngineServerMaxMintNlpQueryParams, EngineServerMaxMintNlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerMinDepositRate, EngineServerMinDepositRatesResponse, EngineServerNoncesParams, EngineServerNoncesResponse, EngineServerOrder, EngineServerOrderResponse, EngineServerOrdersQueryParams, EngineServerPriceTickLiquidity, EngineServerProductOrdersResponse, EngineServerQueryFailureResponse, EngineServerQueryRequest, EngineServerQueryRequestByType, EngineServerQueryRequestType, EngineServerQueryResponse, EngineServerQueryResponseByType, EngineServerQuerySuccessResponse, EngineServerStatusResponse, EngineServerSubaccountFeeRatesParams, EngineServerSubaccountInfoQueryParams, EngineServerSubaccountInfoResponse, EngineServerSubaccountOrders, EngineServerSubaccountOrdersQueryParams, EngineServerSubaccountOrdersResponse, EngineServerSymbol, EngineServerSymbolsQueryParams, EngineServerSymbolsResponse, EngineServerTimeResponse, EngineServerValidateOrderQueryParams, EngineServerValidateOrderResponse };
|
|
@@ -67,7 +67,7 @@ interface EngineServerMaxOrderSizeQueryParams {
|
|
|
67
67
|
interface EngineServerLinkedSignerParams {
|
|
68
68
|
subaccount: string;
|
|
69
69
|
}
|
|
70
|
-
interface
|
|
70
|
+
interface EngineServerMaxMintNlpQueryParams {
|
|
71
71
|
sender: string;
|
|
72
72
|
spot_leverage: string | null;
|
|
73
73
|
}
|
|
@@ -83,7 +83,7 @@ interface EngineServerQueryRequestByType {
|
|
|
83
83
|
market_liquidity: EngineServerMarketLiquidityQueryParams;
|
|
84
84
|
market_price: EngineServerMarketPriceQueryParams;
|
|
85
85
|
market_prices: EngineServerMarketPricesQueryParams;
|
|
86
|
-
|
|
86
|
+
max_nlp_mintable: EngineServerMaxMintNlpQueryParams;
|
|
87
87
|
max_order_size: EngineServerMaxOrderSizeQueryParams;
|
|
88
88
|
max_withdrawable: EngineServerMaxWithdrawableQueryParams;
|
|
89
89
|
min_deposit_rates: Record<string, never>;
|
|
@@ -250,7 +250,7 @@ interface EngineServerMinDepositRatesResponse {
|
|
|
250
250
|
interface EngineServerEdgeAllProductsResponse {
|
|
251
251
|
edge_all_products: Record<number, EngineServerAllProductsResponse>;
|
|
252
252
|
}
|
|
253
|
-
interface
|
|
253
|
+
interface EngineServerMaxMintNlpResponse {
|
|
254
254
|
max_quote_amount: string;
|
|
255
255
|
}
|
|
256
256
|
interface EngineServerQueryResponseByType {
|
|
@@ -265,7 +265,7 @@ interface EngineServerQueryResponseByType {
|
|
|
265
265
|
market_liquidity: EngineServerMarketLiquidityResponse;
|
|
266
266
|
market_price: EngineServerMarketPriceResponse;
|
|
267
267
|
market_prices: EngineServerMarketPricesResponse;
|
|
268
|
-
|
|
268
|
+
max_nlp_mintable: EngineServerMaxMintNlpResponse;
|
|
269
269
|
max_order_size: EngineServerMaxOrderSizeResponse;
|
|
270
270
|
max_withdrawable: EngineServerMaxWithdrawableResponse;
|
|
271
271
|
min_deposit_rates: EngineServerMinDepositRatesResponse;
|
|
@@ -289,4 +289,4 @@ interface EngineServerQueryFailureResponse {
|
|
|
289
289
|
}
|
|
290
290
|
type EngineServerQueryResponse<TQueryType extends keyof EngineServerQueryResponseByType = EngineServerQueryRequestType> = EngineServerQuerySuccessResponse<TQueryType> | EngineServerQueryFailureResponse;
|
|
291
291
|
|
|
292
|
-
export type { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse,
|
|
292
|
+
export type { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse, EngineServerMaxMintNlpQueryParams, EngineServerMaxMintNlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerMinDepositRate, EngineServerMinDepositRatesResponse, EngineServerNoncesParams, EngineServerNoncesResponse, EngineServerOrder, EngineServerOrderResponse, EngineServerOrdersQueryParams, EngineServerPriceTickLiquidity, EngineServerProductOrdersResponse, EngineServerQueryFailureResponse, EngineServerQueryRequest, EngineServerQueryRequestByType, EngineServerQueryRequestType, EngineServerQueryResponse, EngineServerQueryResponseByType, EngineServerQuerySuccessResponse, EngineServerStatusResponse, EngineServerSubaccountFeeRatesParams, EngineServerSubaccountInfoQueryParams, EngineServerSubaccountInfoResponse, EngineServerSubaccountOrders, EngineServerSubaccountOrdersQueryParams, EngineServerSubaccountOrdersResponse, EngineServerSymbol, EngineServerSymbolsQueryParams, EngineServerSymbolsResponse, EngineServerTimeResponse, EngineServerValidateOrderQueryParams, EngineServerValidateOrderResponse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadohq/engine-client",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "> TODO: description",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@nadohq/contracts": "^0.1.0-alpha.
|
|
41
|
-
"@nadohq/utils": "^0.1.0-alpha.
|
|
40
|
+
"@nadohq/contracts": "^0.1.0-alpha.2",
|
|
41
|
+
"@nadohq/utils": "^0.1.0-alpha.2",
|
|
42
42
|
"axios": "*",
|
|
43
43
|
"ts-mixer": "*"
|
|
44
44
|
},
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"viem": "*"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "7ec8ff9383dc6734bb64511b87b0687438d01618"
|
|
52
52
|
}
|
|
@@ -299,19 +299,19 @@ export class EngineExecuteBuilder {
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
/**
|
|
302
|
-
* Builds server payload for the `
|
|
303
|
-
* @param clientParams Client
|
|
304
|
-
* @returns `
|
|
302
|
+
* Builds server payload for the `mint_nlp` execute action.
|
|
303
|
+
* @param clientParams Client MintNlp params.
|
|
304
|
+
* @returns `mint_nlp` payload
|
|
305
305
|
*/
|
|
306
|
-
async
|
|
307
|
-
clientParams: EngineExecuteRequestParamsByType['
|
|
308
|
-
): Promise<EngineServerExecuteRequestByType['
|
|
306
|
+
async buildMintNlpPayload(
|
|
307
|
+
clientParams: EngineExecuteRequestParamsByType['mint_nlp'],
|
|
308
|
+
): Promise<EngineServerExecuteRequestByType['mint_nlp']> {
|
|
309
309
|
const nonce = await this.getTxNonceIfNeeded(clientParams);
|
|
310
310
|
const paramsWithNonce = { ...clientParams, nonce };
|
|
311
311
|
|
|
312
|
-
const tx = getNadoEIP712Values('
|
|
312
|
+
const tx = getNadoEIP712Values('mint_nlp', paramsWithNonce);
|
|
313
313
|
const signature = await this.getSignatureIfNeeded(
|
|
314
|
-
'
|
|
314
|
+
'mint_nlp',
|
|
315
315
|
paramsWithNonce,
|
|
316
316
|
);
|
|
317
317
|
|
|
@@ -323,19 +323,19 @@ export class EngineExecuteBuilder {
|
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
/**
|
|
326
|
-
* Builds server payload for the `
|
|
327
|
-
* @param clientParams Client
|
|
328
|
-
* @returns `
|
|
326
|
+
* Builds server payload for the `burn_nlp` execute action.
|
|
327
|
+
* @param clientParams Client BurnNlp params.
|
|
328
|
+
* @returns `burn_nlp` payload
|
|
329
329
|
*/
|
|
330
|
-
async
|
|
331
|
-
clientParams: EngineExecuteRequestParamsByType['
|
|
332
|
-
): Promise<EngineServerExecuteRequestByType['
|
|
330
|
+
async buildBurnNlpPayload(
|
|
331
|
+
clientParams: EngineExecuteRequestParamsByType['burn_nlp'],
|
|
332
|
+
): Promise<EngineServerExecuteRequestByType['burn_nlp']> {
|
|
333
333
|
const nonce = await this.getTxNonceIfNeeded(clientParams);
|
|
334
334
|
const paramsWithNonce = { ...clientParams, nonce };
|
|
335
335
|
|
|
336
|
-
const tx = getNadoEIP712Values('
|
|
336
|
+
const tx = getNadoEIP712Values('burn_nlp', paramsWithNonce);
|
|
337
337
|
const signature = await this.getSignatureIfNeeded(
|
|
338
|
-
'
|
|
338
|
+
'burn_nlp',
|
|
339
339
|
paramsWithNonce,
|
|
340
340
|
);
|
|
341
341
|
|
|
@@ -106,17 +106,17 @@ export class EngineExecuteClient extends EngineBaseClient {
|
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
async
|
|
109
|
+
async mintNlp(params: EngineExecuteRequestParamsByType['mint_nlp']) {
|
|
110
110
|
return this.execute(
|
|
111
|
-
'
|
|
112
|
-
await this.payloadBuilder.
|
|
111
|
+
'mint_nlp',
|
|
112
|
+
await this.payloadBuilder.buildMintNlpPayload(params),
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
async
|
|
116
|
+
async burnNlp(params: EngineExecuteRequestParamsByType['burn_nlp']) {
|
|
117
117
|
return this.execute(
|
|
118
|
-
'
|
|
119
|
-
await this.payloadBuilder.
|
|
118
|
+
'burn_nlp',
|
|
119
|
+
await this.payloadBuilder.buildBurnNlpPayload(params),
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
122
|
}
|
package/src/EngineQueryClient.ts
CHANGED
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
GetEngineMarketPriceResponse,
|
|
32
32
|
GetEngineMarketPricesParams,
|
|
33
33
|
GetEngineMarketPricesResponse,
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
GetEngineMaxMintNlpAmountParams,
|
|
35
|
+
GetEngineMaxMintNlpAmountResponse,
|
|
36
36
|
GetEngineMaxOrderSizeParams,
|
|
37
37
|
GetEngineMaxOrderSizeResponse,
|
|
38
38
|
GetEngineMaxWithdrawableParams,
|
|
@@ -492,14 +492,14 @@ export class EngineQueryClient extends EngineBaseClient {
|
|
|
492
492
|
}
|
|
493
493
|
|
|
494
494
|
/**
|
|
495
|
-
* Retrieves the estimated max quote amount for minting
|
|
495
|
+
* Retrieves the estimated max quote amount for minting NLP.
|
|
496
496
|
*
|
|
497
497
|
* @param params
|
|
498
498
|
*/
|
|
499
|
-
async
|
|
500
|
-
params:
|
|
501
|
-
): Promise<
|
|
502
|
-
const baseResponse = await this.query('
|
|
499
|
+
async getMaxMintNlpAmount(
|
|
500
|
+
params: GetEngineMaxMintNlpAmountParams,
|
|
501
|
+
): Promise<GetEngineMaxMintNlpAmountResponse> {
|
|
502
|
+
const baseResponse = await this.query('max_nlp_mintable', {
|
|
503
503
|
sender: subaccountToHex({
|
|
504
504
|
subaccountOwner: params.subaccountOwner,
|
|
505
505
|
subaccountName: params.subaccountName,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
EIP712BurnNlpParams,
|
|
3
3
|
EIP712CancelOrdersParams,
|
|
4
4
|
EIP712CancelProductOrdersParams,
|
|
5
5
|
EIP712IsolatedOrderParams,
|
|
6
6
|
EIP712LinkSignerParams,
|
|
7
7
|
EIP712LiquidateSubaccountParams,
|
|
8
|
-
|
|
8
|
+
EIP712MintNlpParams,
|
|
9
9
|
EIP712OrderParams,
|
|
10
10
|
EIP712TransferQuoteParams,
|
|
11
11
|
EIP712WithdrawCollateralParams,
|
|
@@ -86,21 +86,21 @@ export type EngineLinkSignerParams =
|
|
|
86
86
|
export type EngineTransferQuoteParams =
|
|
87
87
|
WithBaseEngineExecuteParams<EIP712TransferQuoteParams>;
|
|
88
88
|
|
|
89
|
-
export type
|
|
90
|
-
WithSpotLeverage<
|
|
89
|
+
export type EngineMintNlpParams = WithBaseEngineExecuteParams<
|
|
90
|
+
WithSpotLeverage<EIP712MintNlpParams>
|
|
91
91
|
>;
|
|
92
92
|
|
|
93
|
-
export type
|
|
94
|
-
WithBaseEngineExecuteParams<
|
|
93
|
+
export type EngineBurnNlpParams =
|
|
94
|
+
WithBaseEngineExecuteParams<EIP712BurnNlpParams>;
|
|
95
95
|
|
|
96
96
|
export interface EngineExecuteRequestParamsByType {
|
|
97
|
-
|
|
97
|
+
burn_nlp: EngineBurnNlpParams;
|
|
98
98
|
cancel_and_place: EngineCancelAndPlaceParams;
|
|
99
99
|
cancel_orders: EngineCancelOrdersParams;
|
|
100
100
|
cancel_product_orders: EngineCancelProductOrdersParams;
|
|
101
101
|
link_signer: EngineLinkSignerParams;
|
|
102
102
|
liquidate_subaccount: EngineLiquidateSubaccountParams;
|
|
103
|
-
|
|
103
|
+
mint_nlp: EngineMintNlpParams;
|
|
104
104
|
place_isolated_order: EnginePlaceIsolatedOrderParams;
|
|
105
105
|
place_order: EnginePlaceOrderParams;
|
|
106
106
|
transfer_quote: EngineTransferQuoteParams;
|
|
@@ -259,9 +259,9 @@ export interface GetEngineMinDepositRatesResponse {
|
|
|
259
259
|
*/
|
|
260
260
|
export type GetEngineIpBlockStatusResponse = 'query_only' | 'blocked' | null;
|
|
261
261
|
|
|
262
|
-
export interface
|
|
262
|
+
export interface GetEngineMaxMintNlpAmountParams extends Subaccount {
|
|
263
263
|
// If not given, engine defaults to true (leverage/borrow enabled)
|
|
264
264
|
spotLeverage?: boolean;
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
export type
|
|
267
|
+
export type GetEngineMaxMintNlpAmountResponse = BigDecimal;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
EIP712BurnNlpValues,
|
|
3
3
|
EIP712IsolatedOrderParams,
|
|
4
4
|
EIP712LinkSignerValues,
|
|
5
5
|
EIP712LiquidateSubaccountValues,
|
|
6
|
-
|
|
6
|
+
EIP712MintNlpValues,
|
|
7
7
|
EIP712OrderCancellationValues,
|
|
8
8
|
EIP712OrderParams,
|
|
9
9
|
EIP712OrderValues,
|
|
@@ -23,13 +23,13 @@ export interface EngineServerCancelOrdersResponse {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface EngineServerExecuteResponseDataByType {
|
|
26
|
-
|
|
26
|
+
burn_nlp: null;
|
|
27
27
|
cancel_and_place: EngineServerPlaceOrderResponse;
|
|
28
28
|
cancel_orders: EngineServerCancelOrdersResponse;
|
|
29
29
|
cancel_product_orders: EngineServerCancelOrdersResponse;
|
|
30
30
|
link_signer: null;
|
|
31
31
|
liquidate_subaccount: null;
|
|
32
|
-
|
|
32
|
+
mint_nlp: null;
|
|
33
33
|
place_isolated_order: EngineServerPlaceOrderResponse;
|
|
34
34
|
place_order: EngineServerPlaceOrderResponse;
|
|
35
35
|
transfer_quote: null;
|
|
@@ -104,7 +104,7 @@ type WithSpotLeverage<T> = T & {
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
export interface EngineServerExecuteRequestByType {
|
|
107
|
-
|
|
107
|
+
burn_nlp: SignedTx<EIP712BurnNlpValues>;
|
|
108
108
|
cancel_and_place: EngineServiceCancelAndPlaceParams;
|
|
109
109
|
cancel_orders: EngineServerCancelOrdersParams;
|
|
110
110
|
cancel_product_orders: SignedTx<
|
|
@@ -115,7 +115,7 @@ export interface EngineServerExecuteRequestByType {
|
|
|
115
115
|
>;
|
|
116
116
|
link_signer: SignedTx<EIP712LinkSignerValues>;
|
|
117
117
|
liquidate_subaccount: SignedTx<EIP712LiquidateSubaccountValues>;
|
|
118
|
-
|
|
118
|
+
mint_nlp: WithSpotLeverage<SignedTx<EIP712MintNlpValues>>;
|
|
119
119
|
place_isolated_order: EngineServerPlaceIsolatedOrderParams;
|
|
120
120
|
place_order: EngineServerPlaceOrderParams;
|
|
121
121
|
transfer_quote: SignedTx<EIP712TransferQuoteValues>;
|
|
@@ -95,7 +95,7 @@ export interface EngineServerLinkedSignerParams {
|
|
|
95
95
|
subaccount: string;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
export interface
|
|
98
|
+
export interface EngineServerMaxMintNlpQueryParams {
|
|
99
99
|
sender: string;
|
|
100
100
|
// If not given, engine defaults to true (leverage/borrow enabled)
|
|
101
101
|
spot_leverage: string | null;
|
|
@@ -113,7 +113,7 @@ export interface EngineServerQueryRequestByType {
|
|
|
113
113
|
market_liquidity: EngineServerMarketLiquidityQueryParams;
|
|
114
114
|
market_price: EngineServerMarketPriceQueryParams;
|
|
115
115
|
market_prices: EngineServerMarketPricesQueryParams;
|
|
116
|
-
|
|
116
|
+
max_nlp_mintable: EngineServerMaxMintNlpQueryParams;
|
|
117
117
|
max_order_size: EngineServerMaxOrderSizeQueryParams;
|
|
118
118
|
max_withdrawable: EngineServerMaxWithdrawableQueryParams;
|
|
119
119
|
min_deposit_rates: Record<string, never>;
|
|
@@ -330,7 +330,7 @@ export interface EngineServerEdgeAllProductsResponse {
|
|
|
330
330
|
edge_all_products: Record<number, EngineServerAllProductsResponse>;
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
export interface
|
|
333
|
+
export interface EngineServerMaxMintNlpResponse {
|
|
334
334
|
max_quote_amount: string;
|
|
335
335
|
}
|
|
336
336
|
|
|
@@ -346,7 +346,7 @@ export interface EngineServerQueryResponseByType {
|
|
|
346
346
|
market_liquidity: EngineServerMarketLiquidityResponse;
|
|
347
347
|
market_price: EngineServerMarketPriceResponse;
|
|
348
348
|
market_prices: EngineServerMarketPricesResponse;
|
|
349
|
-
|
|
349
|
+
max_nlp_mintable: EngineServerMaxMintNlpResponse;
|
|
350
350
|
max_order_size: EngineServerMaxOrderSizeResponse;
|
|
351
351
|
max_withdrawable: EngineServerMaxWithdrawableResponse;
|
|
352
352
|
min_deposit_rates: EngineServerMinDepositRatesResponse;
|