SignatureQR

The SignatureQR component is a component that allows dApp to sign and verify to ZIGAP through QR recognition.

Signature QR

Basic Usage

import { SignatureQR, SignatureResultType } from 'zigap-utils';

const App = () => {
  const [result, setResult] = useState<SignatureResultType | null>(null);

  return (
    <div>
      <SignatureQR
        dapp='My Awesome Dapp'
        url='https://myapp.com'
        availableNetworks={['v2xphere', 'v3xphere']}
        sigMessage='I agree to the terms and conditions'
        validSeconds={600}
        onReceive={({ status, result }) => {
          if (status === 'SUCCESS') {
            console.log('Signature successful!', result);
            setResult(result as SignatureResultType);
          }
        }}
      />
    </div>
  );
};

Props

Prop
Type
Required
Default
Description

dapp

string

-

Name of the dApp to

use

url

string

-

The url of dApp to connect

availableNetworks

('binance' \| 'ethereum' \| 'v2xphere' \| 'v3xphere')[]

-

List of supported networks in dApp

sigMessage

string

-

Messages signed to verify the identity of the user

validSeconds

number

-

QR code valid seconds

onReceive

(res) => void

optional

-

Callback

expire

SignatureLoginExpireType

optional

{ type : 'NONE'}

Expiration settings

icon

string

optional

-

Your dApp icon url to be displayed.

This prop is optional and the default value is { type: 'NONE'}

processingMark

SignatureProcessingMarkType

optional

{ type: 'DEFAULT'}

How to show the QR image when it's being processed. This prop is optional and the default value is { type: 'DEFAULT'}

qrDomain

string

optional

https://zigap.io

QR domain

Supported Networks

  • binance : bsc

  • ethereum : eth

  • v2xphere : xp

  • v3xphere : xpt

Status Values

Type
Description

SUCCESS

Signature successful

REQUEST

Request in progress

ACCOUNT

Account selection in progress

ERROR

Error occurred

SignatureResultType

Common Style Props

Common style options available for all QR components

Props

Prop
Type
Default
Description

size

number

128

canvas width of QR code

bgColor

string

#fff

background color

fgColor

string

#000

foreground color

style

CSSProperties

-

custom css style

isShowLogo

boolean

false

Zigap logo in the middle of the QR code

logoSize

number

30

logo width & height

Example

Processing Mark Options

Configure how to display during processing.

Options

Type
Description

DEFAULT

Shows default "processing..." message

CUSTOM

Allows custom React component

NONE

No visual indicator

Custom Component Example

Expire Configuration

Configure expiration time and type.

Example

Last updated