nara-sdk 1.0.36 → 1.0.37

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/quest.ts +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nara-sdk",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "SDK for the Nara chain (Solana-compatible)",
5
5
  "module": "index.ts",
6
6
  "main": "index.ts",
package/src/quest.ts CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  } from "@solana/web3.js";
12
12
  import * as anchor from "@coral-xyz/anchor";
13
13
  import { Program, AnchorProvider, Wallet } from "@coral-xyz/anchor";
14
+ import BN from "bn.js";
14
15
  import type { NaraQuest } from "./idls/nara_quest";
15
16
  import { DEFAULT_QUEST_PROGRAM_ID } from "./constants";
16
17
 
@@ -473,8 +474,8 @@ export async function createQuestion(
473
474
  ): Promise<string> {
474
475
  const program = createProgram(connection, wallet, options?.programId);
475
476
  const answerHash = await computeAnswerHash(answer);
476
- const deadline = new anchor.BN(Math.floor(Date.now() / 1000) + deadlineSeconds);
477
- const rewardAmount = new anchor.BN(Math.round(rewardSol * LAMPORTS_PER_SOL));
477
+ const deadline = new BN(Math.floor(Date.now() / 1000) + deadlineSeconds);
478
+ const rewardAmount = new BN(Math.round(rewardSol * LAMPORTS_PER_SOL));
478
479
 
479
480
  const signature = await program.methods
480
481
  .createQuestion(question, answerHash as any, deadline, rewardAmount, difficulty)