Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(async transport => {
transport.setDebugMode(true);
const app = new IoTeXApp(transport);
const result = await app.publicKey([44, 304, 0, 0, 0]);
await transport.close();
const address = publicKeyToAddress(
result.publicKey.toString("hex")
);
const account = { address: address };
getAntenna();
window.signerPlugin.address = address;
window.signerPlugin.publicKey = result.publicKey;
// @ts-ignore
dispatch(setAccount(account));
})
.catch((e: Error) => {
const parseActionDetails = (data: IActionsDetails) => {
// destruct receipt info
const { blkHeight, gasConsumed, status, logs, contractAddress }: Dict =
get(data, "receipt.receiptInfo.receipt") || {};
// destruct action core info
const { gasLimit, gasPrice, grantReward, execution, nonce, transfer }: Dict =
get(data, "action.actionInfo.0.action.core") || {};
const { timestamp, actHash }: Dict = get(data, "action.actionInfo.0") || {};
const { senderPubKey }: Dict = get(data, "action.actionInfo.0.action") || {};
const from = (senderPubKey && publicKeyToAddress(senderPubKey)) || undefined;
return {
status,
blkHeight,
timestamp,
from,
...(execution ? { to: { execution, contractAddress } } : {}),
...(transfer ? { to: { transfer } } : {}),
...(grantReward ? { actionType: t("render.value.grantReward") } : {}),
...(execution ? { evmTransfer: actHash, value: execution.amount } : {}),
...(transfer ? { value: transfer.amount } : {}),
fee: `${fromRau(`${gasConsumed * Number(gasPrice)}`, "Iotx")} IOTX`,
gasLimit: Number(gasLimit).toLocaleString(),
gasPrice: `${Number(gasPrice).toLocaleString()} (${fromRau(
gasPrice,
"Qev"
contract: object.contract,
method: "claimAs",
owner: `${info.data.owner}`,
ownerETH: `${toETHAddress(info.data.owner)}`,
data: object.data
};
}
} catch (e) {
window.console.error(`failed to parse XRC20 token: ${e}`);
}
}
const actionUnion = {
blkHash,
timestamp,
sender: action ? publicKeyToAddress(String(action.senderPubKey)) : "",
gasPrice: `${get(action, "core.gasPrice")} Rau` || "",
gasLimit: `${get(action, "core.gasLimit")}` || "",
actionType: getActionType(actionInfo as ActionInfo),
nonce: get(action, "core.nonce") || 0,
...object
};
const dataSource = buildKeyValueArray(actionUnion);
this.setState({ action, dataSource, actHash });
return {
action,
dataSource
};
}
render(_: string, record: ActionInfo, __: number): JSX.Element {
const addr = publicKeyToAddress(String(record.action.senderPubKey));
return (
<span style="{{">
</span>
);
}
},
render(_: string, record: ActionInfo, __: number): JSX.Element {
const addr = publicKeyToAddress(String(record.action.senderPubKey));
return (
);
}
},