@0gfoundation/0g-agentdna 0.2.2 → 0.4.0
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/GUIDE.md +7 -7
- package/MIGRATION.md +8 -0
- package/MIGRATION.zh.md +5 -0
- package/README.md +2 -2
- package/dist/AgenticID.d.ts +2 -1
- package/dist/AgenticID.d.ts.map +1 -1
- package/dist/AgenticID.js +4 -3
- package/dist/AgenticID.js.map +1 -1
- package/dist/AgenticIDClient.d.ts +1 -1
- package/dist/AgenticIDClient.js +1 -1
- package/dist/AttestorClient.d.ts +1 -1
- package/dist/AttestorClient.js +1 -1
- package/dist/ReputationClient.d.ts +1 -1
- package/dist/ReputationClient.js +1 -1
- package/dist/SandboxClient.d.ts +1 -1
- package/dist/SandboxClient.js +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +8 -2
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/interactive.d.ts +1 -1
- package/dist/cli/commands/interactive.js +1 -1
- package/dist/cli/config.d.ts +10 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +38 -0
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/env.js +1 -1
- package/dist/cli/env.js.map +1 -1
- package/dist/cli/main.js +12 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/sdk.d.ts +1 -1
- package/dist/cli/sdk.js +1 -1
- package/dist/cli/settings.d.ts +3 -3
- package/dist/cli/settings.js +3 -3
- package/dist/constants.d.ts +3 -3
- package/dist/constants.js +2 -2
- package/dist/context.d.ts +2 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/secretEnv.js +1 -1
- package/dist/secretEnv.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/package.json +1 -1
- package/src/AgenticID.ts +4 -3
- package/src/AgenticIDClient.ts +1 -1
- package/src/AttestorClient.ts +1 -1
- package/src/ReputationClient.ts +1 -1
- package/src/SandboxClient.ts +1 -1
- package/src/cli/commands/doctor.ts +8 -2
- package/src/cli/commands/interactive.ts +1 -1
- package/src/cli/config.ts +36 -0
- package/src/cli/env.ts +1 -1
- package/src/cli/main.ts +13 -3
- package/src/cli/sdk.ts +1 -1
- package/src/cli/settings.ts +3 -3
- package/src/constants.ts +3 -3
- package/src/context.ts +2 -2
- package/src/secretEnv.ts +1 -1
- package/src/types.ts +1 -1
package/src/constants.ts
CHANGED
|
@@ -37,7 +37,7 @@ export const ZERO_G_MAINNET = {
|
|
|
37
37
|
} as const;
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* Contract address set — pass one explicitly to `new
|
|
40
|
+
* Contract address set — pass one explicitly to `new AgentDNA({ addresses })`.
|
|
41
41
|
*
|
|
42
42
|
* Addresses are a deployment artifact, NOT baked into the SDK: an RPC + these
|
|
43
43
|
* addresses fully determine the target contracts, and keeping them out of the
|
|
@@ -67,7 +67,7 @@ export interface ContractAddresses {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
|
-
* Default RPC URL for the 0G Galileo Testnet (override via `
|
|
70
|
+
* Default RPC URL for the 0G Galileo Testnet (override via `new AgentDNA({ rpcUrl })`).
|
|
71
71
|
*/
|
|
72
72
|
export const RPC_URL = 'https://evmrpc-testnet.0g.ai';
|
|
73
73
|
|
|
@@ -103,4 +103,4 @@ export const RECEIPT_WAIT = {
|
|
|
103
103
|
|
|
104
104
|
/** This SDK's own version. Kept in lockstep with package.json by a test —
|
|
105
105
|
* a runtime package.json read would break browser bundles, so a constant. */
|
|
106
|
-
export const SDK_VERSION = '0.
|
|
106
|
+
export const SDK_VERSION = '0.4.0';
|
package/src/context.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file context.ts
|
|
3
|
-
* @description Shared config + runtime context for the
|
|
3
|
+
* @description Shared config + runtime context for the AgentDNA facade and its
|
|
4
4
|
* internal per-contract clients. Constructed once; passed to each sub-client.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import { privateKeyToAccount } from 'viem/accounts';
|
|
17
17
|
import { ZERO_G_TESTNET, RPC_URL, type ContractAddresses } from './constants';
|
|
18
18
|
|
|
19
|
-
/** Public config for `new
|
|
19
|
+
/** Public config for `new AgentDNA(config)` (exported as `AgentDNAConfig`). */
|
|
20
20
|
export interface AgenticIDConfig {
|
|
21
21
|
/** RPC endpoint. Defaults to the 0G Galileo testnet RPC. */
|
|
22
22
|
rpcUrl?: string;
|
package/src/secretEnv.ts
CHANGED
|
@@ -118,7 +118,7 @@ export function randomBytes(n: number): Uint8Array {
|
|
|
118
118
|
cryptoObj = (require('crypto') as { webcrypto?: WebCrypto }).webcrypto;
|
|
119
119
|
}
|
|
120
120
|
if (!cryptoObj?.getRandomValues) {
|
|
121
|
-
throw new Error('
|
|
121
|
+
throw new Error('AgentDNA SDK: no WebCrypto available (need a browser or Node >= 18 with crypto.webcrypto)');
|
|
122
122
|
}
|
|
123
123
|
cryptoObj.getRandomValues(a);
|
|
124
124
|
return a;
|
package/src/types.ts
CHANGED