import { Request } from "favorlet.js";
const response = await Request.sendCoin({
chainId: 8217, // 해당 체인 id
appName: "BlockChainApp", // FAVORLET 앱에 노출
transactions: [
{
from: "0x{address in hex}", // 코인을 전송할 주소
to: "0x{address in hex}", // 코인을 받을 주소
value: "1000000000000000000", // 전송할 코인의 양
gasLimit: "100000"
},
],
});
console.log(response);
/*
{
requestId: "56ba790c-aceb-465b-a6f2-33d103b25596",
expiredAt: 1667891675
}
*/
2. createDeepLink
Parameters
타입
설명
string
Request 요청시 전달받은 requestId
Response
타입
설명
string
FAVORLET 앱 내 해당 요청 페이지 DeepLink
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=56ba790c-aceb-465b-a6f2-33d103b25596