Open damoncro opened 2 years ago
I guess this only affects C++ bindings? Do C++ bindings work for any Ethereum chains, then perhaps following the common's module naming works?
Yes, only C++ bindings. No need to modify common crate.
Having different namespaces in c++ is easier for developers divide the functions groups in documents.
Do you mean we follow the common module's naming, based on the lib.rs
:
/// Eth contract types generated from ABI
pub mod contract;
/// interactions with remote node RPC / API (querying, broadcast etc.)
pub mod node;
/// transaction building etc.
pub mod transaction;
/// HD wallet-related functionality
mod wallet;
/// Login module: signing using EIP-4361 on Ethereum or ADR-036 on Cosmos SDK
#[cfg(feature = "login")]
mod login;
/// Utility functions
mod utils;
pub use defi_wallet_core_proto as proto;
// expose all proto related types (e.g. for uniffi)
pub use cosmrs::{tx::Msg, AccountId};
pub use eyre::{Report as ErrorReport, Result};
pub use ibc::Height;
pub use proto::chainmain::nft::v1::*;
#[cfg(feature = "login")]
pub use login::*;
pub use node::*;
pub use transaction::*;
pub use wallet::*;
#[cfg(feature = "uniffi-binding")]
uniffi_macros::include_scaffolding!("common");
#[macro_use]
mod macros;
If so, it is quite a lot of works to do, may need to rearrange the functions in cpp bindings.
It is possible, we just create many cxx::bridge.
@ricky321q Do C++ bindings work for any Ethereum chains? Only Cronos?
We can promote that we can support many chains, but the namespace in c++ should be carefully chosen, if it is org::defi_wallet_core::cronos
, then it may confuse the users that we only support cronos.
After discussed with @lezzokafka and @ricky321q long time ago, we should rename the namespace to be easily distinguish between cosmos and cronos, for example:
org::defi_wallet_core::cosmos
org::defi_wallet_core::cronos
org::defi_wallet_core::unit
etc.
rather than one single
org::defi_wallet_core