setDocument(contract, sender, title, uri, documentHash, currency)

Feature

Returns raw operation that set document for security token. Note : Only contract’s owner (or operator) can execute the function.

Parameters

string contract address, string sender, string title, string uri, string documentHash, string currency

Return Value

object setDocumentOperation

example

const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const title = "test document title"
const uri = "www.abcd_efgh.com";
const documentHash = "381yXYxtWCavzPxeUXRewT412gbLt2hx7VanKazkBrsnyfPPBdXfoG52Yb2wkF8vC3KJyoWgETpsN6k97mQ8tUXr1CmTedcj";
const currencyID = "MCC";

const setDocumentOperation = mitum.sto.setDocument(contractAddress, sender, title, uri, documentHash, currencyID);
console.log(setDocumentOperation);

//output
Operation {
  id: 'mitum',
  fact: SetDocumentFact {
    hint: Hint { s: 'mitum-sto-set-document-operation-fact' },
    token: Token { s: '2023-11-23 05:20:52.595 +0000 UTC' },
    _hash: <Buffer 9a d3 f7 eb ab 7d 09 a1 d8 32 c1 d9 e3 92 34 46 19 c0 c0 ab 57 84 78 f8 35 d6 32 7e 0d b3 7a 96>,
    sender: Address {
      s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      type: 'mitum'
    },
    contract: Address {
      s: '0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca',
      type: 'mitum'
    },
    currency: CurrencyID { s: 'MCC' },
    title: 'Sto title',
    uri: 'www.abcd_efgh.com',
    documentHash: '381yXYxtWCavzPxeUXRewT412gbLt2hx7VanKazkBrsnyfPPBdXfoG52Yb2wkF8vC3KJyoWgETpsN6k97mQ8tUXr1CmTedcj'
  },
  hint: Hint { s: 'mitum-sto-set-document-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated