create account

2024-12-03 - Distriator - MetaMask Connect login & Dash Connect - in progress by sagarkothari88

View this thread on: hive.blogpeakd.comecency.com
· @sagarkothari88 ·
$25.92
2024-12-03 - Distriator - MetaMask Connect login & Dash Connect - in progress
## Updates on Project [Distriator](https://distriator.com)

Today, while working on Dash integration, I was looking for some help & I asked chatGPT. While asking, I missed typing Dash & simply stated that, integrate web3 login. Because of the lack of the context, it suggested me MetaMask based login. This was not what I was looking for. However, upon going through the answer provided to me, I found it helpful. So, instead of focusing on integrating Dash, I switched to MetaMask login for today.

### MetaMask integration

- Source link 1 - https://docs.metamask.io/wallet/connect/metamask-sdk/javascript/pure-js/
- Source link 2 - https://github.com/MetaMask/metamask-sdk/blob/main/packages/examples/pure-javascript/index.html

Because I was more interested in plain-javascript based integration, I did a go-through list of documents & found a related one.

#### Step 1. Get the SDK Source in app

```
<html>
    <head>
        <script src="https://c0f4f41c-2f55-4863-921b-sdk-docs.github.io/cdn/metamask-sdk.js"></script>
    </head>
</html>
```

#### Step 2. Connect & get public wallet address of ETH

```
<!-- Etherium login specific code -->
  <script>
    const mmsdk = new MetaMaskSDK.MetaMaskSDK({
      dappMetadata: {
        name: "Distriator Connect",
      },
    });
    let provider;
    async function loginWithEthereumChain() {
      try {
        await mmsdk.connect();
        if (provider == null) {
          provider = mmsdk.getProvider();
        }
        const address = await provider.request({ method: 'eth_requestAccounts' });
        if (address.length > 0) {
          return address[0];
        } else {
          throw 'No account found';
        }
      } catch (e) {
        console.log('ADD ERR', e)
        throw e;
      }
    }
  </script>
  <!-- Etherium login specific code -->
```

### Demo of MetaMask integration in progress

