How to use the iotex-antenna/lib/crypto/crypto.publicKeyToAddress function in iotex-antenna

To help you get started, we’ve selected a few iotex-antenna examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iotexproject / iotex-explorer / src / shared / wallet / unlock-by-ledger.tsx View on Github external
.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) => {
github iotexproject / iotex-explorer / src / shared / pages / action-detail-page.tsx View on Github external
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"
github iotexproject / iotex-explorer / src / shared / action / action-detail.tsx View on Github external
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
    };
  }
github iotexproject / iotex-explorer / src / shared / pages / action-list-page.tsx View on Github external
render(_: string, record: ActionInfo, __: number): JSX.Element {
      const addr = publicKeyToAddress(String(record.action.senderPubKey));
      return (
        <span style="{{">
          
        </span>
      );
    }
  },
github iotexproject / iotex-explorer / src / shared / address-details / action-table.tsx View on Github external
render(_: string, record: ActionInfo, __: number): JSX.Element {
        const addr = publicKeyToAddress(String(record.action.senderPubKey));
        return (
          
        );
      }
    },