Skip to content

Instantly share code, notes, and snippets.

View Rami-Majdoub's full-sized avatar
💻
Necesito Programar Màs

Rami Majdoub Rami-Majdoub

💻
Necesito Programar Màs
View GitHub Profile
@Rami-Majdoub
Rami-Majdoub / get public key.ts
Created March 17, 2022 05:15 — forked from Breta01/get public key.ts
Requesting the public key from MetaMask
// Account is account address provided as string
// App must have access to the specified account
const account = "0x012...bc"
// Key is returned as base64
const keyB64 = await window.ethereum.request({
method: 'eth_getEncryptionPublicKey',
params: [account],
}) as string;
const publicKey = Buffer.from(keyB64, 'base64');
@Rami-Majdoub
Rami-Majdoub / Common-Currency.json
Created January 12, 2021 16:16 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},