@whitewall-os/sdk 0.1.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/dist/abis.d.ts +321 -0
- package/dist/abis.js +209 -0
- package/dist/addresses.d.ts +14 -0
- package/dist/addresses.js +6 -0
- package/dist/client.d.ts +37 -0
- package/dist/client.js +200 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +3 -0
- package/dist/types.d.ts +20 -0
- package/dist/types.js +1 -0
- package/package.json +36 -0
- package/src/abis.ts +218 -0
- package/src/addresses.ts +23 -0
- package/src/client.ts +260 -0
- package/src/index.ts +12 -0
- package/src/types.ts +23 -0
package/dist/client.js
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { createPublicClient, http, zeroAddress, } from "viem";
|
|
2
|
+
import { baseSepolia } from "viem/chains";
|
|
3
|
+
import { humanVerifiedPolicyAbi, identityRegistryAbi, validationRegistryAbi, whitewallConsumerAbi, } from "./abis.js";
|
|
4
|
+
import { addresses } from "./addresses.js";
|
|
5
|
+
const HUMAN_VERIFIED_TAG = "HUMAN_VERIFIED";
|
|
6
|
+
const chainMap = {
|
|
7
|
+
baseSepolia,
|
|
8
|
+
};
|
|
9
|
+
export class WhitewallOS {
|
|
10
|
+
client;
|
|
11
|
+
addrs;
|
|
12
|
+
policy = null;
|
|
13
|
+
constructor(client, addrs) {
|
|
14
|
+
this.client = client;
|
|
15
|
+
this.addrs = addrs;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create and connect a WhitewallOS instance.
|
|
19
|
+
* Reads policy config from on-chain HumanVerifiedPolicy contract.
|
|
20
|
+
*/
|
|
21
|
+
static async connect(config) {
|
|
22
|
+
const addrs = addresses[config.chain];
|
|
23
|
+
const client = config.publicClient ??
|
|
24
|
+
createPublicClient({
|
|
25
|
+
chain: chainMap[config.chain],
|
|
26
|
+
transport: http(config.rpcUrl),
|
|
27
|
+
});
|
|
28
|
+
const instance = new WhitewallOS(client, addrs);
|
|
29
|
+
await instance.loadPolicyConfig();
|
|
30
|
+
return instance;
|
|
31
|
+
}
|
|
32
|
+
/** Read policy configuration from the on-chain HumanVerifiedPolicy contract */
|
|
33
|
+
async loadPolicyConfig() {
|
|
34
|
+
const [identityRegistry, validationRegistry, worldIdValidator, requiredTier] = await Promise.all([
|
|
35
|
+
this.client.readContract({
|
|
36
|
+
address: this.addrs.humanVerifiedPolicy,
|
|
37
|
+
abi: humanVerifiedPolicyAbi,
|
|
38
|
+
functionName: "getIdentityRegistry",
|
|
39
|
+
}),
|
|
40
|
+
this.client.readContract({
|
|
41
|
+
address: this.addrs.humanVerifiedPolicy,
|
|
42
|
+
abi: humanVerifiedPolicyAbi,
|
|
43
|
+
functionName: "getValidationRegistry",
|
|
44
|
+
}),
|
|
45
|
+
this.client.readContract({
|
|
46
|
+
address: this.addrs.humanVerifiedPolicy,
|
|
47
|
+
abi: humanVerifiedPolicyAbi,
|
|
48
|
+
functionName: "getWorldIdValidator",
|
|
49
|
+
}),
|
|
50
|
+
this.client.readContract({
|
|
51
|
+
address: this.addrs.humanVerifiedPolicy,
|
|
52
|
+
abi: humanVerifiedPolicyAbi,
|
|
53
|
+
functionName: "getRequiredTier",
|
|
54
|
+
}),
|
|
55
|
+
]);
|
|
56
|
+
this.policy = { identityRegistry, validationRegistry, worldIdValidator, requiredTier };
|
|
57
|
+
}
|
|
58
|
+
get policyConfig() {
|
|
59
|
+
if (!this.policy)
|
|
60
|
+
throw new Error("WhitewallOS not connected. Use WhitewallOS.connect()");
|
|
61
|
+
return this.policy;
|
|
62
|
+
}
|
|
63
|
+
// ─── Core Read Methods ───
|
|
64
|
+
async isRegistered(agentId) {
|
|
65
|
+
try {
|
|
66
|
+
const owner = await this.client.readContract({
|
|
67
|
+
address: this.policyConfig.identityRegistry,
|
|
68
|
+
abi: identityRegistryAbi,
|
|
69
|
+
functionName: "ownerOf",
|
|
70
|
+
args: [agentId],
|
|
71
|
+
});
|
|
72
|
+
return owner !== zeroAddress;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async isHumanVerified(agentId) {
|
|
79
|
+
const summary = await this.getValidationSummary(agentId);
|
|
80
|
+
return summary.count > 0n && summary.avgScore >= this.policyConfig.requiredTier;
|
|
81
|
+
}
|
|
82
|
+
async getOwner(agentId) {
|
|
83
|
+
return this.client.readContract({
|
|
84
|
+
address: this.policyConfig.identityRegistry,
|
|
85
|
+
abi: identityRegistryAbi,
|
|
86
|
+
functionName: "ownerOf",
|
|
87
|
+
args: [agentId],
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
async getAgentWallet(agentId) {
|
|
91
|
+
return this.client.readContract({
|
|
92
|
+
address: this.policyConfig.identityRegistry,
|
|
93
|
+
abi: identityRegistryAbi,
|
|
94
|
+
functionName: "getAgentWallet",
|
|
95
|
+
args: [agentId],
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
async getTokenURI(agentId) {
|
|
99
|
+
return this.client.readContract({
|
|
100
|
+
address: this.policyConfig.identityRegistry,
|
|
101
|
+
abi: identityRegistryAbi,
|
|
102
|
+
functionName: "tokenURI",
|
|
103
|
+
args: [agentId],
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
async getMetadata(agentId, key) {
|
|
107
|
+
return this.client.readContract({
|
|
108
|
+
address: this.policyConfig.identityRegistry,
|
|
109
|
+
abi: identityRegistryAbi,
|
|
110
|
+
functionName: "getMetadata",
|
|
111
|
+
args: [agentId, key],
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// ─── Validation ───
|
|
115
|
+
async getValidationSummary(agentId) {
|
|
116
|
+
const [count, avgResponse] = await this.client.readContract({
|
|
117
|
+
address: this.policyConfig.validationRegistry,
|
|
118
|
+
abi: validationRegistryAbi,
|
|
119
|
+
functionName: "getSummary",
|
|
120
|
+
args: [agentId, [this.policyConfig.worldIdValidator], HUMAN_VERIFIED_TAG],
|
|
121
|
+
});
|
|
122
|
+
return { count: BigInt(count), avgScore: avgResponse };
|
|
123
|
+
}
|
|
124
|
+
async getAgentValidations(agentId) {
|
|
125
|
+
return this.client.readContract({
|
|
126
|
+
address: this.policyConfig.validationRegistry,
|
|
127
|
+
abi: validationRegistryAbi,
|
|
128
|
+
functionName: "getAgentValidations",
|
|
129
|
+
args: [agentId],
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
// ─── Composite: Full Status ───
|
|
133
|
+
async getAgentStatus(agentId) {
|
|
134
|
+
const registered = await this.isRegistered(agentId);
|
|
135
|
+
if (!registered) {
|
|
136
|
+
return {
|
|
137
|
+
isRegistered: false,
|
|
138
|
+
isHumanVerified: false,
|
|
139
|
+
tier: 0,
|
|
140
|
+
owner: zeroAddress,
|
|
141
|
+
agentWallet: zeroAddress,
|
|
142
|
+
validationCount: 0n,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
const [owner, agentWallet, summary] = await Promise.all([
|
|
146
|
+
this.getOwner(agentId),
|
|
147
|
+
this.getAgentWallet(agentId),
|
|
148
|
+
this.getValidationSummary(agentId),
|
|
149
|
+
]);
|
|
150
|
+
const isHumanVerified = summary.count > 0n && summary.avgScore >= this.policyConfig.requiredTier;
|
|
151
|
+
const tier = isHumanVerified ? this.policyConfig.requiredTier : 1;
|
|
152
|
+
return {
|
|
153
|
+
isRegistered: true,
|
|
154
|
+
isHumanVerified,
|
|
155
|
+
tier,
|
|
156
|
+
owner,
|
|
157
|
+
agentWallet,
|
|
158
|
+
validationCount: summary.count,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// ─── Event Watching ───
|
|
162
|
+
onAccessGranted(callback) {
|
|
163
|
+
return this.client.watchEvent({
|
|
164
|
+
address: this.addrs.whitewallConsumer,
|
|
165
|
+
event: whitewallConsumerAbi[0], // AccessGranted
|
|
166
|
+
onLogs: (logs) => {
|
|
167
|
+
for (const log of logs) {
|
|
168
|
+
callback({
|
|
169
|
+
agentId: log.args.agentId,
|
|
170
|
+
accountableHuman: log.args.accountableHuman,
|
|
171
|
+
tier: Number(log.args.tier),
|
|
172
|
+
blockNumber: log.blockNumber,
|
|
173
|
+
transactionHash: log.transactionHash,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
onRegistered(callback) {
|
|
180
|
+
return this.client.watchEvent({
|
|
181
|
+
address: this.policyConfig.identityRegistry,
|
|
182
|
+
event: identityRegistryAbi[5], // Registered event
|
|
183
|
+
onLogs: (logs) => {
|
|
184
|
+
for (const log of logs) {
|
|
185
|
+
callback(log.args.agentId, log.args.owner);
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
// ─── Utilities ───
|
|
191
|
+
getAddresses() {
|
|
192
|
+
return this.addrs;
|
|
193
|
+
}
|
|
194
|
+
getPolicyConfig() {
|
|
195
|
+
return this.policyConfig;
|
|
196
|
+
}
|
|
197
|
+
getPublicClient() {
|
|
198
|
+
return this.client;
|
|
199
|
+
}
|
|
200
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { WhitewallOS } from "./client.js";
|
|
2
|
+
export type { WhitewallOSConfig } from "./client.js";
|
|
3
|
+
export type { AgentStatus, AccessGrantedEvent, ValidationSummary } from "./types.js";
|
|
4
|
+
export type { ChainName, WhitewallOSAddresses, PolicyConfig } from "./addresses.js";
|
|
5
|
+
export { addresses } from "./addresses.js";
|
|
6
|
+
export { humanVerifiedPolicyAbi, identityRegistryAbi, validationRegistryAbi, whitewallConsumerAbi, worldIdValidatorAbi, } from "./abis.js";
|
package/dist/index.js
ADDED
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
export interface AgentStatus {
|
|
3
|
+
isRegistered: boolean;
|
|
4
|
+
isHumanVerified: boolean;
|
|
5
|
+
tier: number;
|
|
6
|
+
owner: Address;
|
|
7
|
+
agentWallet: Address;
|
|
8
|
+
validationCount: bigint;
|
|
9
|
+
}
|
|
10
|
+
export interface AccessGrantedEvent {
|
|
11
|
+
agentId: bigint;
|
|
12
|
+
accountableHuman: Address;
|
|
13
|
+
tier: number;
|
|
14
|
+
blockNumber: bigint;
|
|
15
|
+
transactionHash: `0x${string}`;
|
|
16
|
+
}
|
|
17
|
+
export interface ValidationSummary {
|
|
18
|
+
count: bigint;
|
|
19
|
+
avgScore: number;
|
|
20
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@whitewall-os/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TypeScript SDK for Whitewall OS — AI agent accountability protocol",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"dev": "tsc --watch",
|
|
17
|
+
"test": "vitest run",
|
|
18
|
+
"test:unit": "vitest run test/unit.test.ts",
|
|
19
|
+
"test:integration": "vitest run test/integration.test.ts"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"viem": "^2.0.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"typescript": "^5.3.0",
|
|
26
|
+
"vitest": "^4.0.18"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"viem": "^2.0.0"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"src"
|
|
34
|
+
],
|
|
35
|
+
"license": "MIT"
|
|
36
|
+
}
|
package/src/abis.ts
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// ── HumanVerifiedPolicy — entry point, SDK reads config from here ──
|
|
2
|
+
|
|
3
|
+
export const humanVerifiedPolicyAbi = [
|
|
4
|
+
{
|
|
5
|
+
inputs: [],
|
|
6
|
+
name: "getRequiredTier",
|
|
7
|
+
outputs: [{ name: "", type: "uint8" }],
|
|
8
|
+
stateMutability: "view",
|
|
9
|
+
type: "function",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
inputs: [],
|
|
13
|
+
name: "getIdentityRegistry",
|
|
14
|
+
outputs: [{ name: "", type: "address" }],
|
|
15
|
+
stateMutability: "view",
|
|
16
|
+
type: "function",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
inputs: [],
|
|
20
|
+
name: "getValidationRegistry",
|
|
21
|
+
outputs: [{ name: "", type: "address" }],
|
|
22
|
+
stateMutability: "view",
|
|
23
|
+
type: "function",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
inputs: [],
|
|
27
|
+
name: "getWorldIdValidator",
|
|
28
|
+
outputs: [{ name: "", type: "address" }],
|
|
29
|
+
stateMutability: "view",
|
|
30
|
+
type: "function",
|
|
31
|
+
},
|
|
32
|
+
] as const;
|
|
33
|
+
|
|
34
|
+
// ── IdentityRegistry ──
|
|
35
|
+
|
|
36
|
+
export const identityRegistryAbi = [
|
|
37
|
+
{
|
|
38
|
+
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
39
|
+
name: "ownerOf",
|
|
40
|
+
outputs: [{ name: "", type: "address" }],
|
|
41
|
+
stateMutability: "view",
|
|
42
|
+
type: "function",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
inputs: [{ name: "agentId", type: "uint256" }],
|
|
46
|
+
name: "getAgentWallet",
|
|
47
|
+
outputs: [{ name: "", type: "address" }],
|
|
48
|
+
stateMutability: "view",
|
|
49
|
+
type: "function",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
inputs: [{ name: "owner", type: "address" }],
|
|
53
|
+
name: "balanceOf",
|
|
54
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
55
|
+
stateMutability: "view",
|
|
56
|
+
type: "function",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
60
|
+
name: "tokenURI",
|
|
61
|
+
outputs: [{ name: "", type: "string" }],
|
|
62
|
+
stateMutability: "view",
|
|
63
|
+
type: "function",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
inputs: [
|
|
67
|
+
{ name: "agentId", type: "uint256" },
|
|
68
|
+
{ name: "metadataKey", type: "string" },
|
|
69
|
+
],
|
|
70
|
+
name: "getMetadata",
|
|
71
|
+
outputs: [{ name: "", type: "bytes" }],
|
|
72
|
+
stateMutability: "view",
|
|
73
|
+
type: "function",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
anonymous: false,
|
|
77
|
+
inputs: [
|
|
78
|
+
{ indexed: true, name: "agentId", type: "uint256" },
|
|
79
|
+
{ indexed: false, name: "agentURI", type: "string" },
|
|
80
|
+
{ indexed: true, name: "owner", type: "address" },
|
|
81
|
+
],
|
|
82
|
+
name: "Registered",
|
|
83
|
+
type: "event",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
anonymous: false,
|
|
87
|
+
inputs: [
|
|
88
|
+
{ indexed: true, name: "from", type: "address" },
|
|
89
|
+
{ indexed: true, name: "to", type: "address" },
|
|
90
|
+
{ indexed: true, name: "tokenId", type: "uint256" },
|
|
91
|
+
],
|
|
92
|
+
name: "Transfer",
|
|
93
|
+
type: "event",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
inputs: [{ name: "agentURI", type: "string" }],
|
|
97
|
+
name: "register",
|
|
98
|
+
outputs: [],
|
|
99
|
+
stateMutability: "nonpayable",
|
|
100
|
+
type: "function",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
inputs: [
|
|
104
|
+
{ name: "validator", type: "address" },
|
|
105
|
+
{ name: "agentId", type: "uint256" },
|
|
106
|
+
],
|
|
107
|
+
name: "approve",
|
|
108
|
+
outputs: [],
|
|
109
|
+
stateMutability: "nonpayable",
|
|
110
|
+
type: "function",
|
|
111
|
+
},
|
|
112
|
+
] as const;
|
|
113
|
+
|
|
114
|
+
// ── ValidationRegistry ──
|
|
115
|
+
|
|
116
|
+
export const validationRegistryAbi = [
|
|
117
|
+
{
|
|
118
|
+
inputs: [
|
|
119
|
+
{ name: "agentId", type: "uint256" },
|
|
120
|
+
{ name: "validatorAddresses", type: "address[]" },
|
|
121
|
+
{ name: "tag", type: "string" },
|
|
122
|
+
],
|
|
123
|
+
name: "getSummary",
|
|
124
|
+
outputs: [
|
|
125
|
+
{ name: "count", type: "uint64" },
|
|
126
|
+
{ name: "avgResponse", type: "uint8" },
|
|
127
|
+
],
|
|
128
|
+
stateMutability: "view",
|
|
129
|
+
type: "function",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
inputs: [{ name: "agentId", type: "uint256" }],
|
|
133
|
+
name: "getAgentValidations",
|
|
134
|
+
outputs: [{ name: "", type: "bytes32[]" }],
|
|
135
|
+
stateMutability: "view",
|
|
136
|
+
type: "function",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
inputs: [{ name: "requestHash", type: "bytes32" }],
|
|
140
|
+
name: "getValidationStatus",
|
|
141
|
+
outputs: [
|
|
142
|
+
{ name: "validatorAddress", type: "address" },
|
|
143
|
+
{ name: "agentId", type: "uint256" },
|
|
144
|
+
{ name: "response", type: "uint8" },
|
|
145
|
+
{ name: "responseHash", type: "bytes32" },
|
|
146
|
+
{ name: "tag", type: "string" },
|
|
147
|
+
{ name: "lastUpdate", type: "uint256" },
|
|
148
|
+
],
|
|
149
|
+
stateMutability: "view",
|
|
150
|
+
type: "function",
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
anonymous: false,
|
|
154
|
+
inputs: [
|
|
155
|
+
{ indexed: true, name: "validatorAddress", type: "address" },
|
|
156
|
+
{ indexed: true, name: "agentId", type: "uint256" },
|
|
157
|
+
{ indexed: false, name: "requestURI", type: "string" },
|
|
158
|
+
{ indexed: true, name: "requestHash", type: "bytes32" },
|
|
159
|
+
],
|
|
160
|
+
name: "ValidationRequest",
|
|
161
|
+
type: "event",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
anonymous: false,
|
|
165
|
+
inputs: [
|
|
166
|
+
{ indexed: true, name: "validatorAddress", type: "address" },
|
|
167
|
+
{ indexed: true, name: "agentId", type: "uint256" },
|
|
168
|
+
{ indexed: true, name: "requestHash", type: "bytes32" },
|
|
169
|
+
{ indexed: false, name: "response", type: "uint8" },
|
|
170
|
+
{ indexed: false, name: "responseURI", type: "string" },
|
|
171
|
+
{ indexed: false, name: "responseHash", type: "bytes32" },
|
|
172
|
+
{ indexed: false, name: "tag", type: "string" },
|
|
173
|
+
],
|
|
174
|
+
name: "ValidationResponse",
|
|
175
|
+
type: "event",
|
|
176
|
+
},
|
|
177
|
+
] as const;
|
|
178
|
+
|
|
179
|
+
// ── WorldIDValidator ──
|
|
180
|
+
|
|
181
|
+
export const worldIdValidatorAbi = [
|
|
182
|
+
{
|
|
183
|
+
inputs: [
|
|
184
|
+
{ name: "agentId", type: "uint256" },
|
|
185
|
+
{ name: "root", type: "uint256" },
|
|
186
|
+
{ name: "nullifierHash", type: "uint256" },
|
|
187
|
+
{ name: "proof", type: "uint256[8]" },
|
|
188
|
+
],
|
|
189
|
+
name: "verifyAndSetHumanTag",
|
|
190
|
+
outputs: [],
|
|
191
|
+
stateMutability: "nonpayable",
|
|
192
|
+
type: "function",
|
|
193
|
+
},
|
|
194
|
+
] as const;
|
|
195
|
+
|
|
196
|
+
// ── WhitewallConsumer ──
|
|
197
|
+
|
|
198
|
+
export const whitewallConsumerAbi = [
|
|
199
|
+
{
|
|
200
|
+
anonymous: false,
|
|
201
|
+
inputs: [
|
|
202
|
+
{ indexed: true, name: "agentId", type: "uint256" },
|
|
203
|
+
{ indexed: true, name: "accountableHuman", type: "address" },
|
|
204
|
+
{ indexed: false, name: "tier", type: "uint8" },
|
|
205
|
+
],
|
|
206
|
+
name: "AccessGranted",
|
|
207
|
+
type: "event",
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
anonymous: false,
|
|
211
|
+
inputs: [
|
|
212
|
+
{ indexed: true, name: "agentId", type: "uint256" },
|
|
213
|
+
{ indexed: false, name: "reason", type: "bytes32" },
|
|
214
|
+
],
|
|
215
|
+
name: "AccessDenied",
|
|
216
|
+
type: "event",
|
|
217
|
+
},
|
|
218
|
+
] as const;
|
package/src/addresses.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
|
|
3
|
+
export type ChainName = "baseSepolia";
|
|
4
|
+
|
|
5
|
+
export interface WhitewallOSAddresses {
|
|
6
|
+
humanVerifiedPolicy: Address;
|
|
7
|
+
whitewallConsumer: Address;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Protocol-level policy config, read from on-chain HumanVerifiedPolicy */
|
|
11
|
+
export interface PolicyConfig {
|
|
12
|
+
identityRegistry: Address;
|
|
13
|
+
validationRegistry: Address;
|
|
14
|
+
worldIdValidator: Address;
|
|
15
|
+
requiredTier: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const addresses: Record<ChainName, WhitewallOSAddresses> = {
|
|
19
|
+
baseSepolia: {
|
|
20
|
+
humanVerifiedPolicy: "0x8f66f55f4ade4e64b105820972d444a56449e8b3",
|
|
21
|
+
whitewallConsumer: "0xec3114ea6bb29f77b63cd1223533870b663120bb",
|
|
22
|
+
},
|
|
23
|
+
} as const;
|