Skip to content

Commit

Permalink
Permissionlessweb/main (#536)
Browse files Browse the repository at this point in the history
* add bitsong

* bitsong endpoint, docs

* typo fix

* update coin_type

* dev: bump bitsong network

* Bitsong works

---------

Co-authored-by: hard-nett <hardnettt@proton.me>
Co-authored-by: Hard-Nett <123711748+hard-nett@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 27, 2025
1 parent ee9b695 commit 9ad311b
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 20 deletions.
6 changes: 4 additions & 2 deletions cw-orch/examples/queries/bank_query.rs
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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);

Expand Down
17 changes: 17 additions & 0 deletions docs/src/chains/bitsong.md
Original file line number Diff line number Diff line change
@@ -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)
45 changes: 45 additions & 0 deletions packages/cw-orch-networks/src/networks/bitsong.rs
Original file line number Diff line number Diff line change
@@ -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
39 changes: 21 additions & 18 deletions packages/cw-orch-networks/src/networks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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};
Expand Down Expand Up @@ -56,34 +58,35 @@ pub fn parse_network(net_id: &str) -> Result<ChainInfo, String> {
}

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,
Expand Down

0 comments on commit 9ad311b

Please sign in to comment.