Skip to content

Commit 9ad311b

Browse files
Kayanskihard-netthard-nett
authored
Permissionlessweb/main (#536)
* add bitsong * bitsong endpoint, docs * typo fix * update coin_type * dev: bump bitsong network * Bitsong works --------- Co-authored-by: hard-nett <[email protected]> Co-authored-by: Hard-Nett <[email protected]>
1 parent ee9b695 commit 9ad311b

File tree

4 files changed

+87
-20
lines changed

4 files changed

+87
-20
lines changed

cw-orch/examples/queries/bank_query.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
use anyhow::Result as AnyResult;
2-
use cosmwasm_std::Addr;
32
use cw_orch::daemon::Daemon;
43
use cw_orch::prelude::BankQuerier;
54
use cw_orch::prelude::QuerierGetter;
5+
use cw_orch::prelude::TxHandler;
66
use cw_orch_daemon::queriers::Bank;
77
pub fn main() {
8+
dotenv::dotenv().unwrap();
9+
env_logger::init();
810
// We can now create a daemon. This daemon will be used to interact with the chain.
911
let daemon = Daemon::builder(cw_orch::daemon::networks::LOCAL_JUNO) // chain parameter
1012
.build()
@@ -17,7 +19,7 @@ pub fn test_queries(daemon: &Daemon) -> AnyResult<()> {
1719
// ANCHOR: daemon_balance_query
1820
let bank_query_client: Bank = daemon.querier();
1921

20-
let sender = Addr::unchecked("valid_sender_addr");
22+
let sender = daemon.sender_addr();
2123
let balance_result = bank_query_client.balance(&sender, None)?;
2224
println!("Balance of {} : {:?}", sender, balance_result);
2325

docs/src/chains/bitsong.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Bitsong
2+
3+
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.
4+
5+
[Bitsongs Website](https://bitsong.io/)
6+
7+
```rust,ignore
8+
{{#include ../../../packages/cw-orch-networks/src/networks/bitsong.rs:bitsong}}
9+
```
10+
11+
## Usage
12+
13+
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`.
14+
## References
15+
16+
- [Bitsong Documentation](https://docs.bitsong.io/)
17+
- [Bitsong Discord](https://discord.gg/M2fJKfMHAw)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
use cw_orch_core::environment::{ChainInfo, ChainKind, NetworkInfo};
2+
3+
// ANCHOR: bitsong
4+
pub const BITSONG_NETWORK: NetworkInfo = NetworkInfo {
5+
chain_name: "bitsong",
6+
pub_address_prefix: "bitsong",
7+
coin_type: 639u32,
8+
};
9+
10+
pub const BITSONG_2B: ChainInfo = ChainInfo {
11+
kind: ChainKind::Mainnet,
12+
chain_id: "bitsong-2b",
13+
gas_denom: "ubtsg",
14+
gas_price: 0.025,
15+
grpc_urls: &[
16+
"http://bitsong-grpc.polkachu.com:16090",
17+
"http://grpc.explorebitsong.com:443",
18+
],
19+
network_info: BITSONG_NETWORK,
20+
lcd_url: None,
21+
fcd_url: None,
22+
};
23+
24+
// pub const BOBNET: ChainInfo = ChainInfo {
25+
// kind: ChainKind::Testnet,
26+
// chain_id: "bobnet",
27+
// gas_denom: "ubtsg",
28+
// gas_price: 0.025,
29+
// grpc_urls: &["http://grpc-testnet.explorebitsong.com:443"],
30+
// network_info: BITSONG_NETWORK,
31+
// lcd_url: None,
32+
// fcd_url: None,
33+
// };
34+
35+
pub const LOCAL_BITSONG: ChainInfo = ChainInfo {
36+
kind: ChainKind::Local,
37+
chain_id: "localbitsong",
38+
gas_denom: "ubtsg",
39+
gas_price: 0.0026,
40+
grpc_urls: &["tcp://localhost:9094"],
41+
network_info: BITSONG_NETWORK,
42+
lcd_url: None,
43+
fcd_url: None,
44+
};
45+
// ANCHOR_END: bitsong

packages/cw-orch-networks/src/networks/mod.rs

+21-18
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! Contains information and helpers for different blockchain networks
44
//! See [parse_network] to easily retrieve this static network information
55
pub mod archway;
6+
pub mod bitsong;
67
pub mod cosmos;
78
pub mod doravota;
89
pub mod injective;
@@ -22,6 +23,7 @@ pub mod xion;
2223
#[allow(deprecated)]
2324
use crate::networks::union::{UNION_TESTNET_8, UNION_TESTNET_9};
2425
pub use archway::{ARCHWAY_1, CONSTANTINE_3};
26+
pub use bitsong::BITSONG_2B;
2527
pub use cosmos::COSMOS_HUB_TESTNET;
2628
pub use cw_orch_core::environment::{ChainInfo, ChainKind, NetworkInfo};
2729
pub use doravota::{VOTA_ASH, VOTA_TESTNET};
@@ -56,34 +58,35 @@ pub fn parse_network(net_id: &str) -> Result<ChainInfo, String> {
5658
}
5759

5860
pub const SUPPORTED_NETWORKS: &[ChainInfo] = &[
59-
UNI_6,
61+
ARCHWAY_1,
62+
ATLANTIC_2,
63+
BITSONG_2B,
64+
CONSTANTINE_3,
65+
HARPOON_4,
66+
INJECTIVE_888,
67+
INJECTIVE_1,
6068
JUNO_1,
6169
LOCAL_JUNO,
62-
PISCO_1,
63-
PHOENIX_1,
70+
LOCAL_LANDSLIDE,
71+
LOCAL_MIGALOO,
72+
LOCAL_NEUTRON,
73+
LOCAL_OSMO,
6474
LOCAL_TERRA,
65-
INJECTIVE_888,
66-
CONSTANTINE_3,
67-
ARCHWAY_1,
68-
PION_1,
75+
LOCAL_SEI,
76+
MIGALOO_1,
6977
NARWHAL_1,
7078
NEUTRON_1,
71-
INJECTIVE_1,
72-
HARPOON_4,
7379
OSMOSIS_1,
7480
OSMO_5,
75-
LOCAL_OSMO,
76-
LOCAL_MIGALOO,
77-
LOCAL_NEUTRON,
78-
MIGALOO_1,
79-
LOCAL_SEI,
80-
SEI_DEVNET_3,
81-
ATLANTIC_2,
8281
PACIFIC_1,
82+
PISCO_1,
83+
PHOENIX_1,
84+
PION_1,
85+
ROLLKIT_TESTNET,
86+
SEI_DEVNET_3,
87+
UNI_6,
8388
XION_TESTNET_1,
8489
XION_MAINNET_1,
85-
ROLLKIT_TESTNET,
86-
LOCAL_LANDSLIDE,
8790
#[allow(deprecated)]
8891
UNION_TESTNET_8,
8992
UNION_TESTNET_9,

0 commit comments

Comments
 (0)