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-datas operation
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);
Operation {
id: 'mitum',
fact: UpdateDatasFact {
hint: Hint { s: 'mitum-storage-update-datas-operation-fact' },
token: Token { s: '2024-11-11 08:39:03.749 +0000 UTC' },
_hash: <Buffer 03 ef 7d a4 98 7e b5 de e3 25 18 fb f8 b9 3e 12 23 20 8a 3b b8 97 b6 06 ae 55 09 68 50 b3 20 e8>,
sender: Address {
s: '0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca',
type: 'mitum'
},
items: [
[UpdateDatasItem],
[UpdateDatasItem],
[UpdateDatasItem],
[UpdateDatasItem]
]
},
hint: Hint { s: 'mitum-storage-update-datas-operation' },
_factSigns: [],
_hash: <Buffer >
}example2. update four data about one contract (0x87…)
PreviousupdateData(contract, sender, dataKey, dataValue, currency)NextdeleteData(contract, sender, dataKey, currency)
Last updated