MCPcopy Create free account
hub / github.com/B3Pay/B3Wallet / initIdentity

Function initIdentity

scripts/utils.ts:34–44  ·  view source on GitHub ↗
(mainnet: boolean)

Source from the content-addressed store, hash-verified

32}
33
34export const initIdentity = (mainnet: boolean) => {
35 const userHomeDir = os.homedir()
36 const file = path.join(
37 userHomeDir,
38 `.config/dfx/identity/${mainnet ? "default" : "default"}/identity.pem`
39 )
40 const buffer = readFileSync(file)
41 const key = buffer.toString("utf-8")
42
43 return decode(key)
44}
45
46export const loadImageFile = <T extends boolean>(
47 imagePath: string,

Callers 1

updateAgentFunction · 0.90

Calls 1

decodeFunction · 0.85

Tested by

no test coverage detected