UNPKG

@algodex/algodex-sdk

Version:

API calls for interacting with the Algorand blockchain

28 lines (25 loc) 594 B
/* * Copyright (C) 2021-2022 Algodex VASP (BVI) Corp. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /** * Group By Key * @param {Array} items * @param {string} key * @return {Object} * @ignore */ const groupBy = (items, key) => items.reduce( (result, item) => ({ ...result, [item[key]]: [ ...(result[item[key]] || []), item.signedTxn, ], }), {}, ); module.exports = groupBy;