13 releases (7 stable)

3.0.1 Aug 28, 2025
2.1.0 Jun 10, 2025
2.0.0 Mar 14, 2024
1.2.0 Nov 14, 2023
0.14.0 Jul 28, 2022

#3 in #cw-storage-plus

Download history 443/week @ 2025-07-23 465/week @ 2025-07-30 326/week @ 2025-08-06 267/week @ 2025-08-13 313/week @ 2025-08-20 711/week @ 2025-08-27 835/week @ 2025-09-03 666/week @ 2025-09-10 239/week @ 2025-09-17 291/week @ 2025-09-24 351/week @ 2025-10-01 168/week @ 2025-10-08 182/week @ 2025-10-15 434/week @ 2025-10-22 374/week @ 2025-10-29 207/week @ 2025-11-05

1,243 downloads per month
Used in 12 crates (2 directly)

Apache-2.0

7KB
114 lines

Procedural macros helper for interacting with cw-storage-plus and cosmwasm-storage.

For more information on this package, please check out the README.


CW-Storage-Plus: Macro helpers for storage-plus

Procedural macros helper for interacting with cw-storage-plus and cosmwasm-storage.

Current features

Auto generate an IndexList impl for your indexes struct.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
struct TestStruct {
    id: u64,
    id2: u32,
    addr: Addr,
}

#[index_list(TestStruct)] // <- Add this line right here.
struct TestIndexes<'a> {
    id: MultiIndex<'a, u32, TestStruct, u64>,
    addr: UniqueIndex<'a, Addr, TestStruct, String>,
}

Auto generate the required impls to use a newtype as a key

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[derive(NewTypeKey)] // <- Add this line right here.
struct TestKey(u64);

// You can now use `TestKey` as a key in `Map`

Dependencies

~150–550KB
~13K SLoC