Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public handleInputChange = (e: React.FormEvent) => {
const name: string = get(e, "target.name");
const value = get(e, "target.value");
// @ts-ignore
this.setState({
[name]: value
});
};
const DataSourceContainer = ({
userDevices: { err, data = [] },
user,
timestamp,
handleUserChange,
handleDeviceChange,
handleTimestampStartChange,
handleTimestampEndChange,
}) => {
const users = data.map((entry) => entry.user);
const devices = dottie.get(data.find((entry) => entry.user === user), 'devices', []);
return (
<div>
{err && (
)}
</div>
function processDependencies (dir, shrinkwrapFile, shrinkwrapPath) {
let shrinkwrapContent = require(shrinkwrapFile);
let dependenciesPath = _.compact(_.flatten([shrinkwrapPath].concat('dependencies')));
let dependencies = dottie.get(shrinkwrapContent, dependenciesPath);
let depNames = Object.keys(dependencies || {});
return Bluebird.mapSeries(depNames, function (depName) {
let depDir = dir + '/node_modules/' + depName;
let depShrinkwrapPath = dependenciesPath.concat(depName);
return processDependency(depDir, shrinkwrapFile, depShrinkwrapPath, depName);
});
}
export function getAddress(record: ActionInfo): string {
const addr: string =
get(record, "action.core.transfer.recipient") ||
get(record, "action.core.execution.contract") ||
get(record, "action.core.createDeposit.recipient") ||
get(record, "action.core.settleDeposit.recipient") ||
get(record, "action.core.plumCreateDeposit.recipient") ||
get(record, "action.core.plumTransfer.recipient") ||
get(record, "action.core.createPlumChain.contract") ||
"";
if (!addr) {
return "-";
}
return addr;
}
render(_: string, record: ActionInfo, __: number): string {
const amount: string =
get(record, "action.core.execution.amount") ||
get(record, "action.core.grantReward.amount") ||
get(record, "action.core.transfer.amount") ||
get(record, "action.core.createDeposit.amount") ||
get(record, "action.core.settleDeposit.amount") ||
get(record, "action.core.createPlumChain.amount") ||
get(record, "action.core.plumCreateDeposit.amount") ||
"";
if (!amount) {
return "-";
}
return `${fromRau(amount, "IOTX")} IOTX`;
}
},
const dataSource = fields.map(field => ({
key: field,
value: get(blockMeta, field),
url
}));
render() {
const {isLoading, params, user} = this.props;
const {data} = this.state;
const details = dottie.get(data, 'details', {});
return (
<div>
{isLoading && }
<header>
{data.failure && data.failure === 'failure_incorrect_link_password' && (
)}
</header></div>
export function getAddress(record: ActionInfo): string {
const addr: string =
get(record, "action.core.transfer.recipient") ||
get(record, "action.core.execution.contract") ||
get(record, "action.core.createDeposit.recipient") ||
get(record, "action.core.settleDeposit.recipient") ||
get(record, "action.core.plumCreateDeposit.recipient") ||
get(record, "action.core.plumTransfer.recipient") ||
get(record, "action.core.createPlumChain.contract") ||
"";
if (!addr) {
return "-";
}
return addr;
}
{({
data,
loading,
error
}: QueryResult<{ chainMetaData: GetChainMetaResponse }>) => {
if (error) {
notification.error({
message: `failed to query chain meta in ActionListPage: ${error}`
});
}
if (!data || loading) {
return null;
}
const numActions = parseInt(
get(data, "chainMeta.numActions"),
10
);
return ;
}}
const parseAddressDetails = (data: { getAccount: GetAccountResponse }) => {
const {
address = "",
balance = "0",
nonce = 0,
pendingNonce = 0,
numActions = 0
} = get(data || {}, "getAccount.accountMeta") || {};
return {
balance: {
address,
balance
},
nametag: address,
nonce,
pendingNonce,
numActions: Number(numActions).toLocaleString()
};
};