(mainnet: boolean)
| 32 | } |
| 33 | |
| 34 | export 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 | |
| 46 | export const loadImageFile = <T extends boolean>( |
| 47 | imagePath: string, |