#holochain #hdk #holo #hdk-helpers

hc_utils

用于 holochain hdk 开发的辅助函数

61 个版本

0.4.0-dev.142024年8月23日
0.4.0-dev.112024年7月30日
0.3.0-beta-dev…2024年3月25日
0.3.0-beta-dev.52023年6月28日
0.0.115 2021年11月12日

#331 in 魔法豆

Download history 86/week @ 2024-05-04 52/week @ 2024-05-11 139/week @ 2024-05-18 27/week @ 2024-05-25 85/week @ 2024-06-01 86/week @ 2024-06-08 236/week @ 2024-06-15 49/week @ 2024-06-22 24/week @ 2024-06-29 29/week @ 2024-07-06 8/week @ 2024-07-13 1/week @ 2024-07-20 162/week @ 2024-07-27 28/week @ 2024-08-03 143/week @ 2024-08-10 96/week @ 2024-08-17

429 每月下载量
用于 hc_cz_profile

Apache-2.0AGPL-3.0 WITH mif-exception

23KB
440

hc-utils

holochain-rsm 的 util 包

注意:目前 hc-utils 包将始终跟随 hdk 的版本,当 hdk 版本为 1.2.1 时,hc_utils 版本将为 v1.2.1

注意:所有函数都已转换为宏

commit_idempotent

Query for an existing Entry in the local source-chain matching the given EntryType name(s). If one exists, return it Address, otherwise commit it.
Query for an existing Link in the local source-chain matching the given LinkType name(s).  If one exists, return it Address, otherwise commit it.

exists

Query for an existing Entry in the local source-chain matching the given EntryType name(s).  If one exists, return it Address, otherwise returns error

get_action

Gets the action of an Entry

get_latest_entry

Obtains the updates for the target Entry, and examines all of them to selects the latest one by looking at the update time in its action.

An identical Entry can be committed by multiple Agents; this obtains the Entry's Action from the perspective of _this_ Agent. It also may be committed by the same Agent multiple times, this algorithm depends on either making the Entry unique, _or_ that the caller is OK with it returning the latest Update by any of this Agent's commits of this identical Entry.
gets latest link created to the specific base

local_source_chain

Returns a list of elements from the local source-chain
Removes link. The current hdk expects you to get all links and delete_link by specifying the entry_hash of the entry that you want to delete

wrappers

String wrapper for all holo_hash types

get_details

Get details for a list of links passed using the HDK::borrow functions

get

Get element for a list of links passed using the HDK::borrow functions

Gets the entries that are linked to a base with LinkTag by matching with the declared TryFrom Entry.
**Macros:**
- `get_links_and_load_type!(base, tag)`
   - `include_latest_updated_entry = true` is used when an entry is updated in the zome and if you need the latest update of those entries
- `get_links_and_load_type!(base, tag, false)`
    - `include_latest_updated_entry = false` is used when an entry does not have updates.

版本映射

hc-utils hdk
v0.0.107 v0.0.107
v0.0.110 v0.0.110
... ...
v0.0.111 v0.0.111
v0.0.115 v0.0.115

License: CAL 1.0

版权 (C) 2017-2020, Holo Ltd.

本程序是自由软件:您可以在许可证文件(CAL-1.0)所提供的条款下重新分发和/或修改它。本程序是在希望它将是有用的前提下分发的,但没有任何保证;甚至没有关于适销性或适用于特定目的的暗示保证。

依赖关系

~12–26MB
~405K SLoC