Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@portkey/did
Advanced tools
![ES Version](https://img.shields.io/badge/ES-2020-yellow) ![Node Version](https://img.shields.io/badge/node-14.x-green) [![NPM Package Version][npm-image-version]][npm-url]
@portkey/did
Script | Description |
---|---|
clean | Uses rm to remove dist/ |
build | Uses tsc to build package and dependent packages |
lint | Uses eslint to lint package |
lint:fix | Uses eslint to check and fix any warnings |
format | Uses prettier to format the code |
The @portkey/did
library is a collection of modules that contain functionality for the did ecosystem.
@portkey/accounts
is for the portkey account.@portkey/utils
is for the portkey utils.@portkey/contracts
is for the portkey contracts.@portkey/graphql
is for the portkey graphql.@portkey/contracts
is for the portkey request.@portkey/types
is for the portkey types.@portkey/utils
is for the portkey utils.@portkey/validator
is for the portkey validator.npm install @portkey/did
yarn add @portkey/did
After that you need configure did server node、graphQL node、storage suite.
class Store implements IStorageSuite {
async getItem(key: string) {
return localStorage.getItem(key);
}
async setItem(key: string, value: string) {
return localStorage.setItem(key, value);
}
async removeItem(key: string) {
return localStorage.removeItem(key);
}
}
did.setConfig({
requestDefaults: {
baseURL: 'your did server node',
timeout: 'timeout', // optional default 8000ms
},
graphQLUrl: 'your graphQL node',
storageMethod: new Store(),
});
That’s it! now you can use the did
object.
@portkey/did
API ReferenceWhere you configure did server node, graphQL node, storage suite.
did.setConfig({
requestDefaults: {
baseURL: 'you did server node',
timeout: 'timeout', // optional default 8000ms
},
graphQLUrl: 'your graphQL node',
storageMethod: 'your storage suite',
});
Email or phone number login.
did.login(type: 'loginAccount', params: AccountLoginParams): Promise<LoginResult>;
Example
did.login('loginAccount', {
chainId: 'chainId',
loginGuardianAccount: 'loginGuardianAccount',
guardiansApproved: [
{
type: 'Email',
value: 'value',
verifierId: 'verifierId',
verificationDoc: 'verificationDoc',
signature: 'signature',
},
],
deviceString: 'deviceString',
context: {
requestId: 'requestId',
clientId: 'clientId',
},
});
Logged in management to add management.
login(type: 'scan', params: ScanLoginParams): Promise<true>;
Example
did.login('scan',{
chainId: 'chainId',
caHash: 'caHash',
management: {
managementAddress: 'managementAddress',
deviceString: 'deviceString';
};
})
getLoginStatus(params: { chainId: ChainId; sessionId: string }): Promise<RecoverStatusResult>;
Example
did.getLoginStatus({
chainId: 'chainId',
sessionId: 'sessionId',
});
logout(params: EditManagerParams): Promise<boolean>;
Example
did.logout({ chainId: 'chainId' });
register(params: Omit<RegisterParams, 'managementAddress'>): Promise<RegisterResult>;
Example
did.register({
type: 'Email',
loginGuardianAccount: 'loginGuardianAccount',
deviceString: 'deviceString',
chainId: 'chainId',
verifierId: 'verifierId',
verificationDoc: 'verificationDoc',
signature: 'signature',
context: {
requestId: 'requestId',
clientId: 'clientId',
},
});
getRegisterStatus(params: { chainId: ChainId; sessionId: string }): Promise<RegisterStatusResult>;
Example
did.getRegisterStatus({
chainId: 'chainId',
sessionId: 'sessionId',
});
getHolderInfo by graphQL.
getHolderInfo(params: Pick<GetHolderInfoParams, 'managementAddress' | 'chainId'>): Promise<Array<GetCAHolderByManagerResult>>;
Example
did.getHolderInfo({
managementAddress: 'managementAddress', // optional
chainId: 'chainId',
});
getHolderInfo by contracts.
getHolderInfo(params: Pick<GetHolderInfoParams, 'managementAddress' | 'chainId'>): Promise<Array<GetCAHolderByManagerResult>>;
Example
did.getHolderInfo({
caHash: 'caHash', // loginGuardianAccount and caHash choose one
loginGuardianAccount: 'loginGuardianAccount', // loginGuardianAccount and caHash choose one
chainId: 'chainId',
});
Get the VerifierServer information of the corresponding chain.
getVerifierServers(chainId: ChainId): Promise<VerifierItem[]>;
Example
did.getVerifierServers({
chainId: 'chainId',
});
send verification code.
getVerificationCode(params: SendVerificationCodeParams): Promise<SendVerificationCodeResult>;
Example
did._services.getVerificationCode({
chainId: 'chainId',
guardianAccount: 'guardianAccount',
type: 'Email',
verifierId: 'verifierId',
});
verify verification code.
verifyVerificationCode(params: VerifyVerificationCodeParams): Promise<VerifyVerificationCodeResult>;
Example
did._services.verifyVerificationCode({
verifierSessionId: 'verifierSessionId',
chainId: 'chainId',
guardianAccount: 'guardianAccount',
verifierId: 'verifierId',
verificationCode: 'verificationCode',
});
FAQs
Unknown package
The npm package @portkey/did receives a total of 1,032 weekly downloads. As such, @portkey/did popularity was classified as popular.
We found that @portkey/did demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.