Skip to content

Commit

Permalink
feat: add transaction id and address fields to untrusted data
Browse files Browse the repository at this point in the history
Signed-off-by: Jimmy Madrigal <jimmymadrigal+github@gmail.com>
  • Loading branch information
jimmymadrigal committed Apr 12, 2024
1 parent e1a781e commit f7d6bfc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dscvr-one/frames-adapter",
"version": "2.0.2",
"version": "2.0.3",
"description": "Frames adapter to validate in DSCVR frame instances",
"type": "module",
"main": "./dist/index.js",
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export type {
DscvrFramesRequest,
DscvrUntrustedData,
DscvrValidationResponse,
UnknownFrameRequest,
} from './types';
export { dscvrClientProtocolPrefix } from './constants';
export {
Expand Down
4 changes: 3 additions & 1 deletion src/queries/validation.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ export const validationQuery = `#graphql
},
content {
id
}
},
buttonIndex,
state,
url,
timestamp,
inputText,
transactionId,
address,
}
}
`;
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { dscvrClientProtocolPrefix } from './constants';
export type DscvrUntrustedData = OpenFramesUntrustedData & {
dscvrId: string;
contentId?: string;
transactionId?: string;
address?: string;
state?: string;
};

Expand Down Expand Up @@ -42,4 +44,6 @@ export interface ValidatedQueryResult {
timestamp: string;
url: string;
buttonIndex: number;
transactionId: string | null;
address: string | null;
}
2 changes: 2 additions & 0 deletions src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ export const validateDscvrFrameMessage = async (
contentId: content?.id,
inputText: queryResult.inputText || undefined,
buttonIndex: queryResult.buttonIndex,
transactionId: queryResult.transactionId || undefined,
address: queryResult.address || undefined,
state: queryResult.state || undefined,
url: queryResult.url,
timestamp: Number(queryResult.timestamp),
Expand Down

0 comments on commit f7d6bfc

Please sign in to comment.