generateTpSlSalt
Generate a random uint256 salt (as a decimal string) for replay protection. Every conditional-order and delete message carries a fresh salt; buildConditionalOrderMessage and buildTpSlDeleteMessage call this automatically unless you pass an explicit salt (e.g. to sign deterministically in tests).
Draws 32 random bytes from crypto.getRandomValues and folds them into a big integer.
import { generateTpSlSalt } from "@symmio/trading-core";
const salt = generateTpSlSalt();
// "8471293…" (decimal string)Parameters
None.
Returns
stringA random
uint256 as a decimal string.Related
buildConditionalOrderMessage— accepts an optionalsaltoverride.buildTpSlDeleteMessage— same.
Last updated on