How to use the @walletconnect/utils.convertHexToNumber function in @walletconnect/utils

To help you get started, we’ve selected a few @walletconnect/utils 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 WalletConnect / walletconnect-test-wallet / src / components / DisplayRequest.tsx View on Github external
let params = [{ label: "Method", value: displayRequest.method }];

    switch (displayRequest.method) {
      case "eth_sendTransaction":
      case "eth_signTransaction":
        params = [
          ...params,
          { label: "From", value: displayRequest.params[0].from },
          { label: "To", value: displayRequest.params[0].to },
          {
            label: "Gas Limit",
            value: displayRequest.params[0].gas
              ? convertHexToNumber(displayRequest.params[0].gas)
              : displayRequest.params[0].gasLimit
              ? convertHexToNumber(displayRequest.params[0].gasLimit)
              : ""
          },
          {
            label: "Gas Price",
            value: convertHexToNumber(displayRequest.params[0].gasPrice)
          },
          {
            label: "Nonce",
            value: convertHexToNumber(displayRequest.params[0].nonce)
          },
          {
            label: "Value",
            value: convertHexToNumber(displayRequest.params[0].value)
          },
          { label: "Data", value: displayRequest.params[0].data }
        ];
github WalletConnect / walletconnect-test-wallet / src / components / DisplayRequest.tsx View on Github external
rejectRequest
    } = this.props;

    let params = [{ label: "Method", value: displayRequest.method }];

    switch (displayRequest.method) {
      case "eth_sendTransaction":
      case "eth_signTransaction":
        params = [
          ...params,
          { label: "From", value: displayRequest.params[0].from },
          { label: "To", value: displayRequest.params[0].to },
          {
            label: "Gas Limit",
            value: displayRequest.params[0].gas
              ? convertHexToNumber(displayRequest.params[0].gas)
              : displayRequest.params[0].gasLimit
              ? convertHexToNumber(displayRequest.params[0].gasLimit)
              : ""
          },
          {
            label: "Gas Price",
            value: convertHexToNumber(displayRequest.params[0].gasPrice)
          },
          {
            label: "Nonce",
            value: convertHexToNumber(displayRequest.params[0].nonce)
          },
          {
            label: "Value",
            value: convertHexToNumber(displayRequest.params[0].value)
          },
github WalletConnect / walletconnect-test-wallet / src / components / DisplayRequest.tsx View on Github external
? convertHexToNumber(displayRequest.params[0].gas)
              : displayRequest.params[0].gasLimit
              ? convertHexToNumber(displayRequest.params[0].gasLimit)
              : ""
          },
          {
            label: "Gas Price",
            value: convertHexToNumber(displayRequest.params[0].gasPrice)
          },
          {
            label: "Nonce",
            value: convertHexToNumber(displayRequest.params[0].nonce)
          },
          {
            label: "Value",
            value: convertHexToNumber(displayRequest.params[0].value)
          },
          { label: "Data", value: displayRequest.params[0].data }
        ];
        break;

      case "eth_sign":
        params = [
          ...params,
          { label: "Address", value: displayRequest.params[0] },
          { label: "Message", value: displayRequest.params[1] }
        ];
        break;
      case "personal_sign":
        params = [
          ...params,
          { label: "Address", value: displayRequest.params[1] },
github WalletConnect / walletconnect-test-wallet / src / components / DisplayRequest.tsx View on Github external
{ label: "To", value: displayRequest.params[0].to },
          {
            label: "Gas Limit",
            value: displayRequest.params[0].gas
              ? convertHexToNumber(displayRequest.params[0].gas)
              : displayRequest.params[0].gasLimit
              ? convertHexToNumber(displayRequest.params[0].gasLimit)
              : ""
          },
          {
            label: "Gas Price",
            value: convertHexToNumber(displayRequest.params[0].gasPrice)
          },
          {
            label: "Nonce",
            value: convertHexToNumber(displayRequest.params[0].nonce)
          },
          {
            label: "Value",
            value: convertHexToNumber(displayRequest.params[0].value)
          },
          { label: "Data", value: displayRequest.params[0].data }
        ];
        break;

      case "eth_sign":
        params = [
          ...params,
          { label: "Address", value: displayRequest.params[0] },
          { label: "Message", value: displayRequest.params[1] }
        ];
        break;
github WalletConnect / walletconnect-test-wallet / src / components / DisplayRequest.tsx View on Github external
case "eth_signTransaction":
        params = [
          ...params,
          { label: "From", value: displayRequest.params[0].from },
          { label: "To", value: displayRequest.params[0].to },
          {
            label: "Gas Limit",
            value: displayRequest.params[0].gas
              ? convertHexToNumber(displayRequest.params[0].gas)
              : displayRequest.params[0].gasLimit
              ? convertHexToNumber(displayRequest.params[0].gasLimit)
              : ""
          },
          {
            label: "Gas Price",
            value: convertHexToNumber(displayRequest.params[0].gasPrice)
          },
          {
            label: "Nonce",
            value: convertHexToNumber(displayRequest.params[0].nonce)
          },
          {
            label: "Value",
            value: convertHexToNumber(displayRequest.params[0].value)
          },
          { label: "Data", value: displayRequest.params[0].data }
        ];
        break;

      case "eth_sign":
        params = [
          ...params,