Skip to content

Commit

Permalink
Merge pull request #467 from jolocom/fix/eip1559_fee_data
Browse files Browse the repository at this point in the history
Fix/eip1559 fee data
  • Loading branch information
Exulansis authored May 2, 2022
2 parents 352bd11 + 463bb1e commit b1ea8dd
Show file tree
Hide file tree
Showing 34 changed files with 672 additions and 139 deletions.
15 changes: 10 additions & 5 deletions js/credentials/credential/credential.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ export declare class Credential {
private _type;
private _claim;
private _name;
id: string;
claim: IClaimSection;
type: string[];
name: string;
context: JsonLdContext;
get id(): string;
set id(id: string);
get claim(): IClaimSection;
set claim(claim: IClaimSection);
get type(): string[];
set type(type: string[]);
get name(): string;
set name(name: string);
get context(): JsonLdContext;
set context(context: JsonLdContext);
static create<T extends BaseMetadata>({ metadata, claim, subject, }: ISignedCredCreationArgs<T>): Credential;
static fromJSON(json: ICredentialAttrs): Credential;
toJSON(): ICredentialAttrs;
Expand Down
35 changes: 23 additions & 12 deletions js/credentials/signedCredential/signedCredential.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,29 @@ export declare class SignedCredential implements IDigestable {
private _issued;
private _expires?;
private _proof;
context: JsonLdContext;
id: string;
issuer: string;
issued: Date;
type: string[];
signature: string;
readonly signer: ISigner;
expires: Date;
proof: ILinkedDataSignature;
subject: string;
claim: IClaimSection;
name: string;
get context(): JsonLdContext;
set context(context: JsonLdContext);
get id(): string;
set id(id: string);
get issuer(): string;
set issuer(issuer: string);
get issued(): Date;
set issued(issued: Date);
get type(): string[];
set type(type: string[]);
get signature(): string;
set signature(signature: string);
get signer(): ISigner;
get expires(): Date;
set expires(expiry: Date);
get proof(): ILinkedDataSignature;
set proof(proof: ILinkedDataSignature);
get subject(): string;
set subject(subject: string);
get claim(): IClaimSection;
set claim(claim: IClaimSection);
get name(): string;
set name(name: string);
static create<T extends BaseMetadata>(credentialOptions: ISignedCredCreationArgs<T>, issInfo: IIssInfo, expires?: Date): Promise<SignedCredential>;
private prepareSignature;
asBytes(): Promise<Buffer>;
Expand Down
32 changes: 21 additions & 11 deletions js/identity/didDocument/didDocument.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,28 @@ export declare class DidDocument implements IDigestable {
private _updated;
private _proof;
private _context;
specVersion: number;
context: ContextEntry[];
did: string;
authentication: AuthenticationSection[];
publicKey: PublicKeySection[];
get specVersion(): number;
set specVersion(specVersion: number);
get context(): ContextEntry[];
set context(context: ContextEntry[]);
get did(): string;
set did(did: string);
get authentication(): AuthenticationSection[];
set authentication(authentication: AuthenticationSection[]);
get publicKey(): PublicKeySection[];
set publicKey(value: PublicKeySection[]);
findPublicKeySectionById(keyId: string): PublicKeySection;
service: ServiceEndpointsSection[];
created: Date;
updated: Date;
readonly signer: ISigner;
signature: string;
proof: ILinkedDataSignature;
get service(): ServiceEndpointsSection[];
set service(service: ServiceEndpointsSection[]);
get created(): Date;
set created(value: Date);
get updated(): Date;
set updated(value: Date);
get signer(): ISigner;
get signature(): string;
set signature(signature: string);
get proof(): ILinkedDataSignature;
set proof(proof: ILinkedDataSignature);
addAuthKeyId(authenticationKeyId: string): void;
addAuthKey(authenticationKey: PublicKeySection): void;
addPublicKeySection(section: PublicKeySection): void;
Expand Down
12 changes: 8 additions & 4 deletions js/identity/didDocument/sections/publicKeySection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ export declare class PublicKeySection {
private _type;
private _controller;
private _publicKeyHex;
controller: string;
id: string;
type: string;
publicKeyHex: string;
get controller(): string;
set controller(controller: string);
get id(): string;
set id(id: string);
get type(): string;
set type(type: string);
get publicKeyHex(): string;
set publicKeyHex(keyHex: string);
static fromEcdsa(publicKey: Buffer, id: string, did: string): PublicKeySection;
toJSON(): IPublicKeySectionAttrs;
static fromJSON(json: IPublicKeySectionAttrs): PublicKeySection;
Expand Down
12 changes: 8 additions & 4 deletions js/identity/didDocument/sections/serviceEndpointsSection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ export declare class ServiceEndpointsSection {
protected _type: string;
protected _serviceEndpoint: string;
protected _description: string;
id: string;
type: string;
serviceEndpoint: string;
description: string;
get id(): string;
set id(id: string);
get type(): string;
set type(type: string);
get serviceEndpoint(): string;
set serviceEndpoint(service: string);
get description(): string;
set description(description: string);
toJSON(): IServiceEndpointSectionAttrs;
static fromJSON(json: IServiceEndpointSectionAttrs): ServiceEndpointsSection;
}
Expand Down
13 changes: 8 additions & 5 deletions js/identity/identity.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ interface IdentityAttributes {
export declare class Identity {
private _didDocument;
private _publicProfileCredential?;
did: string;
didDocument: DidDocument;
readonly serviceEndpointSections: import("./didDocument/sections").ServiceEndpointsSection[];
readonly publicKeySection: import("./didDocument/sections").PublicKeySection[];
publicProfile: SignedCredential | undefined;
get did(): string;
set did(did: string);
get didDocument(): DidDocument;
set didDocument(didDocument: DidDocument);
get serviceEndpointSections(): import("./didDocument/sections").ServiceEndpointsSection[];
get publicKeySection(): import("./didDocument/sections").PublicKeySection[];
get publicProfile(): SignedCredential | undefined;
set publicProfile(publicProfile: SignedCredential | undefined);
static fromDidDocument({ didDocument, publicProfile, }: IIdentityCreateArgs): Identity;
toJSON(): IdentityAttributes;
static fromJSON(json: IdentityAttributes): Identity;
Expand Down
28 changes: 17 additions & 11 deletions js/identityWallet/identityWallet.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import { Identity } from '../identity/identity';
import { JSONWebToken } from '../interactionTokens/JSONWebToken';
import { Authentication } from '../interactionTokens/authentication';
import { CredentialRequest } from '../interactionTokens/credentialRequest';
import { CredentialResponse } from '../interactionTokens/credentialResponse';
import { ISignedCredCreationArgs } from '../credentials/signedCredential/types';
import { CredentialOfferRequest } from '../interactionTokens/credentialOfferRequest';
import { CredentialOfferResponse } from '../interactionTokens/credentialOfferResponse';
import { CredentialsReceive } from '../interactionTokens/credentialsReceive';
import { CredentialOfferRequestAttrs, CredentialOfferResponseAttrs, IAuthenticationAttrs, ICredentialRequestAttrs, ICredentialResponseAttrs, ICredentialsReceiveAttrs } from '../interactionTokens/interactionTokens.types';
import { KeyTypes } from '@jolocom/vaulted-key-provider';
import { IResolver } from '../didMethods/types';
Expand All @@ -22,10 +24,14 @@ export declare class IdentityWallet {
private _identity;
private _publicKeyMetadata;
private _keyProvider;
did: string;
identity: Identity;
didDocument: import("../identity/didDocument/didDocument").DidDocument;
publicKeyMetadata: IKeyMetadata;
get did(): string;
set did(did: string);
get identity(): Identity;
set identity(identity: Identity);
get didDocument(): import("../identity/didDocument/didDocument").DidDocument;
set didDocument(didDocument: import("../identity/didDocument/didDocument").DidDocument);
get publicKeyMetadata(): IKeyMetadata;
set publicKeyMetadata(metadata: IKeyMetadata);
constructor({ identity, publicKeyMetadata, vaultedKeyProvider, }: IIdentityWalletCreateArgs);
private createSignedCred;
private createMessage;
Expand All @@ -52,15 +58,15 @@ export declare class IdentityWallet {
}, pass: string, recieved?: JSONWebToken<R>) => Promise<JSONWebToken<T_1>>;
interactionTokens: {
request: {
auth: ({ expires, aud, pca, ...message }: WithExtraOptions<ExclusivePartial<IAuthenticationAttrs, "callbackURL">>, pass: string) => Promise<JSONWebToken<any>>;
offer: ({ expires, aud, pca, ...message }: WithExtraOptions<CredentialOfferRequestAttrs>, pass: string) => Promise<JSONWebToken<any>>;
share: ({ expires, aud, pca, ...message }: WithExtraOptions<ICredentialRequestAttrs>, pass: string) => Promise<JSONWebToken<any>>;
auth: ({ expires, aud, pca, ...message }: WithExtraOptions<ExclusivePartial<IAuthenticationAttrs, "callbackURL">>, pass: string) => Promise<JSONWebToken<Authentication | CredentialRequest | CredentialOfferRequest | CredentialOfferResponse | CredentialsReceive | CredentialResponse>>;
offer: ({ expires, aud, pca, ...message }: WithExtraOptions<CredentialOfferRequestAttrs>, pass: string) => Promise<JSONWebToken<Authentication | CredentialRequest | CredentialOfferRequest | CredentialOfferResponse | CredentialsReceive | CredentialResponse>>;
share: ({ expires, aud, pca, ...message }: WithExtraOptions<ICredentialRequestAttrs>, pass: string) => Promise<JSONWebToken<Authentication | CredentialRequest | CredentialOfferRequest | CredentialOfferResponse | CredentialsReceive | CredentialResponse>>;
};
response: {
auth: ({ expires, aud, pca, ...message }: WithExtraOptions<ExclusivePartial<IAuthenticationAttrs, "callbackURL">>, pass: string, recieved?: JSONWebToken<Authentication>) => Promise<JSONWebToken<any>>;
offer: ({ expires, aud, pca, ...message }: WithExtraOptions<CredentialOfferResponseAttrs>, pass: string, recieved?: JSONWebToken<CredentialOfferRequest>) => Promise<JSONWebToken<any>>;
share: ({ expires, aud, pca, ...message }: WithExtraOptions<ICredentialResponseAttrs>, pass: string, recieved?: JSONWebToken<CredentialRequest>) => Promise<JSONWebToken<any>>;
issue: ({ expires, aud, pca, ...message }: WithExtraOptions<ICredentialsReceiveAttrs>, pass: string, recieved?: JSONWebToken<CredentialOfferResponse>) => Promise<JSONWebToken<any>>;
auth: ({ expires, aud, pca, ...message }: WithExtraOptions<ExclusivePartial<IAuthenticationAttrs, "callbackURL">>, pass: string, recieved?: JSONWebToken<Authentication>) => Promise<JSONWebToken<Authentication | CredentialRequest | CredentialOfferRequest | CredentialOfferResponse | CredentialsReceive | CredentialResponse>>;
offer: ({ expires, aud, pca, ...message }: WithExtraOptions<CredentialOfferResponseAttrs>, pass: string, recieved?: JSONWebToken<CredentialOfferRequest>) => Promise<JSONWebToken<Authentication | CredentialRequest | CredentialOfferRequest | CredentialOfferResponse | CredentialsReceive | CredentialResponse>>;
share: ({ expires, aud, pca, ...message }: WithExtraOptions<ICredentialResponseAttrs>, pass: string, recieved?: JSONWebToken<CredentialRequest>) => Promise<JSONWebToken<Authentication | CredentialRequest | CredentialOfferRequest | CredentialOfferResponse | CredentialsReceive | CredentialResponse>>;
issue: ({ expires, aud, pca, ...message }: WithExtraOptions<ICredentialsReceiveAttrs>, pass: string, recieved?: JSONWebToken<CredentialOfferResponse>) => Promise<JSONWebToken<Authentication | CredentialRequest | CredentialOfferRequest | CredentialOfferResponse | CredentialsReceive | CredentialResponse>>;
};
};
};
Expand Down
30 changes: 19 additions & 11 deletions js/interactionTokens/JSONWebToken.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,25 @@ export declare class JSONWebToken<T> implements IDigestable {
private _header;
private _signature;
private _payload;
payload: IPayloadSection<T>;
signature: string;
issuer: string;
audience: string;
readonly issued: number;
readonly expires: number;
nonce: string;
interactionToken: T;
interactionType: string;
header: IJWTHeader;
readonly signer: {
get payload(): IPayloadSection<T>;
set payload(payload: IPayloadSection<T>);
get signature(): string;
set signature(signature: string);
get issuer(): string;
set issuer(issuer: string);
get audience(): string;
set audience(audience: string);
get issued(): number;
get expires(): number;
get nonce(): string;
set nonce(nonce: string);
get interactionToken(): T;
set interactionToken(interactionToken: T);
get interactionType(): string;
set interactionType(type: string);
get header(): IJWTHeader;
set header(jwtHeader: IJWTHeader);
get signer(): {
did: string;
keyId: string;
};
Expand Down
6 changes: 4 additions & 2 deletions js/interactionTokens/authentication.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { IAuthenticationAttrs } from './interactionTokens.types';
export declare class Authentication {
private _callbackURL;
private _description;
callbackURL: string;
description: string;
get callbackURL(): string;
set callbackURL(callbackURL: string);
get description(): string;
set description(description: string);
toJSON(): Record<string, any>;
static fromJSON(json: IAuthenticationAttrs): Authentication;
}
8 changes: 5 additions & 3 deletions js/interactionTokens/credentialOfferRequest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { CredentialOffer, CredentialOfferInputRequest, CredentialOfferMetadata,
export declare class CredentialOfferRequest {
private _callbackURL;
private _offeredCredentials;
callbackURL: string;
offeredCredentials: CredentialOffer[];
get callbackURL(): string;
set callbackURL(callbackURL: string);
get offeredCredentials(): CredentialOffer[];
set offeredCredentials(offeredCredentials: CredentialOffer[]);
getRenderInfoForType(type: string): CredentialOfferRenderInfo | undefined;
getMetadataForType(type: string): CredentialOfferMetadata | undefined;
getRequestedInputForType(type: string): CredentialOfferInputRequest | undefined;
getOfferForType(type: string): CredentialOffer;
readonly offeredTypes: string[];
get offeredTypes(): string[];
toJSON(): CredentialOfferRequestAttrs;
static fromJSON(json: CredentialOfferRequestAttrs): CredentialOfferRequest;
}
6 changes: 4 additions & 2 deletions js/interactionTokens/credentialOfferResponse.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { CredentialOfferRequest } from './credentialOfferRequest';
export declare class CredentialOfferResponse {
private _callbackURL;
private _selectedCredentials;
callbackURL: string;
selectedCredentials: CredentialOfferResponseSelection[];
get callbackURL(): string;
set callbackURL(callbackURL: string);
get selectedCredentials(): CredentialOfferResponseSelection[];
set selectedCredentials(selectedCredentials: CredentialOfferResponseSelection[]);
satisfiesRequest({ offeredTypes }: CredentialOfferRequest): boolean;
toJSON(): CredentialOfferResponseAttrs;
static fromJSON(json: CredentialOfferResponseAttrs): CredentialOfferResponse;
Expand Down
8 changes: 5 additions & 3 deletions js/interactionTokens/credentialRequest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import { ISignedCredentialAttrs } from '../credentials/signedCredential/types';
export declare class CredentialRequest {
private _callbackURL;
private _credentialRequirements;
credentialRequirements: ICredentialRequest[];
callbackURL: string;
readonly requestedCredentialTypes: string[][];
get credentialRequirements(): ICredentialRequest[];
set credentialRequirements(requirements: ICredentialRequest[]);
get callbackURL(): string;
set callbackURL(callback: string);
get requestedCredentialTypes(): string[][];
applyConstraints(credentials: ISignedCredentialAttrs[]): ISignedCredentialAttrs[];
toJSON(): ICredentialRequestAttrs;
static fromJSON(json: ICredentialRequestAttrs): CredentialRequest;
Expand Down
6 changes: 4 additions & 2 deletions js/interactionTokens/credentialResponse.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import { CredentialRequest } from './credentialRequest';
export declare class CredentialResponse {
private _callbackURL;
private _suppliedCredentials;
suppliedCredentials: SignedCredential[];
callbackURL: string;
get suppliedCredentials(): SignedCredential[];
set suppliedCredentials(suppliedCredentials: SignedCredential[]);
get callbackURL(): string;
set callbackURL(callbackURL: string);
satisfiesRequest(cr: CredentialRequest): boolean;
toJSON(): ICredentialResponseAttrs;
static fromJSON(json: ICredentialResponseAttrs): CredentialResponse;
Expand Down
3 changes: 2 additions & 1 deletion js/interactionTokens/credentialsReceive.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { SignedCredential } from '../credentials/signedCredential/signedCredenti
import { ICredentialsReceiveAttrs } from './interactionTokens.types';
export declare class CredentialsReceive {
private _signedCredentials;
signedCredentials: SignedCredential[];
get signedCredentials(): SignedCredential[];
set signedCredentials(signedCredentials: SignedCredential[]);
toJSON(): ICredentialsReceiveAttrs;
static fromJSON(json: ICredentialsReceiveAttrs): CredentialsReceive;
}
7 changes: 3 additions & 4 deletions js/interactionTokens/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { KeyTypes } from '@jolocom/vaulted-key-provider';
export * from '@jolocom/protocol-ts/dist/lib/interactionTokens';
export declare enum SupportedJWA {
ES256KR = "ES256K-R",
ES256K = "ES256K",
EdDSA = "EdDSA"
}
export declare const KeyTypeToJWA: {
[KeyTypes.ecdsaSecp256k1VerificationKey2019]: SupportedJWA;
[KeyTypes.ecdsaSecp256k1RecoveryMethod2020]: SupportedJWA;
[KeyTypes.ed25519VerificationKey2018]: SupportedJWA;
EcdsaSecp256k1VerificationKey2019: SupportedJWA;
EcdsaSecp256k1RecoveryMethod2020: SupportedJWA;
Ed25519VerificationKey2018: SupportedJWA;
};
4 changes: 3 additions & 1 deletion js/linkedData/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/// <reference types="node" />
import { JsonLdObject, SignedJsonLdObject, JsonLdContext } from './types';
import { Identity } from '../identity/identity';
import { IResolver } from '../didMethods/types';
export declare const normalizeJsonLd: ({ ["@context"]: _, ...data }: JsonLdObject, context: JsonLdContext) => Promise<any>;
export declare const normalizeSignedLdObject: ({ proof, ["@context"]: _, ...data }: SignedJsonLdObject, context: JsonLdContext) => Promise<Buffer>;
export declare const digestJsonLd: (signedLdObject: SignedJsonLdObject, context: JsonLdContext) => Promise<Buffer>;
export declare const validateJsonLd: (json: SignedJsonLdObject, resolverOrIdentity?: import("../utils/validation").IdentityOrResolver) => Promise<boolean>;
export declare const validateJsonLd: (json: SignedJsonLdObject, resolverOrIdentity?: IResolver | Identity) => Promise<boolean>;
17 changes: 11 additions & 6 deletions js/linkedDataSignature/suites/ecdsaKoblitzSignature2016.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ export declare class EcdsaLinkedDataSignature implements ILinkedDataSignature, I
private _created;
private _nonce;
private _signatureValue;
created: Date;
type: string;
nonce: string;
signature: string;
creator: string;
readonly signer: {
get created(): Date;
set created(created: Date);
get type(): string;
set type(type: string);
get nonce(): string;
set nonce(nonce: string);
get signature(): string;
set signature(signature: string);
get creator(): string;
set creator(creator: string);
get signer(): {
did: string;
keyId: string;
};
Expand Down
Loading

0 comments on commit b1ea8dd

Please sign in to comment.