0.0.15 • Published 9 months ago
favorlet-wallet-connect v0.0.15
favorlet-wallet-connect
favorlet-wallet-connect는 블록체인 지갑과 클라이언트 사이의 통신에 필요한 provider(공급자)및 UI를 제공하는 라이브러리입니다.
https://www.npmjs.com/package/favorlet-wallet-connect
$ npm i favorlet-wallet-connect
지갑연결
import { Favorlet } from 'favorlet-wallet-connect';
const favorlet = await Favorlet(chainId, 'app name');\
const [account] = await favorlet.request({ method: 'eth_requestAccounts' });
서명
import { Favorlet } from 'favorlet-wallet-connect';
const favorlet = await Favorlet(chainId, 'app name');
const signMessage = await favorlet.request({ method: 'personal_sign', params: ['account', 'message']});
컨트렉트실행
import { Favorlet } from 'favorlet-wallet-connect';
const favorlet = await Favorlet(chainId, 'app name');
const hash = await favorlet.request({ method: 'eth_sendTransaction', params: [{
from: "0x{address in hex}",
to: "0x{address in hex}",
value: "1000000000000000000", (option)
data: "0x{hex}" (option)
gasLimit: "21000" (option)
}]});