Skip to content

Conversation

Sotatek-DukeVu
Copy link
Collaborator

Remove references to any in src/keri/core directory
Issue: WebOfTrust#340

@Sotatek-DukeVu Sotatek-DukeVu force-pushed the chore/remove-reference-any-type branch from 647c35e to 03cad8d Compare August 8, 2025 10:45
@Sotatek-DukeVu Sotatek-DukeVu requested a review from iFergal August 8, 2025 10:45
@Sotatek-DukeVu Sotatek-DukeVu self-assigned this Aug 8, 2025
const sn = new CesrNumber({}, undefined, this.serder.sad['s']).num + 1;
const anchor = { i: _agent.pre, s: seqner.snh, d: _agent.said! };
const sn =
new CesrNumber({}, undefined, String(this.serder.sad['s'])).num + 1;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sotatek-Patrick-Vu is currently working on the typing for ee Serders (establishment events). I think we could narrow the typing here and we'd know exactly the format of sad so we'd know sad.s is a string. That'd be better but requires some coordination.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the status here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

pre: this.serder.pre,
dig: this.serder.sad['d'],
pre: this.serder.pre!,
dig: this.serder.sad['d']!,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for these ! values

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

i: string;
t: string;
p: string;
a: InteractEventData[];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as mentioned in previous comment, a can be Record<string, unknown>[];. SealSourceTriple is just a common one that's used

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using the type from generated type of Patrick. He told me he will update this.

s: string;
d: string;
}
export interface InteractEventSAD extends BaseSAD {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patrick will also have ixn

a: ReplyData;
}

export interface SealData {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah guess this is the SealSourceTriple

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@Sotatek-DukeVu Sotatek-DukeVu force-pushed the chore/remove-reference-any-type branch from 67cc8d0 to 50384d4 Compare August 25, 2025 09:23
@Sotatek-DukeVu Sotatek-DukeVu changed the base branch from chore/openapi_type_hints to feat/agenting_type_hints August 25, 2025 09:24
async approve(name: string, data?: any): Promise<EventResult> {
async approve(
name: string,
data: { i: string; s: string; d: string }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can use the SealSourceTriple

async approve(name: string, data?: any): Promise<EventResult> {
async approve(
name: string,
data?: { i: string; s: string; d: string }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please

a: Record<string, unknown>[];
}

export type InteractEventData = components['schemas']['Seal'];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets call it SealSourceTriple - I believe in this case, ['schemas']['Seal'] is the specific i,s,d one right?

const sn = new CesrNumber({}, undefined, this.serder.sad['s']).num + 1;
const anchor = { i: _agent.pre, s: seqner.snh, d: _agent.said! };
const sn =
new CesrNumber({}, undefined, String(this.serder.sad['s'])).num + 1;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the status here?

eid?: string;
}

export interface RotateEventSAD extends BaseSAD, Record<string, unknown> {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I forgot there was 2 dimension fractions too. cc @Sotatek-Patrick-Vu

eid?: string;
}

export interface RotateEventSAD extends BaseSAD, Record<string, unknown> {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get these types from openapi though?

}

export type Seal<
T extends components['schemas']['Seal'] = components['schemas']['Seal'],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A seal can have any attributes at all - so essentially Record<string, unknown>. SealSourceTriple is components['schemas']['Seal'] right? If so, maybe we should rename @Sotatek-Patrick-Vu

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SealSourceTriple is components['schemas']['Seal'] right?
Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants