@newtype-ai/nit-sdk 0.2.1 → 0.2.3
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 +5 -4
- package/dist/index.d.ts +9 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,8 +18,9 @@ const result = await verifyAgent(payload);
|
|
|
18
18
|
|
|
19
19
|
if (result.verified) {
|
|
20
20
|
// result.agent_id — the agent's permanent UUID
|
|
21
|
-
// result.card — the agent's
|
|
22
|
-
// result.
|
|
21
|
+
// result.card — the agent's card for your domain (skills, description, etc.)
|
|
22
|
+
// result.wallet — { solana, evm } chain addresses
|
|
23
|
+
// result.readToken — for fetching updated cards later
|
|
23
24
|
console.log(`Welcome, ${result.card?.name}`);
|
|
24
25
|
} else {
|
|
25
26
|
console.log(`Verification failed: ${result.error}`);
|
|
@@ -31,7 +32,7 @@ if (result.verified) {
|
|
|
31
32
|
1. The agent runs `nit sign --login your-app.com` to generate a signed login payload
|
|
32
33
|
2. The agent sends the payload to your app
|
|
33
34
|
3. Your app calls `verifyAgent(payload)` — this hits `api.newtype-ai.org/agent-card/verify`
|
|
34
|
-
4. You get back `{ verified: true, agent_id, card }` or `{ verified: false, error }`
|
|
35
|
+
4. You get back `{ verified: true, agent_id, card, branch, wallet, readToken }` or `{ verified: false, error }`
|
|
35
36
|
|
|
36
37
|
That's it. The server verifies the Ed25519 signature against the agent's registered public key.
|
|
37
38
|
|
|
@@ -44,7 +45,7 @@ That's it. The server verifies the Ed25519 signature against the agent's registe
|
|
|
44
45
|
| `payload` | `LoginPayload` | `{ agent_id, domain, timestamp, signature }` from the agent |
|
|
45
46
|
| `options.apiUrl` | `string` | Override API URL (default: `https://api.newtype-ai.org`) |
|
|
46
47
|
|
|
47
|
-
Returns `Promise<VerifyResult>` — either `{ verified: true, agent_id, domain, card,
|
|
48
|
+
Returns `Promise<VerifyResult>` — either `{ verified: true, agent_id, domain, card, branch, wallet, readToken }` or `{ verified: false, error }`.
|
|
48
49
|
|
|
49
50
|
## Full Integration Guide
|
|
50
51
|
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,10 @@ interface AgentCard {
|
|
|
36
36
|
};
|
|
37
37
|
skills: AgentCardSkill[];
|
|
38
38
|
publicKey?: string;
|
|
39
|
+
wallet?: {
|
|
40
|
+
solana: string;
|
|
41
|
+
evm: string;
|
|
42
|
+
};
|
|
39
43
|
iconUrl?: string;
|
|
40
44
|
documentationUrl?: string;
|
|
41
45
|
}
|
|
@@ -47,8 +51,11 @@ interface VerifySuccess {
|
|
|
47
51
|
card: AgentCard | null;
|
|
48
52
|
/** Which branch the card came from — the domain branch if pushed, otherwise 'main'. */
|
|
49
53
|
branch: string;
|
|
50
|
-
/**
|
|
51
|
-
|
|
54
|
+
/** Chain wallet addresses derived from the agent's Ed25519 keypair. */
|
|
55
|
+
wallet?: {
|
|
56
|
+
solana: string;
|
|
57
|
+
evm: string;
|
|
58
|
+
} | null;
|
|
52
59
|
/** HMAC-signed read token for fetching the agent's domain branch card. 30-day expiry. */
|
|
53
60
|
readToken: string;
|
|
54
61
|
}
|