@medialane/sdk 0.48.1 → 0.50.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/index.cjs +31 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +82 -2
- package/dist/index.d.ts +82 -2
- package/dist/index.js +31 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -411,6 +411,7 @@ declare class Medialane1155Module {
|
|
|
411
411
|
|
|
412
412
|
type IPType = "Audio" | "Art" | "Documents" | "NFT" | "Video" | "Photography" | "Patents" | "Posts" | "Publications" | "RWA" | "Software" | "Custom";
|
|
413
413
|
type CollectionSort = "recent" | "supply" | "floor" | "volume" | "name";
|
|
414
|
+
type CollectionTokensSort = "recent" | "oldest" | "name";
|
|
414
415
|
/** Bounded capability set (05-service-model §III). Expand the union when a
|
|
415
416
|
* service needs behavior outside it — never make it free-form. */
|
|
416
417
|
type ServiceCapability = "list" | "buy" | "make_offer" | "cancel" | "transfer" | "burn" | "mint" | "claim" | "airdrop" | "remix" | "license" | "subscribe" | "redeem" | "launch" | "swap" | "sponsor";
|
|
@@ -1164,6 +1165,75 @@ interface DropMintStatus {
|
|
|
1164
1165
|
mintedByWallet: number;
|
|
1165
1166
|
totalMinted: number;
|
|
1166
1167
|
}
|
|
1168
|
+
interface ApiRewardsBadge {
|
|
1169
|
+
key: string;
|
|
1170
|
+
name: string;
|
|
1171
|
+
description: string;
|
|
1172
|
+
icon: string;
|
|
1173
|
+
color: string;
|
|
1174
|
+
category: string;
|
|
1175
|
+
}
|
|
1176
|
+
interface ApiRewardsLevel {
|
|
1177
|
+
level: number;
|
|
1178
|
+
name: string;
|
|
1179
|
+
xpRequired: number;
|
|
1180
|
+
badgeColor: string;
|
|
1181
|
+
description: string | null;
|
|
1182
|
+
}
|
|
1183
|
+
interface ApiUserRewards {
|
|
1184
|
+
address: string;
|
|
1185
|
+
accountId: string | null;
|
|
1186
|
+
publicId: string | null;
|
|
1187
|
+
totalXp: number;
|
|
1188
|
+
currentLevel: number;
|
|
1189
|
+
currentLevelName: string;
|
|
1190
|
+
badgeColor: string;
|
|
1191
|
+
nextLevel: {
|
|
1192
|
+
level: number;
|
|
1193
|
+
name: string;
|
|
1194
|
+
xpRequired: number;
|
|
1195
|
+
} | null;
|
|
1196
|
+
progressPct: number;
|
|
1197
|
+
breakdown: Record<string, number>;
|
|
1198
|
+
badges: ApiRewardsBadge[];
|
|
1199
|
+
computedAt: string | null;
|
|
1200
|
+
}
|
|
1201
|
+
interface ApiRewardsLeaderboardEntry {
|
|
1202
|
+
rank: number;
|
|
1203
|
+
address: string;
|
|
1204
|
+
accountId: string | null;
|
|
1205
|
+
publicId: string | null;
|
|
1206
|
+
totalXp: number;
|
|
1207
|
+
currentLevel: number;
|
|
1208
|
+
currentLevelName: string;
|
|
1209
|
+
badgeColor: string;
|
|
1210
|
+
}
|
|
1211
|
+
interface ApiRewardsConfig {
|
|
1212
|
+
levels: ApiRewardsLevel[];
|
|
1213
|
+
actions: {
|
|
1214
|
+
type: string;
|
|
1215
|
+
label: string;
|
|
1216
|
+
xp: number;
|
|
1217
|
+
dailyCap: number | null;
|
|
1218
|
+
}[];
|
|
1219
|
+
badges: ApiRewardsBadge[];
|
|
1220
|
+
}
|
|
1221
|
+
interface ApiRewardsBatchEntry {
|
|
1222
|
+
address: string;
|
|
1223
|
+
totalXp: number;
|
|
1224
|
+
currentLevel: number;
|
|
1225
|
+
currentLevelName: string;
|
|
1226
|
+
badgeColor: string;
|
|
1227
|
+
}
|
|
1228
|
+
interface ApiPointEvent {
|
|
1229
|
+
id: string;
|
|
1230
|
+
actionType: string;
|
|
1231
|
+
xp: number;
|
|
1232
|
+
multiplier: number;
|
|
1233
|
+
finalXp: number;
|
|
1234
|
+
txHash: string | null;
|
|
1235
|
+
createdAt: string;
|
|
1236
|
+
}
|
|
1167
1237
|
|
|
1168
1238
|
declare class MedialaneApiError extends Error {
|
|
1169
1239
|
readonly status: number;
|
|
@@ -1194,7 +1264,7 @@ declare class ApiClient {
|
|
|
1194
1264
|
getCollections(page?: number, limit?: number, isKnown?: boolean, sort?: CollectionSort, service?: string): Promise<ApiResponse<ApiCollection[]>>;
|
|
1195
1265
|
getCollectionsByOwner(owner: string, page?: number, limit?: number): Promise<ApiResponse<ApiCollection[]>>;
|
|
1196
1266
|
getCollection(contract: string): Promise<ApiResponse<ApiCollection>>;
|
|
1197
|
-
getCollectionTokens(contract: string, page?: number, limit?: number): Promise<ApiResponse<ApiToken[]>>;
|
|
1267
|
+
getCollectionTokens(contract: string, page?: number, limit?: number, sort?: CollectionTokensSort): Promise<ApiResponse<ApiToken[]>>;
|
|
1198
1268
|
getActivities(query?: ApiActivitiesQuery): Promise<ApiResponse<ApiActivity[]>>;
|
|
1199
1269
|
getActivitiesByAddress(address: string, page?: number, limit?: number): Promise<ApiResponse<ApiActivity[]>>;
|
|
1200
1270
|
getTokenComments(contract: string, tokenId: string, opts?: {
|
|
@@ -1394,6 +1464,16 @@ declare class ApiClient {
|
|
|
1394
1464
|
sort?: CollectionSort;
|
|
1395
1465
|
}): Promise<ApiResponse<ApiCollection[]>>;
|
|
1396
1466
|
getDropMintStatus(collection: string, wallet: string): Promise<DropMintStatus>;
|
|
1467
|
+
/** Score + level + progress + badges for one address (zeroed for unknown). */
|
|
1468
|
+
getRewards(address: string): Promise<ApiUserRewards>;
|
|
1469
|
+
/** Paginated XP leaderboard. */
|
|
1470
|
+
getRewardsLeaderboard(page?: number, limit?: number): Promise<ApiResponse<ApiRewardsLeaderboardEntry[]>>;
|
|
1471
|
+
/** Point-event history for an address. */
|
|
1472
|
+
getRewardsEvents(address: string, page?: number, limit?: number): Promise<ApiResponse<ApiPointEvent[]>>;
|
|
1473
|
+
/** Reward configuration: level ladder, enabled action XP values, badge catalog. */
|
|
1474
|
+
getRewardsConfig(): Promise<ApiRewardsConfig>;
|
|
1475
|
+
/** Minimal level info for up to 50 addresses — one call per list page. */
|
|
1476
|
+
getRewardsBatch(addresses: string[]): Promise<ApiRewardsBatchEntry[]>;
|
|
1397
1477
|
}
|
|
1398
1478
|
|
|
1399
1479
|
interface CreatePopCollectionParams {
|
|
@@ -9280,4 +9360,4 @@ declare function build1155OrderTypedData(message: Record<string, unknown>, chain
|
|
|
9280
9360
|
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
9281
9361
|
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
9282
9362
|
|
|
9283
|
-
export { ADMIN_HEADERS, ADMIN_SCOPE, type ActivityType, type AddSupplyParams, type AdminGrant, type AdminRequest, type AdminRequestSig, type AdminSession, type AdminSessionTypedDataInput, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, type ApiChain, ApiClient, type ApiCoin, type ApiCoinsQuery, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintEditionParams, type BuildFeeCallParams, CHAINS, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type Chain, type ChainCoordinates, type ClaimConditions, ClubService, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateClubParams, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateCreatorCoinParams, type CreateDropParams, type CreateGrantOpts, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateSponsorshipOfferParams, type CreateTicketCollectionParams, type CreateWebhookParams, CreatorCoinFactoryABI, type CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, DEFAULT_CHAIN, DEFAULT_CURRENCY, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EnforcementDeclaration, type FailoverFetchOptions, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, IPClubABI, IPClubNFTABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, type IPType, type IntentCall, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, LAUNCH_PRICE_QUOTE_PER_COIN, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintEditionParams, type MintParams, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, PUBLIC_RPC_FALLBACKS, type ParsedAdminHeaders, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type RequestSiwsTokenArgs, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, STARKNET_COLLECTION_1155_CLASS_HASH, STARKNET_COLLECTION_1155_CONTRACT, STARKNET_COLLECTION_1155_FACTORY_CLASS_HASH, STARKNET_COLLECTION_1155_START_BLOCK, STARKNET_COLLECTION_721_CONTRACT, STARKNET_COLLECTION_721_START_BLOCK, STARKNET_CREATOR_COIN_CLASS_HASH, STARKNET_CREATOR_COIN_EKUBO_LAUNCHER, STARKNET_CREATOR_COIN_FACTORY_CLASS_HASH, STARKNET_CREATOR_COIN_FACTORY_CONTRACT, STARKNET_CREATOR_COIN_START_BLOCK, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_IPCOLLECTION_CLASS_HASH, STARKNET_IPNFT_CLASS_HASH, STARKNET_IP_CLUB_NFT_CLASS_HASH, STARKNET_IP_CLUB_REGISTRY_CONTRACT, STARKNET_IP_SPONSORSHIP_CONTRACT, STARKNET_IP_SPONSORSHIP_LICENSE_CONTRACT, STARKNET_IP_TICKETS_FACTORY_CONTRACT, STARKNET_IP_TICKET_COLLECTION_CLASS_HASH, STARKNET_MARKETPLACE_1155_CLASS_HASH, STARKNET_MARKETPLACE_1155_CONTRACT, STARKNET_MARKETPLACE_1155_START_BLOCK, STARKNET_MARKETPLACE_721_CLASS_HASH, STARKNET_MARKETPLACE_721_CONTRACT, STARKNET_MARKETPLACE_721_START_BLOCK, STARKNET_NFTCOMMENTS_CONTRACT, STARKNET_POP_COLLECTION_CLASS_HASH, STARKNET_POP_FACTORY_CONTRACT, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type ServiceEventDeclaration, type ServiceId, type SiwsSigner, type SortOrder, SponsorshipService, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, TicketService, type TxResult, VALIDATED_EKUBO_PARAMS, type WebhookEventType, type WebhookStatus, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancellationTypedData, buildCreateCreatorCoinCall, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buybackQuoteRaw, toRaw as coinToRaw, createAdminSessionGrant, createFailoverFetch, encodeAdminHeaders, encodeByteArray, fdvHuman, formatAmount, getCoordinates, getCreatorCoinPrice, getListableTokens, getService, getServicesByCapability, getSiwsStorageKey, getStoredSiwsToken, getTokenByAddress, getTokenBySymbol, hasCapability, isServiceId, isSiwsTokenValid, isTransientRpcError, listServices, normalizeAddress, normalizeHash, normalizeSiwsSignature, parseAdminHeaders, parseAmount, parseCreatorCoinCreated, randomNonce, requestSiwsToken, resolveConfig, resolveFeeConfig, sessionKeyHashOf, shortenAddress, signAdminRequest, storeSiwsToken, stringifyBigInts, teamCoinsRaw, u256ToBigInt, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
|
|
9363
|
+
export { ADMIN_HEADERS, ADMIN_SCOPE, type ActivityType, type AddSupplyParams, type AdminGrant, type AdminRequest, type AdminRequestSig, type AdminSession, type AdminSessionTypedDataInput, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, type ApiChain, ApiClient, type ApiCoin, type ApiCoinsQuery, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPointEvent, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiRewardsBadge, type ApiRewardsBatchEntry, type ApiRewardsConfig, type ApiRewardsLeaderboardEntry, type ApiRewardsLevel, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserRewards, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintEditionParams, type BuildFeeCallParams, CHAINS, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type Chain, type ChainCoordinates, type ClaimConditions, ClubService, type CollectionSort, type CollectionTokensSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateClubParams, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateCreatorCoinParams, type CreateDropParams, type CreateGrantOpts, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateSponsorshipOfferParams, type CreateTicketCollectionParams, type CreateWebhookParams, CreatorCoinFactoryABI, type CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, DEFAULT_CHAIN, DEFAULT_CURRENCY, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EnforcementDeclaration, type FailoverFetchOptions, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, IPClubABI, IPClubNFTABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, type IPType, type IntentCall, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, LAUNCH_PRICE_QUOTE_PER_COIN, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintEditionParams, type MintParams, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, PUBLIC_RPC_FALLBACKS, type ParsedAdminHeaders, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type RequestSiwsTokenArgs, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, STARKNET_COLLECTION_1155_CLASS_HASH, STARKNET_COLLECTION_1155_CONTRACT, STARKNET_COLLECTION_1155_FACTORY_CLASS_HASH, STARKNET_COLLECTION_1155_START_BLOCK, STARKNET_COLLECTION_721_CONTRACT, STARKNET_COLLECTION_721_START_BLOCK, STARKNET_CREATOR_COIN_CLASS_HASH, STARKNET_CREATOR_COIN_EKUBO_LAUNCHER, STARKNET_CREATOR_COIN_FACTORY_CLASS_HASH, STARKNET_CREATOR_COIN_FACTORY_CONTRACT, STARKNET_CREATOR_COIN_START_BLOCK, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_IPCOLLECTION_CLASS_HASH, STARKNET_IPNFT_CLASS_HASH, STARKNET_IP_CLUB_NFT_CLASS_HASH, STARKNET_IP_CLUB_REGISTRY_CONTRACT, STARKNET_IP_SPONSORSHIP_CONTRACT, STARKNET_IP_SPONSORSHIP_LICENSE_CONTRACT, STARKNET_IP_TICKETS_FACTORY_CONTRACT, STARKNET_IP_TICKET_COLLECTION_CLASS_HASH, STARKNET_MARKETPLACE_1155_CLASS_HASH, STARKNET_MARKETPLACE_1155_CONTRACT, STARKNET_MARKETPLACE_1155_START_BLOCK, STARKNET_MARKETPLACE_721_CLASS_HASH, STARKNET_MARKETPLACE_721_CONTRACT, STARKNET_MARKETPLACE_721_START_BLOCK, STARKNET_NFTCOMMENTS_CONTRACT, STARKNET_POP_COLLECTION_CLASS_HASH, STARKNET_POP_FACTORY_CONTRACT, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type ServiceEventDeclaration, type ServiceId, type SiwsSigner, type SortOrder, SponsorshipService, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, TicketService, type TxResult, VALIDATED_EKUBO_PARAMS, type WebhookEventType, type WebhookStatus, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancellationTypedData, buildCreateCreatorCoinCall, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buybackQuoteRaw, toRaw as coinToRaw, createAdminSessionGrant, createFailoverFetch, encodeAdminHeaders, encodeByteArray, fdvHuman, formatAmount, getCoordinates, getCreatorCoinPrice, getListableTokens, getService, getServicesByCapability, getSiwsStorageKey, getStoredSiwsToken, getTokenByAddress, getTokenBySymbol, hasCapability, isServiceId, isSiwsTokenValid, isTransientRpcError, listServices, normalizeAddress, normalizeHash, normalizeSiwsSignature, parseAdminHeaders, parseAmount, parseCreatorCoinCreated, randomNonce, requestSiwsToken, resolveConfig, resolveFeeConfig, sessionKeyHashOf, shortenAddress, signAdminRequest, storeSiwsToken, stringifyBigInts, teamCoinsRaw, u256ToBigInt, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
|
package/dist/index.d.ts
CHANGED
|
@@ -411,6 +411,7 @@ declare class Medialane1155Module {
|
|
|
411
411
|
|
|
412
412
|
type IPType = "Audio" | "Art" | "Documents" | "NFT" | "Video" | "Photography" | "Patents" | "Posts" | "Publications" | "RWA" | "Software" | "Custom";
|
|
413
413
|
type CollectionSort = "recent" | "supply" | "floor" | "volume" | "name";
|
|
414
|
+
type CollectionTokensSort = "recent" | "oldest" | "name";
|
|
414
415
|
/** Bounded capability set (05-service-model §III). Expand the union when a
|
|
415
416
|
* service needs behavior outside it — never make it free-form. */
|
|
416
417
|
type ServiceCapability = "list" | "buy" | "make_offer" | "cancel" | "transfer" | "burn" | "mint" | "claim" | "airdrop" | "remix" | "license" | "subscribe" | "redeem" | "launch" | "swap" | "sponsor";
|
|
@@ -1164,6 +1165,75 @@ interface DropMintStatus {
|
|
|
1164
1165
|
mintedByWallet: number;
|
|
1165
1166
|
totalMinted: number;
|
|
1166
1167
|
}
|
|
1168
|
+
interface ApiRewardsBadge {
|
|
1169
|
+
key: string;
|
|
1170
|
+
name: string;
|
|
1171
|
+
description: string;
|
|
1172
|
+
icon: string;
|
|
1173
|
+
color: string;
|
|
1174
|
+
category: string;
|
|
1175
|
+
}
|
|
1176
|
+
interface ApiRewardsLevel {
|
|
1177
|
+
level: number;
|
|
1178
|
+
name: string;
|
|
1179
|
+
xpRequired: number;
|
|
1180
|
+
badgeColor: string;
|
|
1181
|
+
description: string | null;
|
|
1182
|
+
}
|
|
1183
|
+
interface ApiUserRewards {
|
|
1184
|
+
address: string;
|
|
1185
|
+
accountId: string | null;
|
|
1186
|
+
publicId: string | null;
|
|
1187
|
+
totalXp: number;
|
|
1188
|
+
currentLevel: number;
|
|
1189
|
+
currentLevelName: string;
|
|
1190
|
+
badgeColor: string;
|
|
1191
|
+
nextLevel: {
|
|
1192
|
+
level: number;
|
|
1193
|
+
name: string;
|
|
1194
|
+
xpRequired: number;
|
|
1195
|
+
} | null;
|
|
1196
|
+
progressPct: number;
|
|
1197
|
+
breakdown: Record<string, number>;
|
|
1198
|
+
badges: ApiRewardsBadge[];
|
|
1199
|
+
computedAt: string | null;
|
|
1200
|
+
}
|
|
1201
|
+
interface ApiRewardsLeaderboardEntry {
|
|
1202
|
+
rank: number;
|
|
1203
|
+
address: string;
|
|
1204
|
+
accountId: string | null;
|
|
1205
|
+
publicId: string | null;
|
|
1206
|
+
totalXp: number;
|
|
1207
|
+
currentLevel: number;
|
|
1208
|
+
currentLevelName: string;
|
|
1209
|
+
badgeColor: string;
|
|
1210
|
+
}
|
|
1211
|
+
interface ApiRewardsConfig {
|
|
1212
|
+
levels: ApiRewardsLevel[];
|
|
1213
|
+
actions: {
|
|
1214
|
+
type: string;
|
|
1215
|
+
label: string;
|
|
1216
|
+
xp: number;
|
|
1217
|
+
dailyCap: number | null;
|
|
1218
|
+
}[];
|
|
1219
|
+
badges: ApiRewardsBadge[];
|
|
1220
|
+
}
|
|
1221
|
+
interface ApiRewardsBatchEntry {
|
|
1222
|
+
address: string;
|
|
1223
|
+
totalXp: number;
|
|
1224
|
+
currentLevel: number;
|
|
1225
|
+
currentLevelName: string;
|
|
1226
|
+
badgeColor: string;
|
|
1227
|
+
}
|
|
1228
|
+
interface ApiPointEvent {
|
|
1229
|
+
id: string;
|
|
1230
|
+
actionType: string;
|
|
1231
|
+
xp: number;
|
|
1232
|
+
multiplier: number;
|
|
1233
|
+
finalXp: number;
|
|
1234
|
+
txHash: string | null;
|
|
1235
|
+
createdAt: string;
|
|
1236
|
+
}
|
|
1167
1237
|
|
|
1168
1238
|
declare class MedialaneApiError extends Error {
|
|
1169
1239
|
readonly status: number;
|
|
@@ -1194,7 +1264,7 @@ declare class ApiClient {
|
|
|
1194
1264
|
getCollections(page?: number, limit?: number, isKnown?: boolean, sort?: CollectionSort, service?: string): Promise<ApiResponse<ApiCollection[]>>;
|
|
1195
1265
|
getCollectionsByOwner(owner: string, page?: number, limit?: number): Promise<ApiResponse<ApiCollection[]>>;
|
|
1196
1266
|
getCollection(contract: string): Promise<ApiResponse<ApiCollection>>;
|
|
1197
|
-
getCollectionTokens(contract: string, page?: number, limit?: number): Promise<ApiResponse<ApiToken[]>>;
|
|
1267
|
+
getCollectionTokens(contract: string, page?: number, limit?: number, sort?: CollectionTokensSort): Promise<ApiResponse<ApiToken[]>>;
|
|
1198
1268
|
getActivities(query?: ApiActivitiesQuery): Promise<ApiResponse<ApiActivity[]>>;
|
|
1199
1269
|
getActivitiesByAddress(address: string, page?: number, limit?: number): Promise<ApiResponse<ApiActivity[]>>;
|
|
1200
1270
|
getTokenComments(contract: string, tokenId: string, opts?: {
|
|
@@ -1394,6 +1464,16 @@ declare class ApiClient {
|
|
|
1394
1464
|
sort?: CollectionSort;
|
|
1395
1465
|
}): Promise<ApiResponse<ApiCollection[]>>;
|
|
1396
1466
|
getDropMintStatus(collection: string, wallet: string): Promise<DropMintStatus>;
|
|
1467
|
+
/** Score + level + progress + badges for one address (zeroed for unknown). */
|
|
1468
|
+
getRewards(address: string): Promise<ApiUserRewards>;
|
|
1469
|
+
/** Paginated XP leaderboard. */
|
|
1470
|
+
getRewardsLeaderboard(page?: number, limit?: number): Promise<ApiResponse<ApiRewardsLeaderboardEntry[]>>;
|
|
1471
|
+
/** Point-event history for an address. */
|
|
1472
|
+
getRewardsEvents(address: string, page?: number, limit?: number): Promise<ApiResponse<ApiPointEvent[]>>;
|
|
1473
|
+
/** Reward configuration: level ladder, enabled action XP values, badge catalog. */
|
|
1474
|
+
getRewardsConfig(): Promise<ApiRewardsConfig>;
|
|
1475
|
+
/** Minimal level info for up to 50 addresses — one call per list page. */
|
|
1476
|
+
getRewardsBatch(addresses: string[]): Promise<ApiRewardsBatchEntry[]>;
|
|
1397
1477
|
}
|
|
1398
1478
|
|
|
1399
1479
|
interface CreatePopCollectionParams {
|
|
@@ -9280,4 +9360,4 @@ declare function build1155OrderTypedData(message: Record<string, unknown>, chain
|
|
|
9280
9360
|
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
9281
9361
|
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
9282
9362
|
|
|
9283
|
-
export { ADMIN_HEADERS, ADMIN_SCOPE, type ActivityType, type AddSupplyParams, type AdminGrant, type AdminRequest, type AdminRequestSig, type AdminSession, type AdminSessionTypedDataInput, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, type ApiChain, ApiClient, type ApiCoin, type ApiCoinsQuery, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintEditionParams, type BuildFeeCallParams, CHAINS, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type Chain, type ChainCoordinates, type ClaimConditions, ClubService, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateClubParams, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateCreatorCoinParams, type CreateDropParams, type CreateGrantOpts, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateSponsorshipOfferParams, type CreateTicketCollectionParams, type CreateWebhookParams, CreatorCoinFactoryABI, type CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, DEFAULT_CHAIN, DEFAULT_CURRENCY, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EnforcementDeclaration, type FailoverFetchOptions, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, IPClubABI, IPClubNFTABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, type IPType, type IntentCall, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, LAUNCH_PRICE_QUOTE_PER_COIN, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintEditionParams, type MintParams, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, PUBLIC_RPC_FALLBACKS, type ParsedAdminHeaders, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type RequestSiwsTokenArgs, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, STARKNET_COLLECTION_1155_CLASS_HASH, STARKNET_COLLECTION_1155_CONTRACT, STARKNET_COLLECTION_1155_FACTORY_CLASS_HASH, STARKNET_COLLECTION_1155_START_BLOCK, STARKNET_COLLECTION_721_CONTRACT, STARKNET_COLLECTION_721_START_BLOCK, STARKNET_CREATOR_COIN_CLASS_HASH, STARKNET_CREATOR_COIN_EKUBO_LAUNCHER, STARKNET_CREATOR_COIN_FACTORY_CLASS_HASH, STARKNET_CREATOR_COIN_FACTORY_CONTRACT, STARKNET_CREATOR_COIN_START_BLOCK, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_IPCOLLECTION_CLASS_HASH, STARKNET_IPNFT_CLASS_HASH, STARKNET_IP_CLUB_NFT_CLASS_HASH, STARKNET_IP_CLUB_REGISTRY_CONTRACT, STARKNET_IP_SPONSORSHIP_CONTRACT, STARKNET_IP_SPONSORSHIP_LICENSE_CONTRACT, STARKNET_IP_TICKETS_FACTORY_CONTRACT, STARKNET_IP_TICKET_COLLECTION_CLASS_HASH, STARKNET_MARKETPLACE_1155_CLASS_HASH, STARKNET_MARKETPLACE_1155_CONTRACT, STARKNET_MARKETPLACE_1155_START_BLOCK, STARKNET_MARKETPLACE_721_CLASS_HASH, STARKNET_MARKETPLACE_721_CONTRACT, STARKNET_MARKETPLACE_721_START_BLOCK, STARKNET_NFTCOMMENTS_CONTRACT, STARKNET_POP_COLLECTION_CLASS_HASH, STARKNET_POP_FACTORY_CONTRACT, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type ServiceEventDeclaration, type ServiceId, type SiwsSigner, type SortOrder, SponsorshipService, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, TicketService, type TxResult, VALIDATED_EKUBO_PARAMS, type WebhookEventType, type WebhookStatus, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancellationTypedData, buildCreateCreatorCoinCall, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buybackQuoteRaw, toRaw as coinToRaw, createAdminSessionGrant, createFailoverFetch, encodeAdminHeaders, encodeByteArray, fdvHuman, formatAmount, getCoordinates, getCreatorCoinPrice, getListableTokens, getService, getServicesByCapability, getSiwsStorageKey, getStoredSiwsToken, getTokenByAddress, getTokenBySymbol, hasCapability, isServiceId, isSiwsTokenValid, isTransientRpcError, listServices, normalizeAddress, normalizeHash, normalizeSiwsSignature, parseAdminHeaders, parseAmount, parseCreatorCoinCreated, randomNonce, requestSiwsToken, resolveConfig, resolveFeeConfig, sessionKeyHashOf, shortenAddress, signAdminRequest, storeSiwsToken, stringifyBigInts, teamCoinsRaw, u256ToBigInt, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
|
|
9363
|
+
export { ADMIN_HEADERS, ADMIN_SCOPE, type ActivityType, type AddSupplyParams, type AdminGrant, type AdminRequest, type AdminRequestSig, type AdminSession, type AdminSessionTypedDataInput, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, type ApiChain, ApiClient, type ApiCoin, type ApiCoinsQuery, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPointEvent, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiRewardsBadge, type ApiRewardsBatchEntry, type ApiRewardsConfig, type ApiRewardsLeaderboardEntry, type ApiRewardsLevel, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserRewards, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintEditionParams, type BuildFeeCallParams, CHAINS, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type Chain, type ChainCoordinates, type ClaimConditions, ClubService, type CollectionSort, type CollectionTokensSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateClubParams, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateCreatorCoinParams, type CreateDropParams, type CreateGrantOpts, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateSponsorshipOfferParams, type CreateTicketCollectionParams, type CreateWebhookParams, CreatorCoinFactoryABI, type CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, DEFAULT_CHAIN, DEFAULT_CURRENCY, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EnforcementDeclaration, type FailoverFetchOptions, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, IPClubABI, IPClubNFTABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, type IPType, type IntentCall, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, LAUNCH_PRICE_QUOTE_PER_COIN, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintEditionParams, type MintParams, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, PUBLIC_RPC_FALLBACKS, type ParsedAdminHeaders, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type RequestSiwsTokenArgs, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, STARKNET_COLLECTION_1155_CLASS_HASH, STARKNET_COLLECTION_1155_CONTRACT, STARKNET_COLLECTION_1155_FACTORY_CLASS_HASH, STARKNET_COLLECTION_1155_START_BLOCK, STARKNET_COLLECTION_721_CONTRACT, STARKNET_COLLECTION_721_START_BLOCK, STARKNET_CREATOR_COIN_CLASS_HASH, STARKNET_CREATOR_COIN_EKUBO_LAUNCHER, STARKNET_CREATOR_COIN_FACTORY_CLASS_HASH, STARKNET_CREATOR_COIN_FACTORY_CONTRACT, STARKNET_CREATOR_COIN_START_BLOCK, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_IPCOLLECTION_CLASS_HASH, STARKNET_IPNFT_CLASS_HASH, STARKNET_IP_CLUB_NFT_CLASS_HASH, STARKNET_IP_CLUB_REGISTRY_CONTRACT, STARKNET_IP_SPONSORSHIP_CONTRACT, STARKNET_IP_SPONSORSHIP_LICENSE_CONTRACT, STARKNET_IP_TICKETS_FACTORY_CONTRACT, STARKNET_IP_TICKET_COLLECTION_CLASS_HASH, STARKNET_MARKETPLACE_1155_CLASS_HASH, STARKNET_MARKETPLACE_1155_CONTRACT, STARKNET_MARKETPLACE_1155_START_BLOCK, STARKNET_MARKETPLACE_721_CLASS_HASH, STARKNET_MARKETPLACE_721_CONTRACT, STARKNET_MARKETPLACE_721_START_BLOCK, STARKNET_NFTCOMMENTS_CONTRACT, STARKNET_POP_COLLECTION_CLASS_HASH, STARKNET_POP_FACTORY_CONTRACT, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type ServiceEventDeclaration, type ServiceId, type SiwsSigner, type SortOrder, SponsorshipService, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, TicketService, type TxResult, VALIDATED_EKUBO_PARAMS, type WebhookEventType, type WebhookStatus, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancellationTypedData, buildCreateCreatorCoinCall, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buybackQuoteRaw, toRaw as coinToRaw, createAdminSessionGrant, createFailoverFetch, encodeAdminHeaders, encodeByteArray, fdvHuman, formatAmount, getCoordinates, getCreatorCoinPrice, getListableTokens, getService, getServicesByCapability, getSiwsStorageKey, getStoredSiwsToken, getTokenByAddress, getTokenBySymbol, hasCapability, isServiceId, isSiwsTokenValid, isTransientRpcError, listServices, normalizeAddress, normalizeHash, normalizeSiwsSignature, parseAdminHeaders, parseAmount, parseCreatorCoinCreated, randomNonce, requestSiwsToken, resolveConfig, resolveFeeConfig, sessionKeyHashOf, shortenAddress, signAdminRequest, storeSiwsToken, stringifyBigInts, teamCoinsRaw, u256ToBigInt, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
|
package/dist/index.js
CHANGED
|
@@ -9685,9 +9685,9 @@ var ApiClient = class {
|
|
|
9685
9685
|
getCollection(contract) {
|
|
9686
9686
|
return this.get(`/v1/collections/${this.addr(contract)}`);
|
|
9687
9687
|
}
|
|
9688
|
-
getCollectionTokens(contract, page = 1, limit = 20) {
|
|
9688
|
+
getCollectionTokens(contract, page = 1, limit = 20, sort = "recent") {
|
|
9689
9689
|
return this.get(
|
|
9690
|
-
`/v1/collections/${this.addr(contract)}/tokens?page=${page}&limit=${limit}`
|
|
9690
|
+
`/v1/collections/${this.addr(contract)}/tokens?page=${page}&limit=${limit}&sort=${sort}`
|
|
9691
9691
|
);
|
|
9692
9692
|
}
|
|
9693
9693
|
// ─── Activities ────────────────────────────────────────────────────────────
|
|
@@ -10132,6 +10132,35 @@ var ApiClient = class {
|
|
|
10132
10132
|
);
|
|
10133
10133
|
return res.data;
|
|
10134
10134
|
}
|
|
10135
|
+
// ─── Rewards (v0.49.0) ─────────────────────────────────────────────────────
|
|
10136
|
+
// Scores are recomputed on a schedule by the backend (~15 min) — reads only.
|
|
10137
|
+
/** Score + level + progress + badges for one address (zeroed for unknown). */
|
|
10138
|
+
async getRewards(address) {
|
|
10139
|
+
const res = await this.get(`/v1/rewards/${this.addr(address)}`);
|
|
10140
|
+
return res.data;
|
|
10141
|
+
}
|
|
10142
|
+
/** Paginated XP leaderboard. */
|
|
10143
|
+
getRewardsLeaderboard(page = 1, limit = 50) {
|
|
10144
|
+
return this.get(`/v1/rewards?page=${page}&limit=${limit}`);
|
|
10145
|
+
}
|
|
10146
|
+
/** Point-event history for an address. */
|
|
10147
|
+
getRewardsEvents(address, page = 1, limit = 20) {
|
|
10148
|
+
return this.get(
|
|
10149
|
+
`/v1/rewards/${this.addr(address)}/events?page=${page}&limit=${limit}`
|
|
10150
|
+
);
|
|
10151
|
+
}
|
|
10152
|
+
/** Reward configuration: level ladder, enabled action XP values, badge catalog. */
|
|
10153
|
+
async getRewardsConfig() {
|
|
10154
|
+
const res = await this.get(`/v1/rewards/config`);
|
|
10155
|
+
return res.data;
|
|
10156
|
+
}
|
|
10157
|
+
/** Minimal level info for up to 50 addresses — one call per list page. */
|
|
10158
|
+
async getRewardsBatch(addresses) {
|
|
10159
|
+
if (addresses.length === 0) return [];
|
|
10160
|
+
const params = new URLSearchParams({ addresses: addresses.map((a) => this.addr(a)).join(",") });
|
|
10161
|
+
const res = await this.get(`/v1/rewards/batch?${params}`);
|
|
10162
|
+
return res.data;
|
|
10163
|
+
}
|
|
10135
10164
|
};
|
|
10136
10165
|
var PopService = class {
|
|
10137
10166
|
constructor(config) {
|