MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / to_account

Function to_account

sdk/rust/src/ethereum.rs:9–15  ·  view source on GitHub ↗
(
    get_key_response: &GetKeyResponse,
)

Source from the content-addressed store, hash-verified

7use dstack_sdk_types::dstack::GetKeyResponse;
8
9pub fn to_account(
10 get_key_response: &GetKeyResponse,
11) -> Result<PrivateKeySigner, Box<dyn std::error::Error>> {
12 let key_bytes = hex::decode(&get_key_response.key)?;
13 let wallet = PrivateKeySigner::from_slice(&key_bytes)?;
14 Ok(wallet)
15}

Callers 1

test_async_to_keypairFunction · 0.50

Calls 1

decodeFunction · 0.85

Tested by 1

test_async_to_keypairFunction · 0.40