Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions cmd/crates/soroban-spec-typescript/src/boilerplate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static PROJECT_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/src/project_temp

const NETWORK_PASSPHRASE_TESTNET: &str = "Test SDF Network ; September 2015";
const NETWORK_PASSPHRASE_FUTURENET: &str = "Test SDF Future Network ; October 2022";
Comment thread
leighmcculloch marked this conversation as resolved.
const NETWORK_PASSPHRASE_STANDALONE: &str = "Standalone Network ; February 2017";
const NETWORK_PASSPHRASE_LOCAL: &str = "Standalone Network ; February 2017";

pub struct Project(PathBuf);

Expand Down Expand Up @@ -135,10 +135,24 @@ impl Project {
}
let contract_id = contract_id.unwrap();
let network_passphrase = network_passphrase.unwrap();
if network_passphrase == NETWORK_PASSPHRASE_LOCAL {
return format!(
r#"export const networks = {{
local: {{
networkPassphrase: "{network_passphrase}",
contractId: "{contract_id}",
}},
/** @deprecated Use `local` instead. */
standalone: {{
networkPassphrase: "{network_passphrase}",
contractId: "{contract_id}",
}},
}} as const"#
);
}
let network = match network_passphrase {
NETWORK_PASSPHRASE_TESTNET => "testnet",
NETWORK_PASSPHRASE_FUTURENET => "futurenet",
NETWORK_PASSPHRASE_STANDALONE => "standalone",
_ => "unknown",
};
let network_passphrase = sanitize_string(network_passphrase);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
const publicKey = root.keypair.publicKey();

const contract = new Client({
...networks.standalone,
...networks.local,
rpcUrl,
allowHttp: true,
publicKey: root.keypair.publicKey(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { rpcUrl, root, signer } from "./util.js"
import { Client, networks } from "test-custom-types"

const contract = new Client({
...networks.standalone,
...networks.local,
rpcUrl,
allowHttp: true,
publicKey: root.keypair.publicKey(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { rpcUrl, root, signer } from "./util.js"
import { Client, networks } from "xlm"

const contract = new Client({
...networks.standalone,
...networks.local,
rpcUrl,
allowHttp: true,
publicKey: root.keypair.publicKey(),
Expand Down
Loading