mirror of
https://github.com/pezkuwichain/phishing.git
synced 2026-06-12 21:41:06 +00:00
Add checkAddress sample
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
# @polkadot/phishing
|
# @polkadot/phishing
|
||||||
|
|
||||||
|
To check for sites that are on the list -
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { checkIfDenied } from '@polkadot/phishing';
|
import { checkIfDenied } from '@polkadot/phishing';
|
||||||
|
|
||||||
@@ -7,3 +9,17 @@ const isOnDeny = await checkIfDenied(window.location.host);
|
|||||||
|
|
||||||
console.log(`isOnDeny=${isOnDeny}`);
|
console.log(`isOnDeny=${isOnDeny}`);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To check for addresses that are on the list -
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { checkAddress } from '@polkadot/phishing';
|
||||||
|
|
||||||
|
const info = await checkAddress('1b....');
|
||||||
|
|
||||||
|
if (info) {
|
||||||
|
console.log(`The address is reported as ${info}`);
|
||||||
|
} else {
|
||||||
|
console.log('Not reported');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user