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

Suppoort attachments in the protocol #299

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

Suppoort attachments in the protocol #299

wants to merge 9 commits into from

Conversation

Kolezhniuk
Copy link
Collaborator

No description provided.

src/iden3comm/handlers/credential-proposal.ts Outdated Show resolved Hide resolved
src/iden3comm/types/protocol/transparent-payment.ts Outdated Show resolved Hide resolved
src/iden3comm/constants.ts Show resolved Hide resolved
@@ -86,6 +88,8 @@ export function createAuthorizationRequestWithMessage(
created_time: getUnixTimestamp(new Date()),
expires_time: opts?.expires_time ? getUnixTimestamp(opts.expires_time) : undefined
};

opts?.attachments && (request.attachments = opts.attachments);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks interesting! However, since attachments are optional, it would be better to assign them directly in the request construction.
attachments: opts?.attachments

vmidyllic
vmidyllic previously approved these changes Jan 23, 2025
@@ -64,6 +69,7 @@ export function createProposalRequest(
created_time: getUnixTimestamp(new Date()),
expires_time: opts?.expires_time ? getUnixTimestamp(opts.expires_time) : undefined
};
opts.attachments?.length && (request.attachments = opts.attachments);
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here, better just:
attachments: opts?.attachments

@Kolezhniuk Kolezhniuk dismissed stale reviews from volodymyr-basiuk and vmidyllic via a95be40 January 29, 2025 14:15
getProtocolMessageTypeByGoalCode(m.body.goal_code) ===
PROTOCOL_MESSAGE_TYPE.PROPOSAL_REQUEST_MESSAGE_TYPE &&
m.to === proposalRequest.to && // issuer
(!m.body.paymentReference || m.body.paymentReference === proposalRequest.from) // user
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove user

// credential not found in the wallet, prepare proposal protocol message
const proposal = await this._params.proposalResolverFn(cred.context, cred.type);
const proposal = await this._params.proposalResolverFn(cred.context, cred.type, {
paymentInfo: paymentInfo?.body?.paymentData
Copy link
Collaborator

Choose a reason for hiding this comment

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

paymentMessage.body.payments[]

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