Skip to content

Releases: scrtlabs/secret-toolkit

secret-toolkit-storage v0.4.2

31 Aug 11:45
d8b9879
Compare
Choose a tag to compare
  • Simplified implementation of .clone method
  • Added .add_suffix and .clone methods to secret-toolkit::storage::Item
  • Minor performance updates to secret-toolkit::storage::Keymap

Contributor: @srdtrk

secret-toolkit-storage v0.4.1

31 Aug 11:45
9bee9c9
Compare
Choose a tag to compare

BUGFIX: Item::is_empty was returning the opposite value from what you'd expect.

v0.4.0 - Better Storage

15 Aug 19:37
e60b07f
Compare
Choose a tag to compare

This release mostly includes the work of @srdtrk in #53. Thanks Srdtrk!

It revamps the secret-toolkit-storage package to make it more similar to cw-storage-plus and much easier
to use. It also removes the Cashmap type from the incubator in favor of KeyMap in secret-toolkit-storage.

This is a summary of the changes and additions in this release:

  • Minimum Rust version is bumped to the latest v1.63. This is because we want to use Mutex::new in a const fn.
  • No more distinction between Readonly* and *Mut types. Instead, methods take references or mutable references to the storage every time.
  • Usage of PrefixedStore is made mostly unnecessary.
  • Storage type's constructors are const functions, which means they can be initialized as global static variables.
  • Added secret-toolkit::storage::Item which is similar to Item from cw-storage-plus or TypedStore from cosmwasm_storage v0.10.
  • Added secret-toolkit::storage::KeyMap which is similar to Cashmap.
  • Cashmap is completely removed.

A full guide to using the new storage types can be found
in the package's readme file.

v0.3.0 - Shockwave

11 May 08:59
003c154
Compare
Choose a tag to compare

This release includes new features and utilities, bugfixes, and replaces secp256k signing and validation with the pre-compiled functions in the new crypto APIs introduced in the Shockwave Alpha update which should improve performance significantly.

New features

  • Added clear method to AppendStore and DequeStore to quickly reset the collections (#34)
  • docs.rs documentation now includes all sub-crates.
  • BUGFIX: secret-toolkit::snip721::Metadata was severely out of date with the SNIP-721 specification, and not useful.
    It is now compatible with deployed SNIP-721 contracts.
  • Added types module under the util package, to standardize often used types.
  • Added secret-toolkit::viewing_key, which can be imported by enabling the viewing-key feature.
  • Added secret-toolkit::permit::PubKey::canonical_address().
  • Types in secret-toolkit::permit::Permit are now generic over the type of permissions they accept.
  • Added the maxheap type to the incubator.
  • Added secret-toolkit::utils::feature_toggle which allow managing feature flags in your contract.

Breaking

  • secret-toolkit::permit::validate() Now supports validating any type of Cosmos address.
    Interface changes: Now takes a reference to the current token address instead
    of taking it by value and an optional hrp string.
    In addition, it returns a String and not HumanAddr.
  • Renamed secret-toolkit::permit::Permission to secret-toolkit::permit::TokenPermission.
  • secret-toolkit-crypto now has features ["hash", "rng" and "ecc-secp256k1"] which are all off by default - enable those you need.
  • secret-toolkit-crypto::secp256k1::PublicKey::parse now returns StdResult<Self>.
  • Changes to secret-toolkit::crypto::secp256k1::PrivateKey::sign:
    • The data argument is now any slice of bytes, and not the hash of a slice of data.
    • the Api from deps.api is now required as the second argument as we now use the precompiled implementation.
  • Changes to secret-toolkit::crypto::secp256k1::PublicKey::verify:
    • the Api from deps.api is now required as the third argument as we now use the precompiled implementation.
  • secret-toolkit-incubator now has features ["cashmap", "generational-store"] which are all off by default.

v0.2.0

19 Jan 11:16
a821c22
Compare
Choose a tag to compare

This release includes a ton of new features, and a few breaking changes in various interfaces.
This version is also the first released to crates.io!

  • Change: when a query fails because of a bad viewing key, this now correctly fails with StdError::Unauthorized
  • Added support for some missing SNIP-20 functionality, such as CreateViewingKey
  • Added support for SNIP-21 queries (memos and improved history) which broke some interfaces
  • Added support for SNIP-22 messages (batch operations)
  • Added support for SNIP-23 messages (improved Send operations) which broke some interfaces
  • Added support for SNIP-24 permits
  • Added Base64Of<S: Serde, T>, Base64JsonOf<T>, and Base64Bincode2Of<T>,
    which are wrappers that automatically deserializes base64 strings to T.
    It can be used in message types' fields instead of Binary when the contents of the string
    should have more specific contents.
  • Added storage::DequeStore - Similar to AppendStore but allows pushing and popping on both ends
  • Added the secret-toolkit::incubator package intended for experimental features. It contains:
    • CashMap - A hashmap like storage abstraction
    • GenerationalIndex - A generational index storage abstraction
  • The various subpackages can now be selected using feature flags. The default flags are ["serialization", "snip20", "snip721", "storage", "utils"]
    while ["crypto", "permit", "incubator"] are left disabled by default.

V0.1.1

19 Jan 11:17
6c646a9
Compare
Choose a tag to compare
  • Removed unused dev-dependency that was slowing down test compilation times.

v0.1.0

19 Jan 11:18
687b908
Compare
Choose a tag to compare

This is the first release of secret-toolkit. It supports:

  • secret-toolkit::snip20 - Helper types and functions for interaction with
    SNIP-20 contracts.
  • secret-toolkit::snip721 - Helper types and functions for interaction with
    SNIP-721 contracts.
  • secret-toolkit::crypto - Wrappers for known-to-work crypto primitives from
    ecosystem libraries. We include implementations for Sha256, Secp256k1 keys,
    and ChaChaRng.
  • secret-toolkit::storage - Types implementing useful storage managements
    techniques: AppendStore and TypedStore, using bincode2 by default.
  • secret-toolkit::serialization - marker types for overriding the storage
    format used by types in secret-toolkit::storage. Json and Bincode2.
  • secret-toolkit::utils - General utilities for writing contract code.
    • padding - tools for padding queries and responses.
    • calls - Tools for marking types as messages in queries and callbacks
      to other contracts.