repo stringlengths 5 106 | file_url stringlengths 78 301 | file_path stringlengths 4 211 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:56:49 2026-01-05 02:23:25 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
my19940202/wx-read-comment-extension | https://github.com/my19940202/wx-read-comment-extension/blob/8777d2787cd90acedc2e73051289354a2724bc4a/utils/build.js | utils/build.js | // Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
process.env.ASSET_PATH = '/';
var webpack = require('webpack'),
path = require('path'),
fs = require('fs'),
config = require('../webpack.config'),
Zi... | javascript | MIT | 8777d2787cd90acedc2e73051289354a2724bc4a | 2026-01-05T03:45:56.853974Z | false |
carsonwah/react-native-push-notification-popup | https://github.com/carsonwah/react-native-push-notification-popup/blob/c3e0221e2c86fe09c77a99c1ff76395aa30c7047/.eslintrc.js | .eslintrc.js | module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2017,
"ecmaFeatures": {
"experimentalObjectRestSpre... | javascript | MIT | c3e0221e2c86fe09c77a99c1ff76395aa30c7047 | 2026-01-05T03:46:10.889138Z | false |
carsonwah/react-native-push-notification-popup | https://github.com/carsonwah/react-native-push-notification-popup/blob/c3e0221e2c86fe09c77a99c1ff76395aa30c7047/src/index.js | src/index.js | import { DefaultPopup } from './views';
export default DefaultPopup;
| javascript | MIT | c3e0221e2c86fe09c77a99c1ff76395aa30c7047 | 2026-01-05T03:46:10.889138Z | false |
carsonwah/react-native-push-notification-popup | https://github.com/carsonwah/react-native-push-notification-popup/blob/c3e0221e2c86fe09c77a99c1ff76395aa30c7047/src/components/index.js | src/components/index.js | javascript | MIT | c3e0221e2c86fe09c77a99c1ff76395aa30c7047 | 2026-01-05T03:46:10.889138Z | false | |
carsonwah/react-native-push-notification-popup | https://github.com/carsonwah/react-native-push-notification-popup/blob/c3e0221e2c86fe09c77a99c1ff76395aa30c7047/src/utils/index.js | src/utils/index.js | import { Dimensions, Platform, StatusBar } from 'react-native';
// Code borrowed from https://github.com/ovr/react-native-status-bar-height
const STATUSBAR_DEFAULT_HEIGHT = 20;
const STATUSBAR_X_HEIGHT = 44;
const STATUSBAR_IP12_HEIGHT = 47;
const STATUSBAR_IP12MAX_HEIGHT = 47;
const STATUSBAR_IP14PRO_HEIGHT = 54;
con... | javascript | MIT | c3e0221e2c86fe09c77a99c1ff76395aa30c7047 | 2026-01-05T03:46:10.889138Z | false |
carsonwah/react-native-push-notification-popup | https://github.com/carsonwah/react-native-push-notification-popup/blob/c3e0221e2c86fe09c77a99c1ff76395aa30c7047/src/views/index.js | src/views/index.js | import DefaultPopup from './DefaultPopup';
export {
DefaultPopup
};
| javascript | MIT | c3e0221e2c86fe09c77a99c1ff76395aa30c7047 | 2026-01-05T03:46:10.889138Z | false |
carsonwah/react-native-push-notification-popup | https://github.com/carsonwah/react-native-push-notification-popup/blob/c3e0221e2c86fe09c77a99c1ff76395aa30c7047/src/views/DefaultPopup.js | src/views/DefaultPopup.js | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Animated, View, Text, Image, Dimensions, StyleSheet, PanResponder, TouchableWithoutFeedback } from 'react-native';
import { getStatusBarHeight } from '../utils';
const { width: deviceWidth } = Dimensions.get('window');
const CONTA... | javascript | MIT | c3e0221e2c86fe09c77a99c1ff76395aa30c7047 | 2026-01-05T03:46:10.889138Z | false |
bramus/js-pagination-sequence | https://github.com/bramus/js-pagination-sequence/blob/6ed880c250e50319bea334dd2df518db8b2252c6/src/index.js | src/index.js | import { range } from '@bramus/range';
/**
* Generate a sequence of numbers for use in a pagination system, the clever way.
* @author Bramus Van Damme <bramus@bram.us>
*
* The algorithm always returns the same amount of items in the sequence,
* independent of the position of the current page.
*
* Example rows g... | javascript | MIT | 6ed880c250e50319bea334dd2df518db8b2252c6 | 2026-01-05T03:46:14.480165Z | false |
bramus/js-pagination-sequence | https://github.com/bramus/js-pagination-sequence/blob/6ed880c250e50319bea334dd2df518db8b2252c6/test/index.js | test/index.js | import { equal, deepEqual } from 'assert';
// import { generate } from '../src/index.js'; // 🤔 SyntaxError: The requested module '@bramus/range' does not provide an export named 'range'
import { generate, generateFromObj } from '../dist/index.esm.js';
const addLeadingZeros = (value, targetLength) => {
return valu... | javascript | MIT | 6ed880c250e50319bea334dd2df518db8b2252c6 | 2026-01-05T03:46:14.480165Z | false |
sharkdp/quizzity | https://github.com/sharkdp/quizzity/blob/ba2aa489feda437c6db868de93d082dd0ac9248f/js/quizzity.js | js/quizzity.js | /*jslint browser: true, nomen: true, white: true*/
/*global $*/
/*global _*/
/*global L*/
/*global ga*/
'use strict';
var Quizzity = function() {
this.cities = []; // cities to guess
this.mapElements = []; // map elements
};
Quizzity.prototype.initializeInterface = function() {
// Set up the map and tile... | javascript | MIT | ba2aa489feda437c6db868de93d082dd0ac9248f | 2026-01-05T03:46:15.265302Z | false |
jeroenheijmans/advent-of-code-charts | https://github.com/jeroenheijmans/advent-of-code-charts/blob/82b5b6f326400925c80d46d4362e64e146e968b8/src/js/dummyData-twelveDayEvent.js | src/js/dummyData-twelveDayEvent.js | (function (aoc) {
aoc["dummyData"] = {
"day1_ts": 1764565200,
"num_days": 12,
"owner_id": 189709,
"event": "2025",
"members": {
"125708": {
"local_score": 1760,
"stars": 12,
"name": "CloudWinner_1337",
"id": 125708,
"last_star_t... | javascript | MIT | 82b5b6f326400925c80d46d4362e64e146e968b8 | 2026-01-05T03:46:16.213986Z | true |
jeroenheijmans/advent-of-code-charts | https://github.com/jeroenheijmans/advent-of-code-charts/blob/82b5b6f326400925c80d46d4362e64e146e968b8/src/js/dummyData-large.js | src/js/dummyData-large.js | (function (aoc) {
aoc["dummyData"] = {
owner_id: 189709,
event: "2022",
members: {
30614: {
completion_day_level: {
2: {
1: { get_star_ts: 1670004471, star_index: 497978 },
2: { get_star_ts: 1670005434, star_index: 501126 },
},
5: {
... | javascript | MIT | 82b5b6f326400925c80d46d4362e64e146e968b8 | 2026-01-05T03:46:16.213986Z | true |
jeroenheijmans/advent-of-code-charts | https://github.com/jeroenheijmans/advent-of-code-charts/blob/82b5b6f326400925c80d46d4362e64e146e968b8/src/js/dummyData-regular.js | src/js/dummyData-regular.js | (function (aoc) {
aoc["dummyData"] = {
members: {
714373: {
completion_day_level: {
6: {
1: { get_star_ts: 1670310958, star_index: 1494771 },
2: { star_index: 1494931, get_star_ts: 1670310989 },
},
8: {
1: { star_index: 2003389, get_s... | javascript | MIT | 82b5b6f326400925c80d46d4362e64e146e968b8 | 2026-01-05T03:46:16.213986Z | true |
jeroenheijmans/advent-of-code-charts | https://github.com/jeroenheijmans/advent-of-code-charts/blob/82b5b6f326400925c80d46d4362e64e146e968b8/src/js/dummyData-oneDay.js | src/js/dummyData-oneDay.js | (function (aoc) {
aoc["dummyData"] = {
members: {
12345: {
last_star_ts: 0,
local_score: 0,
completion_day_level: {},
stars: 0,
name: "Senor Wontplaythisyear",
global_score: 0,
id: 12345,
},
23456: {
name: "Felt Welkore",
gl... | javascript | MIT | 82b5b6f326400925c80d46d4362e64e146e968b8 | 2026-01-05T03:46:16.213986Z | false |
jeroenheijmans/advent-of-code-charts | https://github.com/jeroenheijmans/advent-of-code-charts/blob/82b5b6f326400925c80d46d4362e64e146e968b8/src/js/app.js | src/js/app.js | // @ts-check
/**
* @typedef moment
* @property {import('moment')} moment
*/
(function (/** @type {any} */ aoc) {
// Unsure how to add JSDoc types so for now like this.
// See also: https://stackoverflow.com/q/77466760/419956
const Chart = /** @type {any} */ (window["Chart"]);
// See https://stacko... | javascript | MIT | 82b5b6f326400925c80d46d4362e64e146e968b8 | 2026-01-05T03:46:16.213986Z | true |
jeroenheijmans/advent-of-code-charts | https://github.com/jeroenheijmans/advent-of-code-charts/blob/82b5b6f326400925c80d46d4362e64e146e968b8/src/js/dummyData-default.js | src/js/dummyData-default.js | (function (aoc) {
aoc["dummyData"] = {
"members": {
"100001": {
"last_star_ts": "1544190334",
"global_score": 0,
"completion_day_level": {
"1": {
"1": {
"star_index": 154367544... | javascript | MIT | 82b5b6f326400925c80d46d4362e64e146e968b8 | 2026-01-05T03:46:16.213986Z | false |
jeroenheijmans/advent-of-code-charts | https://github.com/jeroenheijmans/advent-of-code-charts/blob/82b5b6f326400925c80d46d4362e64e146e968b8/src/js/dummyData-empty.js | src/js/dummyData-empty.js | (function (aoc) {
aoc["dummyData"] = {
"members": {
"190664": {
"name": "Jeroen Heijmans",
"stars": 0,
"id": "190664",
"last_star_ts": "1544165499",
"local_score": 0,
"completion_day_level": {
... | javascript | MIT | 82b5b6f326400925c80d46d4362e64e146e968b8 | 2026-01-05T03:46:16.213986Z | false |
ricmoo/scrypt-js | https://github.com/ricmoo/scrypt-js/blob/3f106c1ba13a0c909f48740eb3cf86d91e724ad2/scrypt.js | scrypt.js | "use strict";
(function(root) {
const MAX_VALUE = 0x7fffffff;
// The SHA256 and PBKDF2 implementation are from scrypt-async-js:
// See: https://github.com/dchest/scrypt-async-js
function SHA256(m) {
const K = new Uint32Array([
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c2... | javascript | MIT | 3f106c1ba13a0c909f48740eb3cf86d91e724ad2 | 2026-01-05T03:46:20.050863Z | false |
ricmoo/scrypt-js | https://github.com/ricmoo/scrypt-js/blob/3f106c1ba13a0c909f48740eb3cf86d91e724ad2/test/test-scrypt.js | test/test-scrypt.js | "use strict";
const assert = require("assert");
const scrypt = require('../scrypt.js');
const testVectors = require('./test-vectors.json');
for (let i = 0; i < testVectors.length; i++) {
const test = testVectors[i];
const password = Buffer.from(test.password, 'hex');
const salt = Buffer.from(test.salt,... | javascript | MIT | 3f106c1ba13a0c909f48740eb3cf86d91e724ad2 | 2026-01-05T03:46:20.050863Z | false |
ricmoo/scrypt-js | https://github.com/ricmoo/scrypt-js/blob/3f106c1ba13a0c909f48740eb3cf86d91e724ad2/thirdparty/buffer.js | thirdparty/buffer.js | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.buffer=e()}}(function(){var define,module,exports;ret... | javascript | MIT | 3f106c1ba13a0c909f48740eb3cf86d91e724ad2 | 2026-01-05T03:46:20.050863Z | true |
ricmoo/scrypt-js | https://github.com/ricmoo/scrypt-js/blob/3f106c1ba13a0c909f48740eb3cf86d91e724ad2/thirdparty/unorm.js | thirdparty/unorm.js | (function (root) {
"use strict";
/***** unorm.js *****/
/*
* UnicodeNormalizer 1.0.0
* Copyright (c) 2008 Matsuza
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
* $Date: 2008-06-05 16:44:17 +0200 (Thu, 05 Jun 2008) $
* $Rev: 13309 $
*/
var DEFAULT_FEATURE = [null, 0, ... | javascript | MIT | 3f106c1ba13a0c909f48740eb3cf86d91e724ad2 | 2026-01-05T03:46:20.050863Z | true |
ricmoo/scrypt-js | https://github.com/ricmoo/scrypt-js/blob/3f106c1ba13a0c909f48740eb3cf86d91e724ad2/thirdparty/setImmediate.js | thirdparty/setImmediate.js | (function (global, undefined) {
"use strict";
if (global.setImmediate) {
return;
}
var nextHandle = 1; // Spec says greater than zero
var tasksByHandle = {};
var currentlyRunningATask = false;
var doc = global.document;
var setImmediate;
function addFromSetImmediateArgumen... | javascript | MIT | 3f106c1ba13a0c909f48740eb3cf86d91e724ad2 | 2026-01-05T03:46:20.050863Z | false |
vadimdemedes/generator-micro-service | https://github.com/vadimdemedes/generator-micro-service/blob/4609587b50cbf986ae2a6a6f21a00dcbe99fc01a/app/index.js | app/index.js | 'use strict';
const Generator = require('yeoman-generator');
const kebabcase = require('lodash.kebabcase');
const superb = require('superb');
module.exports = class extends Generator {
constructor(a, b) {
super(a, b);
this.option('cli', {
type: Boolean,
desc: 'Add a CLI'
});
}
prompting() {
return ... | javascript | MIT | 4609587b50cbf986ae2a6a6f21a00dcbe99fc01a | 2026-01-05T03:46:20.777315Z | false |
vadimdemedes/generator-micro-service | https://github.com/vadimdemedes/generator-micro-service/blob/4609587b50cbf986ae2a6a6f21a00dcbe99fc01a/app/templates/cli.js | app/templates/cli.js | #!/usr/bin/env node
'use strict';
const {spawn} = require('child_process');
const updateNotifier = require('update-notifier');
const pkg = require('./package.json');
updateNotifier({pkg}).notify();
const args = process.argv.slice(2);
spawn('npm', ['start', '--'].concat(args), {
cwd: __dirname,
stdio: 'inherit'
})... | javascript | MIT | 4609587b50cbf986ae2a6a6f21a00dcbe99fc01a | 2026-01-05T03:46:20.777315Z | false |
vadimdemedes/generator-micro-service | https://github.com/vadimdemedes/generator-micro-service/blob/4609587b50cbf986ae2a6a6f21a00dcbe99fc01a/app/templates/index.js | app/templates/index.js | 'use strict';
const {json} = require('micro');
module.exports = async req => {
const body = await json(req);
// let's echo the text
return {text: body.text};
};
| javascript | MIT | 4609587b50cbf986ae2a6a6f21a00dcbe99fc01a | 2026-01-05T03:46:20.777315Z | false |
vadimdemedes/generator-micro-service | https://github.com/vadimdemedes/generator-micro-service/blob/4609587b50cbf986ae2a6a6f21a00dcbe99fc01a/app/templates/test.js | app/templates/test.js | 'use strict';
const listen = require('test-listen');
const micro = require('micro');
const test = require('ava');
const got = require('got');
require('async-to-gen/register')({includes: /index\.js$/});
const app = require('./'); // eslint-disable-line import/order
test('echo back the text', async t => {
const servi... | javascript | MIT | 4609587b50cbf986ae2a6a6f21a00dcbe99fc01a | 2026-01-05T03:46:20.777315Z | false |
vadimdemedes/generator-micro-service | https://github.com/vadimdemedes/generator-micro-service/blob/4609587b50cbf986ae2a6a6f21a00dcbe99fc01a/test/app.js | test/app.js | 'use strict';
import path from 'path';
import helpers from 'yeoman-test';
import assert from 'yeoman-assert';
import test from 'ava';
const generator = path.join(__dirname, '../app');
test.serial('generates expected files', async () => {
await helpers
.run(generator)
.withPrompts({
appName: 'test',
userna... | javascript | MIT | 4609587b50cbf986ae2a6a6f21a00dcbe99fc01a | 2026-01-05T03:46:20.777315Z | false |
xyu/elasticsearch-whatson | https://github.com/xyu/elasticsearch-whatson/blob/a856dddbafdebc4a685085c187f57632b96c2bd6/_site/assets/js/jquery-2.1.0.min.js | _site/assets/js/jquery-2.1.0.min.js | /*! jQuery v2.1.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof windo... | javascript | MIT | a856dddbafdebc4a685085c187f57632b96c2bd6 | 2026-01-05T03:46:21.461171Z | true |
xyu/elasticsearch-whatson | https://github.com/xyu/elasticsearch-whatson/blob/a856dddbafdebc4a685085c187f57632b96c2bd6/_site/assets/js/app.js | _site/assets/js/app.js | (function($) {
var cluster = {
_info: {
host: '',
name: 'Not Connected',
status: 'red',
version: {
major: null,
minor: null,
patch: null
},
master_node: null
},
_is_refreshing: false,
_last_update: null,
_refresh_interval: 5000,
_interval_id: null,
init: function() {
va... | javascript | MIT | a856dddbafdebc4a685085c187f57632b96c2bd6 | 2026-01-05T03:46:21.461171Z | true |
xyu/elasticsearch-whatson | https://github.com/xyu/elasticsearch-whatson/blob/a856dddbafdebc4a685085c187f57632b96c2bd6/_site/assets/js/d3.v3.min.js | _site/assets/js/d3.v3.min.js | !function(){function n(n){return null!=n&&!isNaN(n)}function t(n){return n.length}function e(n){for(var t=1;n*t%1;)t*=10;return t}function r(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function u(){}function i(n){return aa+n in this}function o(n){retur... | javascript | MIT | a856dddbafdebc4a685085c187f57632b96c2bd6 | 2026-01-05T03:46:21.461171Z | true |
xyu/elasticsearch-whatson | https://github.com/xyu/elasticsearch-whatson/blob/a856dddbafdebc4a685085c187f57632b96c2bd6/_site/assets/js/jquery.powertip.min.js | _site/assets/js/jquery.powertip.min.js | /*!
PowerTip - v1.2.0 - 2013-04-03
http://stevenbenner.github.com/jquery-powertip/
Copyright (c) 2013 Steven Benner (http://stevenbenner.com/).
Released under MIT license.
https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt
*/
(function(e){"function"==typeof define&&define.amd?define(["jquery"],... | javascript | MIT | a856dddbafdebc4a685085c187f57632b96c2bd6 | 2026-01-05T03:46:21.461171Z | false |
xyu/elasticsearch-whatson | https://github.com/xyu/elasticsearch-whatson/blob/a856dddbafdebc4a685085c187f57632b96c2bd6/_site/assets/js/underscore-min.js | _site/assets/js/underscore-min.js | // Underscore.js 1.5.2
// http://underscorejs.org
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.... | javascript | MIT | a856dddbafdebc4a685085c187f57632b96c2bd6 | 2026-01-05T03:46:21.461171Z | false |
tunguskha/Image-shadow | https://github.com/tunguskha/Image-shadow/blob/23b61933059d1c30eb7ca5c5978409e809303fd3/assets/js/video-shadow.js | assets/js/video-shadow.js | /*
* video-shadow.js
* <fabien.dutaud@gmail.com> (https://tungu.me)
* Released under the MIT License.
*/
var headCss = "@supports (-ms-ime-align: auto) { .v-clone { display: none; } } @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { .v-clone { display: none; } }";
var head = document.hea... | javascript | MIT | 23b61933059d1c30eb7ca5c5978409e809303fd3 | 2026-01-05T03:46:11.705029Z | false |
tunguskha/Image-shadow | https://github.com/tunguskha/Image-shadow/blob/23b61933059d1c30eb7ca5c5978409e809303fd3/assets/js/image-video-shadow.js | assets/js/image-video-shadow.js | /*
* image-video-shadow.js
* <fabien.dutaud@gmail.com> (https://tungu.me)
* Released under the MIT License.
*/
var headCss =
"@supports (-ms-ime-align: auto) { .image-shadow, .v-clone { display: none; } } @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { .image-shadow, .v-clone { displ... | javascript | MIT | 23b61933059d1c30eb7ca5c5978409e809303fd3 | 2026-01-05T03:46:11.705029Z | false |
tunguskha/Image-shadow | https://github.com/tunguskha/Image-shadow/blob/23b61933059d1c30eb7ca5c5978409e809303fd3/assets/js/video-shadow.min.js | assets/js/video-shadow.min.js | var headCss = "@supports (-ms-ime-align: auto) { .v-clone { display: none; } } @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { .v-clone { display: none; } }", head = document.head || document.getElementsByTagName("head")[0], style = document.createElement("style"); style.type = "text/css", st... | javascript | MIT | 23b61933059d1c30eb7ca5c5978409e809303fd3 | 2026-01-05T03:46:11.705029Z | false |
tunguskha/Image-shadow | https://github.com/tunguskha/Image-shadow/blob/23b61933059d1c30eb7ca5c5978409e809303fd3/assets/js/image-shadow.min.js | assets/js/image-shadow.min.js | var headCss = "@supports (-ms-ime-align: auto) { .image-shadow { display: none; } } @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { .image-shadow { display: none; } }", head = document.head || document.getElementsByTagName("head")[0], style = document.createElement("style"); style.type = "tex... | javascript | MIT | 23b61933059d1c30eb7ca5c5978409e809303fd3 | 2026-01-05T03:46:11.705029Z | false |
tunguskha/Image-shadow | https://github.com/tunguskha/Image-shadow/blob/23b61933059d1c30eb7ca5c5978409e809303fd3/assets/js/image-shadow.js | assets/js/image-shadow.js | /*
* image-shadow.js
* <fabien.dutaud@gmail.com> (https://tungu.me)
* Released under the MIT License.
*/
var headCss =
"@supports (-ms-ime-align: auto) { .image-shadow { display: none; } } @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { .image-shadow { display: none; } }";
var head = ... | javascript | MIT | 23b61933059d1c30eb7ca5c5978409e809303fd3 | 2026-01-05T03:46:11.705029Z | false |
tunguskha/Image-shadow | https://github.com/tunguskha/Image-shadow/blob/23b61933059d1c30eb7ca5c5978409e809303fd3/assets/js/image-video-shadow.min.js | assets/js/image-video-shadow.min.js | var headCss = "@supports (-ms-ime-align: auto) { .image-shadow, .v-clone { display: none; } } @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { .image-shadow, .v-clone { display: none; } }", head = document.head || document.getElementsByTagName("head")[0], style = document.createElement("style"... | javascript | MIT | 23b61933059d1c30eb7ca5c5978409e809303fd3 | 2026-01-05T03:46:11.705029Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/babel.config.js | babel.config.js | module.exports = function (api) {
api.cache(false)
return {
presets: [
[
'@babel/preset-env',
{
targets: {
browsers: [
'chrome >= 58',
'firefox >= 56.2',
],
},
},
],
'@babel/preset-react',
],
... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/gulpfile.js | gulpfile.js | const watchify = require('watchify')
const browserify = require('browserify')
const envify = require('envify/custom')
const gulp = require('gulp')
const source = require('vinyl-source-stream')
const buffer = require('vinyl-buffer')
const gutil = require('gulp-util')
const watch = require('gulp-watch')
const sourcemaps ... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/.storybook/addons.js | .storybook/addons.js | import '@storybook/addon-knobs/register'
import '@storybook/addon-actions/register'
| javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/.storybook/config.js | .storybook/config.js | import { configure } from '@storybook/react'
import '../ui/app/css/index.scss'
const req = require.context('../ui/app/components', true, /\.stories\.js$/)
function loadStories () {
require('./decorators')
req.keys().forEach((filename) => req(filename))
}
configure(loadStories, module)
| javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/.storybook/decorators.js | .storybook/decorators.js | import React from 'react'
import { addDecorator } from '@storybook/react'
import { withInfo } from '@storybook/addon-info'
import { withKnobs } from '@storybook/addon-knobs/react'
const styles = {
height: '100vh',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}
const CenterDecorator = story... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/.storybook/webpack.config.js | .storybook/webpack.config.js | const path = require('path')
module.exports = {
module: {
rules: [
{
test: /\.(woff(2)?|ttf|eot|svg|otf)(\?v=\d+\.\d+\.\d+)?$/,
loaders: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/',
},
}],
... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/first-time-state.js | app/scripts/first-time-state.js |
/**
* @typedef {Object} FirstTimeState
* @property {Object} config Initial configuration parameters
* @property {Object} NetworkController Network controller state
*/
/**
* @type {FirstTimeState}
*/
const initialState = {
config: {},
}
module.exports = initialState
| javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/chromereload.js | app/scripts/chromereload.js | // 'use strict';
// // Reload client for Chrome Apps & Extensions.
// // The reload client has a compatibility with livereload.
// // WARNING: only supports reload command.
// var LIVERELOAD_HOST = 'localhost:';
// var LIVERELOAD_PORT = 35729;
// var connection = new WebSocket('ws://' + LIVERELOAD_HOST + LIVERELOAD_P... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | true |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/metamask-controller.js | app/scripts/metamask-controller.js | /**
* @file The central metamask controller. Aggregates other controllers and exports an api.
* @copyright Copyright (c) 2018 MetaMask
* @license MIT
*/
const assert = require('assert').strict
const EventEmitter = require('events')
const pump = require('pump')
const Dnode = require('dnode')
const Capnode = ... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | true |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/background.js | app/scripts/background.js | /*
* @file The entry point for the web extension singleton process.
*/
// these need to run before anything else
require('./lib/freezeGlobals')
require('./lib/setupFetchDebugging')()
// polyfills
import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'
const endOfStream = require('end-of-stream')
const pump = ... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/phishing-detect.js | app/scripts/phishing-detect.js | const querystring = require('querystring')
const dnode = require('dnode')
const { EventEmitter } = require('events')
const PortStream = require('extension-port-stream')
const extension = require('extensionizer')
const {setupMultiplex} = require('./lib/stream-utils.js')
const { getEnvironmentType } = require('./lib/util... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/inpage.js | app/scripts/inpage.js |
// TODO:plugins:launch remove this
console.warn('MetaMask: You are using the experimental plugin version of MetaMask.')
// need to make sure we aren't affected by overlapping namespaces
// and that we dont affect the app with our namespace
// mostly a fix for web3's BigNumber if AMD's "define" is defined...
let __def... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/ui.js | app/scripts/ui.js |
// this must run before anything else
require('./lib/freezeGlobals')
// polyfills
import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'
const PortStream = require('extension-port-stream')
const { getEnvironmentType } = require('./lib/util')
const { ENVIRONMENT_TYPE_NOTIFICATION, ENVIRONMENT_TYPE_FULLSCREEN, EN... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/edge-encryptor.js | app/scripts/edge-encryptor.js | const asmcrypto = require('asmcrypto.js')
const Unibabel = require('browserify-unibabel')
/**
* A Microsoft Edge-specific encryption class that exposes
* the interface expected by eth-keykeyring-controller
*/
class EdgeEncryptor {
/**
* Encrypts an arbitrary object to ciphertext
*
* @param {string} passw... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/contentscript.js | app/scripts/contentscript.js | const fs = require('fs')
const path = require('path')
const pump = require('pump')
const log = require('loglevel')
const querystring = require('querystring')
const { Writable } = require('readable-stream')
const LocalMessageDuplexStream = require('post-message-stream')
const ObjectMultiplex = require('obj-multiplex')
c... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/balance.js | app/scripts/controllers/balance.js | const ObservableStore = require('obs-store')
const PendingBalanceCalculator = require('../lib/pending-balance-calculator')
const BN = require('ethereumjs-util').BN
class BalanceController {
/**
* Controller responsible for storing and updating an account's balance.
*
* @typedef {Object} BalanceController
... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/plugins.js | app/scripts/controllers/plugins.js | /* global BigInt64Array, BigUint64Array */
const ObservableStore = require('obs-store')
const EventEmitter = require('safe-event-emitter')
const extend = require('xtend')
const { ethErrors, serializeError } = require('eth-json-rpc-errors')
const {
pluginRestrictedMethodDescriptions,
} = require('./permissions/rest... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/accounts.js | app/scripts/controllers/accounts.js | const ObservableStore = require('obs-store')
const EventEmitter = require('safe-event-emitter')
const sigUtil = require('eth-sig-util')
const normalizeAddress = sigUtil.normalize
/**
* Accounts Controller
*
* Provides methods with the same interface as KeyringController
* ( https://www.npmjs.com/package/eth-keyrin... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/cached-balances.js | app/scripts/controllers/cached-balances.js | const ObservableStore = require('obs-store')
const extend = require('xtend')
/**
* @typedef {Object} CachedBalancesOptions
* @property {Object} accountTracker An {@code AccountTracker} reference
* @property {Function} getNetwork A function to get the current network
* @property {Object} initState The initial contr... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/onboarding.js | app/scripts/controllers/onboarding.js | const ObservableStore = require('obs-store')
const extend = require('xtend')
const log = require('loglevel')
/**
* @typedef {Object} InitState
* @property {Boolean} seedPhraseBackedUp Indicates whether the user has completed the seed phrase backup challenge
*/
/**
* @typedef {Object} OnboardingOptions
* @propert... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/threebox.js | app/scripts/controllers/threebox.js | const ObservableStore = require('obs-store')
const Box = process.env.IN_TEST
? require('../../../development/mock-3box')
: require('3box')
const log = require('loglevel')
const migrations = require('../migrations/')
const Migrator = require('../lib/migrator')
const JsonRpcEngine = require('json-rpc-engine')
const p... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/incoming-transactions.js | app/scripts/controllers/incoming-transactions.js | const ObservableStore = require('obs-store')
const log = require('loglevel')
const BN = require('bn.js')
const createId = require('../lib/random-id')
const { bnToHex } = require('../lib/util')
import fetchWithTimeout from '../lib/fetch-with-timeout'
const {
MAINNET_CODE,
ROPSTEN_CODE,
RINKEBY_CODE,
KOVAN_CODE,
... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/app-state.js | app/scripts/controllers/app-state.js | const ObservableStore = require('obs-store')
const extend = require('xtend')
class AppStateController {
/**
* @constructor
* @param opts
*/
constructor (opts = {}) {
const {initState, onInactiveTimeout, preferencesStore} = opts
const {preferences} = preferencesStore.getState()
this.onInactive... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/address-audit.js | app/scripts/controllers/address-audit.js | const ObservableStore = require('obs-store')
const extend = require('xtend')
/**
* A controller that stores info about audited addresses
*/
class AddressAuditController {
/**
* Creates a AddressAuditController
*
* @param {Object} [config] - Options to configure controller
*/
constructor (opts = {}) {... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/preferences.js | app/scripts/controllers/preferences.js | const ObservableStore = require('obs-store')
const { INTERNAL_METHOD_PREFIX } = require('./permissions')
const normalizeAddress = require('eth-sig-util').normalize
const { isValidAddress, sha3, bufferToHex } = require('ethereumjs-util')
const extend = require('xtend')
const { ethErrors } = require('eth-json-rpc-errors'... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/prompts.js | app/scripts/controllers/prompts.js | const ObservableStore = require('obs-store')
const extend = require('xtend')
class PromptController {
constructor () {
const initState = extend({
prompts: {},
})
this.store = new ObservableStore(initState)
this.promptPromises = {}
}
addPrompt (title, { message, html }) {
const currentP... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/detect-tokens.js | app/scripts/controllers/detect-tokens.js | const ethers = require('ethers')
const contracts = require('eth-contract-metadata')
const { warn } = require('loglevel')
const { MAINNET } = require('./network/enums')
// By default, poll every 3 minutes
const DEFAULT_INTERVAL = 180 * 1000
const ERC20_ABI = [{'constant': true, 'inputs': [{'name': '_owner', 'type': 'add... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/recent-blocks.js | app/scripts/controllers/recent-blocks.js | const ObservableStore = require('obs-store')
const extend = require('xtend')
const EthQuery = require('eth-query')
const log = require('loglevel')
const pify = require('pify')
const {
ROPSTEN,
RINKEBY,
KOVAN,
MAINNET,
GOERLI,
} = require('./network/enums')
const INFURA_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVA... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/resource.js | app/scripts/controllers/resource.js | const ObservableStore = require('obs-store')
const EventEmitter = require('safe-event-emitter')
const { ethErrors } = require('eth-json-rpc-errors')
/**
* Resource Controller
*
* An abstract class intended to describe a particular resource that is managed by plugins.
* Example resources are accounts and assets.
*... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/infura.js | app/scripts/controllers/infura.js | const ObservableStore = require('obs-store')
const extend = require('xtend')
const log = require('loglevel')
// every ten minutes
const POLLING_INTERVAL = 10 * 60 * 1000
class InfuraController {
constructor (opts = {}) {
const initState = extend({
infuraNetworkStatus: {},
}, opts.initState)
this.... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/token-rates.js | app/scripts/controllers/token-rates.js | const ObservableStore = require('obs-store')
const log = require('loglevel')
const normalizeAddress = require('eth-sig-util').normalize
const ethUtil = require('ethereumjs-util')
// By default, poll every 3 minutes
const DEFAULT_INTERVAL = 180 * 1000
/**
* A controller that polls for token exchange
* rates based o... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/ab-test.js | app/scripts/controllers/ab-test.js | const ObservableStore = require('obs-store')
const extend = require('xtend')
const { getRandomArrayItem } = require('../lib/util')
/**
* a/b test descriptions:
* - `fullScreenVsPopup`:
* - description: tests whether showing tx confirmations in full screen in the browser will increase rates of successful
* conf... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/permissions/permissionsLog.js | app/scripts/controllers/permissions/permissionsLog.js |
const clone = require('clone')
const { isValidAddress } = require('ethereumjs-util')
const LOG_LIMIT = 100
/**
* Create middleware for logging requests and responses to restricted and
* permissions-related methods.
*/
module.exports = function createLoggerMiddleware ({
origin, walletPrefix, restrictedMethods, s... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/permissions/index.js | app/scripts/controllers/permissions/index.js | const JsonRpcEngine = require('json-rpc-engine')
const asMiddleware = require('json-rpc-engine/src/asMiddleware')
const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware')
const ObservableStore = require('obs-store')
const RpcCap = require('rpc-cap').CapabilitiesController
const { ethErrors, se... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/permissions/methodMiddleware.js | app/scripts/controllers/permissions/methodMiddleware.js |
const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware')
const { ethErrors, serializeError} = require('eth-json-rpc-errors')
const { PLUGIN_PREFIX, PLUGIN_PREFIX_REGEX } = require('./enums')
/**
* Middleware for preprocessing permission requests and outright handling
* certain methods.
*
... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/permissions/enums.js | app/scripts/controllers/permissions/enums.js |
const pluginPrefix = 'wallet_plugin_'
module.exports = {
WALLET_PREFIX: 'wallet_',
PLUGIN_PREFIX: pluginPrefix,
PLUGIN_PREFIX_REGEX: new RegExp(`^${pluginPrefix}`),
HISTORY_STORE_KEY: 'permissionsHistory',
LOG_STORE_KEY: 'permissionsLog',
METADATA_STORE_KEY: 'domainMetadata',
CAVEAT_NAMES: {
exposed... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/permissions/restrictedMethods.js | app/scripts/controllers/permissions/restrictedMethods.js |
const { ethErrors } = require('eth-json-rpc-errors')
const { deriveKeyFromPath } = require('@metamask/key-tree')
// ATTN: this list determines which internal API methods a plugin can actually use
const pluginRestrictedMethodDescriptions = {
onNewTx: 'Take action whenever a new transaction is created',
fetch: 'Ret... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/ens/ens.js | app/scripts/controllers/ens/ens.js | const EthJsEns = require('ethjs-ens')
const ensNetworkMap = require('ethjs-ens/lib/network-map.json')
class Ens {
static getNetworkEnsSupport (network) {
return Boolean(ensNetworkMap[network])
}
constructor ({ network, provider } = {}) {
this._ethJsEns = new EthJsEns({
network,
provider,
... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/ens/index.js | app/scripts/controllers/ens/index.js | const ethUtil = require('ethereumjs-util')
const ObservableStore = require('obs-store')
const punycode = require('punycode')
const log = require('loglevel')
const Ens = require('./ens')
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
const ZERO_X_ERROR_ADDRESS = '0x'
class EnsController {
construc... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/transactions/index.js | app/scripts/controllers/transactions/index.js | const EventEmitter = require('safe-event-emitter')
const ObservableStore = require('obs-store')
const ethUtil = require('ethereumjs-util')
const Transaction = require('ethereumjs-tx')
const EthQuery = require('ethjs-query')
const { ethErrors } = require('eth-json-rpc-errors')
const abi = require('human-standard-token-a... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/transactions/tx-gas-utils.js | app/scripts/controllers/transactions/tx-gas-utils.js | const EthQuery = require('ethjs-query')
const {
hexToBn,
BnMultiplyByFraction,
bnToHex,
} = require('../../lib/util')
const log = require('loglevel')
const { addHexPrefix } = require('ethereumjs-util')
const { SEND_ETHER_ACTION_KEY } = require('../../../../ui/app/helpers/constants/transactions.js')
const SIMPLE_G... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/transactions/tx-state-manager.js | app/scripts/controllers/transactions/tx-state-manager.js | const extend = require('xtend')
const EventEmitter = require('safe-event-emitter')
const ObservableStore = require('obs-store')
const log = require('loglevel')
const txStateHistoryHelper = require('./lib/tx-state-history-helper')
const createId = require('../../lib/random-id')
const { getFinalStates, normalizeTxParams ... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/transactions/enums.js | app/scripts/controllers/transactions/enums.js | const TRANSACTION_TYPE_CANCEL = 'cancel'
const TRANSACTION_TYPE_RETRY = 'retry'
const TRANSACTION_TYPE_STANDARD = 'standard'
const TRANSACTION_STATUS_APPROVED = 'approved'
const TRANSACTION_STATUS_CONFIRMED = 'confirmed'
module.exports = {
TRANSACTION_TYPE_CANCEL,
TRANSACTION_TYPE_RETRY,
TRANSACTION_TYPE_STANDA... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/transactions/pending-tx-tracker.js | app/scripts/controllers/transactions/pending-tx-tracker.js | const EventEmitter = require('safe-event-emitter')
const log = require('loglevel')
const EthQuery = require('ethjs-query')
/**
Event emitter utility class for tracking the transactions as they<br>
go from a pending state to a confirmed (mined in a block) state<br>
<br>
As well as continues broadcast while in th... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/transactions/lib/recipient-blacklist.js | app/scripts/controllers/transactions/lib/recipient-blacklist.js | module.exports = {
'blacklist': [
// IDEX phisher
'0x9bcb0A9d99d815Bb87ee3191b1399b1Bcc46dc77',
// Ganache default seed phrases
'0x627306090abab3a6e1400e9345bc60c78a8bef57',
'0xf17f52151ebef6c7334fad080c5704d77216b732',
'0xc5fdf4076b8f3a5357c5e395ab970b5b54098fef',
'0x821aea9a577a9b44299b9... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/transactions/lib/tx-state-history-helper.js | app/scripts/controllers/transactions/lib/tx-state-history-helper.js | const jsonDiffer = require('fast-json-patch')
const clone = require('clone')
/** @module*/
module.exports = {
generateHistoryEntry,
replayHistory,
snapshotFromTxMeta,
migrateFromSnapshotsToDiffs,
}
/**
converts non-initial history entries into diffs
@param longHistory {array}
@returns {array}
*/
function... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/transactions/lib/recipient-blacklist-checker.js | app/scripts/controllers/transactions/lib/recipient-blacklist-checker.js | const Config = require('./recipient-blacklist.js')
/** @module*/
module.exports = {
checkAccount,
}
/**
* Checks if a specified account on a specified network is blacklisted.
@param networkId {number}
@param account {string}
*/
function checkAccount (networkId, account) {
const mainnetId = 1
if (networkId... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/transactions/lib/util.js | app/scripts/controllers/transactions/lib/util.js | const {
addHexPrefix,
isValidAddress,
} = require('ethereumjs-util')
/**
@module
*/
module.exports = {
normalizeTxParams,
validateTxParams,
validateFrom,
validateRecipient,
getFinalStates,
}
// functions that handle normalizing of that key in txParams
const normalizers = {
from: (from, LowerCase = tr... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/network/contract-addresses.js | app/scripts/controllers/network/contract-addresses.js | const SINGLE_CALL_BALANCES_ADDRESS = '0xb1f8e55c7f64d203c1400b9d8555d050f94adf39'
const SINGLE_CALL_BALANCES_ADDRESS_RINKEBY = '0x9f510b19f1ad66f0dcf6e45559fab0d6752c1db7'
const SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN = '0xb8e671734ce5c8d7dfbbea5574fa4cf39f7a54a4'
const SINGLE_CALL_BALANCES_ADDRESS_KOVAN = '0xb1d3fbb2f83a... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/network/index.js | app/scripts/controllers/network/index.js | const NetworkController = require('./network')
module.exports = NetworkController
| javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/network/createInfuraClient.js | app/scripts/controllers/network/createInfuraClient.js | const mergeMiddleware = require('json-rpc-engine/src/mergeMiddleware')
const createScaffoldMiddleware = require('json-rpc-engine/src/createScaffoldMiddleware')
const createBlockReRefMiddleware = require('eth-json-rpc-middleware/block-ref')
const createRetryOnEmptyMiddleware = require('eth-json-rpc-middleware/retryOnEmp... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/network/createJsonRpcClient.js | app/scripts/controllers/network/createJsonRpcClient.js | const mergeMiddleware = require('json-rpc-engine/src/mergeMiddleware')
const createFetchMiddleware = require('eth-json-rpc-middleware/fetch')
const createBlockRefRewriteMiddleware = require('eth-json-rpc-middleware/block-ref-rewrite')
const createBlockCacheMiddleware = require('eth-json-rpc-middleware/block-cache')
con... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/network/createMetamaskMiddleware.js | app/scripts/controllers/network/createMetamaskMiddleware.js | const mergeMiddleware = require('json-rpc-engine/src/mergeMiddleware')
const createScaffoldMiddleware = require('json-rpc-engine/src/createScaffoldMiddleware')
const createWalletSubprovider = require('eth-json-rpc-middleware/wallet')
const { createPendingNonceMiddleware, createPendingTxMiddleware } = require('./middlew... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/network/network.js | app/scripts/controllers/network/network.js | const assert = require('assert')
const EventEmitter = require('events')
const ObservableStore = require('obs-store')
const ComposedStore = require('obs-store/lib/composed')
const EthQuery = require('eth-query')
const JsonRpcEngine = require('json-rpc-engine')
const providerFromEngine = require('eth-json-rpc-middleware/... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/network/createLocalhostClient.js | app/scripts/controllers/network/createLocalhostClient.js | const mergeMiddleware = require('json-rpc-engine/src/mergeMiddleware')
const createFetchMiddleware = require('eth-json-rpc-middleware/fetch')
const createBlockRefRewriteMiddleware = require('eth-json-rpc-middleware/block-ref-rewrite')
const createBlockTrackerInspectorMiddleware = require('eth-json-rpc-middleware/block-... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/network/util.js | app/scripts/controllers/network/util.js | const {
ROPSTEN,
RINKEBY,
KOVAN,
MAINNET,
GOERLI,
ROPSTEN_CODE,
RINKEBY_CODE,
KOVAN_CODE,
GOERLI_CODE,
ROPSTEN_DISPLAY_NAME,
RINKEBY_DISPLAY_NAME,
KOVAN_DISPLAY_NAME,
MAINNET_DISPLAY_NAME,
GOERLI_DISPLAY_NAME,
} = require('./enums')
const networkToNameMap = {
[ROPSTEN]: ROPSTEN_DISPLAY_NA... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/network/enums.js | app/scripts/controllers/network/enums.js | const ROPSTEN = 'ropsten'
const RINKEBY = 'rinkeby'
const KOVAN = 'kovan'
const MAINNET = 'mainnet'
const LOCALHOST = 'localhost'
const GOERLI = 'goerli'
const MAINNET_CODE = 1
const ROPSTEN_CODE = 3
const RINKEBY_CODE = 4
const KOVAN_CODE = 42
const GOERLI_CODE = 5
const ROPSTEN_DISPLAY_NAME = 'Ropsten'
const RINKEB... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/controllers/network/middleware/pending.js | app/scripts/controllers/network/middleware/pending.js | const { formatTxMetaForRpcResult } = require('../util')
const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware')
function createPendingNonceMiddleware ({ getPendingNonce }) {
return createAsyncMiddleware(async (req, res, next) => {
const {method, params} = req
if (method !== 'eth_ge... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/platforms/sw.js | app/scripts/platforms/sw.js | class SwPlatform {
/**
* Reloads the platform
*/
reload () {
// TODO: you can't actually do this
/** @type {any} */ (global).location.reload()
}
/**
* Opens a window
* @param {{url: string}} opts - The window options
*/
openWindow (opts) {
// TODO: this doesn't actually work
/*... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/platforms/window.js | app/scripts/platforms/window.js | class WindowPlatform {
/**
* Reload the platform
*/
reload () {
/** @type {any} */ (global).location.reload()
}
/**
* Opens a window
* @param {{url: string}} opts - The window options
*/
openWindow (opts) {
/** @type {any} */ (global).open(opts.url, '_blank')
}
/**
* Returns th... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/platforms/extension.js | app/scripts/platforms/extension.js | const extension = require('extensionizer')
const {createExplorerLink: explorerLink} = require('etherscan-link')
const {getEnvironmentType} = require('../lib/util')
const {ENVIRONMENT_TYPE_BACKGROUND} = require('../lib/enums')
class ExtensionPlatform {
//
// Public
//
reload () {
extension.runtime.reload(... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
MetaMask/metamask-snaps-beta | https://github.com/MetaMask/metamask-snaps-beta/blob/4169c2445e025631fa963e03da24379607a9beab/app/scripts/migrations/019.js | app/scripts/migrations/019.js |
const version = 19
/*
This migration sets transactions as failed
whos nonce is too high
*/
const clone = require('clone')
module.exports = {
version,
migrate: function (originalVersionedData) {
const versionedData = clone(originalVersionedData)
versionedData.meta.version = version
try {
con... | javascript | MIT | 4169c2445e025631fa963e03da24379607a9beab | 2026-01-05T03:45:16.937444Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.