@0gfoundation/0g-agentdna 0.0.0-stage → 0.2.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 +975 -0
- package/LICENSE +21 -0
- package/MIGRATION.md +84 -0
- package/MIGRATION.zh.md +70 -0
- package/PROVIDERS.md +273 -0
- package/PROVIDERS.zh.md +234 -0
- package/README.md +334 -2
- package/dist/AgentClient.d.ts +312 -0
- package/dist/AgentClient.d.ts.map +1 -0
- package/dist/AgentClient.js +715 -0
- package/dist/AgentClient.js.map +1 -0
- package/dist/AgenticID.d.ts +823 -0
- package/dist/AgenticID.d.ts.map +1 -0
- package/dist/AgenticID.js +1188 -0
- package/dist/AgenticID.js.map +1 -0
- package/dist/AgenticIDClient.d.ts +68 -0
- package/dist/AgenticIDClient.d.ts.map +1 -0
- package/dist/AgenticIDClient.js +198 -0
- package/dist/AgenticIDClient.js.map +1 -0
- package/dist/AttestorClient.d.ts +465 -0
- package/dist/AttestorClient.d.ts.map +1 -0
- package/dist/AttestorClient.js +1030 -0
- package/dist/AttestorClient.js.map +1 -0
- package/dist/Providers.d.ts +72 -0
- package/dist/Providers.d.ts.map +1 -0
- package/dist/Providers.js +182 -0
- package/dist/Providers.js.map +1 -0
- package/dist/ReputationClient.d.ts +213 -0
- package/dist/ReputationClient.d.ts.map +1 -0
- package/dist/ReputationClient.js +708 -0
- package/dist/ReputationClient.js.map +1 -0
- package/dist/SandboxClient.d.ts +107 -0
- package/dist/SandboxClient.d.ts.map +1 -0
- package/dist/SandboxClient.js +200 -0
- package/dist/SandboxClient.js.map +1 -0
- package/dist/ServeProof.d.ts +161 -0
- package/dist/ServeProof.d.ts.map +1 -0
- package/dist/ServeProof.js +230 -0
- package/dist/ServeProof.js.map +1 -0
- package/dist/ServeSession.d.ts +180 -0
- package/dist/ServeSession.d.ts.map +1 -0
- package/dist/ServeSession.js +336 -0
- package/dist/ServeSession.js.map +1 -0
- package/dist/Settings.d.ts +179 -0
- package/dist/Settings.d.ts.map +1 -0
- package/dist/Settings.js +247 -0
- package/dist/Settings.js.map +1 -0
- package/dist/abi.d.ts +2216 -0
- package/dist/abi.d.ts.map +1 -0
- package/dist/abi.js +1248 -0
- package/dist/abi.js.map +1 -0
- package/dist/cli/commands/cells.d.ts +34 -0
- package/dist/cli/commands/cells.d.ts.map +1 -0
- package/dist/cli/commands/cells.js +66 -0
- package/dist/cli/commands/cells.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +15 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +236 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/interactive.d.ts +107 -0
- package/dist/cli/commands/interactive.d.ts.map +1 -0
- package/dist/cli/commands/interactive.js +3034 -0
- package/dist/cli/commands/interactive.js.map +1 -0
- package/dist/cli/commands/list.d.ts +31 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +115 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/providers.d.ts +3 -0
- package/dist/cli/commands/providers.d.ts.map +1 -0
- package/dist/cli/commands/providers.js +21 -0
- package/dist/cli/commands/providers.js.map +1 -0
- package/dist/cli/commands/settings.d.ts +22 -0
- package/dist/cli/commands/settings.d.ts.map +1 -0
- package/dist/cli/commands/settings.js +188 -0
- package/dist/cli/commands/settings.js.map +1 -0
- package/dist/cli/commands/status.d.ts +16 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +148 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/update.d.ts +21 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +95 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/config.d.ts +73 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +239 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/env.d.ts +36 -0
- package/dist/cli/env.d.ts.map +1 -0
- package/dist/cli/env.js +74 -0
- package/dist/cli/env.js.map +1 -0
- package/dist/cli/envelope.d.ts +33 -0
- package/dist/cli/envelope.d.ts.map +1 -0
- package/dist/cli/envelope.js +62 -0
- package/dist/cli/envelope.js.map +1 -0
- package/dist/cli/errors.d.ts +48 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/errors.js +81 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/inference.d.ts +21 -0
- package/dist/cli/inference.d.ts.map +1 -0
- package/dist/cli/inference.js +60 -0
- package/dist/cli/inference.js.map +1 -0
- package/dist/cli/logo.d.ts +21 -0
- package/dist/cli/logo.d.ts.map +1 -0
- package/dist/cli/logo.js +131 -0
- package/dist/cli/logo.js.map +1 -0
- package/dist/cli/main.d.ts +14 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +223 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/proofs.d.ts +67 -0
- package/dist/cli/proofs.d.ts.map +1 -0
- package/dist/cli/proofs.js +133 -0
- package/dist/cli/proofs.js.map +1 -0
- package/dist/cli/ref.d.ts +39 -0
- package/dist/cli/ref.d.ts.map +1 -0
- package/dist/cli/ref.js +48 -0
- package/dist/cli/ref.js.map +1 -0
- package/dist/cli/sdk.d.ts +24 -0
- package/dist/cli/sdk.d.ts.map +1 -0
- package/dist/cli/sdk.js +65 -0
- package/dist/cli/sdk.js.map +1 -0
- package/dist/cli/settings.d.ts +66 -0
- package/dist/cli/settings.d.ts.map +1 -0
- package/dist/cli/settings.js +137 -0
- package/dist/cli/settings.js.map +1 -0
- package/dist/cli/tokenize.d.ts +61 -0
- package/dist/cli/tokenize.d.ts.map +1 -0
- package/dist/cli/tokenize.js +157 -0
- package/dist/cli/tokenize.js.map +1 -0
- package/dist/cli/types.d.ts +25 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +8 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/constants.d.ts +107 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +74 -0
- package/dist/constants.js.map +1 -0
- package/dist/context.d.ts +108 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +64 -0
- package/dist/context.js.map +1 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +118 -0
- package/dist/index.js.map +1 -0
- package/dist/provider-catalog.json +23 -0
- package/dist/seal.d.ts +47 -0
- package/dist/seal.d.ts.map +1 -0
- package/dist/seal.js +145 -0
- package/dist/seal.js.map +1 -0
- package/dist/secretEnv.d.ts +119 -0
- package/dist/secretEnv.d.ts.map +1 -0
- package/dist/secretEnv.js +199 -0
- package/dist/secretEnv.js.map +1 -0
- package/dist/taskHash.d.ts +39 -0
- package/dist/taskHash.d.ts.map +1 -0
- package/dist/taskHash.js +119 -0
- package/dist/taskHash.js.map +1 -0
- package/dist/types.d.ts +336 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -0
- package/package.json +75 -4
- package/scripts/sync-providers.cjs +8 -0
- package/src/AgentClient.ts +897 -0
- package/src/AgenticID.ts +1382 -0
- package/src/AgenticIDClient.ts +238 -0
- package/src/AttestorClient.ts +1306 -0
- package/src/Providers.ts +176 -0
- package/src/ReputationClient.ts +821 -0
- package/src/SandboxClient.ts +227 -0
- package/src/ServeProof.ts +290 -0
- package/src/ServeSession.ts +421 -0
- package/src/Settings.ts +296 -0
- package/src/abi.ts +1282 -0
- package/src/cli/commands/cells.ts +61 -0
- package/src/cli/commands/doctor.ts +235 -0
- package/src/cli/commands/interactive.ts +2715 -0
- package/src/cli/commands/list.ts +117 -0
- package/src/cli/commands/providers.ts +16 -0
- package/src/cli/commands/settings.ts +197 -0
- package/src/cli/commands/status.ts +170 -0
- package/src/cli/commands/update.ts +86 -0
- package/src/cli/config.ts +225 -0
- package/src/cli/env.ts +90 -0
- package/src/cli/envelope.ts +57 -0
- package/src/cli/errors.ts +114 -0
- package/src/cli/inference.ts +57 -0
- package/src/cli/logo.ts +125 -0
- package/src/cli/main.ts +235 -0
- package/src/cli/proofs.ts +160 -0
- package/src/cli/ref.ts +58 -0
- package/src/cli/sdk.ts +65 -0
- package/src/cli/settings.ts +153 -0
- package/src/cli/tokenize.ts +131 -0
- package/src/cli/types.ts +27 -0
- package/src/constants.ts +106 -0
- package/src/context.ts +161 -0
- package/src/index.ts +129 -0
- package/src/provider-catalog.json +23 -0
- package/src/seal.ts +163 -0
- package/src/secretEnv.ts +250 -0
- package/src/taskHash.ts +100 -0
- package/src/types.ts +357 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file AgenticIDClient.ts
|
|
3
|
+
* @description Internal client for the AgenticID contract (seal-bound transfer +
|
|
4
|
+
* the reads that transfer/clone/reputation use). Consumers use the `AgenticID`
|
|
5
|
+
* facade's `agent` namespace, not this directly.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
type Address,
|
|
10
|
+
type Hash,
|
|
11
|
+
type TransactionReceipt,
|
|
12
|
+
type WriteContractReturnType,
|
|
13
|
+
} from 'viem';
|
|
14
|
+
import { agenticIDAbi, cloneGateAbi, standardCloneAuthorizerAbi } from './abi';
|
|
15
|
+
import { RECEIPT_WAIT } from './constants';
|
|
16
|
+
import { requireWallet, type Ctx } from './context';
|
|
17
|
+
|
|
18
|
+
export interface IntelligentDataResult {
|
|
19
|
+
dataDescription: string;
|
|
20
|
+
dataHash: Hash;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class AgenticIDClient {
|
|
24
|
+
constructor(private readonly ctx: Ctx) {}
|
|
25
|
+
|
|
26
|
+
private get address(): Address {
|
|
27
|
+
return this.ctx.addresses.agenticID;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// ── Seal-bound transfer ────────────────────────────────────────────────────
|
|
31
|
+
|
|
32
|
+
async transferFrom(from: Address, to: Address, tokenId: bigint): Promise<WriteContractReturnType> {
|
|
33
|
+
const { walletClient, account } = requireWallet(this.ctx);
|
|
34
|
+
return walletClient.writeContract({
|
|
35
|
+
address: this.address,
|
|
36
|
+
abi: agenticIDAbi,
|
|
37
|
+
functionName: 'transferFrom',
|
|
38
|
+
args: [from, to, tokenId],
|
|
39
|
+
account,
|
|
40
|
+
chain: this.ctx.chain,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async safeTransferFrom(
|
|
45
|
+
from: Address,
|
|
46
|
+
to: Address,
|
|
47
|
+
tokenId: bigint,
|
|
48
|
+
data: `0x${string}` = '0x',
|
|
49
|
+
): Promise<WriteContractReturnType> {
|
|
50
|
+
const { walletClient, account } = requireWallet(this.ctx);
|
|
51
|
+
return walletClient.writeContract({
|
|
52
|
+
address: this.address,
|
|
53
|
+
abi: agenticIDAbi,
|
|
54
|
+
functionName: 'safeTransferFrom',
|
|
55
|
+
args: [from, to, tokenId, data],
|
|
56
|
+
account,
|
|
57
|
+
chain: this.ctx.chain,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ── Reads ──────────────────────────────────────────────────────────────────
|
|
62
|
+
|
|
63
|
+
async getAgentSeal(agentId: bigint): Promise<Address> {
|
|
64
|
+
return this.ctx.publicClient.readContract({
|
|
65
|
+
address: this.address, abi: agenticIDAbi, functionName: 'getAgentSeal', args: [agentId],
|
|
66
|
+
}) as Promise<Address>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async getSealId(agentId: bigint): Promise<Hash> {
|
|
70
|
+
return this.ctx.publicClient.readContract({
|
|
71
|
+
address: this.address, abi: agenticIDAbi, functionName: 'getSealId', args: [agentId],
|
|
72
|
+
}) as Promise<Hash>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The agent's on-chain URI (ERC-8004 canonical). Points at the agent's
|
|
77
|
+
* AgentCard (a JSON doc on 0G storage) whose `url` field is the live serve
|
|
78
|
+
* endpoint. Empty string until the attestor's two-phase setAgentURI fills it
|
|
79
|
+
* (i.e. before the agent is provisioned).
|
|
80
|
+
*/
|
|
81
|
+
async tokenURI(tokenId: bigint): Promise<string> {
|
|
82
|
+
return this.ctx.publicClient.readContract({
|
|
83
|
+
address: this.address, abi: agenticIDAbi, functionName: 'tokenURI', args: [tokenId],
|
|
84
|
+
}) as Promise<string>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async getAgentIdBySealId(sealId: Hash): Promise<bigint> {
|
|
88
|
+
return this.ctx.publicClient.readContract({
|
|
89
|
+
address: this.address, abi: agenticIDAbi, functionName: 'getAgentIdBySealId', args: [sealId],
|
|
90
|
+
}) as Promise<bigint>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async isSealIdBound(sealId: Hash): Promise<boolean> {
|
|
94
|
+
return this.ctx.publicClient.readContract({
|
|
95
|
+
address: this.address, abi: agenticIDAbi, functionName: 'isSealIdBound', args: [sealId],
|
|
96
|
+
}) as Promise<boolean>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async intelligentDatasOf(tokenId: bigint): Promise<IntelligentDataResult[]> {
|
|
100
|
+
const result = (await this.ctx.publicClient.readContract({
|
|
101
|
+
address: this.address, abi: agenticIDAbi, functionName: 'intelligentDatasOf', args: [tokenId],
|
|
102
|
+
})) as readonly { dataDescription: string; dataHash: Hash }[];
|
|
103
|
+
return result.map((d) => ({ dataDescription: d.dataDescription, dataHash: d.dataHash }));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async sealedKeysOf(tokenId: bigint): Promise<`0x${string}`[]> {
|
|
107
|
+
const result = (await this.ctx.publicClient.readContract({
|
|
108
|
+
address: this.address, abi: agenticIDAbi, functionName: 'sealedKeysOf', args: [tokenId],
|
|
109
|
+
})) as readonly `0x${string}`[];
|
|
110
|
+
return [...result];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
async ownerOf(tokenId: bigint): Promise<Address> {
|
|
114
|
+
return this.ctx.publicClient.readContract({
|
|
115
|
+
address: this.address, abi: agenticIDAbi, functionName: 'ownerOf', args: [tokenId],
|
|
116
|
+
}) as Promise<Address>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ── Policy-mode cloning (issue #133) ──────────────────────────────────────
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Configure (or clear, with `0x0`) this token's clone authorizer — the
|
|
123
|
+
* `ICloneAuthorizer` policy contract that decides which contract-mode
|
|
124
|
+
* clones may mint. Owner-only on chain. Setting an authorizer is the
|
|
125
|
+
* publisher's one-time opt-in to marketplace fork flows; clearing it
|
|
126
|
+
* revokes, and an ownership transfer auto-invalidates it (the gate binds
|
|
127
|
+
* the config to the owner who set it). Lives on the CloneGate satellite.
|
|
128
|
+
*/
|
|
129
|
+
/** CloneGate address, or a named error when this environment has none. */
|
|
130
|
+
private get cloneGateAddress(): Address {
|
|
131
|
+
const a = this.ctx.addresses.cloneGate;
|
|
132
|
+
if (!a || a === '0x0000000000000000000000000000000000000000') {
|
|
133
|
+
throw new Error(
|
|
134
|
+
'cloneGate: this environment has no CloneGate deployed ' +
|
|
135
|
+
'(the attestor /config reports no clone_gate_addr) — ' +
|
|
136
|
+
'policy-mode cloning is unavailable here',
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
return a;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
async setCloneAuthorizer(tokenId: bigint, authorizer: Address): Promise<WriteContractReturnType> {
|
|
143
|
+
const { walletClient, account } = requireWallet(this.ctx);
|
|
144
|
+
return walletClient.writeContract({
|
|
145
|
+
address: this.cloneGateAddress,
|
|
146
|
+
abi: cloneGateAbi,
|
|
147
|
+
functionName: 'setCloneAuthorizer',
|
|
148
|
+
args: [tokenId, authorizer],
|
|
149
|
+
account,
|
|
150
|
+
chain: this.ctx.chain,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The token's configured clone authorizer (`0x0` = none configured →
|
|
156
|
+
* contract-mode clones fail closed).
|
|
157
|
+
*/
|
|
158
|
+
async cloneAuthorizerOf(tokenId: bigint): Promise<Address> {
|
|
159
|
+
return this.ctx.publicClient.readContract({
|
|
160
|
+
address: this.cloneGateAddress, abi: cloneGateAbi, functionName: 'cloneAuthorizerOf', args: [tokenId],
|
|
161
|
+
}) as Promise<Address>;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* For a clone, the agentId it was forked from (0n = not a clone). Survives
|
|
166
|
+
* transfers — lineage is a historical fact.
|
|
167
|
+
*/
|
|
168
|
+
async cloneSourceOf(agentId: bigint): Promise<bigint> {
|
|
169
|
+
return this.ctx.publicClient.readContract({
|
|
170
|
+
address: this.cloneGateAddress, abi: cloneGateAbi, functionName: 'cloneSourceOf', args: [agentId],
|
|
171
|
+
}) as Promise<bigint>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// ── Standard-policy purchase management (StandardCloneAuthorizer) ─────────
|
|
175
|
+
// These helpers speak the OFFICIAL stock policy's ABI to whatever authorizer
|
|
176
|
+
// the token has configured (resolved live via cloneAuthorizerOf). They only
|
|
177
|
+
// work when that policy IS the StandardCloneAuthorizer — a custom policy has
|
|
178
|
+
// its own management surface and these calls would revert against it.
|
|
179
|
+
|
|
180
|
+
/** The token's effective authorizer, or a named error when none is configured. */
|
|
181
|
+
private async requireAuthorizer(sourceAgentId: bigint): Promise<Address> {
|
|
182
|
+
const a = await this.cloneAuthorizerOf(sourceAgentId);
|
|
183
|
+
if (a === '0x0000000000000000000000000000000000000000') {
|
|
184
|
+
throw new Error(
|
|
185
|
+
`agent ${sourceAgentId} has no effective clone authorizer — the owner must ` +
|
|
186
|
+
`setCloneAuthorizer first (and still hold the token)`,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
return a;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** Seller: allow `buyer` to fork this agent (a permission switch; idempotent). */
|
|
193
|
+
async grantClone(sourceAgentId: bigint, buyer: Address): Promise<WriteContractReturnType> {
|
|
194
|
+
const authorizer = await this.requireAuthorizer(sourceAgentId);
|
|
195
|
+
const { walletClient, account } = requireWallet(this.ctx);
|
|
196
|
+
return walletClient.writeContract({
|
|
197
|
+
address: authorizer,
|
|
198
|
+
abi: standardCloneAuthorizerAbi,
|
|
199
|
+
functionName: 'grant',
|
|
200
|
+
args: [sourceAgentId, buyer],
|
|
201
|
+
account,
|
|
202
|
+
chain: this.ctx.chain,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** Seller: close the door for `buyer` (refund, or manual one-shot consumption). */
|
|
207
|
+
async revokeClone(sourceAgentId: bigint, buyer: Address): Promise<WriteContractReturnType> {
|
|
208
|
+
const authorizer = await this.requireAuthorizer(sourceAgentId);
|
|
209
|
+
const { walletClient, account } = requireWallet(this.ctx);
|
|
210
|
+
return walletClient.writeContract({
|
|
211
|
+
address: authorizer,
|
|
212
|
+
abi: standardCloneAuthorizerAbi,
|
|
213
|
+
functionName: 'revoke',
|
|
214
|
+
args: [sourceAgentId, buyer],
|
|
215
|
+
account,
|
|
216
|
+
chain: this.ctx.chain,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** The grant's recorded seller + whether it is currently effective ((0x0, false) = no grant). */
|
|
221
|
+
async cloneGrantOf(sourceAgentId: bigint, buyer: Address): Promise<{ grantor: Address; effective: boolean }> {
|
|
222
|
+
const authorizer = await this.requireAuthorizer(sourceAgentId);
|
|
223
|
+
const [grantor, effective] = (await this.ctx.publicClient.readContract({
|
|
224
|
+
address: authorizer, abi: standardCloneAuthorizerAbi, functionName: 'grantOf', args: [sourceAgentId, buyer],
|
|
225
|
+
})) as readonly [Address, boolean];
|
|
226
|
+
return { grantor, effective };
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
async balanceOf(owner: Address): Promise<bigint> {
|
|
230
|
+
return this.ctx.publicClient.readContract({
|
|
231
|
+
address: this.address, abi: agenticIDAbi, functionName: 'balanceOf', args: [owner],
|
|
232
|
+
}) as Promise<bigint>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
async waitForTransaction(txHash: Hash): Promise<TransactionReceipt> {
|
|
236
|
+
return this.ctx.publicClient.waitForTransactionReceipt({ hash: txHash, ...RECEIPT_WAIT });
|
|
237
|
+
}
|
|
238
|
+
}
|