FAVORLET
FAVORLETFAVORLET scanner
English
English
  • INTRODUCTION
    • FAVORLET
    • FAVORLET scanner
    • Style Guidelines
    • Use Case
      • 2023.03 Ultra Abu Dhabi | Ticket Admission Verification & Commemorative NFT Airdrop
      • 2023.12 KMCA <The Great Gatsby> | Admission Verification & Bling Parts Airdrop
  • FAVORLET GUIDELINES
    • Usage guidelines
      • Offline Verificaton
      • View NFT Collections
      • Send NFT
    • Biz guidelines
      • Holder verification with FAVORLET scanner
  • FOR DEVELOPERS
    • App2App Dev. Guidelines
      • Connect Wallet
      • Message Signature
      • Send Platform Coin
      • Execute Contract
    • Scanner API Guidelines
  • Service center
    • FAQ and Suggestions
  • Announcements
    • Release Note
    • Press Release (KR)
    • Partnership
    • Notice
      • [Dec 1st 2023] FAVORLET v3.0 Update
      • [June 14th 2023] Update Notice
      • [Mar 17th 2023] Update Notice
      • [Mar 10 2023] Ultra Abu Dhabi 2023
      • [Feb 24 2023] Update Notice
      • [Feb 07 2023] Fellaz NFT Ticket for Ultra Abu Dhabi 2023
  • FAVORLET POLICY
    • Terms of Service (Jul 21, 2023)
    • Privacy Policy (Jul 21, 2023)
    • Previous Terms
      • Privacy Policy (Sep 19, 2022)
      • Privacy Policy(May 18th, 2022)
  • FAVORLET SCANNER POLICY
    • Privacy Policy(2022-09-19)
  • FAVORLET
  • Xclusive
  • Fingerlabs
Powered by GitBook
On this page
  • 1. Request.signMessage
  • 2. createDeepLink
  • 3. receipt
  1. FOR DEVELOPERS
  2. App2App Dev. Guidelines

Message Signature

1. Request.signMessage

Parameters

Name
Type
Description

chainId

number

Chain ID of the particular network

appName

string

Name that will appear in FAVORLET app when signing a message

from

string

Wallet address to sign a message

message

string

message to sign

Response

Name
Type
Description

requestId

string

ID to track the requested operation or transaction

expiredAt

number

The amount of time (in seconds) that an operation or transaction request expires.

Example

import { Request } from "favorlet.js";

const response = await Request.signMessage({
  chainId: 8217, // 해당 체인 id
  appName: "BlockChainApp", // FAVORLET 앱에 노출
  from: "0x{address in hex}", // 서명할 지갑 주소
  message: "서명할 메세지", // 서명할 메세지
});

console.log(response);
/*
{
  requestId: "c8393195-b49d-4586-b3fd-0e1a1e94f189",
  expiredAt: 1667891117,
}
*/

2. createDeepLink

Parameters

Type
Description

string

requestId received when requesting

Response

Type
Description

string

DeepLink to the request page within the FAVORLET app

Example

import { createDeepLink } from "favorlet.js";

const deepLink = createDeepLink(response.requestId); // Request를 통해 받은 requestId

/*
- PC: 생성된 deepLink를 qrcode 라이브러리를 이용하여 QR 생성 후 스마트폰으로 스캔
- Mobile: window.location.href 등을 사용하여 생성된 deepLink로 직접 이동
*/
console.log(deepLink);
// https://app.favorlet.link/?requestId=c8393195-b49d-4586-b3fd-0e1a1e94f189

3. receipt

import { receipt } from "favorlet.js";

const result = await receipt(response.requestId); // Request를 통해 받은 requestId

console.log(result);
/*
- status에 따라 이후 분기 처리

### requested
{
  requestId: "c8393195-b49d-4586-b3fd-0e1a1e94f189",
  expiredAt: 1667891117,
  action: "signMessage",
  signMessage: {
    status: "requested"
  }
}

### canceled
{
  requestId: "c8393195-b49d-4586-b3fd-0e1a1e94f189",
  expiredAt: 1667891117,
  action: "signMessage",
  signMessage: {
    status: "canceled",
    signature: null,
    errorMessage: null
  }
}

### succeed
{
  requestId: "c8393195-b49d-4586-b3fd-0e1a1e94f189",
  expiredAt: 1667891117,
  action: "signMessage",
  signMessage: {
    status: "succeed",
    signature: "c308c6bc851cdaf8a125b2990753f376e3660f9f98a4c515de9e8c0fbd98f2cf3db519a7ba4dab78d001232b6f55b24896a57e3264cafe3dda78a89ecfb0bb141b",
    errorMessage: null
  }
}
*/
PreviousConnect WalletNextSend Platform Coin

Last updated 2 years ago