Skip to content

Commit 170a303

Browse files
committed
Rename ASSET_HUB_RPC to POLKADOT_TESTNET_RPC in all code snippets
1 parent 659dba6 commit 170a303

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

.snippets/code/chain-interactions/query-data/runtime-api-calls/dedot/runtime-apis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { DedotClient, WsProvider } from 'dedot';
22
import type { PolkadotAssetHubApi } from '@dedot/chaintypes';
33

4-
const ASSET_HUB_RPC = 'INSERT_WS_ENDPOINT';
4+
const POLKADOT_TESTNET_RPC = 'INSERT_WS_ENDPOINT';
55

66
// Example address to query
77
const ADDRESS = 'INSERT_ADDRESS';
88

99
async function main() {
1010
// Initialize provider and client with Polkadot TestNet types
11-
const provider = new WsProvider(ASSET_HUB_RPC);
11+
const provider = new WsProvider(POLKADOT_TESTNET_RPC);
1212
const client = await DedotClient.new<PolkadotAssetHubApi>(provider);
1313

1414
console.log('Connected to Polkadot Hub TestNet');

.snippets/code/chain-interactions/query-data/runtime-api-calls/papi/runtime-apis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { getWsProvider } from 'polkadot-api/ws-provider/node';
33
import { withPolkadotSdkCompat } from 'polkadot-api/polkadot-sdk-compat';
44
import { polkadotTestNet } from '@polkadot-api/descriptors';
55

6-
const ASSET_HUB_RPC = 'INSERT_WS_ENDPOINT';
6+
const POLKADOT_TESTNET_RPC = 'INSERT_WS_ENDPOINT';
77

88
// Example address to query
99
const ADDRESS = 'INSERT_ADDRESS';
1010

1111
async function main() {
1212
// Create the client connection
1313
const client = createClient(
14-
withPolkadotSdkCompat(getWsProvider(ASSET_HUB_RPC))
14+
withPolkadotSdkCompat(getWsProvider(POLKADOT_TESTNET_RPC))
1515
);
1616

1717
// Get the typed API for Polkadot Hub TestNet (Paseo Asset Hub)

.snippets/code/chain-interactions/query-data/runtime-api-calls/pjs/runtime-apis.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { ApiPromise, WsProvider } from '@polkadot/api';
22

3-
const ASSET_HUB_RPC = 'INSERT_WS_ENDPOINT';
3+
const POLKADOT_TESTNET_RPC = 'INSERT_WS_ENDPOINT';
44

55
// Example address to query
66
const ADDRESS = 'INSERT_ADDRESS';
77

88
async function main() {
99
// Create a WebSocket provider
10-
const wsProvider = new WsProvider(ASSET_HUB_RPC);
10+
const wsProvider = new WsProvider(POLKADOT_TESTNET_RPC);
1111

1212
// Initialize the API
1313
const api = await ApiPromise.create({ provider: wsProvider });

.snippets/code/chain-interactions/query-data/runtime-api-calls/psi/runtime_apis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from substrateinterface import SubstrateInterface
22

3-
ASSET_HUB_RPC = "INSERT_WS_ENDPOINT"
3+
POLKADOT_TESTNET_RPC = "INSERT_WS_ENDPOINT"
44

55
# Example address to query
66
ADDRESS = "INSERT_ADDRESS"
77

88

99
def main():
1010
# Connect to Polkadot Hub TestNet
11-
substrate = SubstrateInterface(url=ASSET_HUB_RPC)
11+
substrate = SubstrateInterface(url=POLKADOT_TESTNET_RPC)
1212

1313
print("Connected to Polkadot Hub TestNet")
1414
print(f"Querying runtime APIs for: {ADDRESS}\n")

.snippets/code/chain-interactions/query-data/runtime-api-calls/subxt/src/bin/runtime_apis.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ use subxt::{OnlineClient, PolkadotConfig};
77
#[subxt::subxt(runtime_metadata_path = "asset_hub_metadata.scale")]
88
pub mod asset_hub {}
99

10-
const ASSET_HUB_RPC: &str = "INSERT_WS_ENDPOINT";
10+
const POLKADOT_TESTNET_RPC: &str = "INSERT_WS_ENDPOINT";
1111

1212
// Example address to query
1313
const ADDRESS: &str = "INSERT_ADDRESS";
1414

1515
#[tokio::main(flavor = "current_thread")]
1616
async fn main() -> Result<(), Box<dyn std::error::Error>> {
1717
// Initialize the Subxt client
18-
let api = OnlineClient::<PolkadotConfig>::from_url(ASSET_HUB_RPC).await?;
18+
let api = OnlineClient::<PolkadotConfig>::from_url(POLKADOT_TESTNET_RPC).await?;
1919

2020
println!("Connected to Polkadot Hub TestNet");
2121
println!("Querying runtime APIs for: {}\n", ADDRESS);

0 commit comments

Comments
 (0)