@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.cjs
CHANGED
|
@@ -9687,9 +9687,9 @@ var ApiClient = class {
|
|
|
9687
9687
|
getCollection(contract) {
|
|
9688
9688
|
return this.get(`/v1/collections/${this.addr(contract)}`);
|
|
9689
9689
|
}
|
|
9690
|
-
getCollectionTokens(contract, page = 1, limit = 20) {
|
|
9690
|
+
getCollectionTokens(contract, page = 1, limit = 20, sort = "recent") {
|
|
9691
9691
|
return this.get(
|
|
9692
|
-
`/v1/collections/${this.addr(contract)}/tokens?page=${page}&limit=${limit}`
|
|
9692
|
+
`/v1/collections/${this.addr(contract)}/tokens?page=${page}&limit=${limit}&sort=${sort}`
|
|
9693
9693
|
);
|
|
9694
9694
|
}
|
|
9695
9695
|
// ─── Activities ────────────────────────────────────────────────────────────
|
|
@@ -10134,6 +10134,35 @@ var ApiClient = class {
|
|
|
10134
10134
|
);
|
|
10135
10135
|
return res.data;
|
|
10136
10136
|
}
|
|
10137
|
+
// ─── Rewards (v0.49.0) ─────────────────────────────────────────────────────
|
|
10138
|
+
// Scores are recomputed on a schedule by the backend (~15 min) — reads only.
|
|
10139
|
+
/** Score + level + progress + badges for one address (zeroed for unknown). */
|
|
10140
|
+
async getRewards(address) {
|
|
10141
|
+
const res = await this.get(`/v1/rewards/${this.addr(address)}`);
|
|
10142
|
+
return res.data;
|
|
10143
|
+
}
|
|
10144
|
+
/** Paginated XP leaderboard. */
|
|
10145
|
+
getRewardsLeaderboard(page = 1, limit = 50) {
|
|
10146
|
+
return this.get(`/v1/rewards?page=${page}&limit=${limit}`);
|
|
10147
|
+
}
|
|
10148
|
+
/** Point-event history for an address. */
|
|
10149
|
+
getRewardsEvents(address, page = 1, limit = 20) {
|
|
10150
|
+
return this.get(
|
|
10151
|
+
`/v1/rewards/${this.addr(address)}/events?page=${page}&limit=${limit}`
|
|
10152
|
+
);
|
|
10153
|
+
}
|
|
10154
|
+
/** Reward configuration: level ladder, enabled action XP values, badge catalog. */
|
|
10155
|
+
async getRewardsConfig() {
|
|
10156
|
+
const res = await this.get(`/v1/rewards/config`);
|
|
10157
|
+
return res.data;
|
|
10158
|
+
}
|
|
10159
|
+
/** Minimal level info for up to 50 addresses — one call per list page. */
|
|
10160
|
+
async getRewardsBatch(addresses) {
|
|
10161
|
+
if (addresses.length === 0) return [];
|
|
10162
|
+
const params = new URLSearchParams({ addresses: addresses.map((a) => this.addr(a)).join(",") });
|
|
10163
|
+
const res = await this.get(`/v1/rewards/batch?${params}`);
|
|
10164
|
+
return res.data;
|
|
10165
|
+
}
|
|
10137
10166
|
};
|
|
10138
10167
|
var PopService = class {
|
|
10139
10168
|
constructor(config) {
|