-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local key format ? #53
Comments
Figured it out actually function sui_key_to_gas_station(sui_priv_key) {
const { schema, secretKey } = decodeSuiPrivateKey(sui_priv_key)
const flag =
schema === 'ED25519' ? 0x00 : schema === 'Secp256k1' ? 0x01 : 0x02
return toBase64(Uint8Array.from([flag, ...secretKey]))
} |
Thanks for asking! I will add this to the docs too. |
thank you import { decodeSuiPrivateKey } from "@mysten/sui/cryptography"
import { toBase64 } from "@mysten/sui/utils"
const sui_key_to_gas_station = (sui_priv_key: string) => {
const { schema, secretKey } = decodeSuiPrivateKey(sui_priv_key)
const flag =
schema === 'ED25519' ? 0x00 : schema === 'Secp256k1' ? 0x01 : 0x02
return toBase64(Uint8Array.from([flag, ...secretKey]))
}
const gas_station_key = sui_key_to_gas_station('your private key')
console.log(gas_station_key) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've been trying to run the tool but can't find what format is expected in the
signer-config.local
settings 🤔The text was updated successfully, but these errors were encountered: