nara-sdk 1.0.37 → 1.0.39
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 +46 -17
- package/index.ts +3 -0
- package/package.json +1 -1
- package/src/agent_registry.ts +170 -56
- package/src/idls/nara_agent_registry.json +872 -71
- package/src/idls/nara_agent_registry.ts +872 -71
- package/src/quest.ts +19 -11
package/src/quest.ts
CHANGED
|
@@ -322,21 +322,29 @@ export async function submitAnswer(
|
|
|
322
322
|
const program = createProgram(connection, wallet, options?.programId);
|
|
323
323
|
|
|
324
324
|
if (activityLog) {
|
|
325
|
-
const { makeLogActivityIx } = await import("./agent_registry");
|
|
325
|
+
const { makeLogActivityIx, makeLogActivityWithReferralIx } = await import("./agent_registry");
|
|
326
326
|
const submitIx = await program.methods
|
|
327
327
|
.submitAnswer(proof.proofA as any, proof.proofB as any, proof.proofC as any, agent, model)
|
|
328
328
|
.accounts({ user: wallet.publicKey, payer: wallet.publicKey })
|
|
329
329
|
.instruction();
|
|
330
|
-
const logIx =
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
330
|
+
const logIx = activityLog.referralAgentId
|
|
331
|
+
? await makeLogActivityWithReferralIx(
|
|
332
|
+
connection,
|
|
333
|
+
wallet.publicKey,
|
|
334
|
+
activityLog.agentId,
|
|
335
|
+
activityLog.model,
|
|
336
|
+
activityLog.activity,
|
|
337
|
+
activityLog.log,
|
|
338
|
+
activityLog.referralAgentId
|
|
339
|
+
)
|
|
340
|
+
: await makeLogActivityIx(
|
|
341
|
+
connection,
|
|
342
|
+
wallet.publicKey,
|
|
343
|
+
activityLog.agentId,
|
|
344
|
+
activityLog.model,
|
|
345
|
+
activityLog.activity,
|
|
346
|
+
activityLog.log
|
|
347
|
+
);
|
|
340
348
|
const tx = new Transaction().add(submitIx).add(logIx);
|
|
341
349
|
tx.feePayer = wallet.publicKey;
|
|
342
350
|
tx.recentBlockhash = (await connection.getLatestBlockhash()).blockhash;
|