updateMultiData(contracts, sender, dataKeys, dataValues, currency)

Feature

Return raw operation to update multiple data. The length of dataKeys must same with length of dataValues and contracts. (max length is 100) Note: Handler of contract also can execute the function.

Parameters

string | string[] contract address, // If given a string, it is automatically converted to an array filled with the same values. string sender, string[] dataKeys, (element’s max length is 200, must not contain: space / : ? # [ ] @) string[] dataValues, (element’s max length is 20000) string currency ID

Return Value

object update-data operation with multi items

example1. update data for each contract

const sender = "0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca";
const currencyID = "MCC";

const contract = "0x87aCb45fFbB1507Be67102875EAc4Eb024306465fca";
const contract2 ="0xa6283308BBedbfB8041A2Ea950A11D142A0F4FD9fca"
const contracts = [contract,contract,contract2,contract2];
const dataKeys = ["key1", "key2", "key3", "key4"];
const dataValues = ["value5", "value6", "value7", "value8"];
const op = mitum.storage.updateMultiData(contracts, sender, dataKeys, dataValues, currencyID);

console.log(op);

BaseOperation {
  id: 'mitum',
  fact: UpdateDataFact {
    hint: Hint { s: 'mitum-storage-update-data-operation-fact' },
    token: Token { s: '2026-02-19 05:39:02.87 +0000 UTC' },
    _hash: <Buffer 2c 97 46 4b 75 26 e7 73 e0 fe 52 79 e2 c6 11 66 27 76 dc 6a ca 08 1d eb e4 72 43 22 e0 b3 7d b7>,
    sender: Address {
      s: '0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca',
      type: 'mitum'
    },
    items: [
      [UpdateDataItem],
      [UpdateDataItem],
      [UpdateDataItem],
      [UpdateDataItem]
    ]
  },
  hint: Hint { s: 'mitum-storage-update-data-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

example2. update four data about one contract (0x87…)

Last updated