![a new item](https://images.ecency.com/DQmRRKhCGKVrcnaU7MYZNj73R8Rw3MhWzUUWyxSHqAhvGET/screenshot_2024_12_03_at_6.32.17_pm.png)

- We have added a new connect item in list of blockchains
- New item says "MetaMask"
- With it, you can connect your ETH address
- It'll only pick the first one from provided addresses

### Connect using MetaMask on Desktop

![Connect using MetaMask on Desktop](https://images.ecency.com/DQmR5N4MEM2jEoo7ctyc6x6P7KgbKbLqGhgVk1ysGhypuS2/screenshot_2024_12_03_at_7.12.15_pm.png)

- Upon clicking on MetaMask button from Connect Screen, Distriator App will show a pop-up.
- Popup will show 2 tabs - Desktop & Mobile.
- I took screenshot after switching to Desktop.
- Desktop tab will show option to open the MetaMask Extension.
- Mobile Option will show QR code which you can scan via MetaMask Mobile app

### MetaMask Extension

![MetaMask Extension](https://images.ecency.com/DQmfRcqkFGmLHB7q6FpPBtWfuxJ4F9Tzx9UWqGK5aMjEhYW/screenshot_2024_12_03_at_7.12.23_pm.png)

- This is how it will look like when you try to authorize using MetaMask extension
- Of course, instead of Localhost, it'll say Distriator. I took screenshot when running locally

### Getting the Address

![Getting the Address](https://images.ecency.com/DQmXo4GQUs6TQpgbrftD6Ep3DHWc3awjTqxCGfGYRqjAi43/screenshot_2024_12_03_at_7.14.54_pm.png)

- So far, we are able to get the address
- We are yet to connect it with hive account
- We are yet to work on other connecting it with a button click event - currently, I executed everything using javascript console.

### Status on all the to-dos

- 💻 Adding signature based verification, validation & account connection
- 💻 Update Business profile with other blockchain addresses
- 💻 Allow users to make payments with other blockchain & claim on Distriator
- 💻 Show businesses with different blockchain payment support
- 💻 Signup with other blockchain accounts
- ⏳ Research work on Dash login
- 💻 Research on World coin login
- 💻 Research on DOC login
- ⏳ MetaMask based login
- ⏳ MetaMask based connect
- ⏳ MetaMask based disconnect
- 💻 Distriator rewards on ETH payments

![](https://images.ecency.com/DQme1eL9v9d8qiTY2KdjUACLN5oMFzUQZP9Rpf8uvDhAnhH/hive_divider.png)


![](https://images.ecency.com/DQme1eL9v9d8qiTY2KdjUACLN5oMFzUQZP9Rpf8uvDhAnhH/hive_divider.png)

<center>

[![Support @sagarkothari88](https://images.hive.blog/u/sagarkothari88/avatar)](https://witness.the-hive-mobile.app/#/witnesses/@sagarkothari88)
### [Vote sagarkothari88 as Hive Witness](https://witness.the-hive-mobile.app/#/witnesses/@sagarkothari88)

[![Support @threespeak](https://images.hive.blog/u/threespeak/avatar)](https://witness.the-hive-mobile.app/#/witnesses/@threespeak)

### [Vote for 3Speak as Witness](https://witness.the-hive-mobile.app/#/witnesses/@threespeak)

</center>

![](https://images.ecency.com/DQme1eL9v9d8qiTY2KdjUACLN5oMFzUQZP9Rpf8uvDhAnhH/hive_divider.png)

### Get paid for paying in HBD/Hive & SATs

## https://distriator.com 

Credits to designers - noakmilo & josegrech

![image by noakmilo](https://images.ecency.com/DQmNM1ahigCcZowJYjJRsdCeLXu5vykGa64cmiCPK5mbRZU/photo_2024_04_26_21.08.09.jpeg)

![banner of distriator by josegrech](https://images.ecency.com/DQmdNqPB61oSdqMf3x2xcX9qNXimd6iMKccwM8nGEUgjUsa/abnner.png)

### Swap your HBD/Hive using @ecency

![](https://images.ecency.com/DQmQkeawijcZVajC14KdSK2KP9vV4NSBTM1hRFpnCaa47Nr/swap_feature_banner.gif)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 158 others
properties (23)
authorsagarkothari88
permlink2024-12-03-daily-updates-on-development-activities
categoryhive-139531
json_metadata"{"app":"ecency/3.2.0-vision","description":"2024-12-03 - Today, we worked on Dash integration & at the same time we also looked at the documentation of MetaMask. Upon finding it helpful, we have also integrated MetaMask.","format":"markdown+html","tags":["dev","neoxian","pepe","pob","spendhbd","bro","ecency","vyb","bbh"],"image":["https://images.ecency.com/DQmRRKhCGKVrcnaU7MYZNj73R8Rw3MhWzUUWyxSHqAhvGET/screenshot_2024_12_03_at_6.32.17_pm.png","https://images.ecency.com/DQmR5N4MEM2jEoo7ctyc6x6P7KgbKbLqGhgVk1ysGhypuS2/screenshot_2024_12_03_at_7.12.15_pm.png","https://images.ecency.com/DQmfRcqkFGmLHB7q6FpPBtWfuxJ4F9Tzx9UWqGK5aMjEhYW/screenshot_2024_12_03_at_7.12.23_pm.png","https://images.ecency.com/DQmXo4GQUs6TQpgbrftD6Ep3DHWc3awjTqxCGfGYRqjAi43/screenshot_2024_12_03_at_7.14.54_pm.png"],"thumbnails":["https://images.ecency.com/DQmRRKhCGKVrcnaU7MYZNj73R8Rw3MhWzUUWyxSHqAhvGET/screenshot_2024_12_03_at_6.32.17_pm.png","https://images.ecency.com/DQmR5N4MEM2jEoo7ctyc6x6P7KgbKbLqGhgVk1ysGhypuS2/screenshot_2024_12_03_at_7.12.15_pm.png","https://images.ecency.com/DQmfRcqkFGmLHB7q6FpPBtWfuxJ4F9Tzx9UWqGK5aMjEhYW/screenshot_2024_12_03_at_7.12.23_pm.png","https://images.ecency.com/DQmXo4GQUs6TQpgbrftD6Ep3DHWc3awjTqxCGfGYRqjAi43/screenshot_2024_12_03_at_7.14.54_pm.png"]}"
created2024-12-03 15:07:51
last_update2024-12-03 15:07:51
depth0
children6
last_payout2024-12-10 15:07:51
cashout_time1969-12-31 23:59:59
total_payout_value12.980 HBD
curator_payout_value12.941 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,289
author_reputation562,240,077,075,620
root_title"2024-12-03 - Distriator - MetaMask Connect login & Dash Connect - in progress"
beneficiaries[]
max_accepted_payout100,000.000 HBD
percent_hbd10,000
post_id138,902,103
net_rshares52,323,412,921,385
author_curate_reward""
vote details (222)
@hive-lu ·
#### Hello sagarkothari88!
**It's nice to let you know that your article will take 11th place.**
Your post is among **15 Best** articles voted 7 days ago by the @hive-lu | King Lucoin Curator by **keithtaylor**
 
You receive 🎖 **1.0** unique **LUBEST** tokens as a reward. You can support Lu world and your curator, then he and you will receive 10x more of the winning token. There is a buyout offer waiting for him on the stock exchange. All you need to do is reblog [Daily Report 502](/lucoin/@hive-lu/daily-report-day-502) with your winnings.
 
<center>[![2.png](https://files.peakd.com/file/peakd-hive/now.calendars/23uEwt7Djmb4N3dE96ecCUemJez6vLU3fmoTrdjEJn1ws4d8iPw2QrrsB22nyhbb178sx.png)](/@hive-lu)</center>
 
---
<center><sub>Invest in the **Lu token** (Lucoin) and get paid. With 50 Lu in your wallet, you also become the curator of the @hive-lu which follows your upvote.
Buy Lu on the [Hive-Engine](https://hive-engine.com/trade/LU) exchange | World of Lu created by <a href="/@szejq">szejq</a> </sub></center>
<center><sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP` _or to resume write a word_ `START`</sub> </center>
properties (22)
authorhive-lu
permlinklucoin-prize-3rxma7
categoryhive-139531
json_metadata""
created2024-12-11 03:30:45
last_update2024-12-11 03:30:45
depth1
children0
last_payout2024-12-18 03:30:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,193
author_reputation33,448,970,442,499
root_title"2024-12-03 - Distriator - MetaMask Connect login & Dash Connect - in progress"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id139,116,849
net_rshares0
@hivebuzz ·
<center>[![](https://images.hive.blog/175x175/https://hivebuzz.me/api/level/sagarkothari88?202412041523)](https://hivebuzz.me/@sagarkothari88)
<center>@sagarkothari88, sorry to see that you have less Hive Power.
Your level lowered and you are now a **Dolphin**!</center>

**Check out our last posts:**
<table><tr><td><a href="/hive-122221/@hivebuzz/pum-202411-delegations"><img src="https://images.hive.blog/64x128/https://i.imgur.com/fg8QnBc.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202411-delegations">Our Hive Power Delegations to the November PUM Winners</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pud-202412-feedback"><img src="https://images.hive.blog/64x128/https://i.imgur.com/zHjYI1k.jpg"></a></td><td><a href="/hive-122221/@hivebuzz/pud-202412-feedback">Feedback from the December Hive Power Up Day</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pum-202411-result"><img src="https://images.hive.blog/64x128/https://i.imgur.com/mzwqdSL.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202411-result">Hive Power Up Month Challenge - November 2024 Winners List</a></td></tr></table>
properties (22)
authorhivebuzz
permlinknotify-1733325952
categoryhive-139531
json_metadata{"image":["https://hivebuzz.me/notify.t6.png"]}
created2024-12-04 15:25:51
last_update2024-12-04 15:25:51
depth1
children0
last_payout2024-12-11 15:25:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,125
author_reputation369,450,107,014,397
root_title"2024-12-03 - Distriator - MetaMask Connect login & Dash Connect - in progress"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id138,933,696
net_rshares0
@indiaunited ·
Indiaunited Curation 1733242840000
This post has been manually curated by @bhattg from Indiaunited community. Join us on our [Discord Server](https://discord.gg/bGmS2tE). 

Do you know that you can earn a passive income by delegating to @indiaunited. We share more than 100 % of the curation rewards with the delegators in the form of IUC tokens. HP delegators and IUC token holders also get upto 20% additional vote weight. 

Here are some handy links for delegations: [100HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=indiaunited&vesting_shares=169596.93185608415%20VESTS), [250HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=indiaunited&vesting_shares=423992.3296402104%20VESTS), [500HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=indiaunited&vesting_shares=847984.6592804207%20VESTS), [1000HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=indiaunited&vesting_shares=1695969.3185608415%20VESTS). 

[![image.png](https://files.peakd.com/file/peakd-hive/bala41288/46eaz12N-image.png)](https://discord.gg/bGmS2tE) 

<sub>**100% of the rewards from this comment goes to the curator for their manual curation efforts. Please encourage the curator @bhattg by upvoting this comment and support the community by voting the posts made by @indiaunited.**</sub>. 

This post received an extra 7.54% vote for delegating HP / holding IUC tokens.
properties (22)
authorindiaunited
permlinkindiaunited-1733242840000
categoryhive-139531
json_metadata{"app":"hiveblog/0.1","format":"markdown","tags":["dev","neoxian","pepe","pob","spendhbd","bro","ecency","vyb","bbh"]}
created2024-12-03 16:20:42
last_update2024-12-03 16:20:42
depth1
children0
last_payout2024-12-10 16:20:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,410
author_reputation100,710,806,276,415
root_title"2024-12-03 - Distriator - MetaMask Connect login & Dash Connect - in progress"
beneficiaries
0.
accountbhattg
weight10,000
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id138,903,863
net_rshares0
@mnurhiver ·
Good evening and peace be upon you. Interesting article
👍  
properties (23)
authormnurhiver
permlinkre-sagarkothari88-2024123t235619911z
categoryhive-139531
json_metadata{"tags":["dev","neoxian","pepe","pob","spendhbd","bro","ecency","vyb","bbh"],"app":"ecency/3.2.0-vision","format":"markdown+html"}
created2024-12-03 16:56:21
last_update2024-12-03 16:56:21
depth1
children0
last_payout2024-12-10 16:56:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length55
author_reputation667,661,802,674,288
root_title"2024-12-03 - Distriator - MetaMask Connect login & Dash Connect - in progress"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id138,904,794
net_rshares0
author_curate_reward""
vote details (1)
@prapanth ·
This is a great development.
👍  
properties (23)
authorprapanth
permlinkre-sagarkothari88-2024124t10477476z
categoryhive-139531
json_metadata{"type":"comment","tags":["hive-139531","dev","neoxian","pepe","pob","spendhbd","bro","ecency","vyb","bbh"],"app":"ecency/3.2.0-mobile","format":"markdown+html"}
created2024-12-04 03:47:09
last_update2024-12-04 03:47:09
depth1
children1
last_payout2024-12-11 03:47:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length28
author_reputation74,930,039,544,651
root_title"2024-12-03 - Distriator - MetaMask Connect login & Dash Connect - in progress"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id138,922,293
net_rshares0
author_curate_reward""
vote details (1)
@sagarkothari88 ·
thank you @prapanth ji
<br/><sub>[via Inbox](https://inbox.the-hive-mobile.app)</sub>
properties (22)
authorsagarkothari88
permlinkre-sagarkothari88-20250104t183152546
categoryhive-139531
json_metadata{"tags":["hive-inbox","ios","android","mobile","app","sagarkothari88","comment","reply"],"app":"Inbox","developer":"sagarkothari88","format":"markdown+html","ts":"2025-01-04T18:31:52.546","hash":"MjAyNS0wMS0wNFQxODozMTo1Mi41NDZfUW5ORlYzVkRkRkZ2VW5aQlFqQjNPV3RTVnpOWFJIbDVaRUZZU25OUGIwOD0=","version":"1.1.3","route":"Dashboard","os":"Web"}
created2025-01-04 13:01:54
last_update2025-01-04 13:01:54
depth2
children0
last_payout2025-01-11 13:01:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length85
author_reputation562,240,077,075,620
root_title"2024-12-03 - Distriator - MetaMask Connect login & Dash Connect - in progress"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id139,705,138
net_rshares0