updateDocument(contract, sender, document, currency)
Feature
Return update did document operation using Document instance to update exist did document.
const contract = "0x99e749E6e00fc6BA3E965881589D185cc5B447d4fca";
const sender = "0xe3a93FeDE11D53283091bD639BDd24c59b8B8C60fca";
const currency = "MCC";
const did = "did:mitum:0xe3a93FeDE11D53283091bD639BDd24c59b8B8C60fca";
// 1️⃣ Create authentication key
const auth = mitum.authdid.writeAsymkeyAuth(
did + "#auth_key",
"SECP256K1_IMFACT_2025",
did,
publicKey
);
// 2️⃣ Build Document via SDK
const doc = mitum.authdid.writeDocument(
[
"https://www.w3.org/ns/did/v1",
"https://imfact.im/did/contexts/v1.jsonld"
],
did,
[auth],
);
// 3️⃣ Create update operation
const op = mitum.authdid.updateDocument(contract, sender, doc, currency);
// 4️⃣ Sign with private key → send to networkPreviouswriteDocument(didContext, didID, authentications, verificationMethods, services?)NextupdateDocumentByDocumentJson(contract, sender, documentJson, currency)
Last updated