nara-sdk 1.0.26 → 1.0.30
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 +11 -9
- package/index.ts +33 -0
- package/package.json +1 -1
- package/src/agent_registry.ts +707 -0
- package/src/constants.ts +6 -0
- package/src/idls/nara_agent_registry.json +1369 -0
- package/src/idls/nara_agent_registry.ts +1375 -0
- package/src/idls/nara_skills_hub.json +169 -95
- package/src/idls/nara_skills_hub.ts +169 -95
- package/src/idls/nara_zk.json +14 -48
- package/src/idls/nara_zk.ts +14 -48
- package/src/quest.ts +45 -2
- package/src/skills.ts +96 -11
- package/src/zkid.ts +42 -0
package/README.md
CHANGED
|
@@ -83,13 +83,15 @@ if (await hasAnswered(connection, wallet)) {
|
|
|
83
83
|
const proof = await generateProof("your-answer", quest.answerHash, wallet.publicKey);
|
|
84
84
|
|
|
85
85
|
// 4a. Submit on-chain (requires gas)
|
|
86
|
-
const { signature } = await submitAnswer(connection, wallet, proof.solana);
|
|
86
|
+
const { signature } = await submitAnswer(connection, wallet, proof.solana, "my-agent", "gpt-4");
|
|
87
87
|
|
|
88
88
|
// 4b. Or submit via gasless relay
|
|
89
89
|
const { txHash } = await submitAnswerViaRelay(
|
|
90
90
|
"https://quest-api.nara.build/",
|
|
91
91
|
wallet.publicKey,
|
|
92
|
-
proof.hex
|
|
92
|
+
proof.hex,
|
|
93
|
+
"my-agent",
|
|
94
|
+
"gpt-4"
|
|
93
95
|
);
|
|
94
96
|
|
|
95
97
|
// 5. Parse reward from transaction
|
|
@@ -203,13 +205,13 @@ const bytes = await getSkillContent(connection, "my-skill");
|
|
|
203
205
|
|
|
204
206
|
## Environment Variables
|
|
205
207
|
|
|
206
|
-
| Variable | Default
|
|
207
|
-
| ------------------- |
|
|
208
|
-
| `RPC_URL` | `https://mainnet-api.nara.build/`
|
|
209
|
-
| `QUEST_RELAY_URL` | `https://quest-api.nara.build/`
|
|
210
|
-
| `QUEST_PROGRAM_ID` | `Quest11111111111111111111111111111111111111`
|
|
211
|
-
| `SKILLS_PROGRAM_ID` | `
|
|
212
|
-
| `ZKID_PROGRAM_ID` | `ZKidentity111111111111111111111111111111111`
|
|
208
|
+
| Variable | Default | Description |
|
|
209
|
+
| ------------------- | ---------------------------------------------- | ----------------------------------- |
|
|
210
|
+
| `RPC_URL` | `https://mainnet-api.nara.build/` | Solana RPC endpoint |
|
|
211
|
+
| `QUEST_RELAY_URL` | `https://quest-api.nara.build/` | Gasless relay for quest submissions |
|
|
212
|
+
| `QUEST_PROGRAM_ID` | `Quest11111111111111111111111111111111111111` | Quest program address |
|
|
213
|
+
| `SKILLS_PROGRAM_ID` | `SkiLLHub11111111111111111111111111111111111` | Skills Hub program address |
|
|
214
|
+
| `ZKID_PROGRAM_ID` | `ZKidentity111111111111111111111111111111111` | ZK ID program address |
|
|
213
215
|
|
|
214
216
|
## Examples
|
|
215
217
|
|
package/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export {
|
|
|
13
13
|
DEFAULT_QUEST_PROGRAM_ID,
|
|
14
14
|
DEFAULT_SKILLS_PROGRAM_ID,
|
|
15
15
|
DEFAULT_ZKID_PROGRAM_ID,
|
|
16
|
+
DEFAULT_AGENT_REGISTRY_PROGRAM_ID,
|
|
16
17
|
} from "./src/constants";
|
|
17
18
|
|
|
18
19
|
// Export quest functions and types
|
|
@@ -29,6 +30,7 @@ export {
|
|
|
29
30
|
type SubmitAnswerResult,
|
|
30
31
|
type SubmitRelayResult,
|
|
31
32
|
type QuestOptions,
|
|
33
|
+
type ActivityLog,
|
|
32
34
|
} from "./src/quest";
|
|
33
35
|
|
|
34
36
|
// Export skills functions and types
|
|
@@ -43,6 +45,10 @@ export {
|
|
|
43
45
|
transferAuthority,
|
|
44
46
|
closeBuffer,
|
|
45
47
|
deleteSkill,
|
|
48
|
+
initConfig as initSkillsConfig,
|
|
49
|
+
updateAdmin as updateSkillsAdmin,
|
|
50
|
+
updateFeeRecipient as updateSkillsFeeRecipient,
|
|
51
|
+
updateRegisterFee as updateSkillsRegisterFee,
|
|
46
52
|
type SkillRecord,
|
|
47
53
|
type SkillInfo,
|
|
48
54
|
type SkillOptions,
|
|
@@ -61,12 +67,39 @@ export {
|
|
|
61
67
|
computeIdCommitment,
|
|
62
68
|
isValidRecipient,
|
|
63
69
|
generateValidRecipient,
|
|
70
|
+
initializeConfig as initZkIdConfig,
|
|
71
|
+
updateConfig as updateZkIdConfig,
|
|
64
72
|
ZKID_DENOMINATIONS,
|
|
65
73
|
type ZkIdInfo,
|
|
66
74
|
type ClaimableDeposit,
|
|
67
75
|
type ZkIdOptions,
|
|
68
76
|
} from "./src/zkid";
|
|
69
77
|
|
|
78
|
+
// Export agent registry functions and types
|
|
79
|
+
export {
|
|
80
|
+
registerAgent,
|
|
81
|
+
getAgentRecord,
|
|
82
|
+
getAgentInfo,
|
|
83
|
+
getAgentMemory,
|
|
84
|
+
getConfig as getAgentRegistryConfig,
|
|
85
|
+
setBio,
|
|
86
|
+
setMetadata,
|
|
87
|
+
uploadMemory,
|
|
88
|
+
closeBuffer as closeAgentBuffer,
|
|
89
|
+
transferAgentAuthority,
|
|
90
|
+
deleteAgent,
|
|
91
|
+
logActivity,
|
|
92
|
+
makeLogActivityIx,
|
|
93
|
+
initConfig as initAgentRegistryConfig,
|
|
94
|
+
updateAdmin,
|
|
95
|
+
updateFeeRecipient,
|
|
96
|
+
updateRegisterFee,
|
|
97
|
+
type AgentRecord,
|
|
98
|
+
type AgentInfo,
|
|
99
|
+
type MemoryMode,
|
|
100
|
+
type AgentRegistryOptions,
|
|
101
|
+
} from "./src/agent_registry";
|
|
102
|
+
|
|
70
103
|
// Re-export commonly used types from dependencies
|
|
71
104
|
export { PublicKey, Keypair, Transaction } from "@solana/web3.js";
|
|
72
105
|
export { default as BN } from "bn.js";
|