Skip to content

Conversation

@vmidyllic
Copy link
Collaborator

No description provided.

@Kolezhniuk Kolezhniuk self-requested a review March 18, 2025 17:11
function throws if it has multiple recipients.
*/

export function getIden3CommSingleRecipient(message: BasicMessage): DID | undefined {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you don't need to pass here the whole BasicMessage, just pass to

Comment on lines 208 to +212
id: request.id,
thid: request.thid,
type: PROTOCOL_MESSAGE_TYPE.CONTRACT_INVOKE_RESPONSE_MESSAGE_TYPE,
from: request.to,
to: request.from,
from: recipient ? recipient.string() : undefined,
to: target,
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe it's make sense to create helper function createBasicMsg(..params)
that hides logic of multiple to passing thid, mediaTyp etc.
And when you creates concrete message you could do something like that

    ...createBasicMsg(thid, to, isMultipleRecipients..., typ),
body: {...}
type: ide3MsgType
}

* @public
*/
export type AuthResponseHandlerOptions = StateVerificationOpts &
BasicHandlerOptions & {
Copy link
Collaborator

@volodymyr-basiuk volodymyr-basiuk Mar 19, 2025

Choose a reason for hiding this comment

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

Looks like we can extend BasicHandlerOptions with Iden3DIDcommCompatibilityOptions. Than it's automatically adds Iden3DIDcommCompatibilityOptions where we had BasicHandlerOptions.

type: cred.type,
context: cred.context,
allowedIssuers: [proposalRequest.to]
allowedIssuers: [to?.string()]
Copy link
Collaborator

Choose a reason for hiding this comment

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

allowedIssuers: [to.string()]

signer: Signer,
payments: PaymentRailsInfo[]
payments: PaymentRailsInfo[],
ctx?: Iden3DIDcommCompatibilityOptions
Copy link
Collaborator

Choose a reason for hiding this comment

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

should it be some options with ctx inside ? what if we need other option here ?
opt?: {
ctx?: Iden3DIDcommCompatibilityOptions
}

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