Claims
addClaim
addClaim('0xb57f5f92f8931e044f59d54f7f2a445e5dd274e16599f104a61a8dd4cfa5b0fa', '0xE4d3Df777CaD70A6b0048bc572Fd3f843751529E','ANY VALUE');
Add a claim
Parameters
String
- Issuer of the claimString
- Subject to add the claimString
- Value of the claim
Returns
Promise with transaction result
Example
addClaim('0xb57f5f92f8931e044f59d54f7f2a445e5dd274e16599f104a61a8dd4cfa5b0fa', '0xE4d3Df777CaD70A6b0048bc572Fd3f843751529E','ANY VALUE')
static
getClaim //static
Datum.getClaim("0x6e585cc6047a55a793d1E922afE28BaefaBcd73C","0x6e585cc6047a55a793d1E922afE28BaefaBcd73C", "0x656d61696c");
Return the value of the claim for given issuer, subject and key
Parameters
String
- issuer that created the claimString
- subject/wallet address for the claimString
- key name of the claim
Returns
Promise
Example
getClaim("0x6e585cc6047a55a793d1E922afE28BaefaBcd73C","0x6e585cc6047a55a793d1E922afE28BaefaBcd73C", "0x656d61696c");
static
getClaims //static
Datum.getClaims("0x6e585cc6047a55a793d1E922afE28BaefaBcd73C");
Returns an array of claims object with issuer, subject, key ,value
Parameters
String
- wallet address to get the claims
Returns
Promise array of claims
Example
getClaims("0x6e585cc6047a55a793d1E922afE28BaefaBcd73C");
Result
[{ issuer: '0x5aB36c692D5bCD2713239307F96212110a298f3E',
subject: '0x5aB36c692D5bCD2713239307F96212110a298f3E',
key: 'Age',
value: '80' } ]
removeClaim
removeClaim('0xb57f5f92f8931e044f59d54f7f2a445e5dd274e16599f104a61a8dd4cfa5b0fa', '0xE4d3Df777CaD70A6b0048bc572Fd3f843751529E');
Removes a claim. Can only be done by issuer or subject of the claim
Parameters
String
- Issuer of the claimString
- Subject to add the claim
Returns
Promise with transaction result
Example
removeClaim('0xb57f5f92f8931e044f59d54f7f2a445e5dd274e16599f104a61a8dd4cfa5b0fa', '0xE4d3Df777CaD70A6b0048bc572Fd3f843751529E')