@investorid/identity-sdk
Version:
Interact with BlockChain Identities.
1,014 lines (1,013 loc) • 76.6 kB
TypeScript
import { keccak256, hashMessage, recoverAddress, recoverPublicKey, solidityKeccak256, verifyMessage } from "ethers/utils";
import Identity from './lib/identities/Identity';
import { KeyPurpose, KeyType } from "./lib/identities/Key.interface";
import { AccessGrantStatus, AccessGrantType, ClaimScheme, ClaimType } from "./lib/claims/Claim.interface";
import { Claim } from "./lib/claims/Claim";
import { SignerModule } from './lib/core/SignerModule';
declare const _default: {
Config: {
enums: {
NETWORKS: typeof import("./lib/core/Config").NETWORKS;
};
errors: {
InvalidProviderError: typeof import("./lib/core/Config").InvalidProviderError;
};
config: typeof import("./lib/core/Config").config;
settings: {
allowUnsecuredProviders: boolean;
};
getProvider: typeof import("./lib/core/Config").getProvider;
setProvider: typeof import("./lib/core/Config").setProvider;
};
Identity: typeof Identity;
Claim: typeof Claim;
SignerModule: typeof SignerModule;
Providers: {
Provider: typeof import("ethers");
Signer: typeof import("ethers").Signer;
JsonRpcProvider: typeof import("ethers/providers").JsonRpcProvider;
Wallet: typeof import("ethers").Wallet;
Web3Provider: typeof import("ethers/providers").Web3Provider;
};
Events: {
ErrorNotification: import("./lib/core/utils/TypedEvent.class").TypedEvent<import("./lib/core/events/ErrorNotification.event").ErrorNotificationEvent>;
};
utils: {
arrayify: typeof import("ethers/utils").arrayify;
toHex: typeof import("./lib/core/utils/Utils").toHex;
enums: {
ClaimScheme: typeof ClaimScheme;
ClaimType: typeof ClaimType;
KeyPurpose: typeof KeyPurpose;
KeyType: typeof KeyType;
AccessGrantType: typeof AccessGrantType;
AccessGrantStatus: typeof AccessGrantStatus;
};
contracts: {
ERC725: {
"contractName": string;
"abi": ({
"anonymous": boolean;
"inputs": {
"indexed": boolean;
"name": string;
"type": string;
}[];
"name": string;
"type": string;
"constant"?: undefined;
"outputs"?: undefined;
"payable"?: undefined;
"stateMutability"?: undefined;
} | {
"constant": boolean;
"inputs": {
"name": string;
"type": string;
}[];
"name": string;
"outputs": {
"name": string;
"type": string;
}[];
"payable": boolean;
"stateMutability": string;
"type": string;
"anonymous"?: undefined;
})[];
"bytecode": string;
"deployedBytecode": string;
"sourceMap": string;
"deployedSourceMap": string;
"source": string;
"sourcePath": string;
"ast": {
"absolutePath": string;
"exportedSymbols": {
"ERC725": number[];
};
"id": number;
"nodeType": string;
"nodes": ({
"id": number;
"literals": string[];
"nodeType": string;
"src": string;
"baseContracts"?: undefined;
"contractDependencies"?: undefined;
"contractKind"?: undefined;
"documentation"?: undefined;
"fullyImplemented"?: undefined;
"linearizedBaseContracts"?: undefined;
"name"?: undefined;
"nodes"?: undefined;
"scope"?: undefined;
} | {
"baseContracts": never[];
"contractDependencies": never[];
"contractKind": string;
"documentation": null;
"fullyImplemented": boolean;
"id": number;
"linearizedBaseContracts": number[];
"name": string;
"nodeType": string;
"nodes": ({
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": {
"argumentTypes": null;
"hexValue": string;
"id": number;
"isConstant": boolean;
"isLValue": boolean;
"isPure": boolean;
"kind": string;
"lValueRequested": boolean;
"nodeType": string;
"src": string;
"subdenomination": null;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"value": string;
};
"visibility": string;
"anonymous"?: undefined;
"documentation"?: undefined;
"parameters"?: undefined;
"canonicalName"?: undefined;
"members"?: undefined;
"body"?: undefined;
"implemented"?: undefined;
"isConstructor"?: undefined;
"isDeclaredConst"?: undefined;
"modifiers"?: undefined;
"payable"?: undefined;
"returnParameters"?: undefined;
"stateMutability"?: undefined;
"superFunction"?: undefined;
} | {
"anonymous": boolean;
"documentation": null;
"id": number;
"name": string;
"nodeType": string;
"parameters": {
"id": number;
"nodeType": string;
"parameters": {
"constant": boolean;
"id": number;
"indexed": boolean;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"src": string;
};
"src": string;
"constant"?: undefined;
"scope"?: undefined;
"stateVariable"?: undefined;
"storageLocation"?: undefined;
"typeDescriptions"?: undefined;
"typeName"?: undefined;
"value"?: undefined;
"visibility"?: undefined;
"canonicalName"?: undefined;
"members"?: undefined;
"body"?: undefined;
"implemented"?: undefined;
"isConstructor"?: undefined;
"isDeclaredConst"?: undefined;
"modifiers"?: undefined;
"payable"?: undefined;
"returnParameters"?: undefined;
"stateMutability"?: undefined;
"superFunction"?: undefined;
} | {
"canonicalName": string;
"id": number;
"members": {
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"visibility": string;
"constant"?: undefined;
"stateVariable"?: undefined;
"storageLocation"?: undefined;
"typeDescriptions"?: undefined;
"typeName"?: undefined;
"value"?: undefined;
"anonymous"?: undefined;
"documentation"?: undefined;
"parameters"?: undefined;
"body"?: undefined;
"implemented"?: undefined;
"isConstructor"?: undefined;
"isDeclaredConst"?: undefined;
"modifiers"?: undefined;
"payable"?: undefined;
"returnParameters"?: undefined;
"stateMutability"?: undefined;
"superFunction"?: undefined;
} | {
"body": null;
"documentation": null;
"id": number;
"implemented": boolean;
"isConstructor": boolean;
"isDeclaredConst": boolean;
"modifiers": never[];
"name": string;
"nodeType": string;
"parameters": {
"id": number;
"nodeType": string;
"parameters": {
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"src": string;
};
"payable": boolean;
"returnParameters": {
"id": number;
"nodeType": string;
"parameters": {
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"src": string;
};
"scope": number;
"src": string;
"stateMutability": string;
"superFunction": null;
"visibility": string;
"constant"?: undefined;
"stateVariable"?: undefined;
"storageLocation"?: undefined;
"typeDescriptions"?: undefined;
"typeName"?: undefined;
"value"?: undefined;
"anonymous"?: undefined;
"canonicalName"?: undefined;
"members"?: undefined;
} | {
"body": null;
"documentation": null;
"id": number;
"implemented": boolean;
"isConstructor": boolean;
"isDeclaredConst": boolean;
"modifiers": never[];
"name": string;
"nodeType": string;
"parameters": {
"id": number;
"nodeType": string;
"parameters": {
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"src": string;
};
"payable": boolean;
"returnParameters": {
"id": number;
"nodeType": string;
"parameters": {
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"baseType": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"id": number;
"length": null;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"src": string;
};
"scope": number;
"src": string;
"stateMutability": string;
"superFunction": null;
"visibility": string;
"constant"?: undefined;
"stateVariable"?: undefined;
"storageLocation"?: undefined;
"typeDescriptions"?: undefined;
"typeName"?: undefined;
"value"?: undefined;
"anonymous"?: undefined;
"canonicalName"?: undefined;
"members"?: undefined;
})[];
"scope": number;
"src": string;
"literals"?: undefined;
})[];
"src": string;
};
"legacyAST": {
"absolutePath": string;
"exportedSymbols": {
"ERC725": number[];
};
"id": number;
"nodeType": string;
"nodes": ({
"id": number;
"literals": string[];
"nodeType": string;
"src": string;
"baseContracts"?: undefined;
"contractDependencies"?: undefined;
"contractKind"?: undefined;
"documentation"?: undefined;
"fullyImplemented"?: undefined;
"linearizedBaseContracts"?: undefined;
"name"?: undefined;
"nodes"?: undefined;
"scope"?: undefined;
} | {
"baseContracts": never[];
"contractDependencies": never[];
"contractKind": string;
"documentation": null;
"fullyImplemented": boolean;
"id": number;
"linearizedBaseContracts": number[];
"name": string;
"nodeType": string;
"nodes": ({
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": {
"argumentTypes": null;
"hexValue": string;
"id": number;
"isConstant": boolean;
"isLValue": boolean;
"isPure": boolean;
"kind": string;
"lValueRequested": boolean;
"nodeType": string;
"src": string;
"subdenomination": null;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"value": string;
};
"visibility": string;
"anonymous"?: undefined;
"documentation"?: undefined;
"parameters"?: undefined;
"canonicalName"?: undefined;
"members"?: undefined;
"body"?: undefined;
"implemented"?: undefined;
"isConstructor"?: undefined;
"isDeclaredConst"?: undefined;
"modifiers"?: undefined;
"payable"?: undefined;
"returnParameters"?: undefined;
"stateMutability"?: undefined;
"superFunction"?: undefined;
} | {
"anonymous": boolean;
"documentation": null;
"id": number;
"name": string;
"nodeType": string;
"parameters": {
"id": number;
"nodeType": string;
"parameters": {
"constant": boolean;
"id": number;
"indexed": boolean;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"src": string;
};
"src": string;
"constant"?: undefined;
"scope"?: undefined;
"stateVariable"?: undefined;
"storageLocation"?: undefined;
"typeDescriptions"?: undefined;
"typeName"?: undefined;
"value"?: undefined;
"visibility"?: undefined;
"canonicalName"?: undefined;
"members"?: undefined;
"body"?: undefined;
"implemented"?: undefined;
"isConstructor"?: undefined;
"isDeclaredConst"?: undefined;
"modifiers"?: undefined;
"payable"?: undefined;
"returnParameters"?: undefined;
"stateMutability"?: undefined;
"superFunction"?: undefined;
} | {
"canonicalName": string;
"id": number;
"members": {
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"visibility": string;
"constant"?: undefined;
"stateVariable"?: undefined;
"storageLocation"?: undefined;
"typeDescriptions"?: undefined;
"typeName"?: undefined;
"value"?: undefined;
"anonymous"?: undefined;
"documentation"?: undefined;
"parameters"?: undefined;
"body"?: undefined;
"implemented"?: undefined;
"isConstructor"?: undefined;
"isDeclaredConst"?: undefined;
"modifiers"?: undefined;
"payable"?: undefined;
"returnParameters"?: undefined;
"stateMutability"?: undefined;
"superFunction"?: undefined;
} | {
"body": null;
"documentation": null;
"id": number;
"implemented": boolean;
"isConstructor": boolean;
"isDeclaredConst": boolean;
"modifiers": never[];
"name": string;
"nodeType": string;
"parameters": {
"id": number;
"nodeType": string;
"parameters": {
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"src": string;
};
"payable": boolean;
"returnParameters": {
"id": number;
"nodeType": string;
"parameters": {
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"src": string;
};
"scope": number;
"src": string;
"stateMutability": string;
"superFunction": null;
"visibility": string;
"constant"?: undefined;
"stateVariable"?: undefined;
"storageLocation"?: undefined;
"typeDescriptions"?: undefined;
"typeName"?: undefined;
"value"?: undefined;
"anonymous"?: undefined;
"canonicalName"?: undefined;
"members"?: undefined;
} | {
"body": null;
"documentation": null;
"id": number;
"implemented": boolean;
"isConstructor": boolean;
"isDeclaredConst": boolean;
"modifiers": never[];
"name": string;
"nodeType": string;
"parameters": {
"id": number;
"nodeType": string;
"parameters": {
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"src": string;
};
"payable": boolean;
"returnParameters": {
"id": number;
"nodeType": string;
"parameters": {
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"baseType": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"id": number;
"length": null;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"src": string;
};
"scope": number;
"src": string;
"stateMutability": string;
"superFunction": null;
"visibility": string;
"constant"?: undefined;
"stateVariable"?: undefined;
"storageLocation"?: undefined;
"typeDescriptions"?: undefined;
"typeName"?: undefined;
"value"?: undefined;
"anonymous"?: undefined;
"canonicalName"?: undefined;
"members"?: undefined;
})[];
"scope": number;
"src": string;
"literals"?: undefined;
})[];
"src": string;
};
"compiler": {
"name": string;
"version": string;
};
"networks": {};
"schemaVersion": string;
"updatedAt": string;
};
ERC735: {
"contractName": string;
"abi": ({
"anonymous": boolean;
"inputs": {
"indexed": boolean;
"name": string;
"type": string;
}[];
"name": string;
"type": string;
"constant"?: undefined;
"outputs"?: undefined;
"payable"?: undefined;
"stateMutability"?: undefined;
} | {
"constant": boolean;
"inputs": {
"name": string;
"type": string;
}[];
"name": string;
"outputs": {
"name": string;
"type": string;
}[];
"payable": boolean;
"stateMutability": string;
"type": string;
"anonymous"?: undefined;
})[];
"bytecode": string;
"deployedBytecode": string;
"sourceMap": string;
"deployedSourceMap": string;
"source": string;
"sourcePath": string;
"ast": {
"absolutePath": string;
"exportedSymbols": {
"ERC735": number[];
};
"id": number;
"nodeType": string;
"nodes": ({
"id": number;
"literals": string[];
"nodeType": string;
"src": string;
"baseContracts"?: undefined;
"contractDependencies"?: undefined;
"contractKind"?: undefined;
"documentation"?: undefined;
"fullyImplemented"?: undefined;
"linearizedBaseContracts"?: undefined;
"name"?: undefined;
"nodes"?: undefined;
"scope"?: undefined;
} | {
"baseContracts": never[];
"contractDependencies": never[];
"contractKind": string;
"documentation": null;
"fullyImplemented": boolean;
"id": number;
"linearizedBaseContracts": number[];
"name": string;
"nodeType": string;
"nodes": ({
"anonymous": boolean;
"documentation": null;
"id": number;
"name": string;
"nodeType": string;
"parameters": {
"id": number;
"nodeType": string;
"parameters": {
"constant": boolean;
"id": number;
"indexed": boolean;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};
"value": null;
"visibility": string;
}[];
"src": string;
};
"src": string;
"canonicalName"?: undefined;
"members"?: undefined;
"scope"?: undefined;
"visibility"?: undefined;
"body"?: undefined;
"implemented"?: undefined;
"isConstructor"?: undefined;
"isDeclaredConst"?: undefined;
"modifiers"?: undefined;
"payable"?: undefined;
"returnParameters"?: undefined;
"stateMutability"?: undefined;
"superFunction"?: undefined;
} | {
"canonicalName": string;
"id": number;
"members": {
"constant": boolean;
"id": number;
"name": string;
"nodeType": string;
"scope": number;
"src": string;
"stateVariable": boolean;
"storageLocation": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
"typeName": {
"id": number;
"name": string;
"nodeType": string;
"src": string;
"typeDescriptions": {
"typeIdentifier": string;
"typeString": string;
};
};