How to use the @0xcert/scaffold.ConnectorIssue.SIGNATURE_FAILED function in @0xcert/scaffold

To help you get started, we’ve selected a few @0xcert/scaffold 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 0xcert / framework / packages / 0xcert-web3-context / src / core / context.ts View on Github external
protected async signData(data: string) {
    try {
      switch (this.signMethod) {
        case SignMethod.ETH_SIGN:
          return await this.web3.eth.sign(data, this.myId);
        case SignMethod.TREZOR:
          return '';
        case SignMethod.EIP712:
          return await this.web3.eth.sign(data, this.myId);
        default:
          return null;
      }
    }
    catch (error) {
      throw new ConnectorError(ConnectorIssue.SIGNATURE_FAILED, error);
    }
  }
github 0xcert / framework / packages / 0xcert-web3-utils / src / core / signatures.ts View on Github external
export async function createSignature(data: string, config: Connector) {
  try {
    switch (config.method) {
      case SignatureMethod.ETH_SIGN:
        return await this.config.web3.eth.sign(data, config.makerId);
      case SignatureMethod.TREZOR:
        return null;
      case SignatureMethod.EIP712:
        return null;
      default:
        throw new ConnectorError(ConnectorIssue.SIGNATURE_FAILED, `Unknown signature ${config.method}`);
    }
  } catch(error) {
    throw parseError(error);
  }
}