-
Notifications
You must be signed in to change notification settings - Fork 57
Issues: bnb-chain/greenfield-whitepaper
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
Author
Label
Projects
Milestones
Assignee
Sort
Issues list
const client = new BncClient("https://testnet-dex.binance.org")
const privateKey = crypto.getPrivateKeyFromMnemonic(mnemonic)
client.setPrivateKey(privateKey)
const from = "tbnb1hgm0p7khfk85zpz5v0j8wnej3a90w709zzlffd"// sender address
const recipient = "tbnb1prrujx8kkukrcrppklggadhuvegfnx8pemsq77"// recipient address
const randomNumber = "e8eae926261ab77d018202434791a335249b470246a7b02e28c3b2fb6ffad8f3"// 32 bytes random number
const timestamp = Math.floor(Date.now()/1000)// take the current timestamp
const randomNumberHash = calculateRandomNumberHash(randomNumber, timestamp)
const amount = [{
denom: "BNB",
amount: 100
}]
const expectedIncome = "100:BNB"// expected income
const heightSpan = 400// height span
const res = client.swap.HTLT(from, recipient, "", "", randomNumberHash, timestamp, amount, expectedIncome, heightSpan, false)
#27
opened Jan 20, 2024 by
Mooodyds
ProTip!
Type g i on any issue or pull request to go back to the issue listing page.