Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/hooks/useBCH.js
Show First 20 Lines • Show All 854 Lines • ▼ Show 20 Lines | ) => { | ||||
link = `${currency.blockExplorerUrlTestnet}/tx/${txidStr}`; | link = `${currency.blockExplorerUrlTestnet}/tx/${txidStr}`; | ||||
} | } | ||||
//console.log(`link`, link); | //console.log(`link`, link); | ||||
return link; | return link; | ||||
}; | }; | ||||
const signPkMessage = async (BCH, pk, message) => { | |||||
try { | |||||
let signature = await BCH.BitcoinCash.signMessageWithPrivKey( | |||||
pk, | |||||
message, | |||||
); | |||||
return signature; | |||||
} catch (err) { | |||||
console.log(`useBCH.signPkMessage() error: `, err); | |||||
throw err; | |||||
} | |||||
}; | |||||
const sendBch = async ( | const sendBch = async ( | ||||
BCH, | BCH, | ||||
wallet, | wallet, | ||||
utxos, | utxos, | ||||
destinationAddress, | destinationAddress, | ||||
sendAmount, | sendAmount, | ||||
feeInSatsPerByte, | feeInSatsPerByte, | ||||
) => { | ) => { | ||||
▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | return { | ||||
getSlpBalancesAndUtxos, | getSlpBalancesAndUtxos, | ||||
getTxHistory, | getTxHistory, | ||||
flattenTransactions, | flattenTransactions, | ||||
parseTxData, | parseTxData, | ||||
addTokenTxData, | addTokenTxData, | ||||
parseTokenInfoForTxHistory, | parseTokenInfoForTxHistory, | ||||
getTxData, | getTxData, | ||||
getRestUrl, | getRestUrl, | ||||
signPkMessage, | |||||
sendBch, | sendBch, | ||||
sendToken, | sendToken, | ||||
createToken, | createToken, | ||||
getTokenStats, | getTokenStats, | ||||
}; | }; | ||||
} | } |