@0xpolygonid/js-sdk 1.32.3 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/esm/index.js +45 -12
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.global.js +22 -22
- package/dist/browser/umd/index.global.js.map +1 -1
- package/dist/node/cjs/index.cjs +298 -14
- package/dist/node/cjs/index.cjs.map +1 -1
- package/dist/node/esm/index.js +45 -12
- package/dist/node/esm/index.js.map +1 -1
- package/dist/types/credentials/status/on-chain-revocation.d.ts.map +1 -1
- package/dist/types/credentials/status/reverse-sparse-merkle-tree.d.ts.map +1 -1
- package/dist/types/iden3comm/handlers/auth.d.ts +2 -1
- package/dist/types/iden3comm/handlers/auth.d.ts.map +1 -1
- package/dist/types/iden3comm/handlers/credential-proposal.d.ts +6 -3
- package/dist/types/iden3comm/handlers/credential-proposal.d.ts.map +1 -1
- package/dist/types/iden3comm/types/index.d.ts +2 -0
- package/dist/types/iden3comm/types/index.d.ts.map +1 -1
- package/dist/types/iden3comm/types/packer.d.ts +4 -1
- package/dist/types/iden3comm/types/packer.d.ts.map +1 -1
- package/dist/types/iden3comm/types/protocol/attachment.d.ts +11 -0
- package/dist/types/iden3comm/types/protocol/attachment.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/common.d.ts +11 -0
- package/dist/types/iden3comm/types/protocol/common.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/payment.d.ts +2 -4
- package/dist/types/iden3comm/types/protocol/payment.d.ts.map +1 -1
- package/dist/types/iden3comm/types/protocol/proposal-request.d.ts +4 -10
- package/dist/types/iden3comm/types/protocol/proposal-request.d.ts.map +1 -1
- package/dist/types/proof/verifiers/pub-signals-verifier.d.ts.map +1 -1
- package/dist/types/storage/blockchain/errors.d.ts +4 -0
- package/dist/types/storage/blockchain/errors.d.ts.map +1 -0
- package/dist/types/storage/blockchain/index.d.ts +1 -0
- package/dist/types/storage/blockchain/index.d.ts.map +1 -1
- package/dist/types/verifiable/constants.d.ts +5 -0
- package/dist/types/verifiable/constants.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/credentials/status/on-chain-revocation.ts +2 -3
- package/src/credentials/status/reverse-sparse-merkle-tree.ts +3 -3
- package/src/iden3comm/handlers/auth.ts +5 -2
- package/src/iden3comm/handlers/credential-proposal.ts +14 -5
- package/src/iden3comm/types/index.ts +2 -0
- package/src/iden3comm/types/packer.ts +7 -1
- package/src/iden3comm/types/protocol/attachment.ts +12 -0
- package/src/iden3comm/types/protocol/common.ts +10 -0
- package/src/iden3comm/types/protocol/payment.ts +2 -4
- package/src/iden3comm/types/protocol/proposal-request.ts +5 -8
- package/src/proof/verifiers/pub-signals-verifier.ts +3 -4
- package/src/storage/blockchain/errors.ts +46 -0
- package/src/storage/blockchain/index.ts +1 -0
- package/src/verifiable/constants.ts +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-chain-revocation.d.ts","sourceRoot":"","sources":["../../../../src/credentials/status/on-chain-revocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAEtF,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"on-chain-revocation.d.ts","sourceRoot":"","sources":["../../../../src/credentials/status/on-chain-revocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAEtF,OAAO,EAAE,GAAG,EA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CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAS,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"reverse-sparse-merkle-tree.d.ts","sourceRoot":"","sources":["../../../../src/credentials/status/reverse-sparse-merkle-tree.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,EAA+B,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAS,MAAM,kBAAkB,CAAC;AAM7E;;;;;;GAMG;AACH,qBAAa,SAAS;IAOD,IAAI,EAAE,IAAI;IAAqB,QAAQ,EAAE,IAAI,EAAE;IANlE;;;;;OAKG;gBACgB,IAAI,GAAE,IAAgB,EAAS,QAAQ,GAAE,IAAI,EAAO;IAEvE;;;;;OAKG;IACH,QAAQ,IAAI,QAAQ;IAepB;;;;OAIG;IACH,MAAM;;;;IAMN;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,SAAS;CAMjD;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAOD,aAAK,QAAQ;IACX,OAAO,IAAI;IACX,MAAM,IAAI;IACV,IAAI,IAAI;IACR,KAAK,IAAI;CACV;AAED;;;;;GAKG;AACH,qBAAa,WAAY,YAAW,wBAAwB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAElD;;;;;;;OAOG;IACG,OAAO,CACX,gBAAgB,EAAE,gBAAgB,EAClC,8BAA8B,CAAC,EAAE,8BAA8B,GAC9D,OAAO,CAAC,gBAAgB,CAAC;IA0B5B;;;;;;OAMG;YACW,SAAS;IAqDvB;;;;OAIG;IACH,OAAO,CAAC,iCAAiC;IAuCzC;;;;;;;OAOG;YACW,0BAA0B;IA8BlC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IA6CjF;;;;OAIG;IACH,OAAO,CAAC,YAAY;CAIrB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQtE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAGrF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MediaType } from '../constants';
|
|
2
2
|
import { IProofService } from '../../proof/proof-service';
|
|
3
|
-
import { StateVerificationOpts, AuthorizationRequestMessage, AuthorizationResponseMessage, BasicMessage, IPackageManager, JWSPackerParams, ZeroKnowledgeProofRequest } from '../types';
|
|
3
|
+
import { StateVerificationOpts, AuthorizationRequestMessage, AuthorizationResponseMessage, BasicMessage, IPackageManager, JWSPackerParams, ZeroKnowledgeProofRequest, Attachment } from '../types';
|
|
4
4
|
import { DID } from '@iden3/js-iden3-core';
|
|
5
5
|
import { AbstractMessageHandler, BasicHandlerOptions, IProtocolMessageHandler } from './message-handler';
|
|
6
6
|
/**
|
|
@@ -11,6 +11,7 @@ export type AuthorizationRequestCreateOptions = {
|
|
|
11
11
|
accept?: string[];
|
|
12
12
|
scope?: ZeroKnowledgeProofRequest[];
|
|
13
13
|
expires_time?: Date;
|
|
14
|
+
attachments?: Attachment[];
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
17
|
* createAuthorizationRequest is a function to create protocol authorization request
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/iden3comm/handlers/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,4BAA4B,EAC5B,YAAY,EACZ,eAAe,EACf,eAAe,EACf,yBAAyB,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/iden3comm/handlers/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,4BAA4B,EAC5B,YAAY,EACZ,eAAe,EACf,eAAe,EACf,yBAAyB,EAEzB,UAAU,EACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,GAAG,EAAoB,MAAM,sBAAsB,CAAC;AAQ7D,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAG3B;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACpC,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,iCAAiC,GACvC,2BAA2B,CAE7B;AACD;;;;;;;;GAQG;AACH,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EA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GAQG;AACH,qBAAa,WACX,SAAQ,sBACR,YAAW,YAAY,EAAE,uBAAuB;IAe9C,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAdhC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAKjC;IACF;;;;;OAKG;gBAEgB,UAAU,EAAE,eAAe,EAC3B,aAAa,EAAE,aAAa;IAK/C,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,yBAAyB,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAiB3F;;OAEG;IACG,yBAAyB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,2BAA2B,CAAC;YAU5E,iBAAiB;IA6C/B;;OAEG;IACG,0BAA0B,CAC9B,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,UAAU,EACnB,IAAI,CAAC,EAAE,kBAAkB,GACxB,OAAO,CAAC;QACT,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,2BAA2B,CAAC;QACzC,YAAY,EAAE,4BAA4B,CAAC;KAC5C,CAAC;YAuCY,kBAAkB;IAyFhC;;OAEG;IACG,2BAA2B,CAC/B,QAAQ,EAAE,4BAA4B,EACtC,OAAO,EAAE,2BAA2B,EACpC,IAAI,CAAC,EAAE,0BAA0B,GAAG,SAAS,GAC5C,OAAO,CAAC;QACT,OAAO,EAAE,2BAA2B,CAAC;QACrC,QAAQ,EAAE,4BAA4B,CAAC;KACxC,CAAC;IAaF,OAAO,CAAC,iBAAiB;IAkCzB,OAAO,CAAC,8BAA8B;CA6BvC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BasicMessage, DIDDocument, IPackageManager, PackerParams } from '../types';
|
|
1
|
+
import { Attachment, BasicMessage, DIDDocument, IPackageManager, PackerParams } from '../types';
|
|
2
2
|
import { DID } from '@iden3/js-iden3-core';
|
|
3
|
-
import { Proposal,
|
|
3
|
+
import { Proposal, ProposalRequestMessage, ProposalMessage, ProposalRequestCredential } from '../types/protocol/proposal-request';
|
|
4
4
|
import { IIdentityWallet } from '../../identity';
|
|
5
5
|
import { AbstractMessageHandler, BasicHandlerOptions, IProtocolMessageHandler } from './message-handler';
|
|
6
6
|
/** @beta ProposalRequestCreationOptions represents proposal-request creation options */
|
|
@@ -8,6 +8,7 @@ export type ProposalRequestCreationOptions = {
|
|
|
8
8
|
credentials: ProposalRequestCredential[];
|
|
9
9
|
did_doc?: DIDDocument;
|
|
10
10
|
expires_time?: Date;
|
|
11
|
+
attachments?: Attachment[];
|
|
11
12
|
};
|
|
12
13
|
/** @beta ProposalCreationOptions represents proposal creation options */
|
|
13
14
|
export type ProposalCreationOptions = {
|
|
@@ -75,7 +76,9 @@ export type ProposalHandlerOptions = BasicHandlerOptions & {
|
|
|
75
76
|
/** @beta CredentialProposalHandlerParams represents credential proposal handler params */
|
|
76
77
|
export type CredentialProposalHandlerParams = {
|
|
77
78
|
agentUrl: string;
|
|
78
|
-
proposalResolverFn: (context: string, type: string
|
|
79
|
+
proposalResolverFn: (context: string, type: string, opts?: {
|
|
80
|
+
msg?: BasicMessage;
|
|
81
|
+
}) => Promise<Proposal>;
|
|
79
82
|
packerParams: PackerParams;
|
|
80
83
|
};
|
|
81
84
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-proposal.d.ts","sourceRoot":"","sources":["../../../../src/iden3comm/handlers/credential-proposal.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EAGZ,WAAW,EACX,eAAe,EACf,YAAY,EACb,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,GAAG,EAAoB,MAAM,sBAAsB,CAAC;AAG7D,OAAO,EACL,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"credential-proposal.d.ts","sourceRoot":"","sources":["../../../../src/iden3comm/handlers/credential-proposal.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,YAAY,EAGZ,WAAW,EACX,eAAe,E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AAC,QAAQ,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,sBAAsB;;;CAW9E"}
|
|
@@ -9,6 +9,8 @@ export * from './protocol/payment';
|
|
|
9
9
|
export * from './protocol/accept-profile';
|
|
10
10
|
export * from './protocol/discovery-protocol';
|
|
11
11
|
export * from './protocol/problem-report';
|
|
12
|
+
export * from './protocol/attachment';
|
|
13
|
+
export * from './protocol/common';
|
|
12
14
|
export * from './packer';
|
|
13
15
|
export * from './models';
|
|
14
16
|
export * from './packageManager';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/iden3comm/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAE1C,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/iden3comm/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAE1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { CircuitId } from '../../circuits';
|
|
|
5
5
|
import { MediaType, PROTOCOL_MESSAGE_TYPE } from '../constants';
|
|
6
6
|
import { DIDDocument, VerificationMethod } from 'did-resolver';
|
|
7
7
|
import { StateVerificationOpts } from './models';
|
|
8
|
+
import { Attachment } from './protocol/attachment';
|
|
8
9
|
/**
|
|
9
10
|
* Protocol message type
|
|
10
11
|
*/
|
|
@@ -42,13 +43,15 @@ export type BasicMessage = {
|
|
|
42
43
|
to?: string;
|
|
43
44
|
created_time?: number;
|
|
44
45
|
expires_time?: number;
|
|
46
|
+
attachments?: Attachment[];
|
|
45
47
|
};
|
|
46
48
|
/**
|
|
47
49
|
* Basic message with all possible fields required
|
|
48
50
|
*/
|
|
49
|
-
export type RequiredBasicMessage = Omit<Required<BasicMessage>, 'created_time' | 'expires_time'> & {
|
|
51
|
+
export type RequiredBasicMessage = Omit<Required<BasicMessage>, 'created_time' | 'expires_time' | 'attachments'> & {
|
|
50
52
|
created_time?: number;
|
|
51
53
|
expires_time?: number;
|
|
54
|
+
attachments?: Attachment[];
|
|
52
55
|
};
|
|
53
56
|
/**
|
|
54
57
|
* parameters for any packer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packer.d.ts","sourceRoot":"","sources":["../../../../src/iden3comm/types/packer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,WAAW,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+
import { JsonDocumentObject } from '../packer';
|
|
2
|
+
export type Attachment = {
|
|
3
|
+
id: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
media_type?: string;
|
|
6
|
+
data: AttachData;
|
|
7
|
+
};
|
|
8
|
+
export type AttachData = {
|
|
9
|
+
json: JsonDocumentObject;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=attachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../../../../src/iden3comm/types/protocol/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,kBAAkB,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents information about a credential schema.
|
|
3
|
+
*
|
|
4
|
+
* @property {string} type - The type of the credential schema.
|
|
5
|
+
* @property {string} context - The context in which the credential schema is used.
|
|
6
|
+
*/
|
|
7
|
+
export type CredentialSchemaInfo = {
|
|
8
|
+
type: string;
|
|
9
|
+
context: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/iden3comm/types/protocol/common.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BasicMessage } from '../';
|
|
2
2
|
import { PaymentFeatures, PaymentRequestDataType, SupportedCurrencies, SupportedPaymentProofType } from '../../../verifiable';
|
|
3
3
|
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
|
|
4
|
+
import { CredentialSchemaInfo } from './common';
|
|
4
5
|
/** @beta PaymentRequestMessage is struct the represents payment-request message */
|
|
5
6
|
export type PaymentRequestMessage = BasicMessage & {
|
|
6
7
|
body: PaymentRequestMessageBody;
|
|
@@ -15,10 +16,7 @@ export type PaymentRequestMessageBody = {
|
|
|
15
16
|
};
|
|
16
17
|
/** @beta PaymentRequestInfo is struct the represents payment info for payment-request */
|
|
17
18
|
export type PaymentRequestInfo = {
|
|
18
|
-
credentials:
|
|
19
|
-
type: string;
|
|
20
|
-
context: string;
|
|
21
|
-
}[];
|
|
19
|
+
credentials: CredentialSchemaInfo[];
|
|
22
20
|
data: Iden3PaymentRequestCryptoV1 | (Iden3PaymentRequestCryptoV1 | Iden3PaymentRailsRequestV1 | Iden3PaymentRailsERC20RequestV1)[];
|
|
23
21
|
description?: string;
|
|
24
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../../../src/iden3comm/types/protocol/payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../../../src/iden3comm/types/protocol/payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,qBAAqB,CAAC;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,GAC3B,0BAA0B,GAC1B,+BAA+B,CAAC;AAEpC;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACxB,oBAAoB,GACpB,mBAAmB,GACnB,wBAAwB,CAAC"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { BasicMessage, DIDDocument
|
|
1
|
+
import { BasicMessage, DIDDocument } from '../';
|
|
2
2
|
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
|
|
3
|
+
import { CredentialSchemaInfo } from './common';
|
|
3
4
|
/** @beta ProposalRequestMessage is struct the represents proposal-request message */
|
|
4
5
|
export type ProposalRequestMessage = BasicMessage & {
|
|
5
6
|
body: ProposalRequestMessageBody;
|
|
6
7
|
type: typeof PROTOCOL_MESSAGE_TYPE.PROPOSAL_REQUEST_MESSAGE_TYPE;
|
|
7
8
|
};
|
|
9
|
+
/** @beta ProposalRequestCredential is struct the represents proposal request credential */
|
|
10
|
+
export type ProposalRequestCredential = CredentialSchemaInfo;
|
|
8
11
|
/** @beta ProposalRequestMessageBody is struct the represents body for proposal-request */
|
|
9
12
|
export type ProposalRequestMessageBody = {
|
|
10
13
|
credentials: ProposalRequestCredential[];
|
|
11
|
-
metadata?: {
|
|
12
|
-
type: string;
|
|
13
|
-
data?: JsonDocumentObject;
|
|
14
|
-
};
|
|
15
14
|
did_doc?: DIDDocument;
|
|
16
15
|
};
|
|
17
16
|
/** @beta ProposalMessage is struct the represents proposal message */
|
|
@@ -23,11 +22,6 @@ export type ProposalMessage = BasicMessage & {
|
|
|
23
22
|
export type ProposalMessageBody = {
|
|
24
23
|
proposals: Proposal[];
|
|
25
24
|
};
|
|
26
|
-
/** @beta ProposalRequestCredential is struct the represents proposal request credential */
|
|
27
|
-
export type ProposalRequestCredential = {
|
|
28
|
-
type: string;
|
|
29
|
-
context: string;
|
|
30
|
-
};
|
|
31
25
|
/** @beta Proposal is struct the represents proposal inside proposal protocol message */
|
|
32
26
|
export type Proposal = {
|
|
33
27
|
credentials: ProposalRequestCredential[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposal-request.d.ts","sourceRoot":"","sources":["../../../../../src/iden3comm/types/protocol/proposal-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"proposal-request.d.ts","sourceRoot":"","sources":["../../../../../src/iden3comm/types/protocol/proposal-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,qFAAqF;AACrF,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG;IAClD,IAAI,EAAE,0BAA0B,CAAC;IACjC,IAAI,EAAE,OAAO,qBAAqB,CAAC,6BAA6B,CAAC;CAClE,CAAC;AAEF,4FAA4F;AAC5F,MAAM,MAAM,yBAAyB,GAAG,oBAAoB,CAAC;AAE7D,0FAA0F;AAC1F,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,EAAE,yBAAyB,EAAE,CAAC;IACzC,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF,uEAAuE;AACvE,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG;IAC3C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,EAAE,OAAO,qBAAqB,CAAC,qBAAqB,CAAC;CAC1D,CAAC;AAEF,oFAAoF;AACpF,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF,wFAAwF;AACxF,MAAM,MAAM,QAAQ,GAAG;IACrB,WAAW,EAAE,yBAAyB,EAAE,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pub-signals-verifier.d.ts","sourceRoot":"","sources":["../../../../src/proof/verifiers/pub-signals-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,EAAE,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,cAAc,EAA2B,MAAM,+BAA+B,CAAC;AAExF,OAAO,EAAE,aAAa,EAAuB,MAAM,eAAe,CAAC;AAEnE,OAAO,EAA2B,UAAU,EAAa,MAAM,kBAAkB,CAAC;AAKlF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAMnD,OAAO,EAGL,UAAU,EAUX,MAAM,SAAS,CAAC;AAKjB,OAAO,EAEL,UAAU,EACV,sBAAsB,EAEvB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"pub-signals-verifier.d.ts","sourceRoot":"","sources":["../../../../src/proof/verifiers/pub-signals-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,EAAE,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,cAAc,EAA2B,MAAM,+BAA+B,CAAC;AAExF,OAAO,EAAE,aAAa,EAAuB,MAAM,eAAe,CAAC;AAEnE,OAAO,EAA2B,UAAU,EAAa,MAAM,kBAAkB,CAAC;AAKlF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAMnD,OAAO,EAGL,UAAU,EAUX,MAAM,SAAS,CAAC;AAKjB,OAAO,EAEL,UAAU,EACV,sBAAsB,EAEvB,MAAM,iBAAiB,CAAC;AAGzB;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CA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ts","sourceRoot":"","sources":["../../../../src/storage/blockchain/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/blockchain/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC"}
|
|
@@ -4,7 +4,12 @@ export declare const VerifiableConstants: Readonly<{
|
|
|
4
4
|
FiELD_IS_EMPTY: string;
|
|
5
5
|
CONTEXT_TYPE_IS_EMPTY: string;
|
|
6
6
|
IDENTITY_DOES_NOT_EXIST: string;
|
|
7
|
+
IDENTITY_DOES_NOT_EXIST_CUSTOM_ERROR: string;
|
|
7
8
|
NO_AUTH_CRED_FOUND: string;
|
|
9
|
+
STATE_DOES_NOT_EXIST: string;
|
|
10
|
+
STATE_DOES_NOT_EXIST_CUSTOM_ERROR: string;
|
|
11
|
+
ROOT_DOES_NOT_EXIST: string;
|
|
12
|
+
ROOT_DOES_NOT_EXIST_CUSTOM_ERROR: string;
|
|
8
13
|
ID_WALLET_NO_CREDENTIAL_SATISFIED_QUERY: string;
|
|
9
14
|
ID_WALLET_SIGNER_IS_REQUIRED: string;
|
|
10
15
|
ID_WALLET_PROVER_IS_REQUIRED: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/verifiable/constants.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"constants.d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BAAyB,8BAA8B;CACxD;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,11 +3,11 @@ import { EthConnectionConfig } from '../../storage/blockchain';
|
|
|
3
3
|
import { CredentialStatusResolver, CredentialStatusResolveOptions } from './resolver';
|
|
4
4
|
import { OnChainRevocationStorage } from '../../storage/blockchain/onchain-revocation';
|
|
5
5
|
import { DID } from '@iden3/js-iden3-core';
|
|
6
|
-
import { VerifiableConstants } from '../../verifiable/constants';
|
|
7
6
|
import { isGenesisState } from '../../utils';
|
|
8
7
|
import { EthStateStorage, EthStateStorageOptions } from '../../storage/blockchain/state';
|
|
9
8
|
import { IStateStorage, IOnchainRevocationStore } from '../../storage';
|
|
10
9
|
import { Hash } from '@iden3/js-merkletree';
|
|
10
|
+
import { isIdentityDoesNotExistError } from '../../storage/blockchain/errors';
|
|
11
11
|
|
|
12
12
|
/*
|
|
13
13
|
* Options for OnChainResolver
|
|
@@ -83,8 +83,7 @@ export class OnChainResolver implements CredentialStatusResolver {
|
|
|
83
83
|
}
|
|
84
84
|
latestIssuerState = latestStateInfo.state;
|
|
85
85
|
} catch (e) {
|
|
86
|
-
|
|
87
|
-
if (!errMsg.includes(VerifiableConstants.ERRORS.IDENTITY_DOES_NOT_EXIST)) {
|
|
86
|
+
if (!isIdentityDoesNotExistError(e)) {
|
|
88
87
|
throw e;
|
|
89
88
|
}
|
|
90
89
|
|
|
@@ -4,9 +4,10 @@ import { Hash, Proof, NodeAux, ZERO_HASH, testBit } from '@iden3/js-merkletree';
|
|
|
4
4
|
import { IStateStorage } from '../../storage';
|
|
5
5
|
import { CredentialStatusResolver, CredentialStatusResolveOptions } from './resolver';
|
|
6
6
|
import { CredentialStatus, RevocationStatus, State } from '../../verifiable';
|
|
7
|
-
import {
|
|
7
|
+
import { CredentialStatusType } from '../../verifiable/constants';
|
|
8
8
|
import { isEthereumIdentity, isGenesisState } from '../../utils';
|
|
9
9
|
import { IssuerResolver } from './sparse-merkle-tree';
|
|
10
|
+
import { isIdentityDoesNotExistError } from '../../storage/blockchain/errors';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* ProofNode is a partial Reverse Hash Service result
|
|
@@ -164,8 +165,7 @@ export class RHSResolver implements CredentialStatusResolver {
|
|
|
164
165
|
}
|
|
165
166
|
latestState = latestStateInfo.state;
|
|
166
167
|
} catch (e) {
|
|
167
|
-
|
|
168
|
-
if (!errMsg.includes(VerifiableConstants.ERRORS.IDENTITY_DOES_NOT_EXIST)) {
|
|
168
|
+
if (!isIdentityDoesNotExistError(e)) {
|
|
169
169
|
throw e;
|
|
170
170
|
}
|
|
171
171
|
const stateHex = this.extractState(credentialStatus.id);
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
IPackageManager,
|
|
11
11
|
JWSPackerParams,
|
|
12
12
|
ZeroKnowledgeProofRequest,
|
|
13
|
-
JSONObject
|
|
13
|
+
JSONObject,
|
|
14
|
+
Attachment
|
|
14
15
|
} from '../types';
|
|
15
16
|
import { DID, getUnixTimestamp } from '@iden3/js-iden3-core';
|
|
16
17
|
import { proving } from '@iden3/js-jwz';
|
|
@@ -35,6 +36,7 @@ export type AuthorizationRequestCreateOptions = {
|
|
|
35
36
|
accept?: string[];
|
|
36
37
|
scope?: ZeroKnowledgeProofRequest[];
|
|
37
38
|
expires_time?: Date;
|
|
39
|
+
attachments?: Attachment[];
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
/**
|
|
@@ -84,7 +86,8 @@ export function createAuthorizationRequestWithMessage(
|
|
|
84
86
|
scope: opts?.scope ?? []
|
|
85
87
|
},
|
|
86
88
|
created_time: getUnixTimestamp(new Date()),
|
|
87
|
-
expires_time: opts?.expires_time ? getUnixTimestamp(opts.expires_time) : undefined
|
|
89
|
+
expires_time: opts?.expires_time ? getUnixTimestamp(opts.expires_time) : undefined,
|
|
90
|
+
attachments: opts?.attachments
|
|
88
91
|
};
|
|
89
92
|
return request;
|
|
90
93
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PROTOCOL_MESSAGE_TYPE, MediaType } from '../constants';
|
|
2
2
|
import {
|
|
3
|
+
Attachment,
|
|
3
4
|
BasicMessage,
|
|
4
5
|
CredentialOffer,
|
|
5
6
|
CredentialsOfferMessage,
|
|
@@ -13,9 +14,9 @@ import * as uuid from 'uuid';
|
|
|
13
14
|
import { proving } from '@iden3/js-jwz';
|
|
14
15
|
import {
|
|
15
16
|
Proposal,
|
|
16
|
-
ProposalRequestCredential,
|
|
17
17
|
ProposalRequestMessage,
|
|
18
|
-
ProposalMessage
|
|
18
|
+
ProposalMessage,
|
|
19
|
+
ProposalRequestCredential
|
|
19
20
|
} from '../types/protocol/proposal-request';
|
|
20
21
|
import { IIdentityWallet } from '../../identity';
|
|
21
22
|
import { byteEncoder } from '../../utils';
|
|
@@ -32,6 +33,7 @@ export type ProposalRequestCreationOptions = {
|
|
|
32
33
|
credentials: ProposalRequestCredential[];
|
|
33
34
|
did_doc?: DIDDocument;
|
|
34
35
|
expires_time?: Date;
|
|
36
|
+
attachments?: Attachment[];
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
/** @beta ProposalCreationOptions represents proposal creation options */
|
|
@@ -62,7 +64,8 @@ export function createProposalRequest(
|
|
|
62
64
|
type: PROTOCOL_MESSAGE_TYPE.PROPOSAL_REQUEST_MESSAGE_TYPE,
|
|
63
65
|
body: opts,
|
|
64
66
|
created_time: getUnixTimestamp(new Date()),
|
|
65
|
-
expires_time: opts?.expires_time ? getUnixTimestamp(opts.expires_time) : undefined
|
|
67
|
+
expires_time: opts?.expires_time ? getUnixTimestamp(opts.expires_time) : undefined,
|
|
68
|
+
attachments: opts.attachments
|
|
66
69
|
};
|
|
67
70
|
return request;
|
|
68
71
|
}
|
|
@@ -153,7 +156,11 @@ export type ProposalHandlerOptions = BasicHandlerOptions & {
|
|
|
153
156
|
/** @beta CredentialProposalHandlerParams represents credential proposal handler params */
|
|
154
157
|
export type CredentialProposalHandlerParams = {
|
|
155
158
|
agentUrl: string;
|
|
156
|
-
proposalResolverFn: (
|
|
159
|
+
proposalResolverFn: (
|
|
160
|
+
context: string,
|
|
161
|
+
type: string,
|
|
162
|
+
opts?: { msg?: BasicMessage }
|
|
163
|
+
) => Promise<Proposal>;
|
|
157
164
|
packerParams: PackerParams;
|
|
158
165
|
};
|
|
159
166
|
|
|
@@ -281,7 +288,9 @@ export class CredentialProposalHandler
|
|
|
281
288
|
}
|
|
282
289
|
|
|
283
290
|
// credential not found in the wallet, prepare proposal protocol message
|
|
284
|
-
const proposal = await this._params.proposalResolverFn(cred.context, cred.type
|
|
291
|
+
const proposal = await this._params.proposalResolverFn(cred.context, cred.type, {
|
|
292
|
+
msg: proposalRequest
|
|
293
|
+
});
|
|
285
294
|
if (!proposal) {
|
|
286
295
|
throw new Error(`can't resolve Proposal for type: ${cred.type}, context: ${cred.context}`);
|
|
287
296
|
}
|
|
@@ -10,6 +10,8 @@ export * from './protocol/accept-profile';
|
|
|
10
10
|
export * from './protocol/discovery-protocol';
|
|
11
11
|
export * from './protocol/problem-report';
|
|
12
12
|
|
|
13
|
+
export * from './protocol/attachment';
|
|
14
|
+
export * from './protocol/common';
|
|
13
15
|
export * from './packer';
|
|
14
16
|
export * from './models';
|
|
15
17
|
export * from './packageManager';
|
|
@@ -5,6 +5,7 @@ import { CircuitId } from '../../circuits';
|
|
|
5
5
|
import { MediaType, PROTOCOL_MESSAGE_TYPE } from '../constants';
|
|
6
6
|
import { DIDDocument, VerificationMethod } from 'did-resolver';
|
|
7
7
|
import { StateVerificationOpts } from './models';
|
|
8
|
+
import { Attachment } from './protocol/attachment';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Protocol message type
|
|
@@ -51,14 +52,19 @@ export type BasicMessage = {
|
|
|
51
52
|
to?: string;
|
|
52
53
|
created_time?: number;
|
|
53
54
|
expires_time?: number;
|
|
55
|
+
attachments?: Attachment[];
|
|
54
56
|
};
|
|
55
57
|
|
|
56
58
|
/**
|
|
57
59
|
* Basic message with all possible fields required
|
|
58
60
|
*/
|
|
59
|
-
export type RequiredBasicMessage = Omit<
|
|
61
|
+
export type RequiredBasicMessage = Omit<
|
|
62
|
+
Required<BasicMessage>,
|
|
63
|
+
'created_time' | 'expires_time' | 'attachments'
|
|
64
|
+
> & {
|
|
60
65
|
created_time?: number;
|
|
61
66
|
expires_time?: number;
|
|
67
|
+
attachments?: Attachment[];
|
|
62
68
|
};
|
|
63
69
|
|
|
64
70
|
/**
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents information about a credential schema.
|
|
3
|
+
*
|
|
4
|
+
* @property {string} type - The type of the credential schema.
|
|
5
|
+
* @property {string} context - The context in which the credential schema is used.
|
|
6
|
+
*/
|
|
7
|
+
export type CredentialSchemaInfo = {
|
|
8
|
+
type: string;
|
|
9
|
+
context: string;
|
|
10
|
+
};
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
SupportedPaymentProofType
|
|
7
7
|
} from '../../../verifiable';
|
|
8
8
|
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
|
|
9
|
+
import { CredentialSchemaInfo } from './common';
|
|
9
10
|
|
|
10
11
|
/** @beta PaymentRequestMessage is struct the represents payment-request message */
|
|
11
12
|
export type PaymentRequestMessage = BasicMessage & {
|
|
@@ -23,10 +24,7 @@ export type PaymentRequestMessageBody = {
|
|
|
23
24
|
|
|
24
25
|
/** @beta PaymentRequestInfo is struct the represents payment info for payment-request */
|
|
25
26
|
export type PaymentRequestInfo = {
|
|
26
|
-
credentials:
|
|
27
|
-
type: string;
|
|
28
|
-
context: string;
|
|
29
|
-
}[];
|
|
27
|
+
credentials: CredentialSchemaInfo[];
|
|
30
28
|
data:
|
|
31
29
|
| Iden3PaymentRequestCryptoV1
|
|
32
30
|
| (
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BasicMessage, DIDDocument
|
|
1
|
+
import { BasicMessage, DIDDocument } from '../';
|
|
2
2
|
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
|
|
3
|
+
import { CredentialSchemaInfo } from './common';
|
|
3
4
|
|
|
4
5
|
/** @beta ProposalRequestMessage is struct the represents proposal-request message */
|
|
5
6
|
export type ProposalRequestMessage = BasicMessage & {
|
|
@@ -7,10 +8,12 @@ export type ProposalRequestMessage = BasicMessage & {
|
|
|
7
8
|
type: typeof PROTOCOL_MESSAGE_TYPE.PROPOSAL_REQUEST_MESSAGE_TYPE;
|
|
8
9
|
};
|
|
9
10
|
|
|
11
|
+
/** @beta ProposalRequestCredential is struct the represents proposal request credential */
|
|
12
|
+
export type ProposalRequestCredential = CredentialSchemaInfo;
|
|
13
|
+
|
|
10
14
|
/** @beta ProposalRequestMessageBody is struct the represents body for proposal-request */
|
|
11
15
|
export type ProposalRequestMessageBody = {
|
|
12
16
|
credentials: ProposalRequestCredential[];
|
|
13
|
-
metadata?: { type: string; data?: JsonDocumentObject };
|
|
14
17
|
did_doc?: DIDDocument;
|
|
15
18
|
};
|
|
16
19
|
|
|
@@ -25,12 +28,6 @@ export type ProposalMessageBody = {
|
|
|
25
28
|
proposals: Proposal[];
|
|
26
29
|
};
|
|
27
30
|
|
|
28
|
-
/** @beta ProposalRequestCredential is struct the represents proposal request credential */
|
|
29
|
-
export type ProposalRequestCredential = {
|
|
30
|
-
type: string;
|
|
31
|
-
context: string;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
31
|
/** @beta Proposal is struct the represents proposal inside proposal protocol message */
|
|
35
32
|
export type Proposal = {
|
|
36
33
|
credentials: ProposalRequestCredential[];
|
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
VerifiablePresentation,
|
|
39
39
|
JsonDocumentObject
|
|
40
40
|
} from '../../iden3comm';
|
|
41
|
+
import { isRootDoesNotExistError, isStateDoesNotExistError } from '../../storage/blockchain/errors';
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
44
|
* Verify Context - params for pub signal verification
|
|
@@ -605,9 +606,7 @@ export class PubSignalsVerifier {
|
|
|
605
606
|
try {
|
|
606
607
|
contractState = await this._stateStorage.getStateInfoByIdAndState(idBigInt, state);
|
|
607
608
|
} catch (e) {
|
|
608
|
-
|
|
609
|
-
const errMsg = stateNotExistErr || (e as unknown as Error).message;
|
|
610
|
-
if (errMsg.includes('State does not exist')) {
|
|
609
|
+
if (isStateDoesNotExistError(e)) {
|
|
611
610
|
if (isGenesis) {
|
|
612
611
|
return {
|
|
613
612
|
latest: true,
|
|
@@ -655,7 +654,7 @@ export class PubSignalsVerifier {
|
|
|
655
654
|
try {
|
|
656
655
|
globalStateInfo = await this._stateStorage.getGISTRootInfo(state, id);
|
|
657
656
|
} catch (e: unknown) {
|
|
658
|
-
if ((e
|
|
657
|
+
if (isRootDoesNotExistError(e)) {
|
|
659
658
|
throw new Error('GIST root does not exist in the smart contract');
|
|
660
659
|
}
|
|
661
660
|
throw e;
|