Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add to as string[] #303

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

add to as string[] #303

wants to merge 2 commits into from

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
}

@@ -99,7 +103,7 @@ export type AuthResponseHandlerOptions = StateVerificationOpts &
BasicHandlerOptions & {
Copy link
Collaborator

Choose a reason for hiding this comment

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

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

@@ -246,7 +249,7 @@ export class CredentialProposalHandler
},
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()]

@@ -487,7 +500,8 @@ export class PaymentHandler
receiver: DID,
agent: 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.

3 participants