Skip to content

Commit

Permalink
docs: update epk-signature and web3-signature readme (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis authored Jul 24, 2019
1 parent e81e950 commit 3220434
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/epk-signature/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import { IdentityTypes, SignatureTypes } from '@requestnetwork/types'

import EthereumPrivateKeySignatureProvider from '@requestnetwork/epk-signature'

const signatureParametersExample: SignatureTypes.ISignature = {
method: SignatureTypes.REQUEST_SIGNATURE_METHOD.ECDSA,
const signatureParametersExample: SignatureTypes.ISignatureParameters = {
method: SignatureTypes.METHOD.ECDSA,
privateKey: '0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3',
};

// Identity from the previous signature parameter
const identityExample: IdentityTypes.IIdentity = {
type: IdentityTypes.REQUEST_IDENTITY_TYPE.ETHEREUM_ADDRESS,
type: IdentityTypes.TYPE.ETHEREUM_ADDRESS,
value: '0x627306090abab3a6e1400e9345bc60c78a8bef57'
};

Expand All @@ -41,7 +41,7 @@ const listOfAvailableIdentity = signatureProvider.getAllRegisteredIdentities();

// can sign data with identity
const dataToSign = { ... };
const signedData = await signatureProvider.sign(dataToSign, identityExample); // { data: { ... }, signature: { method: SignatureTypes.REQUEST_SIGNATURE_METHOD.ECDSA, value: '0x...' }}
const signedData = await signatureProvider.sign(dataToSign, identityExample); // { data: { ... }, signature: { method: SignatureTypes.METHOD.ECDSA, value: '0x...' }}

// can add a new signature parameters
signatureProvider.addSignatureParameters({method: ..., privateKey: ...});
Expand Down
4 changes: 2 additions & 2 deletions packages/web3-signature/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Web3SignatureProvider from '@requestnetwork/web3-signature'

// Identity from the previous signature parameter
const identityExample: IdentityTypes.IIdentity = {
type: IdentityTypes.REQUEST_IDENTITY_TYPE.ETHEREUM_ADDRESS,
type: IdentityTypes.TYPE.ETHEREUM_ADDRESS,
value: '0x627306090abab3a6e1400e9345bc60c78a8bef57'
};

Expand All @@ -42,7 +42,7 @@ const signedData = signatureProvider.sign(dataToSign, identityExample);
{
data: { ... },
signature: {
method: SignatureTypes.REQUEST_SIGNATURE_METHOD.ECDSA,
method: SignatureTypes.METHOD.ECDSA,
value: '0x...'
}
}
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9821,7 +9821,7 @@ shell-quote@^1.6.1:
array-reduce "~0.0.0"
jsonify "~0.0.0"

shelljs@^0.8.1, shelljs@^0.8.3:
[email protected].3, shelljs@^0.8.1:
version "0.8.3"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097"
integrity sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==
Expand Down

0 comments on commit 3220434

Please sign in to comment.