Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function createTransaction(wallet, account) {
const ADDRESS_TO_SEND = 'n2jdejywRogCunR2ozZAfXp1jMnfGpGXGR'
const bitcoinLikeAccount = account.asBitcoinLikeAccount()
const walletCurrency = wallet.getCurrency()
const amount = createAmount(walletCurrency, 10000)
console.log(`--------------------------------`)
console.log(amount.toLong())
console.log(`-----------------after `)
const fees = createAmount(walletCurrency, 1000)
const transactionBuilder = bitcoinLikeAccount.buildTransaction()
transactionBuilder.sendToAddress(amount, ADDRESS_TO_SEND)
// TODO: don't use hardcoded value for sequence (and first also maybe)
transactionBuilder.pickInputs(0, 0xffffff)
transactionBuilder.setFeesPerByte(fees)
return transactionBuilder.build()
}
async function createTransaction(wallet, account) {
const ADDRESS_TO_SEND = 'n2jdejywRogCunR2ozZAfXp1jMnfGpGXGR'
const bitcoinLikeAccount = account.asBitcoinLikeAccount()
const walletCurrency = wallet.getCurrency()
const amount = createAmount(walletCurrency, 10000)
console.log(`--------------------------------`)
console.log(amount.toLong())
console.log(`-----------------after `)
const fees = createAmount(walletCurrency, 1000)
const transactionBuilder = bitcoinLikeAccount.buildTransaction()
transactionBuilder.sendToAddress(amount, ADDRESS_TO_SEND)
// TODO: don't use hardcoded value for sequence (and first also maybe)
transactionBuilder.pickInputs(0, 0xffffff)
transactionBuilder.setFeesPerByte(fees)
return transactionBuilder.build()
}