@nadohq/indexer-client 0.35.0 → 0.37.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/{IndexerBaseClient-C6VZdI3h.cjs → IndexerBaseClient-DxlRS6pt.cjs} +28 -16
- package/dist/IndexerBaseClient-DxlRS6pt.cjs.map +1 -0
- package/dist/IndexerBaseClient.cjs +1 -1
- package/dist/IndexerBaseClient.d.cts +8 -1
- package/dist/IndexerBaseClient.d.cts.map +1 -1
- package/dist/IndexerBaseClient.d.ts +8 -1
- package/dist/IndexerBaseClient.d.ts.map +1 -1
- package/dist/IndexerBaseClient.js +27 -15
- package/dist/IndexerBaseClient.js.map +1 -1
- package/dist/IndexerClient.cjs +1 -1
- package/dist/dataMappers.cjs +1 -1
- package/dist/endpoints.cjs +6 -2
- package/dist/endpoints.cjs.map +1 -1
- package/dist/endpoints.d.cts +4 -0
- package/dist/endpoints.d.cts.map +1 -1
- package/dist/endpoints.d.ts +4 -0
- package/dist/endpoints.d.ts.map +1 -1
- package/dist/endpoints.js +6 -2
- package/dist/endpoints.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/types/IndexerServerFailureError.cjs +1 -1
- package/dist/types/indexerErrorCodes.cjs +1 -1
- package/package.json +4 -4
- package/src/IndexerBaseClient.ts +41 -17
- package/src/endpoints.ts +6 -2
- package/dist/IndexerBaseClient-C6VZdI3h.cjs.map +0 -1
|
@@ -38,7 +38,9 @@ var IndexerBaseClient = class {
|
|
|
38
38
|
validateStatus: () => true,
|
|
39
39
|
headers: (0, _nadohq_shared.getNadoClientTypeHeaders)(opts.clientType)
|
|
40
40
|
});
|
|
41
|
-
this.
|
|
41
|
+
this.v1Url = `${opts.url}/v1`;
|
|
42
|
+
this.v2Url = `${opts.url}/v2`;
|
|
43
|
+
this.rewardsUrl = `${opts.url}/rewards/v1`;
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
46
|
* Sets the linked signer for execute requests
|
|
@@ -422,7 +424,7 @@ var IndexerBaseClient = class {
|
|
|
422
424
|
* @param params
|
|
423
425
|
*/
|
|
424
426
|
async getLeaderboard(params) {
|
|
425
|
-
return { participants: (await this.
|
|
427
|
+
return { participants: (await this.rewardsQuery("leaderboard", {
|
|
426
428
|
contest_id: params.contestId,
|
|
427
429
|
rank_type: params.rankType,
|
|
428
430
|
start: params.startCursor,
|
|
@@ -436,7 +438,7 @@ var IndexerBaseClient = class {
|
|
|
436
438
|
* @param params
|
|
437
439
|
*/
|
|
438
440
|
async getLeaderboardParticipant(params) {
|
|
439
|
-
return { participant: (0, _nadohq_shared.mapValues)((await this.
|
|
441
|
+
return { participant: (0, _nadohq_shared.mapValues)((await this.rewardsQuery("leaderboard_rank", {
|
|
440
442
|
subaccount: (0, _nadohq_shared.subaccountToHex)(params.subaccount),
|
|
441
443
|
contest_ids: params.contestIds
|
|
442
444
|
})).positions, (position) => require_dataMappers.mapIndexerLeaderboardPosition(position)) };
|
|
@@ -457,7 +459,7 @@ var IndexerBaseClient = class {
|
|
|
457
459
|
tx: (0, _nadohq_shared.getNadoEIP712Values)("leaderboard_authentication", signatureParams),
|
|
458
460
|
signature: await this.sign("leaderboard_authentication", params.verifyingAddr, params.chainId, signatureParams)
|
|
459
461
|
};
|
|
460
|
-
return { registrations: (await this.
|
|
462
|
+
return { registrations: (await this.rewardsQuery("leaderboard_register", { update_registration: updateRegistrationTx })).registrations.map(require_dataMappers.mapIndexerLeaderboardRegistration) };
|
|
461
463
|
}
|
|
462
464
|
/**
|
|
463
465
|
* Retrieves contest registrations for a subaccount. Supports batch lookup
|
|
@@ -466,7 +468,7 @@ var IndexerBaseClient = class {
|
|
|
466
468
|
* @param params - Query parameters including subaccount and contest IDs.
|
|
467
469
|
*/
|
|
468
470
|
async getLeaderboardRegistrations(params) {
|
|
469
|
-
return { registrations: (await this.
|
|
471
|
+
return { registrations: (await this.rewardsQuery("leaderboard_registrations", {
|
|
470
472
|
subaccount: (0, _nadohq_shared.subaccountToHex)(params.subaccount),
|
|
471
473
|
contest_ids: params.contestIds,
|
|
472
474
|
active: params.active
|
|
@@ -478,7 +480,7 @@ var IndexerBaseClient = class {
|
|
|
478
480
|
* @param params
|
|
479
481
|
*/
|
|
480
482
|
async getLeaderboardContests(params) {
|
|
481
|
-
return { contests: (await this.
|
|
483
|
+
return { contests: (await this.rewardsQuery("leaderboard_contests", {
|
|
482
484
|
contest_ids: params.contestIds,
|
|
483
485
|
active: params.active
|
|
484
486
|
})).contests.map(require_dataMappers.mapIndexerLeaderboardContest) };
|
|
@@ -528,7 +530,7 @@ var IndexerBaseClient = class {
|
|
|
528
530
|
* @param params
|
|
529
531
|
*/
|
|
530
532
|
async getPrivateAlphaChoice(params) {
|
|
531
|
-
const baseResponse = await this.
|
|
533
|
+
const baseResponse = await this.rewardsQuery("private_alpha_choice", { address: params.address });
|
|
532
534
|
return {
|
|
533
535
|
points: (0, _nadohq_shared.toBigNumber)(baseResponse.points),
|
|
534
536
|
feeRefund: (0, _nadohq_shared.toBigNumber)(baseResponse.fee_refund),
|
|
@@ -540,7 +542,7 @@ var IndexerBaseClient = class {
|
|
|
540
542
|
* @param params
|
|
541
543
|
*/
|
|
542
544
|
async getPoints(params) {
|
|
543
|
-
const baseResponse = await this.
|
|
545
|
+
const baseResponse = await this.rewardsQuery("nado_points", { address: params.address });
|
|
544
546
|
return {
|
|
545
547
|
pointsPerEpoch: baseResponse.points_per_epoch.map((epoch) => ({
|
|
546
548
|
epoch: epoch.epoch,
|
|
@@ -565,7 +567,7 @@ var IndexerBaseClient = class {
|
|
|
565
567
|
* @param params
|
|
566
568
|
*/
|
|
567
569
|
async getXPoints(params) {
|
|
568
|
-
const baseResponse = await this.
|
|
570
|
+
const baseResponse = await this.rewardsQuery("nado_xpoints", { address: params.address });
|
|
569
571
|
const mapQuests = (quests) => quests.map((quest) => ({
|
|
570
572
|
questType: quest.quest_type,
|
|
571
573
|
points: (0, _nadohq_shared.toBigNumber)(quest.points)
|
|
@@ -594,7 +596,7 @@ var IndexerBaseClient = class {
|
|
|
594
596
|
* @param params
|
|
595
597
|
*/
|
|
596
598
|
async getCashIncentives(params) {
|
|
597
|
-
const baseResponse = await this.
|
|
599
|
+
const baseResponse = await this.rewardsQuery("cash_incentives", { wallet_address: params.address });
|
|
598
600
|
return {
|
|
599
601
|
events: baseResponse.events.map((event) => ({
|
|
600
602
|
metadata: {
|
|
@@ -643,7 +645,7 @@ var IndexerBaseClient = class {
|
|
|
643
645
|
};
|
|
644
646
|
const tx = (0, _nadohq_shared.getNadoEIP712Values)("social_authentication", signatureParams);
|
|
645
647
|
const signature = await this.sign("social_authentication", params.verifyingAddr, params.chainId, signatureParams);
|
|
646
|
-
return { url: (await this.
|
|
648
|
+
return { url: (await this.rewardsQuery("social_connect", { update_social_account: {
|
|
647
649
|
tx,
|
|
648
650
|
signature
|
|
649
651
|
} })).url };
|
|
@@ -654,7 +656,7 @@ var IndexerBaseClient = class {
|
|
|
654
656
|
* @param params - Query parameters including the wallet address.
|
|
655
657
|
*/
|
|
656
658
|
async listSocialAccounts(params) {
|
|
657
|
-
return { accounts: (await this.
|
|
659
|
+
return { accounts: (await this.rewardsQuery("list_social_accounts", { address: params.address })).accounts.map((a) => ({
|
|
658
660
|
provider: a.provider,
|
|
659
661
|
username: a.username,
|
|
660
662
|
displayName: a.display_name,
|
|
@@ -675,7 +677,7 @@ var IndexerBaseClient = class {
|
|
|
675
677
|
};
|
|
676
678
|
const tx = (0, _nadohq_shared.getNadoEIP712Values)("social_authentication", signatureParams);
|
|
677
679
|
const signature = await this.sign("social_authentication", params.verifyingAddr, params.chainId, signatureParams);
|
|
678
|
-
return { accounts: (await this.
|
|
680
|
+
return { accounts: (await this.rewardsQuery("revoke_social_account", { update_social_account: {
|
|
679
681
|
tx,
|
|
680
682
|
signature
|
|
681
683
|
} })).accounts.map((a) => ({
|
|
@@ -706,9 +708,19 @@ var IndexerBaseClient = class {
|
|
|
706
708
|
this.checkResponseStatus(response);
|
|
707
709
|
return (0, _nadohq_shared.mapValues)(response.data, require_dataMappers.mapIndexerV2Symbols);
|
|
708
710
|
}
|
|
709
|
-
|
|
711
|
+
query(requestType, params) {
|
|
712
|
+
return this.queryWithUrl(this.v1Url, requestType, params);
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Runs a query against the rewards endpoint, which serves leaderboard, points,
|
|
716
|
+
* cash incentives, private alpha, and social account queries
|
|
717
|
+
*/
|
|
718
|
+
rewardsQuery(requestType, params) {
|
|
719
|
+
return this.queryWithUrl(this.rewardsUrl, requestType, params);
|
|
720
|
+
}
|
|
721
|
+
async queryWithUrl(url, requestType, params) {
|
|
710
722
|
const reqBody = { [requestType]: params };
|
|
711
|
-
const response = await this.axiosInstance.post(
|
|
723
|
+
const response = await this.axiosInstance.post(url, reqBody);
|
|
712
724
|
this.checkResponseStatus(response);
|
|
713
725
|
return response.data;
|
|
714
726
|
}
|
|
@@ -742,4 +754,4 @@ Object.defineProperty(exports, "__toESM", {
|
|
|
742
754
|
}
|
|
743
755
|
});
|
|
744
756
|
|
|
745
|
-
//# sourceMappingURL=IndexerBaseClient-
|
|
757
|
+
//# sourceMappingURL=IndexerBaseClient-DxlRS6pt.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndexerBaseClient-DxlRS6pt.cjs","names":["mapIndexerEvent","mapIndexerFundingRate","mapIndexerFundingRateHistory","mapIndexerPortfolio","mapIndexerPerpPrices","mapIndexerCandlesticks","mapIndexerServerProduct","mapIndexerEventWithTx","mapIndexerOrder","mapIndexerMatchEventBalances","mapIndexerProductPayment","mapSnapshotsIntervalToServerParams","mapIndexerMarketSnapshot","mapIndexerMakerStatistics","mapIndexerLeaderboardPosition","mapIndexerLeaderboardRegistration","mapIndexerLeaderboardContest","getValidatedHex","mapIndexerNlpSnapshot","mapIndexerV2Ticker","mapIndexerV2Symbols","WalletNotProvidedError","isIndexerServerFailureResponse","IndexerServerFailureError"],"sources":["../src/IndexerBaseClient.ts"],"sourcesContent":["import {\n EIP712LeaderboardAuthenticationParams,\n EIP712LeaderboardAuthenticationValues,\n EIP712SocialAuthenticationParams,\n getDefaultRecvTime,\n getNadoClientTypeHeaders,\n getNadoEIP712Values,\n getSignedTransactionRequest,\n getValidatedAddress,\n getValidatedHex,\n mapValues,\n nowInSeconds,\n removeDecimals,\n SignableRequestType,\n SignableRequestTypeToParams,\n SignedTx,\n subaccountFromHex,\n subaccountToHex,\n toBigInt,\n toBigNumber,\n toIntegerString,\n WalletClientWithAccount,\n WalletNotProvidedError,\n} from '@nadohq/shared';\nimport axios, { AxiosInstance, AxiosResponse } from 'axios';\nimport {\n mapIndexerCandlesticks,\n mapIndexerEvent,\n mapIndexerEventWithTx,\n mapIndexerFundingRate,\n mapIndexerFundingRateHistory,\n mapIndexerLeaderboardContest,\n mapIndexerLeaderboardPosition,\n mapIndexerLeaderboardRegistration,\n mapIndexerMakerStatistics,\n mapIndexerMarketSnapshot,\n mapIndexerMatchEventBalances,\n mapIndexerNlpSnapshot,\n mapIndexerOrder,\n mapIndexerPerpPrices,\n mapIndexerPortfolio,\n mapIndexerProductPayment,\n mapIndexerServerProduct,\n mapIndexerV2Symbols,\n mapIndexerV2Ticker,\n mapSnapshotsIntervalToServerParams,\n} from './dataMappers';\nimport {\n ConnectSocialAccountParams,\n ConnectSocialAccountResponse,\n GetIndexerBacklogResponse,\n GetIndexerCandlesticksParams,\n GetIndexerCandlesticksResponse,\n GetIndexerCashIncentivesParams,\n GetIndexerCashIncentivesResponse,\n GetIndexerEdgeCandlesticksParams,\n GetIndexerEdgeCandlesticksResponse,\n GetIndexerEdgeMarketSnapshotResponse,\n GetIndexerEdgeMarketSnapshotsParams,\n GetIndexerEventsParams,\n GetIndexerEventsResponse,\n GetIndexerFastWithdrawalSignatureParams,\n GetIndexerFastWithdrawalSignatureResponse,\n GetIndexerFundingRateHistoryParams,\n GetIndexerFundingRateHistoryResponse,\n GetIndexerFundingRateParams,\n GetIndexerFundingRateResponse,\n GetIndexerInterestFundingPaymentsParams,\n GetIndexerInterestFundingPaymentsResponse,\n GetIndexerLeaderboardContestsParams,\n GetIndexerLeaderboardContestsResponse,\n GetIndexerLeaderboardParams,\n GetIndexerLeaderboardParticipantParams,\n GetIndexerLeaderboardParticipantResponse,\n GetIndexerLeaderboardRegistrationsParams,\n GetIndexerLeaderboardRegistrationsResponse,\n GetIndexerLeaderboardResponse,\n GetIndexerLinkedSignerParams,\n GetIndexerLinkedSignerResponse,\n GetIndexerMakerStatisticsParams,\n GetIndexerMakerStatisticsResponse,\n GetIndexerMarketSnapshotsParams,\n GetIndexerMarketSnapshotsResponse,\n GetIndexerMatchEventsParams,\n GetIndexerMatchEventsResponse,\n GetIndexerMultiProductFundingRatesParams,\n GetIndexerMultiProductFundingRatesResponse,\n GetIndexerMultiProductPerpPricesParams,\n GetIndexerMultiProductPerpPricesResponse,\n GetIndexerMultiProductSnapshotsParams,\n GetIndexerMultiProductSnapshotsResponse,\n GetIndexerMultiSubaccountSnapshotsParams,\n GetIndexerMultiSubaccountSnapshotsResponse,\n GetIndexerNlpSnapshotsParams,\n GetIndexerNlpSnapshotsResponse,\n GetIndexerOraclePricesParams,\n GetIndexerOraclePricesResponse,\n GetIndexerOrdersParams,\n GetIndexerOrdersResponse,\n GetIndexerPerpPricesParams,\n GetIndexerPerpPricesResponse,\n GetIndexerPointsParams,\n GetIndexerPointsResponse,\n GetIndexerPortfolioParams,\n GetIndexerPortfolioResponse,\n GetIndexerPrivateAlphaChoiceParams,\n GetIndexerPrivateAlphaChoiceResponse,\n GetIndexerProductSnapshotsParams,\n GetIndexerProductSnapshotsResponse,\n GetIndexerQuotePriceResponse,\n GetIndexerReferralCodeParams,\n GetIndexerReferralCodeResponse,\n GetIndexerSubaccountDDAParams,\n GetIndexerSubaccountDDAResponse,\n GetIndexerV2SymbolsParams,\n GetIndexerV2SymbolsResponse,\n GetIndexerV2TickersParams,\n GetIndexerV2TickersResponse,\n GetIndexerXPointsParams,\n GetIndexerXPointsResponse,\n IndexerEventWithTx,\n IndexerMatchEvent,\n IndexerOraclePrice,\n IndexerServerEventsParams,\n IndexerServerFailureError,\n IndexerServerQueryRequestByType,\n IndexerServerQueryRequestType,\n IndexerServerQueryResponseByType,\n IndexerServerV2SymbolsResponse,\n IndexerServerV2TickersResponse,\n IndexerSnapshotBalance,\n IndexerSubaccountSnapshot,\n isIndexerServerFailureResponse,\n ListIndexerSocialAccountsParams,\n ListIndexerSocialAccountsResponse,\n ListIndexerSubaccountsParams,\n ListIndexerSubaccountsResponse,\n RegisterLeaderboardParams,\n RegisterLeaderboardResponse,\n RevokeSocialAccountParams,\n RevokeSocialAccountResponse,\n} from './types';\n\nexport interface IndexerClientOpts {\n // Server base URL, without a version segment (ex. `https://archive.prod.nado.xyz`)\n url: string;\n // Wallet Client for EIP712 signing\n walletClient?: WalletClientWithAccount;\n // Linked signer registered through the engine, if provided, execute requests will use this signer\n linkedSignerWalletClient?: WalletClientWithAccount;\n // If provided, identifies the calling client, sent as a header with every request\n clientType?: string;\n}\n\ntype IndexerQueryRequestBody = Partial<IndexerServerQueryRequestByType>;\n\n/**\n * Base client for all indexer requests\n */\nexport class IndexerBaseClient {\n readonly opts: IndexerClientOpts;\n readonly v1Url: string;\n readonly v2Url: string;\n readonly rewardsUrl: string;\n readonly axiosInstance: AxiosInstance;\n\n constructor(opts: IndexerClientOpts) {\n this.opts = opts;\n this.axiosInstance = axios.create({\n withCredentials: true,\n // We have custom logic to validate response status and create an appropriate error\n validateStatus: () => true,\n headers: getNadoClientTypeHeaders(opts.clientType),\n });\n this.v1Url = `${opts.url}/v1`;\n this.v2Url = `${opts.url}/v2`;\n this.rewardsUrl = `${opts.url}/rewards/v1`;\n }\n\n /**\n * Sets the linked signer for execute requests\n *\n * @param linkedSignerWalletClient The linkedSigner to use for all signatures. Set to null to revert to the chain signer\n */\n public setLinkedSigner(\n linkedSignerWalletClient: WalletClientWithAccount | null,\n ) {\n this.opts.linkedSignerWalletClient = linkedSignerWalletClient ?? undefined;\n }\n\n /**\n * List all subaccounts\n *\n * @param params\n */\n async listSubaccounts(\n params: ListIndexerSubaccountsParams,\n ): Promise<ListIndexerSubaccountsResponse> {\n const baseResponse = await this.query('subaccounts', params);\n\n return baseResponse.subaccounts.map((item) => {\n const subaccount = subaccountFromHex(item.subaccount);\n return {\n hexId: item.subaccount,\n createdAt: Number(item.created_at),\n isolated: item.isolated,\n ...subaccount,\n };\n });\n }\n\n /**\n * Retrieve snapshots of multiple subaccounts at multiple points in time.\n * Each snapshot is a view of the subaccount's balances at this point in time, with tracked variables for interest, funding, etc.\n *\n * @param params\n */\n async getMultiSubaccountSnapshots(\n params: GetIndexerMultiSubaccountSnapshotsParams,\n ): Promise<GetIndexerMultiSubaccountSnapshotsResponse> {\n const subaccountHexIds = params.subaccounts.map(\n ({ subaccountOwner, subaccountName }) =>\n subaccountToHex({\n subaccountOwner,\n subaccountName,\n }),\n );\n\n const baseResponse = await this.query('account_snapshots', {\n subaccounts: subaccountHexIds,\n timestamps: params.timestamps,\n isolated: params.isolated,\n });\n\n const snapshotsBySubaccount = mapValues(\n baseResponse.snapshots,\n (balanceSnapshots) => {\n const snapshotByTimestamp: Record<string, IndexerSubaccountSnapshot> =\n {};\n\n Object.entries(balanceSnapshots).forEach(([timestamp, events]) => {\n const balances: IndexerSnapshotBalance[] =\n events.map(mapIndexerEvent);\n\n snapshotByTimestamp[timestamp] = {\n timestamp: toBigNumber(timestamp),\n balances,\n };\n });\n\n return snapshotByTimestamp;\n },\n );\n\n return {\n subaccountHexIds,\n snapshots: snapshotsBySubaccount,\n };\n }\n\n /**\n * Retrieves referral code for an address\n *\n * @param params\n */\n async getReferralCode(\n params: GetIndexerReferralCodeParams,\n ): Promise<GetIndexerReferralCodeResponse> {\n const baseResponse = await this.query('referral_code', {\n subaccount: subaccountToHex({\n subaccountOwner: params.subaccount.subaccountOwner,\n subaccountName: params.subaccount.subaccountName,\n }),\n });\n\n return {\n referralCode: baseResponse.referral_code,\n };\n }\n\n /**\n * Retrieves funding rate for a product, where 1 = 100%\n * @param params\n */\n async getFundingRate(\n params: GetIndexerFundingRateParams,\n ): Promise<GetIndexerFundingRateResponse> {\n const baseResponse = await this.query('funding_rate', {\n product_id: params.productId,\n });\n\n return mapIndexerFundingRate(baseResponse);\n }\n\n /**\n * Retrieves funding rate for multiple products, where 1 = 100%\n * @param params\n */\n async getMultiProductFundingRates(\n params: GetIndexerMultiProductFundingRatesParams,\n ): Promise<GetIndexerMultiProductFundingRatesResponse> {\n const baseResponse = await this.query('funding_rates', {\n product_ids: params.productIds,\n });\n\n return mapValues(baseResponse, mapIndexerFundingRate);\n }\n\n /**\n * Retrieves a perp product's historical (realized hourly) funding rates,\n * ordered ascending by timestamp, where 1 = 100%.\n *\n * To paginate forward, pass the last entry's `timestamp + 1` as the next\n * request's `startTimeInclusive`.\n *\n * @param params\n */\n async getFundingRateHistory(\n params: GetIndexerFundingRateHistoryParams,\n ): Promise<GetIndexerFundingRateHistoryResponse> {\n const baseResponse = await this.query('funding_rate_history', {\n product_id: params.productId,\n start_time: params.startTimeInclusive,\n end_time: params.endTimeInclusive,\n limit: params.limit,\n });\n\n return baseResponse.funding_rates.map(mapIndexerFundingRateHistory);\n }\n\n /**\n * Retrieves a subaccount's account-value, PnL, traded-volume, average-trade-size,\n * and markets-traded history across all timeframes, keyed by period. The value\n * aggregates the cross-margin account plus every isolated child; the queried\n * subaccount must be cross-margin.\n *\n * Points are downsampled per timeframe, so the most recent point can be up to\n * ~20 minutes stale. For the exact live value, use the engine client's\n * `getSubaccountSummary` query instead.\n *\n * @param params\n */\n async getPortfolio(\n params: GetIndexerPortfolioParams,\n ): Promise<GetIndexerPortfolioResponse> {\n const baseResponse = await this.query('portfolio', {\n subaccount: subaccountToHex(params.subaccount),\n });\n\n return mapIndexerPortfolio(baseResponse);\n }\n\n /**\n * Retrieves latest mark/index price for a perp product\n * @param params\n */\n async getPerpPrices(\n params: GetIndexerPerpPricesParams,\n ): Promise<GetIndexerPerpPricesResponse> {\n const baseResponse = await this.query('price', {\n product_id: params.productId,\n });\n\n return mapIndexerPerpPrices(baseResponse);\n }\n\n /**\n * Retrieves latest mark/index price for multiple perp products\n * @param params\n */\n async getMultiProductPerpPrices(\n params: GetIndexerMultiProductPerpPricesParams,\n ): Promise<GetIndexerMultiProductPerpPricesResponse> {\n const baseResponse = await this.query('perp_prices', {\n product_ids: params.productIds,\n });\n\n return mapValues(baseResponse, mapIndexerPerpPrices);\n }\n\n /**\n * Retrieves latest oracle prices for provided products\n * @param params\n */\n async getOraclePrices(\n params: GetIndexerOraclePricesParams,\n ): Promise<GetIndexerOraclePricesResponse> {\n const baseResponse = await this.query('oracle_price', {\n product_ids: params.productIds,\n });\n\n return baseResponse.prices.map((price): IndexerOraclePrice => {\n return {\n oraclePrice: removeDecimals(price.oracle_price_x18),\n updateTime: toBigNumber(price.update_time),\n productId: price.product_id,\n };\n });\n }\n\n /**\n * Retrieves candlesticks for a product\n * @param params\n */\n async getCandlesticks(\n params: GetIndexerCandlesticksParams,\n ): Promise<GetIndexerCandlesticksResponse> {\n const baseResponse = await this.query('candlesticks', {\n product_id: params.productId,\n max_time: params.maxTimeInclusive,\n limit: params.limit,\n granularity: params.period,\n });\n\n return baseResponse.candlesticks.map(mapIndexerCandlesticks);\n }\n\n /**\n * Retrieves candlesticks for a product from Edge\n * @param params\n */\n async getEdgeCandlesticks(\n params: GetIndexerEdgeCandlesticksParams,\n ): Promise<GetIndexerEdgeCandlesticksResponse> {\n const baseResponse = await this.query('edge_candlesticks', {\n product_id: params.productId,\n max_time: params.maxTimeInclusive,\n limit: params.limit,\n granularity: params.period,\n });\n\n return baseResponse.candlesticks.map(mapIndexerCandlesticks);\n }\n\n /**\n * Retrieves historical snapshots for a product\n * @param params\n */\n async getProductSnapshots(\n params: GetIndexerProductSnapshotsParams,\n ): Promise<GetIndexerProductSnapshotsResponse> {\n const baseResponse = await this.query('products', {\n product_id: params.productId,\n max_time: params.maxTimestampInclusive,\n limit: params.limit,\n idx: params.startCursor,\n });\n\n return baseResponse.products.map((product) => {\n return {\n ...mapIndexerServerProduct(product.product),\n submissionIndex: product.submission_idx,\n };\n });\n }\n\n /**\n * Retrieves historical snapshots for multiple products\n * @param params\n */\n async getMultiProductSnapshots(\n params: GetIndexerMultiProductSnapshotsParams,\n ): Promise<GetIndexerMultiProductSnapshotsResponse> {\n const timestampToProductsMap = await this.query('product_snapshots', {\n product_ids: params.productIds,\n max_time: params.maxTimestampInclusive ?? [nowInSeconds()],\n });\n\n return mapValues(timestampToProductsMap, (productIdToProduct) => {\n return mapValues(productIdToProduct, (indexerProduct) => {\n return {\n ...mapIndexerServerProduct(indexerProduct.product),\n submissionIndex: indexerProduct.submission_idx,\n };\n });\n });\n }\n\n /**\n * Retrieves historical events\n *\n * @param params\n */\n async getEvents(\n params: GetIndexerEventsParams,\n ): Promise<GetIndexerEventsResponse> {\n const serverLimit = ((): IndexerServerEventsParams['limit'] | undefined => {\n if (!params.limit) {\n return;\n }\n\n if (params.limit.type === 'events') {\n return {\n raw: params.limit.value,\n };\n }\n return {\n txs: params.limit.value,\n };\n })();\n\n const baseResponse = await this.query('events', {\n subaccounts: params.subaccounts?.map((subaccount) =>\n subaccountToHex({\n subaccountOwner: subaccount.subaccountOwner,\n subaccountName: subaccount.subaccountName,\n }),\n ),\n product_ids: params.productIds,\n isolated: params.isolated,\n event_types: params.eventTypes,\n max_time: params.maxTimestampInclusive,\n desc: params.desc,\n limit: serverLimit,\n idx: params.startCursor,\n });\n\n // Keep track of the last tx index, and go to the next one if the submission_idx for the currently processed event does not match\n // txs are ordered the same as events, so this should be correct\n let lastTxIdx = 0;\n return baseResponse.events.map((event): IndexerEventWithTx => {\n if (baseResponse.txs[lastTxIdx].submission_idx !== event.submission_idx) {\n lastTxIdx += 1;\n }\n const tx = baseResponse.txs[lastTxIdx];\n return mapIndexerEventWithTx(event, tx);\n });\n }\n\n /**\n * Retrieves historical orders\n * @param params\n */\n async getOrders(\n params: GetIndexerOrdersParams,\n ): Promise<GetIndexerOrdersResponse> {\n const baseResponse = await this.query('orders', {\n subaccounts: params?.subaccounts?.map((subaccount) =>\n subaccountToHex({\n subaccountOwner: subaccount.subaccountOwner,\n subaccountName: subaccount.subaccountName,\n }),\n ),\n product_ids: params.productIds,\n trigger_types: params.triggerTypes,\n isolated: params.isolated,\n digests: params.digests,\n max_time: params.maxTimestampInclusive,\n limit: params.limit,\n idx: params.startCursor,\n });\n\n return baseResponse.orders.map(mapIndexerOrder);\n }\n\n /**\n * Gets match order events, this will return the same events as the events query, but with additional information\n * to identify the order that was matched\n *\n * @param params\n */\n async getMatchEvents(\n params: GetIndexerMatchEventsParams,\n ): Promise<GetIndexerMatchEventsResponse> {\n const baseResponse = await this.query('matches', {\n subaccounts: params?.subaccounts?.map((subaccount) =>\n subaccountToHex({\n subaccountOwner: subaccount.subaccountOwner,\n subaccountName: subaccount.subaccountName,\n }),\n ),\n product_ids: params.productIds,\n isolated: params.isolated,\n max_time: params.maxTimestampInclusive,\n limit: params.limit,\n idx: params.startCursor,\n });\n\n // Same as logic in `getEvents`\n let lastTxIdx = 0;\n return baseResponse.matches.map((matchEvent): IndexerMatchEvent => {\n if (\n baseResponse.txs[lastTxIdx].submission_idx !== matchEvent.submission_idx\n ) {\n lastTxIdx += 1;\n }\n const { tx, timestamp } = baseResponse.txs[lastTxIdx];\n\n // We use this to derive the product ID for the match\n const postBalances = mapIndexerMatchEventBalances(\n matchEvent.post_balance,\n );\n\n return {\n productId: postBalances.base.productId,\n isolated: matchEvent.isolated,\n totalFee: toBigNumber(matchEvent.fee),\n sequencerFee: toBigNumber(matchEvent.sequencer_fee),\n builderFee: toBigNumber(matchEvent.builder_fee),\n baseFilled: toBigNumber(matchEvent.base_filled),\n quoteFilled: toBigNumber(matchEvent.quote_filled),\n cumulativeFee: toBigNumber(matchEvent.cumulative_fee),\n cumulativeBaseFilled: toBigNumber(matchEvent.cumulative_base_filled),\n cumulativeQuoteFilled: toBigNumber(matchEvent.cumulative_quote_filled),\n digest: matchEvent.digest,\n order: matchEvent.order,\n submissionIndex: matchEvent.submission_idx,\n timestamp: toBigNumber(timestamp),\n preEventTrackedVars: {\n netEntryUnrealized: toBigNumber(matchEvent.net_entry_unrealized),\n netEntryCumulative: toBigNumber(matchEvent.net_entry_cumulative),\n },\n preBalances: mapIndexerMatchEventBalances(matchEvent.pre_balance),\n postBalances,\n tx,\n isTaker: matchEvent.is_taker,\n realizedPnl: toBigNumber(matchEvent.realized_pnl),\n closedAmount: toBigNumber(matchEvent.closed_amount),\n closedNetEntry: toBigNumber(matchEvent.closed_net_entry),\n margin: matchEvent.margin ? toBigNumber(matchEvent.margin) : null,\n ...subaccountFromHex(matchEvent.order.sender),\n };\n });\n }\n\n /**\n * Retrieves historical funding & interest payments.\n * NOTE: `limit` is an upperbound. If a user changes position size such that his position is 0 during each funding/interest tick,\n * then the indexer will return fewer than `limit` results per page. However, more events can be present. This means that\n * there isn't a reliable way to determine whether there is a next page. We just need to keep paginating until the next cursor is null.\n *\n * @param params\n */\n async getInterestFundingPayments(\n params: GetIndexerInterestFundingPaymentsParams,\n ): Promise<GetIndexerInterestFundingPaymentsResponse> {\n const baseResponse = await this.query('interest_and_funding', {\n subaccount: subaccountToHex({\n subaccountOwner: params.subaccount.subaccountOwner,\n subaccountName: params.subaccount.subaccountName,\n }),\n product_ids: params.productIds,\n max_time: params.maxTimestampInclusive,\n limit: params.limit,\n max_idx: params.startCursor,\n });\n\n return {\n fundingPayments: baseResponse.funding_payments.map(\n mapIndexerProductPayment,\n ),\n interestPayments: baseResponse.interest_payments.map(\n mapIndexerProductPayment,\n ),\n nextCursor: baseResponse.next_idx,\n };\n }\n\n /**\n * Gets quote (USDT) price in terms of USD\n */\n async getQuotePrice(): Promise<GetIndexerQuotePriceResponse> {\n const baseResponse = await this.query('quote_price', {});\n return {\n price: removeDecimals(baseResponse.price_x18),\n };\n }\n\n /**\n * Fetches currently registered linked signer with the remaining txs allowed for the subaccount\n */\n async getLinkedSignerWithRateLimit(\n params: GetIndexerLinkedSignerParams,\n ): Promise<GetIndexerLinkedSignerResponse> {\n const baseResponse = await this.query('linked_signer_rate_limit', {\n subaccount: subaccountToHex(params.subaccount),\n });\n return {\n totalTxLimit: toBigNumber(baseResponse.total_tx_limit),\n remainingTxs: toBigNumber(baseResponse.remaining_tx),\n signer: baseResponse.signer,\n waitTimeUntilNextTx: toBigNumber(baseResponse.wait_time),\n };\n }\n\n /**\n * Retrieve historical market snapshots\n * @param params\n */\n async getMarketSnapshots(\n params: GetIndexerMarketSnapshotsParams,\n ): Promise<GetIndexerMarketSnapshotsResponse> {\n const baseResponse = await this.query('market_snapshots', {\n interval: mapSnapshotsIntervalToServerParams(params),\n product_ids: params.productIds,\n });\n\n return baseResponse.snapshots.map(mapIndexerMarketSnapshot);\n }\n\n /**\n * Retrieve historical market snapshots from Edge\n * @param params\n */\n async getEdgeMarketSnapshots(\n params: GetIndexerEdgeMarketSnapshotsParams,\n ): Promise<GetIndexerEdgeMarketSnapshotResponse> {\n const baseResponse = await this.query('edge_market_snapshots', {\n interval: mapSnapshotsIntervalToServerParams(params),\n });\n\n return mapValues(baseResponse.snapshots, (snapshots) =>\n snapshots.map(mapIndexerMarketSnapshot),\n );\n }\n\n /**\n * Retrieve maker statistics for a given epoch\n *\n * @param params\n */\n async getMakerStatistics(\n params: GetIndexerMakerStatisticsParams,\n ): Promise<GetIndexerMakerStatisticsResponse> {\n const baseResponse = await this.query('maker_statistics', {\n product_id: params.productId,\n epoch: params.epoch,\n interval: params.interval,\n });\n\n return {\n rewardCoefficient: toBigNumber(baseResponse.reward_coefficient),\n makers: baseResponse.makers.map(mapIndexerMakerStatistics),\n };\n }\n\n /**\n * Retrieve leaderboard stats for a given contest\n *\n * @param params\n */\n async getLeaderboard(\n params: GetIndexerLeaderboardParams,\n ): Promise<GetIndexerLeaderboardResponse> {\n const baseResponse = await this.rewardsQuery('leaderboard', {\n contest_id: params.contestId,\n rank_type: params.rankType,\n start: params.startCursor,\n limit: params.limit,\n order: params.order,\n });\n\n return {\n participants: baseResponse.positions.map(mapIndexerLeaderboardPosition),\n };\n }\n\n /**\n * Retrieve leaderboard ranking of a subaccount on a given contest\n *\n * @param params\n */\n async getLeaderboardParticipant(\n params: GetIndexerLeaderboardParticipantParams,\n ): Promise<GetIndexerLeaderboardParticipantResponse> {\n const baseResponse = await this.rewardsQuery('leaderboard_rank', {\n subaccount: subaccountToHex(params.subaccount),\n contest_ids: params.contestIds,\n });\n\n return {\n participant: mapValues(baseResponse.positions, (position) =>\n mapIndexerLeaderboardPosition(position),\n ),\n };\n }\n\n /**\n * Registers a subaccount for one or more contests. Requires EIP-712 signing.\n *\n * @param params - Registration parameters including contest IDs and signing config.\n */\n async registerLeaderboard(\n params: RegisterLeaderboardParams,\n ): Promise<RegisterLeaderboardResponse> {\n const signatureParams: EIP712LeaderboardAuthenticationParams = {\n expiration: toIntegerString(params.recvTime ?? getDefaultRecvTime()),\n subaccountName: params.subaccountName,\n subaccountOwner: params.subaccountOwner,\n contestIds: params.contestIds,\n };\n\n const tx = getNadoEIP712Values(\n 'leaderboard_authentication',\n signatureParams,\n );\n const signature = await this.sign(\n 'leaderboard_authentication',\n params.verifyingAddr,\n params.chainId,\n signatureParams,\n );\n\n const updateRegistrationTx: SignedTx<EIP712LeaderboardAuthenticationValues> =\n {\n tx,\n signature,\n };\n\n const baseResponse = await this.rewardsQuery('leaderboard_register', {\n update_registration: updateRegistrationTx,\n });\n\n return {\n registrations: baseResponse.registrations.map(\n mapIndexerLeaderboardRegistration,\n ),\n };\n }\n\n /**\n * Retrieves contest registrations for a subaccount. Supports batch lookup\n * across multiple contests with an optional active filter.\n *\n * @param params - Query parameters including subaccount and contest IDs.\n */\n async getLeaderboardRegistrations(\n params: GetIndexerLeaderboardRegistrationsParams,\n ): Promise<GetIndexerLeaderboardRegistrationsResponse> {\n const baseResponse = await this.rewardsQuery('leaderboard_registrations', {\n subaccount: subaccountToHex(params.subaccount),\n contest_ids: params.contestIds,\n active: params.active,\n });\n\n return {\n registrations: baseResponse.registrations.map(\n mapIndexerLeaderboardRegistration,\n ),\n };\n }\n\n /**\n * Retrieve metadata of provided leaderboard contests\n *\n * @param params\n */\n async getLeaderboardContests(\n params: GetIndexerLeaderboardContestsParams,\n ): Promise<GetIndexerLeaderboardContestsResponse> {\n const baseResponse = await this.rewardsQuery('leaderboard_contests', {\n contest_ids: params.contestIds,\n active: params.active,\n });\n\n return {\n contests: baseResponse.contests.map(mapIndexerLeaderboardContest),\n };\n }\n\n /**\n * Retrieve signature and tx to submit a fast withdrawal\n *\n * @param params\n */\n async getFastWithdrawalSignature(\n params: GetIndexerFastWithdrawalSignatureParams,\n ): Promise<GetIndexerFastWithdrawalSignatureResponse> {\n const baseResponse = await this.query('fast_withdrawal_signature', params);\n return {\n idx: toBigInt(baseResponse.idx),\n tx: baseResponse.tx,\n txV2: baseResponse.tx_v2,\n txBytes: getValidatedHex(baseResponse.tx_bytes),\n signatures: baseResponse.signatures.map(getValidatedHex),\n };\n }\n\n async getNlpSnapshots(\n params: GetIndexerNlpSnapshotsParams,\n ): Promise<GetIndexerNlpSnapshotsResponse> {\n const baseResponse = await this.query('nlp_snapshots', {\n interval: {\n count: params.limit,\n max_time: params.maxTimeInclusive\n ? toIntegerString(params.maxTimeInclusive)\n : undefined,\n granularity: params.granularity,\n },\n });\n\n return {\n snapshots: baseResponse.snapshots.map(mapIndexerNlpSnapshot),\n };\n }\n\n /**\n * Retrieves the subaccount's DDA (Direct Deposit Address)\n * @param params\n */\n async getSubaccountDDA(\n params: GetIndexerSubaccountDDAParams,\n ): Promise<GetIndexerSubaccountDDAResponse> {\n const baseResponse = await this.query('direct_deposit_address', {\n subaccount: subaccountToHex(params.subaccount),\n });\n\n return {\n address: getValidatedAddress(baseResponse.v1_address),\n };\n }\n\n async getSequencerBacklog(): Promise<GetIndexerBacklogResponse> {\n const baseResponse = await this.query('backlog', {});\n\n return {\n totalTxs: toBigNumber(baseResponse.total_txs),\n totalSubmissions: toBigNumber(baseResponse.total_submissions),\n backlogSize: toBigNumber(baseResponse.backlog_size),\n updatedAt: toBigNumber(baseResponse.updated_at),\n backlogEtaInSeconds: baseResponse.backlog_eta_in_seconds\n ? toBigNumber(baseResponse.backlog_eta_in_seconds)\n : null,\n txsPerSecond: baseResponse.txs_per_second\n ? toBigNumber(baseResponse.txs_per_second)\n : null,\n };\n }\n\n /**\n * Retrieves private alpha choice information for a given address\n * @param params\n */\n async getPrivateAlphaChoice(\n params: GetIndexerPrivateAlphaChoiceParams,\n ): Promise<GetIndexerPrivateAlphaChoiceResponse> {\n const baseResponse = await this.rewardsQuery('private_alpha_choice', {\n address: params.address,\n });\n\n return {\n points: toBigNumber(baseResponse.points),\n feeRefund: toBigNumber(baseResponse.fee_refund),\n nftEligibility: baseResponse.nft_eligibility,\n };\n }\n\n /**\n * Retrieves points information for a given address, including points per epoch and all-time points\n * @param params\n */\n async getPoints(\n params: GetIndexerPointsParams,\n ): Promise<GetIndexerPointsResponse> {\n const baseResponse = await this.rewardsQuery('nado_points', {\n address: params.address,\n });\n\n return {\n pointsPerEpoch: baseResponse.points_per_epoch.map((epoch) => ({\n epoch: epoch.epoch,\n description: epoch.description,\n startTime: toBigNumber(epoch.start_time),\n endTime: toBigNumber(epoch.end_time),\n totalPoints: toBigNumber(epoch.total_points),\n points: toBigNumber(epoch.points),\n rank: epoch.rank,\n tier: epoch.tier,\n })),\n allTimePoints: {\n points: toBigNumber(baseResponse.all_time_points.points),\n rank: baseResponse.all_time_points.rank,\n tier: baseResponse.all_time_points.tier,\n },\n };\n }\n\n /**\n * Retrieves xPoints information (Nado x xStocks points program) for a given address,\n * including per-epoch points, all-time points, and per-quest breakdowns.\n * @param params\n */\n async getXPoints(\n params: GetIndexerXPointsParams,\n ): Promise<GetIndexerXPointsResponse> {\n const baseResponse = await this.rewardsQuery('nado_xpoints', {\n address: params.address,\n });\n\n const mapQuests = (\n quests: typeof baseResponse.all_time_points.quests,\n ): GetIndexerXPointsResponse['allTimePoints']['quests'] =>\n quests.map((quest) => ({\n questType: quest.quest_type,\n points: toBigNumber(quest.points),\n }));\n\n return {\n pointsPerEpoch: baseResponse.points_per_epoch.map((epoch) => ({\n epoch: epoch.epoch,\n description: epoch.description,\n startTime: toBigNumber(epoch.start_time),\n endTime: toBigNumber(epoch.end_time),\n totalPoints: toBigNumber(epoch.total_points),\n rank: epoch.rank,\n quests: mapQuests(epoch.quests),\n })),\n allTimePoints: {\n totalPoints: toBigNumber(baseResponse.all_time_points.total_points),\n rank: baseResponse.all_time_points.rank,\n quests: mapQuests(baseResponse.all_time_points.quests),\n },\n };\n }\n\n /**\n * Retrieves cash incentives information for a given wallet address: per-event platform volume,\n * unlocked rewards, and `wallet.claim`, which carries the claim status plus the merkle proof when\n * that status is `claimable`.\n * @param params\n */\n async getCashIncentives(\n params: GetIndexerCashIncentivesParams,\n ): Promise<GetIndexerCashIncentivesResponse> {\n const baseResponse = await this.rewardsQuery('cash_incentives', {\n wallet_address: params.address,\n });\n\n return {\n events: baseResponse.events.map((event) => ({\n metadata: {\n eventId: event.metadata.event_id,\n description: event.metadata.description,\n epochStart: toBigNumber(event.metadata.epoch_start),\n epochEnd: toBigNumber(event.metadata.epoch_end),\n maxVolume: removeDecimals(event.metadata.max_volume),\n maxReward: removeDecimals(event.metadata.max_reward),\n minVolume: removeDecimals(event.metadata.min_volume),\n minReward: removeDecimals(event.metadata.min_reward),\n },\n platform: {\n platformVolume: removeDecimals(event.platform.platform_volume),\n unlockedReward: removeDecimals(event.platform.unlocked_reward),\n },\n wallet: {\n reward: removeDecimals(event.wallet.reward),\n claim:\n event.wallet.claim.status === 'claimable'\n ? {\n status: 'claimable',\n airdropAddress: getValidatedAddress(\n event.wallet.claim.airdrop_address,\n ),\n week: event.wallet.claim.week,\n // Kept in raw token units so it can be passed to the airdrop contract unchanged\n totalAmount: toBigNumber(event.wallet.claim.total_amount),\n proof: event.wallet.claim.proof.map(getValidatedHex),\n }\n : { status: event.wallet.claim.status },\n },\n })),\n walletSummary: {\n totalReward: removeDecimals(baseResponse.wallet_summary.total_reward),\n claimableReward: removeDecimals(\n baseResponse.wallet_summary.claimable_reward,\n ),\n },\n };\n }\n\n /**\n * Initiates a social account connection flow. Returns a URL the user must visit to complete the OAuth flow.\n * Requires EIP-712 signing.\n *\n * @param params - Connection parameters including provider and signing config.\n */\n async connectSocialAccount(\n params: ConnectSocialAccountParams,\n ): Promise<ConnectSocialAccountResponse> {\n const signatureParams: EIP712SocialAuthenticationParams = {\n expiration: toIntegerString(params.recvTime ?? getDefaultRecvTime()),\n subaccountName: params.subaccountName,\n subaccountOwner: params.subaccountOwner,\n provider: params.provider,\n };\n\n const tx = getNadoEIP712Values('social_authentication', signatureParams);\n const signature = await this.sign(\n 'social_authentication',\n params.verifyingAddr,\n params.chainId,\n signatureParams,\n );\n\n const baseResponse = await this.rewardsQuery('social_connect', {\n update_social_account: { tx, signature },\n });\n\n return { url: baseResponse.url };\n }\n\n /**\n * Lists linked social accounts for a given address.\n *\n * @param params - Query parameters including the wallet address.\n */\n async listSocialAccounts(\n params: ListIndexerSocialAccountsParams,\n ): Promise<ListIndexerSocialAccountsResponse> {\n const baseResponse = await this.rewardsQuery('list_social_accounts', {\n address: params.address,\n });\n\n return {\n accounts: baseResponse.accounts.map((a) => ({\n provider: a.provider,\n username: a.username,\n displayName: a.display_name,\n profileImageUrl: a.profile_image_url,\n })),\n };\n }\n\n /**\n * Revokes a linked social account. Requires EIP-712 signing.\n *\n * @param params - Revocation parameters including provider and signing config.\n */\n async revokeSocialAccount(\n params: RevokeSocialAccountParams,\n ): Promise<RevokeSocialAccountResponse> {\n const signatureParams: EIP712SocialAuthenticationParams = {\n expiration: toIntegerString(params.recvTime ?? getDefaultRecvTime()),\n subaccountName: params.subaccountName,\n subaccountOwner: params.subaccountOwner,\n provider: params.provider,\n };\n\n const tx = getNadoEIP712Values('social_authentication', signatureParams);\n const signature = await this.sign(\n 'social_authentication',\n params.verifyingAddr,\n params.chainId,\n signatureParams,\n );\n\n const baseResponse = await this.rewardsQuery('revoke_social_account', {\n update_social_account: { tx, signature },\n });\n\n return {\n accounts: baseResponse.accounts.map((a) => ({\n provider: a.provider,\n username: a.username,\n displayName: a.display_name,\n profileImageUrl: a.profile_image_url,\n })),\n };\n }\n\n /**\n * Get tickers from the v2 indexer endpoint\n * @param params\n */\n async getV2Tickers(\n params: GetIndexerV2TickersParams,\n ): Promise<GetIndexerV2TickersResponse> {\n const response =\n await this.axiosInstance.get<IndexerServerV2TickersResponse>(\n `${this.v2Url}/tickers`,\n { params },\n );\n\n this.checkResponseStatus(response);\n\n return mapValues(response.data, mapIndexerV2Ticker);\n }\n\n /**\n * Get symbols with market hours from the v2 indexer endpoint\n * @param params\n */\n async getV2Symbols(\n params?: GetIndexerV2SymbolsParams,\n ): Promise<GetIndexerV2SymbolsResponse> {\n const response =\n await this.axiosInstance.get<IndexerServerV2SymbolsResponse>(\n `${this.v2Url}/symbols`,\n {\n params: {\n product_type: params?.productType,\n product_ids: params?.productIds,\n },\n },\n );\n\n this.checkResponseStatus(response);\n\n return mapValues(response.data, mapIndexerV2Symbols);\n }\n\n protected query<TRequestType extends IndexerServerQueryRequestType>(\n requestType: TRequestType,\n params: IndexerServerQueryRequestByType[TRequestType],\n ): Promise<IndexerServerQueryResponseByType[TRequestType]> {\n return this.queryWithUrl(this.v1Url, requestType, params);\n }\n\n /**\n * Runs a query against the rewards endpoint, which serves leaderboard, points,\n * cash incentives, private alpha, and social account queries\n */\n protected rewardsQuery<TRequestType extends IndexerServerQueryRequestType>(\n requestType: TRequestType,\n params: IndexerServerQueryRequestByType[TRequestType],\n ): Promise<IndexerServerQueryResponseByType[TRequestType]> {\n return this.queryWithUrl(this.rewardsUrl, requestType, params);\n }\n\n private async queryWithUrl<\n TRequestType extends IndexerServerQueryRequestType,\n >(\n url: string,\n requestType: TRequestType,\n params: IndexerServerQueryRequestByType[TRequestType],\n ): Promise<IndexerServerQueryResponseByType[TRequestType]> {\n const reqBody: IndexerQueryRequestBody = {\n [requestType]: params,\n };\n const response = await this.axiosInstance.post<\n IndexerServerQueryResponseByType[TRequestType]\n >(url, reqBody);\n\n this.checkResponseStatus(response);\n\n return response.data;\n }\n\n protected async sign<T extends SignableRequestType>(\n requestType: T,\n verifyingContract: string,\n chainId: number,\n params: SignableRequestTypeToParams[T],\n ) {\n const walletClient =\n this.opts.linkedSignerWalletClient ?? this.opts.walletClient;\n\n if (!walletClient) {\n throw new WalletNotProvidedError();\n }\n\n return getSignedTransactionRequest({\n chainId,\n requestParams: params,\n requestType,\n walletClient,\n verifyingContract,\n });\n }\n\n private checkResponseStatus(response: AxiosResponse) {\n if (isIndexerServerFailureResponse(response.data)) {\n throw new IndexerServerFailureError(response.data, response.status);\n }\n if (response.status !== 200 || !response.data) {\n throw Error(\n `Unexpected response from server: ${response.status} ${response.statusText}`,\n );\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+JA,IAAa,oBAAb,MAA+B;CAO7B,YAAY,MAAyB;EACnC,KAAK,OAAO;EACZ,KAAK,gBAAgB,MAAA,QAAM,OAAO;GAChC,iBAAiB;GAEjB,sBAAsB;GACtB,UAAA,GAAA,eAAA,0BAAkC,KAAK,UAAU;EACnD,CAAC;EACD,KAAK,QAAQ,GAAG,KAAK,IAAI;EACzB,KAAK,QAAQ,GAAG,KAAK,IAAI;EACzB,KAAK,aAAa,GAAG,KAAK,IAAI;CAChC;;;;;;CAOA,gBACE,0BACA;EACA,KAAK,KAAK,2BAA2B,4BAA4B,KAAA;CACnE;;;;;;CAOA,MAAM,gBACJ,QACyC;EAGzC,QAAO,MAFoB,KAAK,MAAM,eAAe,MAAM,GAEvC,YAAY,KAAK,SAAS;GAC5C,MAAM,cAAA,GAAA,eAAA,mBAA+B,KAAK,UAAU;GACpD,OAAO;IACL,OAAO,KAAK;IACZ,WAAW,OAAO,KAAK,UAAU;IACjC,UAAU,KAAK;IACf,GAAG;GACL;EACF,CAAC;CACH;;;;;;;CAQA,MAAM,4BACJ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B,SAAS,MAAMC,oBAAAA,mBAAmB;CACrD;CAEA,MACE,aACA,QACyD;EACzD,OAAO,KAAK,aAAa,KAAK,OAAO,aAAa,MAAM;CAC1D;;;;;CAMA,aACE,aACA,QACyD;EACzD,OAAO,KAAK,aAAa,KAAK,YAAY,aAAa,MAAM;CAC/D;CAEA,MAAc,aAGZ,KACA,aACA,QACyD;EACzD,MAAM,UAAmC,GACtC,cAAc,OACjB;EACA,MAAM,WAAW,MAAM,KAAK,cAAc,KAExC,KAAK,OAAO;EAEd,KAAK,oBAAoB,QAAQ;EAEjC,OAAO,SAAS;CAClB;CAEA,MAAgB,KACd,aACA,mBACA,SACA,QACA;EACA,MAAM,eACJ,KAAK,KAAK,4BAA4B,KAAK,KAAK;EAElD,IAAI,CAAC,cACH,MAAM,IAAIC,eAAAA,uBAAuB;EAGnC,QAAA,GAAA,eAAA,6BAAmC;GACjC;GACA,eAAe;GACf;GACA;GACA;EACF,CAAC;CACH;CAEA,oBAA4B,UAAyB;EACnD,IAAIC,0BAAAA,+BAA+B,SAAS,IAAI,GAC9C,MAAM,IAAIC,wCAAAA,0BAA0B,SAAS,MAAM,SAAS,MAAM;EAEpE,IAAI,SAAS,WAAW,OAAO,CAAC,SAAS,MACvC,MAAM,MACJ,oCAAoC,SAAS,OAAO,GAAG,SAAS,YAClE;CAEJ;AACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_IndexerBaseClient = require("./IndexerBaseClient-
|
|
2
|
+
const require_IndexerBaseClient = require("./IndexerBaseClient-DxlRS6pt.cjs");
|
|
3
3
|
exports.IndexerBaseClient = require_IndexerBaseClient.IndexerBaseClient;
|
|
@@ -6,7 +6,6 @@ import { AxiosInstance } from "axios";
|
|
|
6
6
|
//#region src/IndexerBaseClient.d.ts
|
|
7
7
|
interface IndexerClientOpts {
|
|
8
8
|
url: string;
|
|
9
|
-
v2Url?: string;
|
|
10
9
|
walletClient?: WalletClientWithAccount;
|
|
11
10
|
linkedSignerWalletClient?: WalletClientWithAccount;
|
|
12
11
|
clientType?: string;
|
|
@@ -16,7 +15,9 @@ interface IndexerClientOpts {
|
|
|
16
15
|
*/
|
|
17
16
|
declare class IndexerBaseClient {
|
|
18
17
|
readonly opts: IndexerClientOpts;
|
|
18
|
+
readonly v1Url: string;
|
|
19
19
|
readonly v2Url: string;
|
|
20
|
+
readonly rewardsUrl: string;
|
|
20
21
|
readonly axiosInstance: AxiosInstance;
|
|
21
22
|
constructor(opts: IndexerClientOpts);
|
|
22
23
|
/**
|
|
@@ -260,6 +261,12 @@ declare class IndexerBaseClient {
|
|
|
260
261
|
*/
|
|
261
262
|
getV2Symbols(params?: GetIndexerV2SymbolsParams): Promise<GetIndexerV2SymbolsResponse>;
|
|
262
263
|
protected query<TRequestType extends IndexerServerQueryRequestType>(requestType: TRequestType, params: IndexerServerQueryRequestByType[TRequestType]): Promise<IndexerServerQueryResponseByType[TRequestType]>;
|
|
264
|
+
/**
|
|
265
|
+
* Runs a query against the rewards endpoint, which serves leaderboard, points,
|
|
266
|
+
* cash incentives, private alpha, and social account queries
|
|
267
|
+
*/
|
|
268
|
+
protected rewardsQuery<TRequestType extends IndexerServerQueryRequestType>(requestType: TRequestType, params: IndexerServerQueryRequestByType[TRequestType]): Promise<IndexerServerQueryResponseByType[TRequestType]>;
|
|
269
|
+
private queryWithUrl;
|
|
263
270
|
protected sign<T extends SignableRequestType>(requestType: T, verifyingContract: string, chainId: number, params: SignableRequestTypeToParams[T]): Promise<`0x${string}`>;
|
|
264
271
|
private checkResponseStatus;
|
|
265
272
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndexerBaseClient.d.cts","names":[],"sources":["../src/src/IndexerBaseClient.ts"],"mappings":";;;;;;UA+IiB,iBAAA;EAEf,GAAA;
|
|
1
|
+
{"version":3,"file":"IndexerBaseClient.d.cts","names":[],"sources":["../src/src/IndexerBaseClient.ts"],"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b,MAAA,EAAQ,+BAAA,CAAgC,YAAA,IACvC,OAAA,CAAQ,gCAAA,CAAiC,YAAA;EAAA,QAI9B,YAAA;EAAA,UAmBE,IAAA,WAAe,mBAAA,CAAA,CAC7B,WAAA,EAAa,CAAA,EACb,iBAAA,UACA,OAAA,UACA,MAAA,EAAQ,2BAAA,CAA4B,CAAA,IAAE,OAAA;EAAA,QAkBhC,mBAAA;AAAA"}
|
|
@@ -6,7 +6,6 @@ import { AxiosInstance } from "axios";
|
|
|
6
6
|
//#region src/IndexerBaseClient.d.ts
|
|
7
7
|
interface IndexerClientOpts {
|
|
8
8
|
url: string;
|
|
9
|
-
v2Url?: string;
|
|
10
9
|
walletClient?: WalletClientWithAccount;
|
|
11
10
|
linkedSignerWalletClient?: WalletClientWithAccount;
|
|
12
11
|
clientType?: string;
|
|
@@ -16,7 +15,9 @@ interface IndexerClientOpts {
|
|
|
16
15
|
*/
|
|
17
16
|
declare class IndexerBaseClient {
|
|
18
17
|
readonly opts: IndexerClientOpts;
|
|
18
|
+
readonly v1Url: string;
|
|
19
19
|
readonly v2Url: string;
|
|
20
|
+
readonly rewardsUrl: string;
|
|
20
21
|
readonly axiosInstance: AxiosInstance;
|
|
21
22
|
constructor(opts: IndexerClientOpts);
|
|
22
23
|
/**
|
|
@@ -260,6 +261,12 @@ declare class IndexerBaseClient {
|
|
|
260
261
|
*/
|
|
261
262
|
getV2Symbols(params?: GetIndexerV2SymbolsParams): Promise<GetIndexerV2SymbolsResponse>;
|
|
262
263
|
protected query<TRequestType extends IndexerServerQueryRequestType>(requestType: TRequestType, params: IndexerServerQueryRequestByType[TRequestType]): Promise<IndexerServerQueryResponseByType[TRequestType]>;
|
|
264
|
+
/**
|
|
265
|
+
* Runs a query against the rewards endpoint, which serves leaderboard, points,
|
|
266
|
+
* cash incentives, private alpha, and social account queries
|
|
267
|
+
*/
|
|
268
|
+
protected rewardsQuery<TRequestType extends IndexerServerQueryRequestType>(requestType: TRequestType, params: IndexerServerQueryRequestByType[TRequestType]): Promise<IndexerServerQueryResponseByType[TRequestType]>;
|
|
269
|
+
private queryWithUrl;
|
|
263
270
|
protected sign<T extends SignableRequestType>(requestType: T, verifyingContract: string, chainId: number, params: SignableRequestTypeToParams[T]): Promise<`0x${string}`>;
|
|
264
271
|
private checkResponseStatus;
|
|
265
272
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndexerBaseClient.d.ts","names":[],"sources":["../src/src/IndexerBaseClient.ts"],"mappings":";;;;;;UA+IiB,iBAAA;EAEf,GAAA;
|
|
1
|
+
{"version":3,"file":"IndexerBaseClient.d.ts","names":[],"sources":["../src/src/IndexerBaseClient.ts"],"mappings":";;;;;;UA+IiB,iBAAA;EAEf,GAAA;EAEA,YAAA,GAAe,uBAAA;EAEf,wBAAA,GAA2B,uBAAuB;EAElD,UAAA;AAAA;;;;cAQW,iBAAA;EAAA,SACF,IAAA,EAAM,iBAAA;EAAA,SACN,KAAA;EAAA,SACA,KAAA;EAAA,SACA,UAAA;EAAA,SACA,aAAA,EAAe,aAAA;cAEZ,IAAA,EAAM,iBAAA;EAPP;;;;;EAyBJ,eAAA,CACL,wBAAA,EAA0B,uBAAA;EAAA;;;;;EAUtB,eAAA,CACJ,MAAA,EAAQ,4BAAA,GACP,OAAA,CAAQ,8BAAA;EAsBR;;;;;;EAFG,2BAAA,CACJ,MAAA,EAAQ,wCAAA,GACP,OAAA,CAAQ,0CAAA;EAgFD;;;;;EAlCJ,eAAA,CACJ,MAAA,EAAQ,4BAAA,GACP,OAAA,CAAQ,8BAAA;EA4ED;;;;EA3DJ,cAAA,CACJ,MAAA,EAAQ,2BAAA,GACP,OAAA,CAAQ,6BAAA;EAwER;;;;EA5DG,2BAAA,CACJ,MAAA,EAAQ,wCAAA,GACP,OAAA,CAAQ,0CAAA;EAsFA;;;;;;;;;EArEL,qBAAA,CACJ,MAAA,EAAQ,kCAAA,GACP,OAAA,CAAQ,oCAAA;EAyHR;;;;;;;;;;;;EAlGG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,EAAQ,yBAAA,GACP,OAAA,CAAQ,2BAAA;EA5pBR;;;;EA8rBG,YAAA,CACJ,MAAA,EAAQ,yBAAA,GACP,OAAA,CAAQ,2BAAA;EAzqBR;;;;EAyrBG,YAAA,CACJ,MAAA,GAAS,yBAAA,GACR,OAAA,CAAQ,2BAAA;EAAA,UAiBD,KAAA,sBAA2B,6BAAA,CAAA,CACnC,WAAA,EAAa,YAAA,EACb,MAAA,EAAQ,+BAAA,CAAgC,YAAA,IACvC,OAAA,CAAQ,gCAAA,CAAiC,YAAA;EA7pBjC;;;;EAAA,UAqqBD,YAAA,sBAAkC,6BAAA,CAAA,CAC1C,WAAA,EAAa,YAAA,EACb,MAAA,EAAQ,+BAAA,CAAgC,YAAA,IACvC,OAAA,CAAQ,gCAAA,CAAiC,YAAA;EAAA,QAI9B,YAAA;EAAA,UAmBE,IAAA,WAAe,mBAAA,CAAA,CAC7B,WAAA,EAAa,CAAA,EACb,iBAAA,UACA,OAAA,UACA,MAAA,EAAQ,2BAAA,CAA4B,CAAA,IAAE,OAAA;EAAA,QAkBhC,mBAAA;AAAA"}
|
|
@@ -15,7 +15,9 @@ var IndexerBaseClient = class {
|
|
|
15
15
|
validateStatus: () => true,
|
|
16
16
|
headers: getNadoClientTypeHeaders(opts.clientType)
|
|
17
17
|
});
|
|
18
|
-
this.
|
|
18
|
+
this.v1Url = `${opts.url}/v1`;
|
|
19
|
+
this.v2Url = `${opts.url}/v2`;
|
|
20
|
+
this.rewardsUrl = `${opts.url}/rewards/v1`;
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
21
23
|
* Sets the linked signer for execute requests
|
|
@@ -399,7 +401,7 @@ var IndexerBaseClient = class {
|
|
|
399
401
|
* @param params
|
|
400
402
|
*/
|
|
401
403
|
async getLeaderboard(params) {
|
|
402
|
-
return { participants: (await this.
|
|
404
|
+
return { participants: (await this.rewardsQuery("leaderboard", {
|
|
403
405
|
contest_id: params.contestId,
|
|
404
406
|
rank_type: params.rankType,
|
|
405
407
|
start: params.startCursor,
|
|
@@ -413,7 +415,7 @@ var IndexerBaseClient = class {
|
|
|
413
415
|
* @param params
|
|
414
416
|
*/
|
|
415
417
|
async getLeaderboardParticipant(params) {
|
|
416
|
-
return { participant: mapValues((await this.
|
|
418
|
+
return { participant: mapValues((await this.rewardsQuery("leaderboard_rank", {
|
|
417
419
|
subaccount: subaccountToHex(params.subaccount),
|
|
418
420
|
contest_ids: params.contestIds
|
|
419
421
|
})).positions, (position) => mapIndexerLeaderboardPosition(position)) };
|
|
@@ -434,7 +436,7 @@ var IndexerBaseClient = class {
|
|
|
434
436
|
tx: getNadoEIP712Values("leaderboard_authentication", signatureParams),
|
|
435
437
|
signature: await this.sign("leaderboard_authentication", params.verifyingAddr, params.chainId, signatureParams)
|
|
436
438
|
};
|
|
437
|
-
return { registrations: (await this.
|
|
439
|
+
return { registrations: (await this.rewardsQuery("leaderboard_register", { update_registration: updateRegistrationTx })).registrations.map(mapIndexerLeaderboardRegistration) };
|
|
438
440
|
}
|
|
439
441
|
/**
|
|
440
442
|
* Retrieves contest registrations for a subaccount. Supports batch lookup
|
|
@@ -443,7 +445,7 @@ var IndexerBaseClient = class {
|
|
|
443
445
|
* @param params - Query parameters including subaccount and contest IDs.
|
|
444
446
|
*/
|
|
445
447
|
async getLeaderboardRegistrations(params) {
|
|
446
|
-
return { registrations: (await this.
|
|
448
|
+
return { registrations: (await this.rewardsQuery("leaderboard_registrations", {
|
|
447
449
|
subaccount: subaccountToHex(params.subaccount),
|
|
448
450
|
contest_ids: params.contestIds,
|
|
449
451
|
active: params.active
|
|
@@ -455,7 +457,7 @@ var IndexerBaseClient = class {
|
|
|
455
457
|
* @param params
|
|
456
458
|
*/
|
|
457
459
|
async getLeaderboardContests(params) {
|
|
458
|
-
return { contests: (await this.
|
|
460
|
+
return { contests: (await this.rewardsQuery("leaderboard_contests", {
|
|
459
461
|
contest_ids: params.contestIds,
|
|
460
462
|
active: params.active
|
|
461
463
|
})).contests.map(mapIndexerLeaderboardContest) };
|
|
@@ -505,7 +507,7 @@ var IndexerBaseClient = class {
|
|
|
505
507
|
* @param params
|
|
506
508
|
*/
|
|
507
509
|
async getPrivateAlphaChoice(params) {
|
|
508
|
-
const baseResponse = await this.
|
|
510
|
+
const baseResponse = await this.rewardsQuery("private_alpha_choice", { address: params.address });
|
|
509
511
|
return {
|
|
510
512
|
points: toBigNumber(baseResponse.points),
|
|
511
513
|
feeRefund: toBigNumber(baseResponse.fee_refund),
|
|
@@ -517,7 +519,7 @@ var IndexerBaseClient = class {
|
|
|
517
519
|
* @param params
|
|
518
520
|
*/
|
|
519
521
|
async getPoints(params) {
|
|
520
|
-
const baseResponse = await this.
|
|
522
|
+
const baseResponse = await this.rewardsQuery("nado_points", { address: params.address });
|
|
521
523
|
return {
|
|
522
524
|
pointsPerEpoch: baseResponse.points_per_epoch.map((epoch) => ({
|
|
523
525
|
epoch: epoch.epoch,
|
|
@@ -542,7 +544,7 @@ var IndexerBaseClient = class {
|
|
|
542
544
|
* @param params
|
|
543
545
|
*/
|
|
544
546
|
async getXPoints(params) {
|
|
545
|
-
const baseResponse = await this.
|
|
547
|
+
const baseResponse = await this.rewardsQuery("nado_xpoints", { address: params.address });
|
|
546
548
|
const mapQuests = (quests) => quests.map((quest) => ({
|
|
547
549
|
questType: quest.quest_type,
|
|
548
550
|
points: toBigNumber(quest.points)
|
|
@@ -571,7 +573,7 @@ var IndexerBaseClient = class {
|
|
|
571
573
|
* @param params
|
|
572
574
|
*/
|
|
573
575
|
async getCashIncentives(params) {
|
|
574
|
-
const baseResponse = await this.
|
|
576
|
+
const baseResponse = await this.rewardsQuery("cash_incentives", { wallet_address: params.address });
|
|
575
577
|
return {
|
|
576
578
|
events: baseResponse.events.map((event) => ({
|
|
577
579
|
metadata: {
|
|
@@ -620,7 +622,7 @@ var IndexerBaseClient = class {
|
|
|
620
622
|
};
|
|
621
623
|
const tx = getNadoEIP712Values("social_authentication", signatureParams);
|
|
622
624
|
const signature = await this.sign("social_authentication", params.verifyingAddr, params.chainId, signatureParams);
|
|
623
|
-
return { url: (await this.
|
|
625
|
+
return { url: (await this.rewardsQuery("social_connect", { update_social_account: {
|
|
624
626
|
tx,
|
|
625
627
|
signature
|
|
626
628
|
} })).url };
|
|
@@ -631,7 +633,7 @@ var IndexerBaseClient = class {
|
|
|
631
633
|
* @param params - Query parameters including the wallet address.
|
|
632
634
|
*/
|
|
633
635
|
async listSocialAccounts(params) {
|
|
634
|
-
return { accounts: (await this.
|
|
636
|
+
return { accounts: (await this.rewardsQuery("list_social_accounts", { address: params.address })).accounts.map((a) => ({
|
|
635
637
|
provider: a.provider,
|
|
636
638
|
username: a.username,
|
|
637
639
|
displayName: a.display_name,
|
|
@@ -652,7 +654,7 @@ var IndexerBaseClient = class {
|
|
|
652
654
|
};
|
|
653
655
|
const tx = getNadoEIP712Values("social_authentication", signatureParams);
|
|
654
656
|
const signature = await this.sign("social_authentication", params.verifyingAddr, params.chainId, signatureParams);
|
|
655
|
-
return { accounts: (await this.
|
|
657
|
+
return { accounts: (await this.rewardsQuery("revoke_social_account", { update_social_account: {
|
|
656
658
|
tx,
|
|
657
659
|
signature
|
|
658
660
|
} })).accounts.map((a) => ({
|
|
@@ -683,9 +685,19 @@ var IndexerBaseClient = class {
|
|
|
683
685
|
this.checkResponseStatus(response);
|
|
684
686
|
return mapValues(response.data, mapIndexerV2Symbols);
|
|
685
687
|
}
|
|
686
|
-
|
|
688
|
+
query(requestType, params) {
|
|
689
|
+
return this.queryWithUrl(this.v1Url, requestType, params);
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Runs a query against the rewards endpoint, which serves leaderboard, points,
|
|
693
|
+
* cash incentives, private alpha, and social account queries
|
|
694
|
+
*/
|
|
695
|
+
rewardsQuery(requestType, params) {
|
|
696
|
+
return this.queryWithUrl(this.rewardsUrl, requestType, params);
|
|
697
|
+
}
|
|
698
|
+
async queryWithUrl(url, requestType, params) {
|
|
687
699
|
const reqBody = { [requestType]: params };
|
|
688
|
-
const response = await this.axiosInstance.post(
|
|
700
|
+
const response = await this.axiosInstance.post(url, reqBody);
|
|
689
701
|
this.checkResponseStatus(response);
|
|
690
702
|
return response.data;
|
|
691
703
|
}
|