Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function SetAccountIdContract({contract}){
// const name = useFetch(contract.hash)
return(
<div>
{toUtf8(contract.account_id)}
<table>
<tbody>
</tbody>
</table>
{JSON.stringify(contract.cost) != "{}" && (
)}
{contract.signature_addresses && contract.signature_addresses.length > 1 && (
)}
</div>
)
}
}
if (input.amount && contractType === 'TransferContract') {
meta.push({ key: 'CONFIRMATIONS.COST', value: formatNumber(input.amount / 1000000) });
} else if (input.amount) {
meta.push({ key: 'CONFIRMATIONS.COST', value: formatNumber(input.amount) });
}
if (input.frozen_balance) {
meta.push({ key: 'CONFIRMATIONS.COST', value: formatNumber(input.frozen_balance / 1000000) });
}
if (input.asset_name) {
meta.push({
key: 'CONFIRMATIONS.TOKEN',
value: this.tokensMap[TronWeb.toUtf8(input.asset_name)].split('_')[0] + ' (' + TronWeb.toUtf8(input.asset_name) + ')'
});
}
if (input.token_id) {
meta.push({ key: 'CONFIRMATIONS.TOKEN', value: input.token_id });
}
if (input.to_address) {
const address = TronWeb.address.fromHex(input.to_address);
const trimmed = [
address.substr(0, 16),
address.substr(28)
].join('...');
meta.push({ key: 'CONFIRMATIONS.RECIPIENT', value: trimmed });
}
)}
);
case "WITNESSCREATECONTRACT":
return (
<div>
<h5>Apply for Super Representative</h5>
</div>
{TronWeb.toUtf8(contractParams.url)}
#{extra.hash}
<table>
<tbody>
</tbody>
</table>
{(extra && extra.hash &&
)}
);
case "WITNESSUPDATECONTRACT":
return (
<small>{tu("issue_a_new_asset")}</small>
{toUtf8(contract.name)}{contract.trx_num / ONE_TRX} : {contract.num}
{contract.end_time - contract.start_time > 1000 ? : "-"}
{contract.end_time - contract.start_time > 1000 ? : "-"}
{toUtf8(contract.description)}<table>
<tbody>
</tbody>
</table>
);
case "PROPOSALCREATECONTRACT":
return (
<div>
<h5>
<i></i>
{tu("proposal_create_contract")}
<small>{tu("proposal_create")}</small>
</h5>
</div>
<table></table>
);
case "ACCOUNTUPDATECONTRACT":
return (
<div>
<h5>
<i></i>
{tu("account_update_contract")}
<small>{tu("update_account_name")}</small>
</h5>
</div>
{toUtf8(contract['account_name'])}<table>
<tbody>
</tbody>
</table>
);
case "ACCOUNTCREATECONTRACT":
return (
<div>
<h5>
<i></i>
{tu("account_create_contract")}
<small>{tu("account_create")}</small>
</h5>
</div>
<table>
<tbody></tbody></table>
async getTokenExtraInfo(ID) {
let tokenID = ID;
if (typeof tokenID !== "number") {
tokenID = TronWeb.toUtf8(tokenID);
if (tokenID === "_")
return { id: 0, decimals: 6, token_name: "TRX" };
else
tokenID = parseInt(tokenID);
}
const token = await Client.getTokens({ id: tokenID });
if (token.total == 1) {
return { id: tokenID, decimals: token.tokens[0].precision, token_name: token.tokens[0].name };
}
return { id: -1, decimals: 0, token_name: "" };;
}
{toUtf8(contract.name)}{contract.trx_num / ONE_TRX} : {contract.num}
{contract.end_time - contract.start_time > 1000 ? : "-"}
{contract.end_time - contract.start_time > 1000 ? : "-"}
{toUtf8(contract.description)}<table>
<tbody>
</tbody>
</table>
);
case "PROPOSALCREATECONTRACT":
return (
<div>
<h5>
<i></i>
{tu("proposal_create_contract")}
<small>{tu("proposal_create")}</small>
</h5>
</div>
<table>
<tbody></tbody></table>
Text() {
return tronWeb.toUtf8(string);
},
Number() {
);
case "EXCHANGECREATECONTRACT":
return (
<div>
<h5>Exchange Create</h5>
</div>
{extra.token1}[{TronWeb.toUtf8(contractParams.first_token_id)}]<
=>{extra.token2}[{TronWeb.toUtf8(contractParams.second_token_id)}]
:
#{extra.hash}
<table>
<tbody>
</tbody></table>
{(extra && extra.hash &&
)}