How to use the iotex-antenna 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 / get-antenna.ts View on Github external
export function getAntenna(): Antenna {
  const injectedWindow: Window & { antenna?: Antenna } = window;
  if (injectedWindow.antenna) {
    return injectedWindow.antenna;
  }
  const url = isElectron()
    ? "https://iotexscan.io/iotex-core-proxy"
    : "/iotex-core-proxy";
  // @ts-ignore
  injectedWindow.signerPlugin = new LedgerSigner();
  injectedWindow.antenna = new Antenna(url, {
    // @ts-ignore
    signer: injectedWindow.signerPlugin
  });
  return injectedWindow.antenna;
}
github iotexproject / iotex-explorer / src / shared / wallet / add-custom-rpc-form-modal.tsx View on Github external
import Input from "antd/lib/input";
import Modal from "antd/lib/modal";
import notification from "antd/lib/notification";

import { WrappedFormUtils } from "antd/lib/form/Form";
import Antenna from "iotex-antenna";
// @ts-ignore
import { t } from "onefx/lib/iso-i18n";
import React from "react";
import { formItemLayout } from "../common/form-item-layout";
import { rulesMap } from "../common/rules";
import { colors } from "../common/styles/style-color";
import { FormItemLabel } from "./contract/cards";
import { IRPCProvider } from "./wallet-reducer";

const antennaTest = new Antenna("");
export interface IAddCustomRPCFormModalProps {
  onOK(network: IRPCProvider): void;
  onCancel(): void;
  visible?: boolean;
  form: WrappedFormUtils;
}
class AddCustomRPCFormModalCom extends React.PureComponent<
  IAddCustomRPCFormModalProps
> {
  public state: { confirming: boolean } = {
    confirming: false
  };
  public handleOk = async () => {
    const { form, onOK } = this.props;
    if (!onOK) {
      return;
github iotexproject / iotex-explorer / src / shared / debug-resolver.tsx View on Github external
GET_ACCOUNT,
  GET_ACTIONS,
  GET_ACTIONS_BY_HASH,
  GET_ACTIONS_BY_INDEX,
  GET_BLOCK_METAS_BY_HASH,
  GET_BLOCK_METAS_BY_INDEX,
  GET_EPOCH_META,
  GET_RECEIPT_BY_ACTION,
  READ_CONTRACT,
  SEND_ACTION,
  SUGGEST_GAS_PRICE
} from "./queries";

import Antenna from "iotex-antenna";

const antenna = new Antenna("http://localhost:4004/iotex-core-proxy");

type PathParamsType = {};

type RequestProp = {
  query: object;
  variables: object;
  name: string;
};

type Props = RouteComponentProps & {};

export const action = {
  core: {
    version: 1,
    nonce: "0",
    gasLimit: "0",