nara-sdk 1.0.85 → 1.0.86
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 +3 -4
- package/package.json +1 -1
- package/src/idls/nara_quest.json +3 -3
- package/src/idls/nara_quest.ts +3 -3
- package/src/quest.ts +11 -15
package/README.md
CHANGED
|
@@ -199,7 +199,7 @@ import {
|
|
|
199
199
|
} from 'nara-sdk';
|
|
200
200
|
|
|
201
201
|
const quest = await getQuestInfo(connection);
|
|
202
|
-
console.log(`Boost slots: ${quest.
|
|
202
|
+
console.log(`Boost slots: ${quest.boostRemainingSlots}/${quest.boostRewardCount}`);
|
|
203
203
|
|
|
204
204
|
const stakeInfo = await getStakeInfo(connection, wallet.publicKey);
|
|
205
205
|
console.log(`Your boost credits: ${stakeInfo?.boostCredits ?? 0}`);
|
|
@@ -216,9 +216,8 @@ const { signature } = await submitAnswer(connection, wallet, proof.solana);
|
|
|
216
216
|
|
|
217
217
|
Relevant `QuestInfo` fields:
|
|
218
218
|
|
|
219
|
-
- `
|
|
220
|
-
— the single Boost PoMI winner bucket
|
|
221
|
-
for chain parity)
|
|
219
|
+
- `boostRewardCount` / `boostWinnerCount` / `boostRewardPerWinner` / `boostRemainingSlots`
|
|
220
|
+
— the single Boost PoMI winner bucket
|
|
222
221
|
- `round` / `question` / `answerHash` / `deadline` / `timeRemaining`
|
|
223
222
|
|
|
224
223
|
Legacy staking (`stake` / `unstake`) remains callable so existing stakers can
|
package/package.json
CHANGED
package/src/idls/nara_quest.json
CHANGED
|
@@ -2067,15 +2067,15 @@
|
|
|
2067
2067
|
"type": "u64"
|
|
2068
2068
|
},
|
|
2069
2069
|
{
|
|
2070
|
-
"name": "
|
|
2070
|
+
"name": "boost_reward_count",
|
|
2071
2071
|
"type": "u32"
|
|
2072
2072
|
},
|
|
2073
2073
|
{
|
|
2074
|
-
"name": "
|
|
2074
|
+
"name": "boost_reward_per_winner",
|
|
2075
2075
|
"type": "u64"
|
|
2076
2076
|
},
|
|
2077
2077
|
{
|
|
2078
|
-
"name": "
|
|
2078
|
+
"name": "boost_winner_count",
|
|
2079
2079
|
"type": "u32"
|
|
2080
2080
|
},
|
|
2081
2081
|
{
|
package/src/idls/nara_quest.ts
CHANGED
|
@@ -2073,15 +2073,15 @@ export type NaraQuest = {
|
|
|
2073
2073
|
"type": "u64"
|
|
2074
2074
|
},
|
|
2075
2075
|
{
|
|
2076
|
-
"name": "
|
|
2076
|
+
"name": "boostRewardCount",
|
|
2077
2077
|
"type": "u32"
|
|
2078
2078
|
},
|
|
2079
2079
|
{
|
|
2080
|
-
"name": "
|
|
2080
|
+
"name": "boostRewardPerWinner",
|
|
2081
2081
|
"type": "u64"
|
|
2082
2082
|
},
|
|
2083
2083
|
{
|
|
2084
|
-
"name": "
|
|
2084
|
+
"name": "boostWinnerCount",
|
|
2085
2085
|
"type": "u32"
|
|
2086
2086
|
},
|
|
2087
2087
|
{
|
package/src/quest.ts
CHANGED
|
@@ -47,15 +47,11 @@ export interface QuestInfo {
|
|
|
47
47
|
answerHash: number[];
|
|
48
48
|
/** Total reward pool for the round, in NARA */
|
|
49
49
|
totalReward: number;
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
stakeRewardCount: number;
|
|
56
|
-
stakeWinnerCount: number;
|
|
57
|
-
stakeRewardPerWinner: number;
|
|
58
|
-
stakeRemainingSlots: number;
|
|
50
|
+
/** Boost PoMI winner bucket (single reward track). */
|
|
51
|
+
boostRewardCount: number;
|
|
52
|
+
boostWinnerCount: number;
|
|
53
|
+
boostRewardPerWinner: number;
|
|
54
|
+
boostRemainingSlots: number;
|
|
59
55
|
difficulty: number;
|
|
60
56
|
deadline: number;
|
|
61
57
|
timeRemaining: number;
|
|
@@ -336,8 +332,8 @@ export async function getQuestInfo(
|
|
|
336
332
|
stakeHigh, stakeLow, createdAtMs, decayMs, nowMs
|
|
337
333
|
);
|
|
338
334
|
|
|
339
|
-
const
|
|
340
|
-
const
|
|
335
|
+
const boostRewardCount = pool.boostRewardCount;
|
|
336
|
+
const boostWinnerCount = pool.boostWinnerCount;
|
|
341
337
|
|
|
342
338
|
return {
|
|
343
339
|
active,
|
|
@@ -345,10 +341,10 @@ export async function getQuestInfo(
|
|
|
345
341
|
question: pool.question,
|
|
346
342
|
answerHash: Array.from(pool.answerHash),
|
|
347
343
|
totalReward: pool.rewardAmount.toNumber() / LAMPORTS_PER_SOL,
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
344
|
+
boostRewardCount,
|
|
345
|
+
boostWinnerCount,
|
|
346
|
+
boostRewardPerWinner: pool.boostRewardPerWinner.toNumber() / LAMPORTS_PER_SOL,
|
|
347
|
+
boostRemainingSlots: Math.max(0, boostRewardCount - boostWinnerCount),
|
|
352
348
|
difficulty: pool.difficulty,
|
|
353
349
|
deadline,
|
|
354
350
|
timeRemaining: secsLeft,
|