@0xpolygonid/js-sdk 1.24.1 → 1.26.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 +376 -748
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +377 -747
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/circuits/auth-v2.js +6 -0
- package/dist/node/cjs/iden3comm/constants.js +6 -1
- package/dist/node/cjs/iden3comm/handlers/auth.js +16 -24
- package/dist/node/cjs/iden3comm/handlers/contract-request.js +7 -1
- package/dist/node/cjs/iden3comm/handlers/discovery-protocol.js +198 -0
- package/dist/node/cjs/iden3comm/handlers/index.js +1 -0
- package/dist/node/cjs/iden3comm/handlers/payment.js +27 -46
- package/dist/node/cjs/iden3comm/packageManager.js +12 -0
- package/dist/node/cjs/iden3comm/packers/jws.js +8 -7
- package/dist/node/cjs/iden3comm/packers/plain.js +8 -2
- package/dist/node/cjs/iden3comm/packers/zkp.js +10 -12
- package/dist/node/cjs/iden3comm/types/index.js +1 -0
- package/dist/node/cjs/iden3comm/types/protocol/discovery-protocol.js +16 -0
- package/dist/node/cjs/iden3comm/utils/contract-request.utils.js +59 -0
- package/dist/node/cjs/iden3comm/utils/index.js +1 -0
- package/dist/node/cjs/proof/proof-service.js +6 -0
- package/dist/node/cjs/storage/blockchain/onchain-zkp-verifier.js +56 -47
- package/dist/node/cjs/utils/did-helper.js +8 -3
- package/dist/node/cjs/verifiable/constants.js +1 -2
- package/dist/node/esm/circuits/auth-v2.js +6 -0
- package/dist/node/esm/iden3comm/constants.js +6 -1
- package/dist/node/esm/iden3comm/handlers/auth.js +17 -25
- package/dist/node/esm/iden3comm/handlers/contract-request.js +7 -1
- package/dist/node/esm/iden3comm/handlers/discovery-protocol.js +169 -0
- package/dist/node/esm/iden3comm/handlers/index.js +1 -0
- package/dist/node/esm/iden3comm/handlers/payment.js +28 -46
- package/dist/node/esm/iden3comm/packageManager.js +12 -0
- package/dist/node/esm/iden3comm/packers/jws.js +9 -8
- package/dist/node/esm/iden3comm/packers/plain.js +9 -3
- package/dist/node/esm/iden3comm/packers/zkp.js +11 -13
- package/dist/node/esm/iden3comm/types/index.js +1 -0
- package/dist/node/esm/iden3comm/types/protocol/discovery-protocol.js +13 -0
- package/dist/node/esm/iden3comm/utils/contract-request.utils.js +54 -0
- package/dist/node/esm/iden3comm/utils/index.js +1 -0
- package/dist/node/esm/proof/proof-service.js +6 -0
- package/dist/node/esm/storage/blockchain/onchain-zkp-verifier.js +58 -49
- package/dist/node/esm/utils/did-helper.js +8 -3
- package/dist/node/esm/verifiable/constants.js +1 -2
- package/dist/types/circuits/auth-v2.d.ts +3 -2
- package/dist/types/iden3comm/constants.d.ts +2 -0
- package/dist/types/iden3comm/handlers/discovery-protocol.d.ts +100 -0
- package/dist/types/iden3comm/handlers/index.d.ts +1 -0
- package/dist/types/iden3comm/handlers/payment.d.ts +5 -9
- package/dist/types/iden3comm/packageManager.d.ts +2 -0
- package/dist/types/iden3comm/packers/jws.d.ts +2 -1
- package/dist/types/iden3comm/packers/plain.d.ts +1 -0
- package/dist/types/iden3comm/packers/zkp.d.ts +3 -2
- package/dist/types/iden3comm/types/index.d.ts +1 -0
- package/dist/types/iden3comm/types/packageManager.d.ts +6 -0
- package/dist/types/iden3comm/types/protocol/discovery-protocol.d.ts +41 -0
- package/dist/types/iden3comm/types/protocol/payment.d.ts +6 -5
- package/dist/types/iden3comm/utils/contract-request.utils.d.ts +20 -0
- package/dist/types/iden3comm/utils/index.d.ts +1 -0
- package/dist/types/proof/proof-service.d.ts +10 -0
- package/dist/types/storage/blockchain/onchain-zkp-verifier.d.ts +2 -0
- package/dist/types/verifiable/constants.d.ts +2 -3
- package/package.json +1 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { BasicMessage, IPackageManager, ProtocolMessage } from '../types';
|
|
2
|
+
import { DiscoverFeatureDiscloseMessage, DiscoverFeatureDisclosure, DiscoverFeatureQueriesMessage, DiscoverFeatureQuery } from '../types/protocol/discovery-protocol';
|
|
3
|
+
import { AbstractMessageHandler, BasicHandlerOptions, IProtocolMessageHandler } from './message-handler';
|
|
4
|
+
/**
|
|
5
|
+
* @beta
|
|
6
|
+
* DiscoveryProtocolOptions contains options for DiscoveryProtocolHandler
|
|
7
|
+
* @public
|
|
8
|
+
* @interface DiscoveryProtocolOptions
|
|
9
|
+
*/
|
|
10
|
+
export interface DiscoveryProtocolOptions {
|
|
11
|
+
packageManager: IPackageManager;
|
|
12
|
+
protocols?: Array<ProtocolMessage>;
|
|
13
|
+
goalCodes?: Array<string>;
|
|
14
|
+
headers?: Array<string>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* Options to pass to discovery-protocol handler
|
|
19
|
+
*
|
|
20
|
+
* @beta
|
|
21
|
+
* @public
|
|
22
|
+
* @type DiscoveryProtocolHandlerOptions
|
|
23
|
+
*/
|
|
24
|
+
export type DiscoveryProtocolHandlerOptions = BasicHandlerOptions & {
|
|
25
|
+
disclosureExpiresDate?: Date;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @beta
|
|
29
|
+
* createDiscoveryFeatureQueryMessage is a function to create didcomm protocol discovery-feature query message
|
|
30
|
+
* @param opts - discovery-feature query options
|
|
31
|
+
* @returns `DiscoverFeatureQueriesMessage`
|
|
32
|
+
*/
|
|
33
|
+
export declare function createDiscoveryFeatureQueryMessage(queries: DiscoverFeatureQuery[], opts?: {
|
|
34
|
+
from?: string;
|
|
35
|
+
to?: string;
|
|
36
|
+
expires_time?: number;
|
|
37
|
+
}): DiscoverFeatureQueriesMessage;
|
|
38
|
+
/**
|
|
39
|
+
* @beta
|
|
40
|
+
* createDiscoveryFeatureDiscloseMessage is a function to create didcomm protocol discovery-feature disclose message
|
|
41
|
+
* @param {DiscoverFeatureDisclosure[]} disclosures - array of disclosures
|
|
42
|
+
* @param opts - basic message options
|
|
43
|
+
* @returns `DiscoverFeatureQueriesMessage`
|
|
44
|
+
*/
|
|
45
|
+
export declare function createDiscoveryFeatureDiscloseMessage(disclosures: DiscoverFeatureDisclosure[], opts?: {
|
|
46
|
+
from?: string;
|
|
47
|
+
to?: string;
|
|
48
|
+
expires_time?: number;
|
|
49
|
+
}): DiscoverFeatureDiscloseMessage;
|
|
50
|
+
/**
|
|
51
|
+
* Interface to work with discovery protocol handler
|
|
52
|
+
*
|
|
53
|
+
* @beta
|
|
54
|
+
* @public
|
|
55
|
+
* @interface IDiscoveryProtocolHandler
|
|
56
|
+
*/
|
|
57
|
+
export interface IDiscoveryProtocolHandler {
|
|
58
|
+
/**
|
|
59
|
+
* handle discovery query message
|
|
60
|
+
*
|
|
61
|
+
* @param {DiscoverFeatureQueriesMessage} message - discover feature queries message
|
|
62
|
+
* @param {{ expires_time?: number}} opts - discover feature handle options
|
|
63
|
+
* @returns {Promise<DiscoverFeatureDiscloseMessage>} - discover feature disclose message
|
|
64
|
+
*/
|
|
65
|
+
handleDiscoveryQuery(message: DiscoverFeatureQueriesMessage, opts?: DiscoveryProtocolHandlerOptions): Promise<DiscoverFeatureDiscloseMessage>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* Handler for discovery protocol
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
* @beta
|
|
73
|
+
* @class DiscoveryProtocolHandler
|
|
74
|
+
* @implements implements DiscoveryProtocolHandler interface
|
|
75
|
+
*/
|
|
76
|
+
export declare class DiscoveryProtocolHandler extends AbstractMessageHandler implements IDiscoveryProtocolHandler, IProtocolMessageHandler {
|
|
77
|
+
private readonly _options;
|
|
78
|
+
/**
|
|
79
|
+
* Creates an instance of DiscoveryProtocolHandler.
|
|
80
|
+
* @param {DiscoveryProtocolOptions} _options - discovery protocol options
|
|
81
|
+
*/
|
|
82
|
+
constructor(_options: DiscoveryProtocolOptions);
|
|
83
|
+
/**
|
|
84
|
+
* @inheritdoc IProtocolMessageHandler#handle
|
|
85
|
+
*/
|
|
86
|
+
handle(message: BasicMessage, context: {
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
}): Promise<BasicMessage | null>;
|
|
89
|
+
/**
|
|
90
|
+
* @inheritdoc IDiscoveryProtocolHandler#handleDiscoveryQuery
|
|
91
|
+
*/
|
|
92
|
+
handleDiscoveryQuery(message: DiscoverFeatureQueriesMessage, opts?: DiscoveryProtocolHandlerOptions): Promise<DiscoverFeatureDiscloseMessage>;
|
|
93
|
+
private handleQuery;
|
|
94
|
+
private handleAcceptQuery;
|
|
95
|
+
private handleProtocolQuery;
|
|
96
|
+
private handleGoalCodeQuery;
|
|
97
|
+
private handleHeaderQuery;
|
|
98
|
+
private handleMatch;
|
|
99
|
+
private wildcardToRegExp;
|
|
100
|
+
}
|
|
@@ -2,7 +2,6 @@ import { BasicMessage, IPackageManager, PackerParams } from '../types';
|
|
|
2
2
|
import { DID } from '@iden3/js-iden3-core';
|
|
3
3
|
import { AbstractMessageHandler, BasicHandlerOptions, IProtocolMessageHandler } from './message-handler';
|
|
4
4
|
import { Iden3PaymentRailsERC20RequestV1, Iden3PaymentRailsRequestV1, MultiChainPaymentConfig, PaymentMessage, PaymentRequestInfo, PaymentRequestMessage, PaymentRequestTypeUnion, PaymentTypeUnion } from '../types/protocol/payment';
|
|
5
|
-
import { PaymentFeatures, PaymentRequestDataType, SupportedCurrencies } from '../../verifiable';
|
|
6
5
|
import { Signer } from 'ethers';
|
|
7
6
|
import { Resolvable } from 'did-resolver';
|
|
8
7
|
/** @beta PaymentRequestCreationOptions represents payment-request creation options */
|
|
@@ -24,7 +23,6 @@ export type PaymentCreationOptions = {
|
|
|
24
23
|
*/
|
|
25
24
|
export declare function createPaymentRequest(sender: DID, receiver: DID, agent: string, payments: PaymentRequestInfo[], opts?: PaymentRequestCreationOptions): PaymentRequestMessage;
|
|
26
25
|
export declare function verifyEIP712TypedData(data: Iden3PaymentRailsRequestV1 | Iden3PaymentRailsERC20RequestV1, resolver: Resolvable): Promise<string>;
|
|
27
|
-
export declare function convertPaymentAmount(amount: string, currency: SupportedCurrencies): Promise<bigint>;
|
|
28
26
|
/**
|
|
29
27
|
* @beta
|
|
30
28
|
* PaymentRailsInfo represents payment info for payment rails
|
|
@@ -35,20 +33,18 @@ export type PaymentRailsInfo = {
|
|
|
35
33
|
context: string;
|
|
36
34
|
}[];
|
|
37
35
|
description?: string;
|
|
38
|
-
|
|
36
|
+
options: PaymentRailsOptionInfo[];
|
|
39
37
|
};
|
|
40
38
|
/**
|
|
41
39
|
* @beta
|
|
42
|
-
*
|
|
40
|
+
* PaymentRailsOptionInfo represents option info for payment rails
|
|
43
41
|
*/
|
|
44
|
-
export type
|
|
42
|
+
export type PaymentRailsOptionInfo = {
|
|
43
|
+
optionId: string;
|
|
44
|
+
chainId: string;
|
|
45
45
|
nonce: bigint;
|
|
46
46
|
amount: string;
|
|
47
|
-
currency: SupportedCurrencies | string;
|
|
48
|
-
chainId: string;
|
|
49
47
|
expirationDate?: Date;
|
|
50
|
-
features?: PaymentFeatures[];
|
|
51
|
-
type: PaymentRequestDataType.Iden3PaymentRailsRequestV1 | PaymentRequestDataType.Iden3PaymentRailsERC20RequestV1;
|
|
52
48
|
};
|
|
53
49
|
/**
|
|
54
50
|
* @beta
|
|
@@ -13,6 +13,8 @@ export declare class PackageManager implements IPackageManager {
|
|
|
13
13
|
* Creates an instance of PackageManager.
|
|
14
14
|
*/
|
|
15
15
|
constructor();
|
|
16
|
+
/** {@inheritDoc IPackageManager.getSupportedProfiles} */
|
|
17
|
+
getSupportedProfiles(): string[];
|
|
16
18
|
/** {@inheritDoc IPackageManager.isProfileSupported} */
|
|
17
19
|
isProfileSupported(mediaType: MediaType, profile: string): boolean;
|
|
18
20
|
/** {@inheritDoc IPackageManager.getSupportedMediaTypes} */
|
|
@@ -12,6 +12,8 @@ import { Resolvable } from 'did-resolver';
|
|
|
12
12
|
export declare class JWSPacker implements IPacker {
|
|
13
13
|
private readonly _kms;
|
|
14
14
|
private readonly _documentResolver;
|
|
15
|
+
private readonly supportedAlgorithms;
|
|
16
|
+
private readonly supportedProtocolVersions;
|
|
15
17
|
/**
|
|
16
18
|
* Creates an instance of JWSPacker.
|
|
17
19
|
*
|
|
@@ -48,7 +50,6 @@ export declare class JWSPacker implements IPacker {
|
|
|
48
50
|
getSupportedProfiles(): string[];
|
|
49
51
|
/** {@inheritDoc IPacker.isProfileSupported} */
|
|
50
52
|
isProfileSupported(profile: string): boolean;
|
|
51
|
-
private getSupportedAlgorithms;
|
|
52
53
|
private resolveDidDoc;
|
|
53
54
|
private packInternal;
|
|
54
55
|
}
|
|
@@ -8,6 +8,7 @@ import { MediaType } from '../constants';
|
|
|
8
8
|
* @implements implements IPacker interface
|
|
9
9
|
*/
|
|
10
10
|
export declare class PlainPacker implements IPacker {
|
|
11
|
+
private readonly supportedProtocolVersions;
|
|
11
12
|
/**
|
|
12
13
|
* Packs a basic message using the specified parameters.
|
|
13
14
|
*
|
|
@@ -58,6 +58,9 @@ export declare class ZKPPacker implements IPacker {
|
|
|
58
58
|
readonly provingParamsMap: Map<string, ProvingParams>;
|
|
59
59
|
readonly verificationParamsMap: Map<string, VerificationParams>;
|
|
60
60
|
private readonly _opts;
|
|
61
|
+
private readonly supportedProtocolVersions;
|
|
62
|
+
private readonly supportedAlgorithms;
|
|
63
|
+
private readonly supportedCircuitIds;
|
|
61
64
|
/**
|
|
62
65
|
* Creates an instance of ZKPPacker.
|
|
63
66
|
* @param {Map<string, ProvingParams>} provingParamsMap - string is derived by JSON.parse(ProvingMethodAlg)
|
|
@@ -91,6 +94,4 @@ export declare class ZKPPacker implements IPacker {
|
|
|
91
94
|
getSupportedProfiles(): string[];
|
|
92
95
|
/** {@inheritDoc IPacker.isProfileSupported} */
|
|
93
96
|
isProfileSupported(profile: string): boolean;
|
|
94
|
-
private getSupportedAlgorithms;
|
|
95
|
-
private getSupportedCircuitIds;
|
|
96
97
|
}
|
|
@@ -7,6 +7,7 @@ export * from './protocol/contract-request';
|
|
|
7
7
|
export * from './protocol/proposal-request';
|
|
8
8
|
export * from './protocol/payment';
|
|
9
9
|
export * from './protocol/accept-profile';
|
|
10
|
+
export * from './protocol/discovery-protocol';
|
|
10
11
|
export * from './packer';
|
|
11
12
|
export * from './models';
|
|
12
13
|
export * from './packageManager';
|
|
@@ -70,6 +70,12 @@ export interface IPackageManager {
|
|
|
70
70
|
* @returns MediaType[]
|
|
71
71
|
*/
|
|
72
72
|
getSupportedMediaTypes(): MediaType[];
|
|
73
|
+
/**
|
|
74
|
+
* gets supported accept profiles by packer manager
|
|
75
|
+
*
|
|
76
|
+
* @returns string[]
|
|
77
|
+
*/
|
|
78
|
+
getSupportedProfiles(): string[];
|
|
73
79
|
/**
|
|
74
80
|
* returns true if media type and algorithms supported by packer manager
|
|
75
81
|
*
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
|
|
2
|
+
import { BasicMessage } from '../packer';
|
|
3
|
+
/** @beta DiscoverFeatureQueryType is enum for query type fields */
|
|
4
|
+
export declare enum DiscoverFeatureQueryType {
|
|
5
|
+
FeatureType = "feature-type"
|
|
6
|
+
}
|
|
7
|
+
/** @beta DiscoveryProtocolFeatureType is enum for supported feature-types */
|
|
8
|
+
export declare enum DiscoveryProtocolFeatureType {
|
|
9
|
+
Accept = "accept",
|
|
10
|
+
Protocol = "protocol",
|
|
11
|
+
GoalCode = "goal-code",
|
|
12
|
+
Header = "header"
|
|
13
|
+
}
|
|
14
|
+
/** @beta DiscoverFeatureQueriesMessage is struct the represents discover feature queries message */
|
|
15
|
+
export type DiscoverFeatureQueriesMessage = BasicMessage & {
|
|
16
|
+
body: DiscoverFeatureQueriesBody;
|
|
17
|
+
type: typeof PROTOCOL_MESSAGE_TYPE.DISCOVERY_PROTOCOL_QUERIES_MESSAGE_TYPE;
|
|
18
|
+
};
|
|
19
|
+
/** @beta DiscoverFeatureQueriesBody is struct the represents discover feature queries body */
|
|
20
|
+
export type DiscoverFeatureQueriesBody = {
|
|
21
|
+
queries: DiscoverFeatureQuery[];
|
|
22
|
+
};
|
|
23
|
+
/** @beta DiscoverFeatureQuery is struct the represents discover feature query */
|
|
24
|
+
export type DiscoverFeatureQuery = {
|
|
25
|
+
[DiscoverFeatureQueryType.FeatureType]: DiscoveryProtocolFeatureType;
|
|
26
|
+
match?: string;
|
|
27
|
+
};
|
|
28
|
+
/** @beta DiscoverFeatureDiscloseMessage is struct the represents discover feature disclose message */
|
|
29
|
+
export type DiscoverFeatureDiscloseMessage = BasicMessage & {
|
|
30
|
+
body: DiscoverFeatureDiscloseBody;
|
|
31
|
+
type: typeof PROTOCOL_MESSAGE_TYPE.DISCOVERY_PROTOCOL_DISCLOSE_MESSAGE_TYPE;
|
|
32
|
+
};
|
|
33
|
+
/** @beta DiscoverFeatureDiscloseBody is struct the represents discover feature disclose body */
|
|
34
|
+
export type DiscoverFeatureDiscloseBody = {
|
|
35
|
+
disclosures: DiscoverFeatureDisclosure[];
|
|
36
|
+
};
|
|
37
|
+
/** @beta DiscoverFeatureDisclosure is struct the represents discover feature disclosure */
|
|
38
|
+
export type DiscoverFeatureDisclosure = {
|
|
39
|
+
[DiscoverFeatureQueryType.FeatureType]: DiscoveryProtocolFeatureType;
|
|
40
|
+
id: string;
|
|
41
|
+
};
|
|
@@ -36,7 +36,6 @@ export type Iden3PaymentRailsRequestV1 = {
|
|
|
36
36
|
'@context': string | (string | object)[];
|
|
37
37
|
recipient: string;
|
|
38
38
|
amount: string;
|
|
39
|
-
currency: SupportedCurrencies | string;
|
|
40
39
|
expirationDate: string;
|
|
41
40
|
nonce: string;
|
|
42
41
|
metadata: string;
|
|
@@ -106,11 +105,13 @@ export type Iden3PaymentRailsERC20V1 = {
|
|
|
106
105
|
/** @beta MultiChainPaymentConfig is struct that represents payments contracts information for different chains */
|
|
107
106
|
export type MultiChainPaymentConfig = {
|
|
108
107
|
chainId: string;
|
|
109
|
-
|
|
108
|
+
paymentRails: string;
|
|
110
109
|
recipient: string;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
options: {
|
|
111
|
+
id: string;
|
|
112
|
+
type: PaymentRequestDataType.Iden3PaymentRailsRequestV1 | PaymentRequestDataType.Iden3PaymentRailsERC20RequestV1;
|
|
113
|
+
contractAddress?: string;
|
|
114
|
+
features?: PaymentFeatures[];
|
|
114
115
|
}[];
|
|
115
116
|
};
|
|
116
117
|
/**
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CircuitId } from '../../circuits';
|
|
2
|
+
import { DID } from '@iden3/js-iden3-core';
|
|
3
|
+
import { IProofService } from '../../proof';
|
|
4
|
+
import { ZeroKnowledgeProofResponse } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* @beta
|
|
7
|
+
* Retrieves the request ID from circuit string.
|
|
8
|
+
* CircuitId.AuthV2 - 940499666
|
|
9
|
+
* @returns The request ID.
|
|
10
|
+
*/
|
|
11
|
+
export declare function calculateRequestIdForCircuit(circuitId: CircuitId): number;
|
|
12
|
+
/**
|
|
13
|
+
* Prepares the zero-knowledge proof response for the AuthV2 circuit.
|
|
14
|
+
* @beta
|
|
15
|
+
* @param address - The address associated with the request.
|
|
16
|
+
* @param senderDid - The sender's decentralized identifier (DID).
|
|
17
|
+
* @param proofService - The proof service used to generate the proof.
|
|
18
|
+
* @returns A promise that resolves to an array of ZeroKnowledgeProofResponse objects.
|
|
19
|
+
*/
|
|
20
|
+
export declare function prepareAuthV2ZeroKnowledgeResponse(address: string, senderDid: DID, proofService: IProofService): Promise<ZeroKnowledgeProofResponse[]>;
|
|
@@ -73,6 +73,14 @@ export interface IProofService {
|
|
|
73
73
|
* @returns `Promise<Uint8Array>`
|
|
74
74
|
*/
|
|
75
75
|
generateAuthV2Inputs(hash: Uint8Array, did: DID, circuitId: CircuitId): Promise<Uint8Array>;
|
|
76
|
+
/**
|
|
77
|
+
* generates auth inputs
|
|
78
|
+
*
|
|
79
|
+
* @param {Uint8Array} hash - challenge that will be signed
|
|
80
|
+
* @param {DID} did - identity that will generate a proof
|
|
81
|
+
* @returns `Promise<ZKProof>`
|
|
82
|
+
*/
|
|
83
|
+
generateAuthV2Proof(hash: Uint8Array, did: DID): Promise<ZKProof>;
|
|
76
84
|
/**
|
|
77
85
|
* state verification function
|
|
78
86
|
*
|
|
@@ -138,6 +146,8 @@ export declare class ProofService implements IProofService {
|
|
|
138
146
|
private loadLdContext;
|
|
139
147
|
/** {@inheritdoc IProofService.generateAuthV2Inputs} */
|
|
140
148
|
generateAuthV2Inputs(hash: Uint8Array, did: DID, circuitId: CircuitId): Promise<Uint8Array>;
|
|
149
|
+
/** {@inheritdoc IProofService.generateAuthV2Proof} */
|
|
150
|
+
generateAuthV2Proof(challenge: Uint8Array, did: DID): Promise<ZKProof>;
|
|
141
151
|
verifyState(circuitId: string, pubSignals: string[], opts?: StateVerificationOpts): Promise<boolean>;
|
|
142
152
|
findCredentialByProofQuery(did: DID, query: ProofQuery): Promise<{
|
|
143
153
|
cred: W3CCredential;
|
|
@@ -35,6 +35,7 @@ export declare class OnChainZKPVerifier implements IOnChainZKPVerifier {
|
|
|
35
35
|
* supported circuits
|
|
36
36
|
*/
|
|
37
37
|
private static readonly _supportedCircuits;
|
|
38
|
+
private static readonly _supportedCircuitsPubSignalsMap;
|
|
38
39
|
/**
|
|
39
40
|
*
|
|
40
41
|
* Creates an instance of OnChainZKPVerifier.
|
|
@@ -55,6 +56,7 @@ export declare class OnChainZKPVerifier implements IOnChainZKPVerifier {
|
|
|
55
56
|
* {@inheritDoc IOnChainZKPVerifier.submitZKPResponseV2}
|
|
56
57
|
*/
|
|
57
58
|
submitZKPResponseV2(ethSigner: Signer, txData: ContractInvokeTransactionData, zkProofResponses: ZeroKnowledgeProofResponse[]): Promise<Map<string, ZeroKnowledgeProofResponse[]>>;
|
|
59
|
+
private static getCrossChainResolvers;
|
|
58
60
|
static prepareTxArgsSubmitV2(resolverUrl: string, txData: ContractInvokeTransactionData, zkProofResponses: ZeroKnowledgeProofResponse[]): Promise<JsonDocumentObjectValue[]>;
|
|
59
61
|
prepareTxArgsSubmitV2(txData: ContractInvokeTransactionData, zkProofResponses: ZeroKnowledgeProofResponse[]): Promise<JsonDocumentObjectValue[]>;
|
|
60
62
|
private static packZkpProof;
|
|
@@ -117,6 +117,7 @@ export declare enum SupportedPaymentProofType {
|
|
|
117
117
|
/**
|
|
118
118
|
* Media types for Payment supported currencies
|
|
119
119
|
* @beta
|
|
120
|
+
* @deprecated
|
|
120
121
|
* @enum {string}
|
|
121
122
|
*/
|
|
122
123
|
export declare enum SupportedCurrencies {
|
|
@@ -124,9 +125,7 @@ export declare enum SupportedCurrencies {
|
|
|
124
125
|
ETH_WEI = "ETHWEI",
|
|
125
126
|
ETH_GWEI = "ETHGWEI",
|
|
126
127
|
MATIC = "MATIC",
|
|
127
|
-
POL = "POL"
|
|
128
|
-
USDT = "USDT",
|
|
129
|
-
USDC = "USDC"
|
|
128
|
+
POL = "POL"
|
|
130
129
|
}
|
|
131
130
|
/**
|
|
132
131
|
* Supported features for payment-request
|