nara-sdk 1.0.85 → 1.0.87

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
@@ -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.stakeRemainingSlots}/${quest.stakeRewardCount}`);
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
- - `stakeRewardCount` / `stakeWinnerCount` / `stakeRewardPerWinner` / `stakeRemainingSlots`
220
- — the single Boost PoMI winner bucket (field names retain the `stake*` prefix
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nara-sdk",
3
- "version": "1.0.85",
3
+ "version": "1.0.87",
4
4
  "description": "SDK for the Nara chain (Solana-compatible)",
5
5
  "module": "index.ts",
6
6
  "main": "index.ts",
@@ -2067,15 +2067,15 @@
2067
2067
  "type": "u64"
2068
2068
  },
2069
2069
  {
2070
- "name": "stake_reward_count",
2070
+ "name": "boost_reward_count",
2071
2071
  "type": "u32"
2072
2072
  },
2073
2073
  {
2074
- "name": "stake_reward_per_winner",
2074
+ "name": "boost_reward_per_winner",
2075
2075
  "type": "u64"
2076
2076
  },
2077
2077
  {
2078
- "name": "stake_winner_count",
2078
+ "name": "boost_winner_count",
2079
2079
  "type": "u32"
2080
2080
  },
2081
2081
  {
@@ -2073,15 +2073,15 @@ export type NaraQuest = {
2073
2073
  "type": "u64"
2074
2074
  },
2075
2075
  {
2076
- "name": "stakeRewardCount",
2076
+ "name": "boostRewardCount",
2077
2077
  "type": "u32"
2078
2078
  },
2079
2079
  {
2080
- "name": "stakeRewardPerWinner",
2080
+ "name": "boostRewardPerWinner",
2081
2081
  "type": "u64"
2082
2082
  },
2083
2083
  {
2084
- "name": "stakeWinnerCount",
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
- * Boost PoMI winner bucket (single reward track).
52
- * Named `stake*` for chain-field parity — the underlying pool fields are still
53
- * `stake_reward_count` / `stake_reward_per_winner` / `stake_winner_count`.
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;
@@ -109,13 +105,6 @@ export interface QuestOptions {
109
105
  circuitWasmPath?: string | Uint8Array;
110
106
  /** File path (Node.js), URL string, or pre-loaded Uint8Array (browser) */
111
107
  zkeyPath?: string | Uint8Array;
112
- /**
113
- * @deprecated Boost PoMI no longer gates on stake; credits are the sole admission ticket.
114
- * If set, a legacy `stake` instruction is still bundled before `submit_answer`:
115
- * - number: stake the exact NARA amount
116
- * - "auto": no-op (kept for API compatibility)
117
- */
118
- stake?: "auto" | number;
119
108
  }
120
109
 
121
110
  export interface ActivityLog {
@@ -336,8 +325,8 @@ export async function getQuestInfo(
336
325
  stakeHigh, stakeLow, createdAtMs, decayMs, nowMs
337
326
  );
338
327
 
339
- const stakeRewardCount = pool.stakeRewardCount;
340
- const stakeWinnerCount = pool.stakeWinnerCount;
328
+ const boostRewardCount = pool.boostRewardCount;
329
+ const boostWinnerCount = pool.boostWinnerCount;
341
330
 
342
331
  return {
343
332
  active,
@@ -345,10 +334,10 @@ export async function getQuestInfo(
345
334
  question: pool.question,
346
335
  answerHash: Array.from(pool.answerHash),
347
336
  totalReward: pool.rewardAmount.toNumber() / LAMPORTS_PER_SOL,
348
- stakeRewardCount,
349
- stakeWinnerCount,
350
- stakeRewardPerWinner: pool.stakeRewardPerWinner.toNumber() / LAMPORTS_PER_SOL,
351
- stakeRemainingSlots: Math.max(0, stakeRewardCount - stakeWinnerCount),
337
+ boostRewardCount,
338
+ boostWinnerCount,
339
+ boostRewardPerWinner: pool.boostRewardPerWinner.toNumber() / LAMPORTS_PER_SOL,
340
+ boostRemainingSlots: Math.max(0, boostRewardCount - boostWinnerCount),
352
341
  difficulty: pool.difficulty,
353
342
  deadline,
354
343
  timeRemaining: secsLeft,
@@ -458,24 +447,12 @@ export async function submitAnswer(
458
447
  );
459
448
  }
460
449
 
461
- // Legacy optional stake instruction (staking channel is closed but still callable)
462
- let stakeIx: any = null;
463
- if (typeof options?.stake === "number" && options.stake > 0) {
464
- const stakeLamports = new BN(Math.round(options.stake * LAMPORTS_PER_SOL));
465
- stakeIx = await program.methods
466
- .stake(stakeLamports)
467
- .accounts({ user: wallet.publicKey } as any)
468
- .instruction();
469
- }
470
-
471
450
  const submitIx = await program.methods
472
451
  .submitAnswer(proof.proofA as any, proof.proofB as any, proof.proofC as any, agent, model)
473
452
  .accounts({ user: wallet.publicKey, payer: wallet.publicKey })
474
453
  .instruction();
475
454
 
476
- const ixs = [];
477
- if (stakeIx) ixs.push(stakeIx);
478
- ixs.push(submitIx);
455
+ const ixs = [submitIx];
479
456
 
480
457
  if (activityLog) {
481
458
  const { makeLogActivityIx, makeLogActivityWithReferralIx } = await import("./agent_registry");