Skip to content

Instantly share code, notes, and snippets.

View joaoaguiam's full-sized avatar

Joao Aguiam joaoaguiam

View GitHub Profile
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreie33homqk3nukfqc3aa5yypft2fv3sdxaywijmotzp7ewept3yp2q ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
### Keybase proof
I hereby claim:
* I am joaoaguiam on github.
* I am joaoaguiam (https://keybase.io/joaoaguiam) on keybase.
* I have a public key ASC4ElT7-PeexDYUxCFQfxCnrkK3h16N26J1quk9NMMK-wo
To claim this, I am signing this object:
3Box is a social profiles network for web3. This post links my 3Box profile to my Github account!
✅ did:muport:QmWDjTTmxsFU1E7ecugdx6T3DWKHbYoKtZduqK87YD6ADM ✅
Create your profile today to start building social connection and trust online. https://3box.io/
3Box is a social profiles network for web3. This post links my 3Box profile to my Github account!
✅ did:muport:QmWDjTTmxsFU1E7ecugdx6T3DWKHbYoKtZduqK87YD6ADM ✅
Create your profile today to start building social connection and trust online. https://3box.io/
did:muport:0x12345
test gist api
const verifiers = require("./utils/verifiers");
class VerifiedAccounts {
constructor(box) {
this._box = box;
this._did = box._muportDID.getDid();
}
/**
* Internal function to prevent using the methods without having been initialized with a 3Box
module.exports = {
/**
* Verify github account method. It will return the github username if verified correctly.
* @param did DID of the user to be verified
* @param proof URL to the gist file under the user account containing the user DID.
* @returns Object containing the github user in the data field and in case of error, the error message under the error field.
*/
verifyGithub: async (did, proof) => {
if (!proof || proof.trim() === "") {
throw new Error("verifyGithub: proof (gist url) parameter is not present");
did:muport:QmXfdXB8h9UzCT5XNmMhkuYuG49LYTPJcJAwhWorHhsCo4-----
const abi = require('ethereumjs-abi')
const BN = require('bn.js')
const Web3 = require('web3');
const account = web3.eth.accounts.privateKeyToAccount(privateKey);
let messageHash = "0x" + abi.soliditySHA3(
["address", "uint", "uint"],
[new BN(userAddress, 16), new BN(String(stakeAmount), 10), new BN(String(expiryDate), 10)]
).toString("hex");