MCPcopy Create free account
hub / github.com/clockwork-xyz/examples / get_client

Function get_client

subscriptions/client/src/utils.rs:102–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100}
101
102pub fn get_client() -> Client {
103 let client_private_str = &*std::env::var("CLIENT_PRIVATE").unwrap();
104 let client_private = &serde_json::from_str(client_private_str).unwrap();
105 let mut key = vec![];
106 if let Value::Array(arr) = client_private {
107 for val in arr {
108 if let Value::Number(value) = val {
109 let a = value.as_u64().unwrap() as u8;
110 key.push(a);
111 }
112 }
113 }
114
115 let keypair = Keypair::from_bytes(&key).unwrap();
116 let client = Client::new(keypair, "https://api.devnet.solana.com".into());
117 return client;
118}
119
120pub fn print_config(
121 subscription: Pubkey,

Callers 1

get_env_varsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected