메타마스크 잠금처리 알아내기 Metamask locked
본문 바로가기

블록체인

메타마스크 잠금처리 알아내기 Metamask locked

메타마스크와 클레이튼은 매우 유사하다

window.web3 = new Web3(ethereum);
is_metamask_unlocked = window.ethereum._metamask.isUnlocked();
console.log('is_metamask_unlocked', is_metamask_unlocked)

const klaytn = require("../lib.common/klaytn");
console.log('is_klaytn_unlocked',klaytn._kaikas.isUnlocked())

https://gitcoin.co/issue/unlock-protocol/unlock/327

잠금되어있을경우 promiseResult가 false임

 

Detect when Metamask is locked | unlock-protocol Funded Issue Detail | Gitcoin

Metamask is "locked" by default, we should be able to detect that and show an error to the user asking them to unlock it.

gitcoin.co

https://docs.kaikas.io/02_api_reference/01_klaytn_provider

 

Klaytn Provider - Kaikas Docs

Kaikas injects a global API into websites visited by its users at window.klaytn. This API allows websites to request user login, load data from blockchains, and create transactions. You can use this API to detect whether the user uses Kaikas.

docs.kaikas.io

https://github.com/gitcoinco/web/blob/0c6df031c066954f376ce927d721061bd24ec374/app/assets/v2/js/metamask-approval.js

 

GitHub - gitcoinco/web: Grow Open Source

Grow Open Source. Contribute to gitcoinco/web development by creating an account on GitHub.

github.com

 

반응형