App2App Dev. Guidelines

This is favorlet.js Web SDK for FAVORLET web environment.

Introduction

  • favorlet.js Web SDK is for easy and convenient use when you want to request the following functions through FAVORLET app.

A Request to bring user's FAVORLET account

A Signature request to verify possession of FAVORLET wallet address

A request to transfer platform coins on the chain set up in the FAVORLET wallet

A Contract execution request through FAVORLET wallet

Install

  • use npm install favorlet.js yarn or add favorlet.js and write as below.

import { Request, createDeepLink, receipt } from "favorlet.js";

Summary

API request is proceed in the order ofRequest, createDeepLink, receipt.

whenRequest, a unique Request ID is issued to distinguish it from other requests, and each step

communicates with this Request ID.

Please refer to below information for more detailed explanation of each step.

Request

There are four steps to request an action or transaction through the FAVORLET app.

  • connectWallet: A request to bring user's FAVORLET account

  • signMessage: A signature request to verify possession of FAVORLET account

  • sendCoin: A request to transfer platform coins on the chain set up in the FAVORLET

  • executeContract: A Contract execution request through FAVORLET wallet

Create an address (DeepLink) that meets the communication standard to deliver the requestId that is received when requesting from BApp to FAVORLET app.

During development, the method of passing the generated DeepLink to the FAVORLET app must be handled differently depending on the BApp execution environment.

  • PC

    • Create a QR code using the DeepLink library and scan it with your smartphone.

    • For QR generation, refer to the library below

  • Mobile

    • Use window.location.href and move to DeepLink

When running DeepLink, the corresponding branch will automatically activate depending on whether FAVORLET app is installed or not.

  • If installed: Run the FAVORLET app

  • If not installed: Go to the app store of your OS

receipt

Check the result of the action performed by the FAVORLET app with the requestId issued upon request.

Response

  • action: Request kind

  • status

    • requested: requested status

    • executed: the status of executing the request

    • canceled: canceled request

    • failed: request executed but failed

    • succeed: request executed and succeed

Style Guide

Please refer to the page below for the service logo and terminology regulations.

Last updated