@reyaxyz/api-sdk 0.9.0 → 0.10.0
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/clients/modules/markets.js +1 -1
- package/dist/clients/modules/markets.js.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/types/clients/modules/markets.d.ts +1 -1
- package/dist/types/clients/modules/markets.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/clients/modules/markets.ts +2 -2
- package/src/index.ts +1 -0
|
@@ -83,7 +83,7 @@ var MarketsClient = /** @class */ (function (_super) {
|
|
|
83
83
|
var uri;
|
|
84
84
|
return __generator(this, function (_a) {
|
|
85
85
|
uri = '/api/markets';
|
|
86
|
-
return [2 /*return*/, this.get(uri, { id: params.id })];
|
|
86
|
+
return [2 /*return*/, this.get(uri, { id: params === null || params === void 0 ? void 0 : params.id })];
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markets.js","sourceRoot":"/","sources":["clients/modules/markets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,gDAAgC;AAEhC;IAA2C,iCAAU;IAArD;;IAoEA,CAAC;IAnEC;;;;;;;;;;;;;;;;;OAiBG;IAEG,kCAAU,GAAhB,UAAiB,
|
|
1
|
+
{"version":3,"file":"markets.js","sourceRoot":"/","sources":["clients/modules/markets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,gDAAgC;AAEhC;IAA2C,iCAAU;IAArD;;IAoEA,CAAC;IAnEC;;;;;;;;;;;;;;;;;OAiBG;IAEG,kCAAU,GAAhB,UAAiB,MAAyB;;;;gBAClC,GAAG,GAAG,cAAc,CAAC;gBAC3B,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,EAAE,CAAC,EAAC;;;KAC1C;IAED;;;;;;;;;;;;;;;;OAgBG;IAEG,wCAAgB,GAAtB,UACE,QAA4B,EAC5B,UAA6B,EAC7B,OAAuB,EACvB,KAAqB,EACrB,KAAqB;;;;gBAEf,GAAG,GAAG,+BAAwB,QAAQ,CAAE,CAAC;gBAC/C,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,UAAU,YAAA;wBACV,OAAO,SAAA;wBACP,KAAK,OAAA;wBACL,KAAK,OAAA;qBACN,CAAC,EAAC;;;KACJ;IAEK,gDAAwB,GAA9B,UACE,QAAgB,EAChB,KAAqB;;;;gBAEf,GAAG,GAAG,sBAAe,QAAQ,CAAE,CAAC;gBACtC,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,KAAK,OAAA;qBACN,CAAC,EAAC;;;KACJ;IACH,oBAAC;AAAD,CAAC,AApED,CAA2C,cAAU,GAoEpD","sourcesContent":["import {\n CandlesResolution,\n GetMarketsParams,\n MarketCandlesResponse,\n MarketEntity,\n TradesResponse,\n} from '../types';\nimport RestClient from './rest';\n\nexport default class MarketsClient extends RestClient {\n /**\n * Asynchronously retrieves market data from the API.\n *\n * This method makes a request to the API to fetch data for markets. If a specific market is provided as a parameter,\n * it fetches data for that particular market; otherwise, it fetches data for all available markets.\n *\n * @param {GetMarketsParams} [params] - The specific market ticker identifier for which data is requested. This parameter is optional.\n * @returns {Promise<MarketEntity[]>} A promise that resolves to the response containing market data.\n * @memberof MarketsClient\n *\n * @example\n * // Fetch data for all markets\n * const allMarketsData = await market.getMarkets();\n *\n * @example\n * // Fetch data for a specific market\n * const specificMarketData = await market.getMarkets('ETH-USDC');\n */\n\n async getMarkets(params?: GetMarketsParams): Promise<MarketEntity[]> {\n const uri = '/api/markets';\n return this.get(uri, { id: params?.id });\n }\n\n /**\n * Retrieves candlestick data for a specified market.\n *\n * This method fetches historical candlestick (or OHLC - Open, High, Low, Close) data for a given market.\n * The data can be filtered by time range (fromISO and toISO) and resolution.\n *\n * @param {number} marketId - The market identifier for which candlestick data is to be retrieved.\n * @param {CandlesResolution} resolution - The granularity of the candlestick data (e.g., '1MIN', '5MIN', '1HR').\n * @param {string|null} [fromISO] - The start time for the range of candlestick data in ISO 8601 format. Optional.\n * @param {string|null} [toISO] - The end time for the range of candlestick data in ISO 8601 format. Optional.\n * @param {number|null} [limit] - The maximum number of candlestick data points to retrieve. Optional.\n * @returns {Promise<MarketCandlesResponse>} A promise that resolves to the market candlestick data.\n * @memberof MarketsClient\n *\n * @example\n * const marketCandles = await market.getMarketCandles('BTC-USD', '1HR', '2023-01-01T00:00:00Z', '2023-01-02T00:00:00Z');\n */\n\n async getMarketCandles(\n marketId: MarketEntity['id'],\n resolution: CandlesResolution,\n fromISO?: string | null,\n toISO?: string | null,\n limit?: number | null,\n ): Promise<MarketCandlesResponse> {\n const uri = `/api/markets/candles/${marketId}`;\n return this.get(uri, {\n resolution,\n fromISO,\n toISO,\n limit,\n });\n }\n\n async getPerpetualMarketTrades(\n marketId: number,\n limit?: number | null,\n ): Promise<TradesResponse> {\n const uri = `/api/trades/${marketId}`;\n return this.get(uri, {\n limit,\n });\n }\n}\n"]}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.ApiClient = void 0;
|
|
4
18
|
var api_client_1 = require("./clients/api-client");
|
|
5
19
|
Object.defineProperty(exports, "ApiClient", { enumerable: true, get: function () { return api_client_1.ApiClient; } });
|
|
20
|
+
__exportStar(require("./clients/types"), exports);
|
|
6
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAiD;AAAxC,uGAAA,SAAS,OAAA;AAClB,kDAAgC","sourcesContent":["export { ApiClient } from './clients/api-client';\nexport * from './clients/types';\n"]}
|
|
@@ -19,7 +19,7 @@ export default class MarketsClient extends RestClient {
|
|
|
19
19
|
* // Fetch data for a specific market
|
|
20
20
|
* const specificMarketData = await market.getMarkets('ETH-USDC');
|
|
21
21
|
*/
|
|
22
|
-
getMarkets(params
|
|
22
|
+
getMarkets(params?: GetMarketsParams): Promise<MarketEntity[]>;
|
|
23
23
|
/**
|
|
24
24
|
* Retrieves candlestick data for a specified market.
|
|
25
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markets.d.ts","sourceRoot":"/","sources":["clients/modules/markets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,UAAU,MAAM,QAAQ,CAAC;AAEhC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;IACnD;;;;;;;;;;;;;;;;;OAiBG;IAEG,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"markets.d.ts","sourceRoot":"/","sources":["clients/modules/markets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,UAAU,MAAM,QAAQ,CAAC;AAEhC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;IACnD;;;;;;;;;;;;;;;;;OAiBG;IAEG,UAAU,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAKpE;;;;;;;;;;;;;;;;OAgBG;IAEG,gBAAgB,CACpB,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,EAC5B,UAAU,EAAE,iBAAiB,EAC7B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,EACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB,OAAO,CAAC,qBAAqB,CAAC;IAU3B,wBAAwB,CAC5B,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB,OAAO,CAAC,cAAc,CAAC;CAM3B"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,cAAc,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/api-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"axios": "^1.6.2"
|
|
37
37
|
},
|
|
38
38
|
"packageManager": "pnpm@8.10.4",
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "faa38b7af7e74b04a98215efadbef38fab902665"
|
|
40
40
|
}
|
|
@@ -27,9 +27,9 @@ export default class MarketsClient extends RestClient {
|
|
|
27
27
|
* const specificMarketData = await market.getMarkets('ETH-USDC');
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
-
async getMarkets(params
|
|
30
|
+
async getMarkets(params?: GetMarketsParams): Promise<MarketEntity[]> {
|
|
31
31
|
const uri = '/api/markets';
|
|
32
|
-
return this.get(uri, { id: params
|
|
32
|
+
return this.get(uri, { id: params?.id });
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
package/src/index.ts
CHANGED