Skip to content

Instantly share code, notes, and snippets.

View Vatsalya-singhi's full-sized avatar

Vatsalya Singhi Vatsalya-singhi

View GitHub Profile
public createAndSendOffer(id: string) {
this.peerConnections[id]
.createOffer(this.offerOptions)
.then(async (offer: RTCSessionDescriptionInit) => {
if (this.peerConnections[id].signalingState != "stable") {
console.log("-- The connection isn't stable yet; postponing...")
return;
}
this.peerConnections[id].setLocalDescription(offer).then(() => {
@Vatsalya-singhi
Vatsalya-singhi / request.ts
Created April 29, 2020 11:04
Request to access to user's accounts
// request to access user account details
this.ethereum = (window as any).ethereum;
this.webby3 = (window as any).web3;
if (typeof this.ethereum == 'undefined') {
this.dialog.presentToast('Please install MetaMask extension');
return;
}
try {
let x = await this.ethereum.enable();
console.log('ethereum enabled=>', x);
gitlab merge to master example