Skip to content

prepareExtrinsicToRevoke

prepareExtrinsicToRevoke(statementUri, creatorUri, authorAccount, authorizationUri, signCallback): Promise<SubmittableExtrinsic>

Dispatches a statement revocation transaction to the CORD blockchain.

Parameters

statementUri: stmt:cord:${string}

The URI of the statement to be revoked.

creatorUri: did:cord:3${string}

The DID URI of the creator of the statement. This identifier is used to authorize the transaction.

authorAccount: CordKeyringPair

The blockchain account used to sign and submit the transaction.

authorizationUri: auth:cord:${string}

The URI of the authorization used for the statement.

signCallback: SignExtrinsicCallback

A callback function that handles the signing of the transaction.

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);
});

Source

statement/src/Statement.chain.ts:468