rain-sdk-v2 2.1.1 → 2.1.3

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/README.md CHANGED
@@ -952,6 +952,9 @@ const pool = await rain.getPoolByContractAddress({ contractAddress: '0x...' });
952
952
  // Search pools
953
953
  const results = await rain.searchPool({ query: 'bitcoin', limit: 10, offset: 0 });
954
954
 
955
+ // Get trending tags (ranked by market activity in last 24h)
956
+ const tags = await rain.getTrendingTags({ limit: 10 });
957
+
955
958
  // Get featured pools
956
959
  const featured = await rain.getFeaturedPools({ limit: 10, offset: 0 });
957
960
 
package/dist/Rain.d.ts CHANGED
@@ -5,7 +5,7 @@ import { RainCoreConfig, RainEnvironment } from './types.js';
5
5
  import { LoginParams, LoginResult } from './auth/types.js';
6
6
  import { SellProceedsResult } from './markets/getSellProceeds.js';
7
7
  import { EntrySharesResult } from './markets/getEntryShares.js';
8
- import type { UserProfileUpdateParams, UserHistoryParams, CreateCommentParams, CommentsListingParams, UpdateCommentParams, CommentCountParams, PublicPoolsParams, PrivatePoolsParams, PoolListingByCreatorParams, VerifyAccessCodeParams, PoolTotalParticipantsParams, SearchPoolParams, RelatedPoolsParams, UpdateStreamingParams, UpdatePoolResolutionTimeParams, FindPoolFallbackParams, SignOraclesExtendTimeParams, UserTotalInvestmentParams, OptionsTotalVolumeParams, PoolActivityParams, TopHoldersParams, UserInvestedPoolsParams, InvestmentVolumeGraphParams, UserPnlGraphParams, TopWinnersLosersParams, PnlByPoolIdParams, UserPositionsParams, OpenPositionsParams, UserSharePositionsParams, SearchInvestedPoolsParams, PriceDataParams, AddReviewParams, GetUserOrdersParams, OrderBookParams, GetUserOrderByPoolIdParams, OrdersListingByPoolParams, AddUserPointsParams, UserOnboardingParams, PointsGraphParams, GetNotificationsParams, MarkNotificationAsReadParams, CreateDisputeMessageParams, GetPoolDisputeConvoParams, FollowToggleParams, FollowCheckParams, FollowListParams, FollowStatsParams, RainBurnPerPoolParams, ToggleBookmarkParams, GetBookmarksParams, CheckBookmarkParams } from './api/types.js';
8
+ import type { UserProfileUpdateParams, UserHistoryParams, CreateCommentParams, CommentsListingParams, UpdateCommentParams, CommentCountParams, PublicPoolsParams, PrivatePoolsParams, PoolListingByCreatorParams, VerifyAccessCodeParams, PoolTotalParticipantsParams, SearchPoolParams, RelatedPoolsParams, UpdateStreamingParams, UpdatePoolResolutionTimeParams, FindPoolFallbackParams, SignOraclesExtendTimeParams, TrendingTagsParams, UserTotalInvestmentParams, OptionsTotalVolumeParams, PoolActivityParams, TopHoldersParams, UserInvestedPoolsParams, InvestmentVolumeGraphParams, UserPnlGraphParams, TopWinnersLosersParams, PnlByPoolIdParams, UserPositionsParams, OpenPositionsParams, UserSharePositionsParams, SearchInvestedPoolsParams, PriceDataParams, AddReviewParams, GetUserOrdersParams, OrderBookParams, GetUserOrderByPoolIdParams, OrdersListingByPoolParams, AddUserPointsParams, UserOnboardingParams, PointsGraphParams, GetNotificationsParams, MarkNotificationAsReadParams, CreateDisputeMessageParams, GetPoolDisputeConvoParams, FollowToggleParams, FollowCheckParams, FollowListParams, FollowStatsParams, RainBurnPerPoolParams, ToggleBookmarkParams, GetBookmarksParams, CheckBookmarkParams } from './api/types.js';
9
9
  export declare class Rain {
10
10
  readonly environment: RainEnvironment;
11
11
  private readonly marketFactory;
@@ -235,6 +235,7 @@ export declare class Rain {
235
235
  checkTokenExpiration(accessToken: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
236
236
  updatePoolResolutionTime(params: UpdatePoolResolutionTimeParams, accessToken: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
237
237
  findPoolFallback(params: FindPoolFallbackParams, accessToken: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
238
+ getTrendingTags(params: TrendingTagsParams): Promise<import("./api/types.js").ApiResponse<unknown>>;
238
239
  getFeaturedPools(accessToken?: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
239
240
  getUserTotalInvestment(params: UserTotalInvestmentParams, accessToken: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
240
241
  getOptionsTotalVolume(params: OptionsTotalVolumeParams, accessToken?: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
package/dist/Rain.js CHANGED
@@ -333,6 +333,9 @@ export class Rain {
333
333
  async findPoolFallback(params, accessToken) {
334
334
  return poolsApi.findPoolFallback(params, this.cfg(accessToken));
335
335
  }
336
+ async getTrendingTags(params) {
337
+ return poolsApi.getTrendingTags(params, this.cfg());
338
+ }
336
339
  async getFeaturedPools(accessToken) {
337
340
  return poolsApi.getFeaturedPools(this.cfg(accessToken));
338
341
  }
@@ -1,4 +1,4 @@
1
- import { ApiConfig, ApiResponse, PublicPoolsParams, PrivatePoolsParams, PoolListingByCreatorParams, VerifyAccessCodeParams, PoolTotalParticipantsParams, SearchPoolParams, RelatedPoolsParams, UpdateStreamingParams, UpdatePoolResolutionTimeParams, FindPoolFallbackParams, SignOraclesExtendTimeParams } from './types.js';
1
+ import { ApiConfig, ApiResponse, PublicPoolsParams, PrivatePoolsParams, PoolListingByCreatorParams, VerifyAccessCodeParams, PoolTotalParticipantsParams, SearchPoolParams, RelatedPoolsParams, UpdateStreamingParams, UpdatePoolResolutionTimeParams, FindPoolFallbackParams, SignOraclesExtendTimeParams, TrendingTagsParams } from './types.js';
2
2
  export declare function accessPool(params: {
3
3
  poolId: string;
4
4
  accessCode: string;
@@ -38,4 +38,5 @@ export declare function getPoolResolutionHistory(params: {
38
38
  }, config: ApiConfig): Promise<ApiResponse>;
39
39
  export declare function updatePoolResolutionTime(params: UpdatePoolResolutionTimeParams, config: ApiConfig): Promise<ApiResponse>;
40
40
  export declare function findPoolFallback(params: FindPoolFallbackParams, config: ApiConfig): Promise<ApiResponse>;
41
+ export declare function getTrendingTags(params: TrendingTagsParams, config: ApiConfig): Promise<ApiResponse>;
41
42
  export declare function getFeaturedPools(config: ApiConfig): Promise<ApiResponse>;
package/dist/api/pools.js CHANGED
@@ -140,6 +140,14 @@ export async function findPoolFallback(params, config) {
140
140
  });
141
141
  return handleResponse(res);
142
142
  }
143
+ export async function getTrendingTags(params, config) {
144
+ const qs = buildQuery({ limit: params.limit });
145
+ const res = await fetch(`${config.apiUrl}/pools/trending-tags${qs}`, {
146
+ method: 'GET',
147
+ headers: buildHeaders(config),
148
+ });
149
+ return handleResponse(res);
150
+ }
143
151
  export async function getFeaturedPools(config) {
144
152
  const res = await fetch(`${config.apiUrl}/pools/get-featured-pools`, {
145
153
  method: 'GET',
@@ -130,6 +130,9 @@ export interface PoolTotalParticipantsParams {
130
130
  export interface SearchPoolParams {
131
131
  question: string;
132
132
  }
133
+ export interface TrendingTagsParams {
134
+ limit?: number;
135
+ }
133
136
  export interface RelatedPoolsParams {
134
137
  poolId: string;
135
138
  limit?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rain-sdk-v2",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "type": "module",
5
5
  "description": "Rain SDK V2 — TypeScript SDK for Rain prediction markets on Arbitrum. Market creation, trading, liquidity, order book, split/merge, dispute, and smart account support.",
6
6
  "main": "dist/index.js",