@renegade-fi/core
Advanced tools
Comparing version 0.0.0-canary-20241019210513 to 0.0.0-canary-20241019214613
@@ -10,5 +10,2 @@ import { ADMIN_OPEN_ORDERS_ROUTE } from '../constants.js'; | ||
} | ||
if (parameters.includeFillable) { | ||
url.searchParams.set('include_fillable', String(true)); | ||
} | ||
const res = await getRelayerWithAdmin(config, url.toString()); | ||
@@ -18,4 +15,4 @@ if (!res.orders) { | ||
} | ||
return new Map(res.orders.map((order) => [order.order.id, order])); | ||
return res.orders; | ||
} | ||
//# sourceMappingURL=getOpenOrders.js.map |
@@ -7,3 +7,7 @@ import { ADMIN_ORDER_METADATA_ROUTE } from '../constants.js'; | ||
const { getRelayerBaseUrl } = config; | ||
const res = await getRelayerWithAdmin(config, getRelayerBaseUrl(ADMIN_ORDER_METADATA_ROUTE(id))); | ||
const url = new URL(getRelayerBaseUrl(ADMIN_ORDER_METADATA_ROUTE(id))); | ||
if (parameters.includeFillable) { | ||
url.searchParams.set('include_fillable', String(true)); | ||
} | ||
const res = await getRelayerWithAdmin(config, url.toString()); | ||
if (!res.order) { | ||
@@ -10,0 +14,0 @@ throw new BaseError('No order found'); |
import type { Config } from '../createConfig.js'; | ||
import { type BaseErrorType } from '../errors/base.js'; | ||
import type { OpenOrder } from '../types/order.js'; | ||
export type GetOpenOrdersParams = { | ||
matchingPool?: string; | ||
includeFillable?: boolean; | ||
}; | ||
export type GetOpenOrdersReturnType = Map<string, OpenOrder>; | ||
export type GetOpenOrdersReturnType = string[]; | ||
export type GetOpenOrdersErrorType = BaseErrorType; | ||
export declare function getOpenOrders(config: Config, parameters?: GetOpenOrdersParams): Promise<GetOpenOrdersReturnType>; | ||
//# sourceMappingURL=getOpenOrders.d.ts.map |
import type { Config } from '../createConfig.js'; | ||
import { type BaseErrorType } from '../errors/base.js'; | ||
import type { OrderMetadata } from '../types/order.js'; | ||
import type { AdminOrderMetadata } from '../types/order.js'; | ||
export type GetOrderMetadataParameters = { | ||
id: string; | ||
includeFillable?: boolean; | ||
}; | ||
export type GetOrderMetadataReturnType = OrderMetadata; | ||
export type GetOrderMetadataReturnType = AdminOrderMetadata; | ||
export type GetOrderMetadataErrorType = BaseErrorType; | ||
export declare function getOrderMetadata(config: Config, parameters: GetOrderMetadataParameters): Promise<GetOrderMetadataReturnType>; | ||
//# sourceMappingURL=getOrderMetadata.d.ts.map |
@@ -10,3 +10,2 @@ import { type GetOpenOrdersParams, type GetOpenOrdersReturnType } from '../actions/getOpenOrders.js'; | ||
matchingPool?: string | undefined; | ||
includeFillable?: boolean | undefined; | ||
scopeKey?: string | undefined; | ||
@@ -21,3 +20,2 @@ }]; | ||
matchingPool?: string | undefined; | ||
includeFillable?: boolean | undefined; | ||
scopeKey?: string | undefined; | ||
@@ -30,3 +28,2 @@ }]; | ||
matchingPool?: string | undefined; | ||
includeFillable?: boolean | undefined; | ||
scopeKey?: string | undefined; | ||
@@ -33,0 +30,0 @@ }]; |
@@ -10,2 +10,3 @@ import { type GetOrderMetadataParameters, type GetOrderMetadataReturnType } from '../actions/getOrderMetadata.js'; | ||
id: string; | ||
includeFillable?: boolean | undefined; | ||
scopeKey?: string | undefined; | ||
@@ -17,5 +18,6 @@ }]; | ||
direction?: unknown; | ||
}) => Promise<import("../types/order.js").OrderMetadata>; | ||
}) => Promise<import("../types/order.js").AdminOrderMetadata>; | ||
readonly queryKey: readonly ["order-metadata", { | ||
id: string; | ||
includeFillable?: boolean | undefined; | ||
scopeKey?: string | undefined; | ||
@@ -28,2 +30,3 @@ }]; | ||
id: string; | ||
includeFillable?: boolean | undefined; | ||
scopeKey?: string | undefined; | ||
@@ -30,0 +33,0 @@ }]; |
@@ -34,3 +34,3 @@ export type Order = { | ||
}; | ||
export type OpenOrder = { | ||
export type AdminOrderMetadata = { | ||
order: OrderMetadata; | ||
@@ -37,0 +37,0 @@ wallet_id: string; |
{ | ||
"name": "@renegade-fi/core", | ||
"description": "VanillaJS library for Renegade", | ||
"version": "0.0.0-canary-20241019210513", | ||
"version": "0.0.0-canary-20241019214613", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
import { ADMIN_OPEN_ORDERS_ROUTE } from '../constants.js' | ||
import type { Config } from '../createConfig.js' | ||
import { BaseError, type BaseErrorType } from '../errors/base.js' | ||
import type { OpenOrder } from '../types/order.js' | ||
import { getRelayerWithAdmin } from '../utils/http.js' | ||
@@ -9,6 +8,5 @@ | ||
matchingPool?: string | ||
includeFillable?: boolean | ||
} | ||
export type GetOpenOrdersReturnType = Map<string, OpenOrder> | ||
export type GetOpenOrdersReturnType = string[] | ||
@@ -29,6 +27,2 @@ export type GetOpenOrdersErrorType = BaseErrorType | ||
if (parameters.includeFillable) { | ||
url.searchParams.set('include_fillable', String(true)) | ||
} | ||
const res = await getRelayerWithAdmin(config, url.toString()) | ||
@@ -39,3 +33,3 @@ | ||
} | ||
return new Map(res.orders.map((order: OpenOrder) => [order.order.id, order])) | ||
return res.orders | ||
} |
import { ADMIN_ORDER_METADATA_ROUTE } from '../constants.js' | ||
import type { Config } from '../createConfig.js' | ||
import { BaseError, type BaseErrorType } from '../errors/base.js' | ||
import type { OrderMetadata } from '../types/order.js' | ||
import type { AdminOrderMetadata } from '../types/order.js' | ||
import { getRelayerWithAdmin } from '../utils/http.js' | ||
export type GetOrderMetadataParameters = { id: string } | ||
export type GetOrderMetadataParameters = { | ||
id: string | ||
includeFillable?: boolean | ||
} | ||
export type GetOrderMetadataReturnType = OrderMetadata | ||
export type GetOrderMetadataReturnType = AdminOrderMetadata | ||
@@ -20,7 +23,10 @@ export type GetOrderMetadataErrorType = BaseErrorType | ||
const res = await getRelayerWithAdmin( | ||
config, | ||
getRelayerBaseUrl(ADMIN_ORDER_METADATA_ROUTE(id)), | ||
) | ||
const url = new URL(getRelayerBaseUrl(ADMIN_ORDER_METADATA_ROUTE(id))) | ||
if (parameters.includeFillable) { | ||
url.searchParams.set('include_fillable', String(true)) | ||
} | ||
const res = await getRelayerWithAdmin(config, url.toString()) | ||
if (!res.order) { | ||
@@ -27,0 +33,0 @@ throw new BaseError('No order found') |
@@ -43,3 +43,3 @@ export type Order = { | ||
export type OpenOrder = { | ||
export type AdminOrderMetadata = { | ||
order: OrderMetadata | ||
@@ -46,0 +46,0 @@ wallet_id: string |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
705949
7783