create(contract, sender, authType, publicKey, serviceType, serviceEndPoints, currency)

Feature

Return raw operation to create new did and did document. Note: Contract account must be deployed on the mitum network. Handler of contract also can execute the function.

Parameters

string contract Address,

string sender,

string authType, // currently only “ECDSA” supported

string publicKey,

string serviceType,

string serviceEndPoints,

string currency ID

Return Value

object register model operation

example

const sender = "0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca";
const currencyID = "MCC";
const contract = "0x99e749E6e00fc6BA3E965881589D185cc5B447d4fca";
const authType = "ECDSA";
const serviceType = "mitumDappType"
const serviceEndpoints = "http://localhost:3000"
const publicKey = "02bb41168240ca6a2b74f130ba3760204b494fba7381d25bcde601d7c39185df25fpu";

const operation = mitum.authdid.create(contract, sender, authType, publicKey, serviceType, serviceEndpoints, currencyID);
console.log(operation);

// output
Operation {
  id: 'mitum',
  fact: CreateFact {
    hint: Hint { s: 'mitum-did-create-did-operation-fact' },
    token: Token { s: '2024-12-05 00:59:41.819 +0000 UTC' },
    _hash: <Buffer f1 55 87 7a b6 f8 e0 31 29 15 e7 44 21 3d ab 67 81 db fa 02 98 b1 e7 21 1c bd 83 66 36 2b 0c 63>,
    sender: Address {
      s: '0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca',
      type: 'mitum'
    },
    contract: Address {
      s: '0x99e749E6e00fc6BA3E965881589D185cc5B447d4fca',
      type: 'mitum'
    },
    currency: CurrencyID { s: 'MCC' },
    authType: LongString { s: 'EcdsaSecp256k1VerificationKey2019' },
    publicKey: Key {
      key: '02bb41168240ca6a2b74f130ba3760204b494fba7381d25bcde601d7c39185df25',
      suffix: 'fpu',
      type: 'mitum',
      isPriv: false
    },
    serviceType: LongString { s: 'mitumDappType' },
    serviceEndpoints: LongString { s: 'http://localhost:3000' }
  },
  hint: Hint { s: 'mitum-did-create-did-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated