Skip to content

Commit

Permalink
Support new features introduced in Coreum v4 (#13)
Browse files Browse the repository at this point in the history
* update NFT protos and upgrade dependencies

* Remove all extra serde for Contracts (not going to be used)

* add extenstion address and admin for queries

* make globally_frozen optional because it's not sent if false

* make admin optional

* upgrade prost version

* add types for distribution module

* update wasmd protos

* Update version to 1.0.0

Co-Authored-By: keyne <[email protected]>
  • Loading branch information
wojtek-coreum and keyleu authored Jun 21, 2024
1 parent 9e1b6bb commit eab3555
Show file tree
Hide file tree
Showing 20 changed files with 1,930 additions and 770 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[package]
name = "coreum-wasm-sdk"
version = "0.2.4"
version = "1.0.0"
edition = "2021"
description = "SDK for WASM coreum messages and queries."
homepage = "https://coreum.com/"
license = "Apache-2.0"

[dependencies]
cosmwasm-std = { version = "1.5.0", features = ["stargate"] }
serde = { version = "1.0.193", default-features = false, features = ["derive"] }
schemars = "0.8.16"
cosmwasm-schema = "1.5.0"
cosmwasm-std = { version = "1.5.5", features = ["stargate"] }
serde = { version = "1.0.203", default-features = false, features = ["derive"] }
schemars = "0.8.21"
cosmwasm-schema = "1.5.5"
osmosis-std-derive = "0.20.1"
chrono = { version = "0.4.30", default-features = false }
prost = { version = "0.11.0", default-features = false, features = [
chrono = { version = "0.4.38", default-features = false }
prost = { version = "0.12.6", default-features = false, features = [
"prost-derive",
] }
prost-types = { version = "0.12.0", default-features = false }
prost-types = { version = "0.12.6", default-features = false }
serde-cw-value = "0.7.0"
5 changes: 5 additions & 0 deletions src/assetft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pub const FREEZING: u32 = 2;
pub const WHITELISTING: u32 = 3;
pub const IBC: u32 = 4;
pub const BLOCK_SMART_CONTRACTS: u32 = 5;
pub const CLAWBACK: u32 = 6;
pub const EXTENSION: u32 = 7;

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
Expand All @@ -33,12 +35,15 @@ pub struct Token {
pub subunit: String,
pub precision: u32,
pub description: Option<String>,
pub globally_frozen: Option<bool>,
pub features: Option<Vec<u32>>,
pub burn_rate: String,
pub send_commission_rate: String,
pub version: u32,
pub uri: Option<String>,
pub uri_hash: Option<String>,
pub extension_cw_address: Option<String>,
pub admin: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ pub mod pagination;
pub mod shim;
#[allow(deprecated)]
pub mod types;
mod serde;
22 changes: 0 additions & 22 deletions src/serde/mod.rs

This file was deleted.

3 changes: 1 addition & 2 deletions src/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ impl Serialize for Timestamp {
nanos: self.nanos,
};
ts.normalize();
let dt = NaiveDateTime::from_timestamp_opt(ts.seconds, ts.nanos as u32)
let dt = DateTime::from_timestamp(ts.seconds, ts.nanos as u32)
.expect("invalid or out-of-range datetime");
let dt: DateTime<Utc> = DateTime::from_naive_utc_and_offset(dt, Utc);
serializer.serialize_str(format!("{:?}", dt).as_str())
}
}
Expand Down
Loading

0 comments on commit eab3555

Please sign in to comment.