prepareExtrinsicToRevoke
prepareExtrinsicToRevoke(
statementUri
,authorizationUri
):Promise
<SubmittableExtrinsic
>
Dispatches a statement revocation transaction to the CORD blockchain.
Parameters
• statementUri: stmt:cord:${string}
The URI of the statement to be revoked.
• authorizationUri: auth:cord:${string}
The URI of the authorization used for the statement.
Returns
Promise
<SubmittableExtrinsic
>
A promise that resolves once the transaction is successfully processed.
Remarks
This function is responsible for revoking an existing statement on the blockchain. It constructs and submits a transaction to revoke the statement identified by the given URI. The transaction is authorized by the creator and signed by the provided author account.
Throws
- Thrown when there is an error during the dispatch process, such as issues with constructing the transaction, signing, or submission to the blockchain.
Example
const statementUri = 'stmt:cord:example_uri';const creatorUri = 'did:cord:creator_uri';const authorAccount = // ... initialization ...const authorizationUri = 'auth:cord:example_uri';const signCallback = // ... implementation ...
dispatchRevokeToChain(statementUri, creatorUri, authorAccount, authorizationUri, signCallback) .then(() => { console.log('Statement successfully revoked.'); }) .catch(error => { console.error('Error dispatching statement revocation to chain:', error); });