Skip to content

Commit 1b2bc82

Browse files
committed
feat: update api according to docs
1 parent 9471148 commit 1b2bc82

File tree

7 files changed

+59
-57
lines changed

7 files changed

+59
-57
lines changed

package-lock.json

Lines changed: 45 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@deltadefi-protocol/sdk",
33
"description": "The Typescript SDK for DeltaDeFi protocol",
4-
"version": "0.3.26",
4+
"version": "0.3.27",
55
"main": "./dist/index.cjs",
66
"browser": "./dist/index.js",
77
"module": "./dist/index.js",

src/client/accounts/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,24 @@ export class Accounts extends Api {
9898

9999
/**
100100
* Retrieves order records.
101+
* @param data - The order records request parameters.
101102
* @returns A promise that resolves to the order records response.
102103
*/
103104
public getOrderRecords(data: GetOrderRecordRequest): Promise<GetOrderRecordResponse> {
104105
const res = this.axiosInstance.get('/accounts/order-records', { params: data });
105106
return this.resolveAxiosData(res);
106107
}
107108

109+
/**
110+
* Retrieves a single order record by order ID.
111+
* @param orderId - The ID of the order to retrieve.
112+
* @returns A promise that resolves to the order record response.
113+
*/
114+
public getOrderRecord(orderId: string): Promise<GetOrderRecordResponse> {
115+
const res = this.axiosInstance.get(`/accounts/order/${orderId}`);
116+
return this.resolveAxiosData(res);
117+
}
118+
108119
/**
109120
* Retrieves account balance.
110121
* @returns A promise that resolves to the account balance response.

src/client/app/index.ts

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/client/markets/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class Markets extends Api {
5656
): Promise<GetAggregatedPriceResponse> {
5757
const { pair, interval, start, end } = data;
5858
const res = this.axiosInstance.get(
59-
`/market/aggregate/${pair}?interval=${interval}&start=${start || ''}&end=${end || ''}`,
59+
`/market/graph/${pair}?interval=${interval}&start=${start || ''}&end=${end || ''}`,
6060
);
6161
return this.resolveAxiosData(res);
6262
}

src/types/requests/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export type GetMarketPriceRequest = {
5454
symbol: TradingSymbol;
5555
};
5656

57-
export type Interval = '15m' | '30m' | '1h' | '1d' | '1w' | '1M';
57+
export type Interval = '5m' | '15m' | '30m' | '1h' | '1d';
5858

5959
export type GetAggregatedPriceRequest = {
6060
pair: string;

0 commit comments

Comments
 (0)