From 826ad3511a5cc9c2d79d57732ec7fbfa915590ba Mon Sep 17 00:00:00 2001 From: GopherDID <74898029+vmidyllic@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:51:41 +0300 Subject: [PATCH] Fix/reason onchain (#276) * fixes according to spec * 1.21.0 --- package-lock.json | 4 ++-- package.json | 2 +- src/iden3comm/handlers/contract-request.ts | 1 - src/iden3comm/types/protocol/contract-request.ts | 7 ++++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd6652fd..8dac2adf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@0xpolygonid/js-sdk", - "version": "1.20.3", + "version": "1.21.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@0xpolygonid/js-sdk", - "version": "1.20.3", + "version": "1.21.0", "license": "MIT or Apache-2.0", "dependencies": { "@noble/curves": "^1.4.0", diff --git a/package.json b/package.json index 12efea30..54816ae6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@0xpolygonid/js-sdk", - "version": "1.20.3", + "version": "1.21.0", "description": "SDK to work with Polygon ID", "main": "dist/node/cjs/index.js", "module": "dist/node/esm/index.js", diff --git a/src/iden3comm/handlers/contract-request.ts b/src/iden3comm/handlers/contract-request.ts index 5c356f53..2a1a4a20 100644 --- a/src/iden3comm/handlers/contract-request.ts +++ b/src/iden3comm/handlers/contract-request.ts @@ -192,7 +192,6 @@ export class ContractRequestHandler to: request.from, body: { transaction_data: request.body.transaction_data, - reason: request.body.reason, scope: [] } }; diff --git a/src/iden3comm/types/protocol/contract-request.ts b/src/iden3comm/types/protocol/contract-request.ts index 588c37d5..86e97661 100644 --- a/src/iden3comm/types/protocol/contract-request.ts +++ b/src/iden3comm/types/protocol/contract-request.ts @@ -1,6 +1,6 @@ import { PROTOCOL_MESSAGE_TYPE } from '../../constants'; import { BasicMessage } from '../packer'; -import { ZeroKnowledgeProofRequest, ZeroKnowledgeProofResponse } from './auth'; +import { DIDDocument, ZeroKnowledgeProofRequest, ZeroKnowledgeProofResponse } from './auth'; /** ContractInvokeRequest represents structure of contract invoke request object */ export type ContractInvokeRequest = BasicMessage & { @@ -10,9 +10,10 @@ export type ContractInvokeRequest = BasicMessage & { /** ContractInvokeRequestBody represents structure of contract invoke request body object */ export type ContractInvokeRequestBody = { - reason: string; + reason?: string; transaction_data: ContractInvokeTransactionData; scope: Array; + did_doc?: DIDDocument; }; /** ContractInvokeResponse represents structure of contract invoke response object */ @@ -25,7 +26,7 @@ export type ContractInvokeResponse = BasicMessage & { export type ContractInvokeResponseBody = { scope: Array; transaction_data: ContractInvokeTransactionData; - reason: string; + did_doc?: DIDDocument; }; /** OnChainZeroKnowledgeProofResponse represents structure of onchain zero knowledge proof response */