diff --git a/cw-orch/examples/queries/bank_query.rs b/cw-orch/examples/queries/bank_query.rs index 798e985af..7a10391b8 100644 --- a/cw-orch/examples/queries/bank_query.rs +++ b/cw-orch/examples/queries/bank_query.rs @@ -1,10 +1,12 @@ use anyhow::Result as AnyResult; -use cosmwasm_std::Addr; use cw_orch::daemon::Daemon; use cw_orch::prelude::BankQuerier; use cw_orch::prelude::QuerierGetter; +use cw_orch::prelude::TxHandler; use cw_orch_daemon::queriers::Bank; pub fn main() { + dotenv::dotenv().unwrap(); + env_logger::init(); // We can now create a daemon. This daemon will be used to interact with the chain. let daemon = Daemon::builder(cw_orch::daemon::networks::LOCAL_JUNO) // chain parameter .build() @@ -17,7 +19,7 @@ pub fn test_queries(daemon: &Daemon) -> AnyResult<()> { // ANCHOR: daemon_balance_query let bank_query_client: Bank = daemon.querier(); - let sender = Addr::unchecked("valid_sender_addr"); + let sender = daemon.sender_addr(); let balance_result = bank_query_client.balance(&sender, None)?; println!("Balance of {} : {:?}", sender, balance_result); diff --git a/docs/src/chains/bitsong.md b/docs/src/chains/bitsong.md new file mode 100644 index 000000000..b6bb9a1a7 --- /dev/null +++ b/docs/src/chains/bitsong.md @@ -0,0 +1,17 @@ +# Bitsong + +BitSong is a multifunctional blockchain-based ecosystem built to empower the music industry. It unites artists, fans, distributors in an environment where music, merchandise, and fan loyalty are assets of value. BitSong’s decentralized ecosystem of services provides the global music community with a trustless marketplace for music streaming, Fan Tokens, and NFTs, powered by the BTSG token. + +[Bitsongs Website](https://bitsong.io/) + +```rust,ignore +{{#include ../../../packages/cw-orch-networks/src/networks/bitsong.rs:bitsong}} +``` + +## Usage + +See how to setup your main function in the [main function](../contracts/scripting.md#main-function) section. Update the network passed into the `Daemon` builder to be `networks::BITSONG_1`. +## References + +- [Bitsong Documentation](https://docs.bitsong.io/) +- [Bitsong Discord](https://discord.gg/M2fJKfMHAw) diff --git a/packages/cw-orch-networks/src/networks/bitsong.rs b/packages/cw-orch-networks/src/networks/bitsong.rs new file mode 100644 index 000000000..f31b12e46 --- /dev/null +++ b/packages/cw-orch-networks/src/networks/bitsong.rs @@ -0,0 +1,45 @@ +use cw_orch_core::environment::{ChainInfo, ChainKind, NetworkInfo}; + +// ANCHOR: bitsong +pub const BITSONG_NETWORK: NetworkInfo = NetworkInfo { + chain_name: "bitsong", + pub_address_prefix: "bitsong", + coin_type: 639u32, +}; + +pub const BITSONG_2B: ChainInfo = ChainInfo { + kind: ChainKind::Mainnet, + chain_id: "bitsong-2b", + gas_denom: "ubtsg", + gas_price: 0.025, + grpc_urls: &[ + "http://bitsong-grpc.polkachu.com:16090", + "http://grpc.explorebitsong.com:443", + ], + network_info: BITSONG_NETWORK, + lcd_url: None, + fcd_url: None, +}; + +// pub const BOBNET: ChainInfo = ChainInfo { +// kind: ChainKind::Testnet, +// chain_id: "bobnet", +// gas_denom: "ubtsg", +// gas_price: 0.025, +// grpc_urls: &["http://grpc-testnet.explorebitsong.com:443"], +// network_info: BITSONG_NETWORK, +// lcd_url: None, +// fcd_url: None, +// }; + +pub const LOCAL_BITSONG: ChainInfo = ChainInfo { + kind: ChainKind::Local, + chain_id: "localbitsong", + gas_denom: "ubtsg", + gas_price: 0.0026, + grpc_urls: &["tcp://localhost:9094"], + network_info: BITSONG_NETWORK, + lcd_url: None, + fcd_url: None, +}; +// ANCHOR_END: bitsong diff --git a/packages/cw-orch-networks/src/networks/mod.rs b/packages/cw-orch-networks/src/networks/mod.rs index f82ee1a7a..73eedade3 100644 --- a/packages/cw-orch-networks/src/networks/mod.rs +++ b/packages/cw-orch-networks/src/networks/mod.rs @@ -3,6 +3,7 @@ //! Contains information and helpers for different blockchain networks //! See [parse_network] to easily retrieve this static network information pub mod archway; +pub mod bitsong; pub mod cosmos; pub mod doravota; pub mod injective; @@ -22,6 +23,7 @@ pub mod xion; #[allow(deprecated)] use crate::networks::union::{UNION_TESTNET_8, UNION_TESTNET_9}; pub use archway::{ARCHWAY_1, CONSTANTINE_3}; +pub use bitsong::BITSONG_2B; pub use cosmos::COSMOS_HUB_TESTNET; pub use cw_orch_core::environment::{ChainInfo, ChainKind, NetworkInfo}; pub use doravota::{VOTA_ASH, VOTA_TESTNET}; @@ -56,34 +58,35 @@ pub fn parse_network(net_id: &str) -> Result { } pub const SUPPORTED_NETWORKS: &[ChainInfo] = &[ - UNI_6, + ARCHWAY_1, + ATLANTIC_2, + BITSONG_2B, + CONSTANTINE_3, + HARPOON_4, + INJECTIVE_888, + INJECTIVE_1, JUNO_1, LOCAL_JUNO, - PISCO_1, - PHOENIX_1, + LOCAL_LANDSLIDE, + LOCAL_MIGALOO, + LOCAL_NEUTRON, + LOCAL_OSMO, LOCAL_TERRA, - INJECTIVE_888, - CONSTANTINE_3, - ARCHWAY_1, - PION_1, + LOCAL_SEI, + MIGALOO_1, NARWHAL_1, NEUTRON_1, - INJECTIVE_1, - HARPOON_4, OSMOSIS_1, OSMO_5, - LOCAL_OSMO, - LOCAL_MIGALOO, - LOCAL_NEUTRON, - MIGALOO_1, - LOCAL_SEI, - SEI_DEVNET_3, - ATLANTIC_2, PACIFIC_1, + PISCO_1, + PHOENIX_1, + PION_1, + ROLLKIT_TESTNET, + SEI_DEVNET_3, + UNI_6, XION_TESTNET_1, XION_MAINNET_1, - ROLLKIT_TESTNET, - LOCAL_LANDSLIDE, #[allow(deprecated)] UNION_TESTNET_8, UNION_TESTNET_9,