-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05bc6f3
commit c696c60
Showing
9 changed files
with
1,924 additions
and
1,905 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
export const abi_RequestForData = [ | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: "address", | ||
name: "trustedForwarder", | ||
type: "address", | ||
}, | ||
], | ||
stateMutability: "nonpayable", | ||
type: "constructor", | ||
}, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ | ||
indexed: true, | ||
internalType: "address", | ||
name: "who", | ||
type: "address", | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: "string", | ||
name: "CID", | ||
type: "string", | ||
}, | ||
], | ||
name: "RequestForData", | ||
type: "event", | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: "address", | ||
name: "forwarder", | ||
type: "address", | ||
}, | ||
], | ||
name: "isTrustedForwarder", | ||
outputs: [ | ||
{ | ||
internalType: "bool", | ||
name: "", | ||
type: "bool", | ||
}, | ||
], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: "string", | ||
name: "CID", | ||
type: "string", | ||
}, | ||
], | ||
name: "requestForData", | ||
outputs: [], | ||
stateMutability: "nonpayable", | ||
type: "function", | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
import detectEthereumProvider from '@metamask/detect-provider'; | ||
|
||
console.log('This is the background page.'); | ||
console.log('Put the background scripts here.'); | ||
|
||
export default async function connect() { | ||
const provider = await detectEthereumProvider(); | ||
|
||
if (provider) { | ||
// From now on, this should always be true: | ||
// provider === window.ethereum | ||
//startApp(provider); // initialize your app | ||
console.log(' MetaMask!'); | ||
} else { | ||
console.log('Please install MetaMask!'); | ||
chrome.runtime.onMessage.addListener( | ||
function(request, sender, sendResponse) { | ||
console.log(sender.tab ? | ||
"from a content script:" + sender.tab.url : | ||
"from the extension"); | ||
if (request.greeting === "hello") | ||
sendResponse({farewell: "goodbye"}); | ||
} | ||
} | ||
); | ||
|
||
function showStayHydratedNotification() { | ||
chrome.notifications.create({ | ||
type: 'basic', | ||
iconUrl: 'stay_hydrated.png', | ||
title: 'Time to Hydrate', | ||
message: 'Everyday I\'m Guzzlin\'!', | ||
buttons: [ | ||
{ title: 'Keep it Flowing.' } | ||
], | ||
priority: 0 | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import { printLine } from './modules/print'; | ||
|
||
console.log('Content script works!'); | ||
|
||
chrome.runtime.sendMessage({greeting: "hello"}, function(response) { | ||
console.log('response', response); | ||
}); | ||
console.log('2 Content script works!'); | ||
console.log('Must reload extension for modifications to take effect.'); | ||
|
||
printLine("Using the 'printLine' function from the Print Module"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.