How to use the arc.checkMetaMaskAndWarn function in arc

To help you get started, we’ve selected a few arc 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 daostack / alchemy / src / components / CreateProposal / SchemeForms / CreateUnknownGenericSchemeProposal.tsx View on Github external
public async handleSubmit(values: FormValues, { setSubmitting }: any ) {
    if (!(await checkMetaMaskAndWarn(this.props.showNotification))) { return; }
    const proposalValues = {...values,
      scheme: this.props.scheme.address,
      dao: this.props.daoAvatarAddress
    };

    setSubmitting(false);
    await this.props.createProposal(proposalValues);

    Analytics.track("Submit Proposal", {
      "DAO Address": this.props.daoAvatarAddress,
      "Proposal Title": values.title,
      "Scheme Address": this.props.scheme.address,
      "Scheme Name": this.props.scheme.name
    });

    this.props.handleClose();
github daostack / alchemy / src / components / Proposal / ActionButton.tsx View on Github external
public async handleClickExecute(actionType: string) {
    if (!(await checkMetaMaskAndWarn(this.props.showNotification.bind(this)))) { return; }
    const { dao, parentPage, proposalState } = this.props;
    await this.props.executeProposal(dao.address, proposalState.id, this.props.currentAccountAddress);

    Analytics.track("Transition Proposal", {
      "DAO Address": dao.address,
      "DAO Name": dao.name,
      "Origin": parentPage,
      "Proposal Hash": proposalState.id,
      "Proposal Title": proposalState.title,
      "Scheme Address": proposalState.scheme.address,
      "Scheme Name": proposalState.scheme.name,
      "Type": actionType
     });
  }