How to use the @0xcert/ethereum-generic-provider.SignMethod.PERSONAL_SIGN function in @0xcert/ethereum-generic-provider

To help you get started, we’ve selected a few @0xcert/ethereum-generic-provider 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-ethereum-gateway / src / core / gateway.ts View on Github external
public async claim(order: Order): Promise {
    if (order.kind === OrderKind.ACTIONS_ORDER) {
      order = normalizeActionsOrderIds(order, this._provider);
      if (this._provider.signMethod == SignMethod.PERSONAL_SIGN) {
        return actionsOrderClaimPersonalSign(this, order);
      } else {
        return actionsOrderClaimEthSign(this, order);
      }
    } else if (order.kind === OrderKind.ASSET_LEDGER_DEPLOY_ORDER) {
      order = normalizeAssetLedgerDeployOrderIds(order, this._provider);
      if (this._provider.signMethod == SignMethod.PERSONAL_SIGN) {
        return assetLedgerDeployOrderClaimPersonalSign(this, order);
      } else {
        return assetLedgerDeployOrderClaimEthSign(this, order);
      }
    } else if (order.kind === OrderKind.VALUE_LEDGER_DEPLOY_ORDER) {
      order = normalizeValueLedgerDeployOrderIds(order, this._provider);
      if (this._provider.signMethod == SignMethod.PERSONAL_SIGN) {
        return valueLedgerDeployOrderClaimPersonalSign(this, order);
      } else {
        return valueLedgerDeployOrderClaimEthSign(this, order);
      }
    } else {
      throw new Error('Not implemented');
    }
  }
github 0xcert / framework / packages / 0xcert-ethereum-deploy-gateway / src / core / gateway.ts View on Github external
public async claim(deploy: Deploy): Promise {
    deploy = normalizeDeployIds(deploy, this._provider);

    if (this._provider.signMethod == SignMethod.PERSONAL_SIGN) {
      return claimPersonalSign(this, deploy);
    } else {
      return claimEthSign(this, deploy);
    }
  }
github 0xcert / framework / packages / 0xcert-ethereum-metamask-provider / src / core / provider.ts View on Github external
public constructor(options?: MetamaskProviderOptions) {
    super({
      ...options,
      signMethod: SignMethod.PERSONAL_SIGN,
    });

    if (this.isSupported()) {
      this.installClient();
      this.installEvents();
    }
  }