Credential Functions
How to use credential model using mitumjs SDK.
Create a contract-account first using function of contract class. The account must be deployed on the Mitum network. (Create an operation with
contract.createAccount()
orcontract.createWallet()
, and useoperation.sign()
andoperation.send()
, or usecontract.touch()
to sign and send at once.)Create a new credential model operation using function
registerModel()
of credential class.Sign and send the operation to Mitum network. (check with
getModelInfo()
)The owner of the contract-account can add template for credential. Use the function
addTemplate()
to make raw operation.Sign and send the operation to Mitum network. (check with
getTemplate()
)The owner of the contract-account can issue a new credential. Use the function
issue()
to make raw operation. (Also possible to revoke the credential withrevoke()
)Sign and send the operation to Mitum network.
The user can verify the credential using the function
getByHolder()
.
Last updated