Saturday, November 16, 2024

Cross Java code to Python


I’ve a Java code that I have to go to python however I do not know which libraries to make use of and how one can begin and for those who may help me it is rather grateful

MNEMONIC = “twenty 4 phrase mnemonic right here”
ACCOUNT_KEY = “”
WALLET_PRIVATE_KEY = “”

// We’ll generate 3 parameters right here
// 1. hashedSecret
// 2. encryptedSecret
// 3. hashedPublicKey

const epochTimeNow = Date.now().toString()

const secret = getDeterministicTradeSecret(MNEMONIC, epochTimeNow) // This perform in outlined under
const hashedSecret = hash160(secret)

const encryptedSecret = encryptTradeSecret(
secret,
ACCOUNT_KEY,
undefined
)

const publicKey = privateKeyToPublic(privateKey)
const hashedPublicKey = hash160(publicKey)

const btc_trade_secrets = {
encrypted_secret: encryptedSecret,
hashed_secret: hashedSecret,
hashed_public_key: hashedPublicKey,
}

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles