···
170
170
171
171
setIsLoadingVerifications(true);
172
172
try {
173
173
-
const response = await agent.api.com.atproto.repo.listRecords({
174
174
-
repo: session.did, // Use session.did
173
173
+
// Use direct agent method
174
174
+
const response = await agent.listRecords({
175
175
+
repo: session.did,
175
176
collection: 'app.bsky.graph.verification',
176
177
limit: 100,
177
178
});
···
220
221
221
222
await Promise.all(batch.map(async (verification, index) => {
222
223
try {
223
223
-
// Get current profile data
224
224
-
const profileRes = await agent.api.app.bsky.actor.getProfile({
224
224
+
// Use direct agent method
225
225
+
const profileRes = await agent.getProfile({
225
226
actor: verification.handle
226
227
});
227
228
···
283
284
try {
284
285
// Fetch follows (public) and known followers/mutuals (authenticated)
285
286
const [follows, mutuals] = await Promise.all([
286
286
-
fetchAllPaginated(publicAgent, publicAgent.api.app.bsky.graph.getFollows.bind(publicAgent.api.app.bsky.graph), { actor: session.did, limit: 100 }), // Use session.did
287
287
-
// Use the main authenticated agent for getKnownFollowers
288
288
-
fetchAllPaginated(agent, agent.api.app.bsky.graph.getKnownFollowers.bind(agent.api.app.bsky.graph), { actor: session.did, limit: 100 }) // Use session.did
287
287
+
// Use direct agent method (even for public agent)
288
288
+
fetchAllPaginated(publicAgent, publicAgent.getFollows.bind(publicAgent), { actor: session.did, limit: 100 }),
289
289
+
// Use direct agent method
290
290
+
fetchAllPaginated(agent, agent.getKnownFollowers.bind(agent), { actor: session.did, limit: 100 })
289
291
]);
290
292
291
293
console.log(`Fetched ${follows.length} follows (public), ${mutuals.length} mutuals (authenticated).`); // Updated log
···
432
434
} else {
433
435
verifierDid = verifierIdentifier;
434
436
try {
435
435
-
const profileRes = await publicAgent.api.app.bsky.actor.getProfile({ actor: verifierDid });
437
437
+
const profileRes = await publicAgent.getProfile({ actor: verifierDid });
436
438
verifierHandle = profileRes.data.handle;
437
439
} catch (profileError) { /* ignore */ }
438
440
}
···
581
583
// 1. Get profile of targetHandle (resolve handle to DID and get display name)
582
584
setStatusMessage(`Fetching profile for ${targetHandle}...`);
583
585
// Use the proper API namespace method
584
584
-
const profileRes = await agent.api.app.bsky.actor.getProfile({ actor: targetHandle });
586
586
+
const profileRes = await agent.getProfile({ actor: targetHandle });
585
587
const targetDid = profileRes.data.did;
586
588
const targetDisplayName = profileRes.data.displayName || profileRes.data.handle;
587
589
console.log('Target Profile:', profileRes.data);
···
600
602
setStatusMessage(`Creating verification record for ${targetHandle} on your profile...`);
601
603
602
604
// The correct method is repo.createRecord, not createRecord
603
603
-
const createRes = await agent.api.com.atproto.repo.createRecord({
605
605
+
const createRes = await agent.createRecord({
604
606
repo: session.did, // Use session.did
605
607
collection: 'app.bsky.graph.verification', // The NSID of the record type
606
608
record: verificationRecord,
···
655
657
const parts = verification.uri.split('/');
656
658
const rkey = parts[parts.length - 1];
657
659
658
658
-
await agent.api.com.atproto.repo.deleteRecord({
660
660
+
await agent.deleteRecord({
659
661
repo: session.did, // Use session.did
660
662
collection: 'app.bsky.graph.verification',
661
663
rkey: rkey