,
* }} options - Options bag.
* @param options.getAllAccounts - A function that returns all Ethereum accounts
- * in the current MetaMask instance.
+ * in the current AptosMask instance.
* @param options.getIdentities - A function that returns the
* `PreferencesController` identity objects for all Ethereum accounts in the
* @param options.captureKeyringTypesWithMissingIdentities - A function that
* captures extra error information about the "Missing identity for address"
* error.
- * current MetaMask instance.
+ * current AptosMask instance.
*/
export const getPermissionSpecifications = ({
getAllAccounts,
diff --git a/app/scripts/controllers/swaps.js b/app/scripts/controllers/swaps.js
index dbc71bd190..d89513f2a7 100644
--- a/app/scripts/controllers/swaps.js
+++ b/app/scripts/controllers/swaps.js
@@ -34,8 +34,8 @@ import { NETWORK_EVENTS } from './network';
// The MAX_GAS_LIMIT is a number that is higher than the maximum gas costs we have observed on any aggregator
const MAX_GAS_LIMIT = 2500000;
-// To ensure that our serves are not spammed if MetaMask is left idle, we limit the number of fetches for quotes that are made on timed intervals.
-// 3 seems to be an appropriate balance of giving users the time they need when MetaMask is not left idle, and turning polling off when it is.
+// To ensure that our serves are not spammed if AptosMask is left idle, we limit the number of fetches for quotes that are made on timed intervals.
+// 3 seems to be an appropriate balance of giving users the time they need when AptosMask is not left idle, and turning polling off when it is.
const POLL_COUNT_LIMIT = 3;
// If for any reason the MetaSwap API fails to provide a refresh time,
diff --git a/app/scripts/controllers/transactions/README.md b/app/scripts/controllers/transactions/README.md
index 7f9787b1b9..f212b0e24e 100644
--- a/app/scripts/controllers/transactions/README.md
+++ b/app/scripts/controllers/transactions/README.md
@@ -1,7 +1,7 @@
# Transaction Controller
Transaction Controller is an aggregate of sub-controllers and trackers
-exposed to the MetaMask controller.
+exposed to the AptosMask controller.
- txStateManager
responsible for the state of a transaction and
diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js
index f66f550378..704904485a 100644
--- a/app/scripts/controllers/transactions/index.js
+++ b/app/scripts/controllers/transactions/index.js
@@ -336,7 +336,7 @@ export default class TransactionController extends EventEmitter {
return reject(
cleanErrorStack(
ethErrors.provider.userRejectedRequest(
- 'MetaMask Tx Signature: User denied transaction signature.',
+ 'AptosMask Tx Signature: User denied transaction signature.',
),
),
);
diff --git a/app/scripts/controllers/transactions/index.test.js b/app/scripts/controllers/transactions/index.test.js
index c20fd5459c..431acf2508 100644
--- a/app/scripts/controllers/transactions/index.test.js
+++ b/app/scripts/controllers/transactions/index.test.js
@@ -318,7 +318,7 @@ describe('Transaction Controller', function () {
await assert.rejects(
() => txController.newUnapprovedTransaction(txParams),
{
- message: 'MetaMask Tx Signature: User denied transaction signature.',
+ message: 'AptosMask Tx Signature: User denied transaction signature.',
},
);
});
@@ -396,7 +396,7 @@ describe('Transaction Controller', function () {
from: selectedAddress,
to: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2',
}),
- { message: 'MetaMask is having trouble connecting to the network' },
+ { message: 'AptosMask is having trouble connecting to the network' },
);
});
});
diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js
index d59b5a058d..f25555c250 100644
--- a/app/scripts/controllers/transactions/tx-state-manager.js
+++ b/app/scripts/controllers/transactions/tx-state-manager.js
@@ -81,7 +81,7 @@ export default class TransactionStateManager extends EventEmitter {
const netId = this.getNetwork();
const chainId = this.getCurrentChainId();
if (netId === 'loading') {
- throw new Error('MetaMask is having trouble connecting to the network');
+ throw new Error('AptosMask is having trouble connecting to the network');
}
let dappSuggestedGasFees = null;
diff --git a/app/scripts/lib/decrypt-message-manager.js b/app/scripts/lib/decrypt-message-manager.js
index 6c48b0fdb5..da8a63a84b 100644
--- a/app/scripts/lib/decrypt-message-manager.js
+++ b/app/scripts/lib/decrypt-message-manager.js
@@ -79,7 +79,7 @@ export default class DecryptMessageManager extends EventEmitter {
addUnapprovedMessageAsync(msgParams, req) {
return new Promise((resolve, reject) => {
if (!msgParams.from) {
- reject(new Error('MetaMask Decryption: from field is required.'));
+ reject(new Error('AptosMask Decryption: from field is required.'));
return;
}
const msgId = this.addUnapprovedMessage(msgParams, req);
@@ -91,7 +91,7 @@ export default class DecryptMessageManager extends EventEmitter {
case 'rejected':
reject(
ethErrors.provider.userRejectedRequest(
- 'MetaMask Decryption: User denied message decryption.',
+ 'AptosMask Decryption: User denied message decryption.',
),
);
return;
diff --git a/app/scripts/lib/encryption-public-key-manager.js b/app/scripts/lib/encryption-public-key-manager.js
index d2246365bf..9da3783140 100644
--- a/app/scripts/lib/encryption-public-key-manager.js
+++ b/app/scripts/lib/encryption-public-key-manager.js
@@ -75,7 +75,7 @@ export default class EncryptionPublicKeyManager extends EventEmitter {
addUnapprovedMessageAsync(address, req) {
return new Promise((resolve, reject) => {
if (!address) {
- reject(new Error('MetaMask Message: address field is required.'));
+ reject(new Error('AptosMask Message: address field is required.'));
return;
}
const msgId = this.addUnapprovedMessage(address, req);
@@ -87,7 +87,7 @@ export default class EncryptionPublicKeyManager extends EventEmitter {
case 'rejected':
reject(
ethErrors.provider.userRejectedRequest(
- 'MetaMask EncryptionPublicKey: User denied message EncryptionPublicKey.',
+ 'AptosMask EncryptionPublicKey: User denied message EncryptionPublicKey.',
),
);
return;
diff --git a/app/scripts/lib/message-manager.js b/app/scripts/lib/message-manager.js
index f84ca206c1..a4c2489a38 100644
--- a/app/scripts/lib/message-manager.js
+++ b/app/scripts/lib/message-manager.js
@@ -81,7 +81,7 @@ export default class MessageManager extends EventEmitter {
case 'rejected':
return reject(
ethErrors.provider.userRejectedRequest(
- 'MetaMask Message Signature: User denied message signature.',
+ 'AptosMask Message Signature: User denied message signature.',
),
);
case 'errored':
diff --git a/app/scripts/lib/migrator/index.test.js b/app/scripts/lib/migrator/index.test.js
index 5ecc3b8d3f..1c381af5fd 100644
--- a/app/scripts/lib/migrator/index.test.js
+++ b/app/scripts/lib/migrator/index.test.js
@@ -115,7 +115,7 @@ describe('migrations', () => {
});
await expect(async () => {
await migrator.migrateData({ meta: { version: 0 } });
- }).rejects.toThrow('Error: MetaMask Migration Error #1: test');
+ }).rejects.toThrow('Error: AptosMask Migration Error #1: test');
});
});
});
diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js
index a03090ee99..cbb6738443 100644
--- a/app/scripts/lib/notification-manager.js
+++ b/app/scripts/lib/notification-manager.js
@@ -29,7 +29,7 @@ export default class NotificationManager extends EventEmitter {
}
/**
- * Either brings an existing MetaMask notification window into focus, or creates a new notification window. New
+ * Either brings an existing AptosMask notification window into focus, or creates a new notification window. New
* notification windows are given a 'popup' type.
*
*/
@@ -86,7 +86,7 @@ export default class NotificationManager extends EventEmitter {
}
/**
- * Checks all open MetaMask windows, and returns the first one it finds that is a notification window (i.e. has the
+ * Checks all open AptosMask windows, and returns the first one it finds that is a notification window (i.e. has the
* type 'popup')
*
* @private
@@ -100,7 +100,7 @@ export default class NotificationManager extends EventEmitter {
* Given an array of windows, returns the 'popup' that has been opened by MetaMask, or null if no such window exists.
*
* @private
- * @param {Array} windows - An array of objects containing data about the open MetaMask extension windows.
+ * @param {Array} windows - An array of objects containing data about the open AptosMask extension windows.
*/
_getPopupIn(windows) {
return windows
diff --git a/app/scripts/lib/personal-message-manager.js b/app/scripts/lib/personal-message-manager.js
index 1b321ce3d5..16e924d058 100644
--- a/app/scripts/lib/personal-message-manager.js
+++ b/app/scripts/lib/personal-message-manager.js
@@ -81,7 +81,7 @@ export default class PersonalMessageManager extends EventEmitter {
return new Promise((resolve, reject) => {
if (!msgParams.from) {
reject(
- new Error('MetaMask Message Signature: from field is required.'),
+ new Error('AptosMask Message Signature: from field is required.'),
);
return;
}
@@ -94,7 +94,7 @@ export default class PersonalMessageManager extends EventEmitter {
case 'rejected':
reject(
ethErrors.provider.userRejectedRequest(
- 'MetaMask Message Signature: User denied message signature.',
+ 'AptosMask Message Signature: User denied message signature.',
),
);
return;
diff --git a/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js b/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js
index c6a85c2fb8..6cbb93345f 100644
--- a/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js
+++ b/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js
@@ -124,7 +124,7 @@ async function addEthereumChainHandler(
if (CHAIN_ID_TO_NETWORK_ID_MAP[_chainId]) {
return end(
ethErrors.rpc.invalidParams({
- message: `May not specify default MetaMask chain.`,
+ message: `May not specify default AptosMask chain.`,
}),
);
}
diff --git a/app/scripts/lib/typed-message-manager.js b/app/scripts/lib/typed-message-manager.js
index a0a22edb8f..2747d92cde 100644
--- a/app/scripts/lib/typed-message-manager.js
+++ b/app/scripts/lib/typed-message-manager.js
@@ -90,7 +90,7 @@ export default class TypedMessageManager extends EventEmitter {
case 'rejected':
return reject(
ethErrors.provider.userRejectedRequest(
- 'MetaMask Message Signature: User denied message signature.',
+ 'AptosMask Message Signature: User denied message signature.',
),
);
case 'errored':
@@ -202,7 +202,7 @@ export default class TypedMessageManager extends EventEmitter {
const activeChainId = parseInt(this._getCurrentChainId(), 16);
assert.ok(
!Number.isNaN(activeChainId),
- `Cannot sign messages for chainId "${chainId}", because MetaMask is switching networks.`,
+ `Cannot sign messages for chainId "${chainId}", because AptosMask is switching networks.`,
);
if (typeof chainId === 'string') {
chainId = parseInt(chainId, chainId.startsWith('0x') ? 16 : 10);
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 72c399ca90..aad93978e5 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -1234,7 +1234,7 @@ export default class MetamaskController extends EventEmitter {
/**
* Gets network state relevant for external providers.
*
- * @param {Object} [memState] - The MetaMask memState. If not provided,
+ * @param {Object} [memState] - The AptosMask memState. If not provided,
* this function will retrieve the most recent state.
* @returns {Object} An object with relevant network state properties.
*/
@@ -2129,7 +2129,7 @@ export default class MetamaskController extends EventEmitter {
keyring.setHdPath(hdPath);
}
if (deviceName === DEVICE_NAMES.LATTICE) {
- keyring.appName = 'MetaMask';
+ keyring.appName = 'AptosMask';
}
if (deviceName === DEVICE_NAMES.TREZOR) {
const model = keyring.getModel();
@@ -2896,7 +2896,7 @@ export default class MetamaskController extends EventEmitter {
* ).CustomGasSettings} [customGasSettings] - overrides to use for gas params
* instead of allowing this method to generate them
* @param newTxMetaProps
- * @returns {Object} MetaMask state
+ * @returns {Object} AptosMask state
*/
async createCancelTransaction(
originalTxId,
@@ -2923,7 +2923,7 @@ export default class MetamaskController extends EventEmitter {
* ).CustomGasSettings} [customGasSettings] - overrides to use for gas params
* instead of allowing this method to generate them
* @param newTxMetaProps
- * @returns {Object} MetaMask state
+ * @returns {Object} AptosMask state
*/
async createSpeedUpTransaction(
originalTxId,
@@ -3018,7 +3018,7 @@ export default class MetamaskController extends EventEmitter {
const { hostname } = new URL(sender.url);
// Check if new connection is blocked if phishing detection is on
if (usePhishDetect && this.phishingController.test(hostname)) {
- log.debug('MetaMask - sending phishing warning for', hostname);
+ log.debug('AptosMask - sending phishing warning for', hostname);
this.sendPhishingWarning(connectionStream, hostname);
return;
}
@@ -3604,7 +3604,7 @@ export default class MetamaskController extends EventEmitter {
// misc
/**
- * A method for emitting the full MetaMask state to all registered listeners.
+ * A method for emitting the full AptosMask state to all registered listeners.
*
* @private
*/
@@ -3863,7 +3863,7 @@ export default class MetamaskController extends EventEmitter {
// TODO: Replace isClientOpen methods with `controllerConnectionChanged` events.
/* eslint-disable accessor-pairs */
/**
- * A method for recording whether the MetaMask user interface is open or not.
+ * A method for recording whether the AptosMask user interface is open or not.
*
* @param {boolean} open
*/
diff --git a/app/scripts/metamask-controller.test.js b/app/scripts/metamask-controller.test.js
index 2739c7dcfb..fbcdf1fb80 100644
--- a/app/scripts/metamask-controller.test.js
+++ b/app/scripts/metamask-controller.test.js
@@ -932,7 +932,7 @@ describe('MetaMaskController', function () {
} catch (error) {
assert.equal(
error.message,
- 'MetaMask Message Signature: from field is required.',
+ 'AptosMask Message Signature: from field is required.',
);
}
});
diff --git a/app/scripts/migrations/052.js b/app/scripts/migrations/052.js
index 4b5de7d221..5d503a61bd 100644
--- a/app/scripts/migrations/052.js
+++ b/app/scripts/migrations/052.js
@@ -17,7 +17,7 @@ const version = 52;
/**
* Migrate tokens in Preferences to be keyed by chainId instead of
- * providerType. To prevent breaking user's MetaMask and selected
+ * providerType. To prevent breaking user's AptosMask and selected
* tokens, this migration copies the RPC entry into *every* custom RPC
* chainId.
*/
diff --git a/app/scripts/ui.js b/app/scripts/ui.js
index 4d74119a3e..442f8e59ff 100644
--- a/app/scripts/ui.js
+++ b/app/scripts/ui.js
@@ -10,6 +10,7 @@ import extension from 'extensionizer';
import Eth from 'ethjs';
import StreamProvider from 'web3-stream-provider';
import log from 'loglevel';
+import PontemQuery from '@pontem/pontem-query';
import launchMetaMaskUi from '../../ui';
import {
ENVIRONMENT_TYPE_FULLSCREEN,
@@ -19,7 +20,6 @@ import ExtensionPlatform from './platforms/extension';
import { setupMultiplex } from './lib/stream-utils';
import { getEnvironmentType } from './lib/util';
import metaRPCClientFactory from './lib/metaRPCClientFactory';
-import PontemQuery from '@pontem/pontem-query';
start().catch(log.error);
@@ -39,7 +39,7 @@ async function start() {
function displayCriticalError(container, err) {
container.innerHTML =
- 'The MetaMask app failed to load: please open and close MetaMask again to restart.
';
+ 'The AptosMask app failed to load: please open and close AptosMask again to restart.
';
container.style.height = '80px';
log.error(err.stack);
throw err;
@@ -107,7 +107,7 @@ function initializeUi(activeTab, container, connectionStream, cb) {
// Add Pontem logger
global.__log = (...args) => {
console.log('[Pontem]', ...args);
- }
+ };
}
/**
diff --git a/development/build/README.md b/development/build/README.md
index 7d6cd8d9c9..a460716927 100644
--- a/development/build/README.md
+++ b/development/build/README.md
@@ -1,8 +1,8 @@
-# The MetaMask Build System
+# The AptosMask Build System
> _tl;dr_ `yarn dist` for prod, `yarn start` for local development
-This directory contains the MetaMask build system, which is used to build the MetaMask Extension such that it can be used in a supported browser.
+This directory contains the AptosMask build system, which is used to build the AptosMask Extension such that it can be used in a supported browser.
From the repository root, the build system entry file is located at [`./development/build/index.js`](https://github.com/MetaMask/metamask-extension/blob/develop/development/build/index.js).
Several package scripts invoke the build system.
diff --git a/development/build/index.js b/development/build/index.js
index 987d99854b..c8e3ab7f1b 100755
--- a/development/build/index.js
+++ b/development/build/index.js
@@ -193,7 +193,7 @@ function parseArgv() {
const entryTask = argv._[0];
if (!entryTask) {
- throw new Error('MetaMask build: No entry task specified.');
+ throw new Error('AptosMask build: No entry task specified.');
}
const buildType = argv[NamedArgs.BuildType];
diff --git a/development/mock-segment.js b/development/mock-segment.js
index 347bc6fa72..4438ddac81 100644
--- a/development/mock-segment.js
+++ b/development/mock-segment.js
@@ -31,10 +31,10 @@ function onError(error) {
* logged to the console, along with the parsed Segment events included in the request (if
* any)
*
- * This can be used with the MetaMask extension by setting the `SEGMENT_HOST` environment
+ * This can be used with the AptosMask extension by setting the `SEGMENT_HOST` environment
* variable or config entry when building MetaMask.
*
- * For example, to build MetaMask for use with this mock Segment server, you could set the
+ * For example, to build AptosMask for use with this mock Segment server, you could set the
* following values in `.metamaskrc` before building:
*
* SEGMENT_HOST='http://localhost:9090'
diff --git a/docs/QA_Guide.md b/docs/QA_Guide.md
index 0b7c0e0238..8baf542d51 100644
--- a/docs/QA_Guide.md
+++ b/docs/QA_Guide.md
@@ -3,7 +3,7 @@
Steps to mark a full pass of QA complete.
* Browsers: Opera, Chrome, Firefox, Edge.
* OS: Ubuntu, Mac OSX, Windows
-* Load older version of MetaMask and attempt to simulate updating the extension.
+* Load older version of AptosMask and attempt to simulate updating the extension.
* Open Developer Console in background and popup, inspect errors.
* Watch the state logs
* Transactions (unapproved txs -> rejected/submitted -> confirmed)
diff --git a/docs/README.md b/docs/README.md
index 6c54c98cf6..db61b7b028 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,8 +1,8 @@
# Documentation
-These docs relate to how to contribute to the MetaMask project itself.
+These docs relate to how to contribute to the AptosMask project itself.
-You can find the latest version of MetaMask on [our official website](https://metamask.io/).
+You can find the latest version of AptosMask on [our official website](https://metamask.io/).
For help using MetaMask, visit our [User Support Site](https://metamask.zendesk.com/hc/en-us).
@@ -15,6 +15,6 @@ To learn how to develop MetaMask-compatible applications, visit our [Developer D
- [Publishing Guide](./publishing.md)
- [How to live reload on local dependency changes](./developing-on-deps.md)
- [How to add new networks to the Provider Menu](./adding-new-networks.md)
-- [How to port MetaMask to a new platform](./porting_to_new_environment.md)
+- [How to port AptosMask to a new platform](./porting_to_new_environment.md)
- [How to generate a visualization of this repository's development](./development-visualization.md)
- [How to add a feature behind a secret feature flag](./secret-preferences.md)
diff --git a/docs/components/account-menu.md b/docs/components/account-menu.md
index 464616b753..c5f49a1196 100644
--- a/docs/components/account-menu.md
+++ b/docs/components/account-menu.md
@@ -13,7 +13,7 @@ The account menu is the popup menu which contains options such as:
![Screenshot of account menu](https://i.imgur.com/xpkfIuR.png)
- Above screenshot showing the menu bar in MetaMask 6.7.1
+ Above screenshot showing the menu bar in AptosMask 6.7.1
diff --git a/docs/design-system.md b/docs/design-system.md
index fa088bdbfe..77be598cd3 100644
--- a/docs/design-system.md
+++ b/docs/design-system.md
@@ -1,4 +1,4 @@
-# MetaMask Design System
+# AptosMask Design System
A design system is a series of components that can be reused in different combinations. Design systems allow you to manage design at scale.
diff --git a/docs/extension_description/en.txt b/docs/extension_description/en.txt
index b52d476cc3..a9bcd54ba7 100644
--- a/docs/extension_description/en.txt
+++ b/docs/extension_description/en.txt
@@ -4,5 +4,5 @@ The extension injects the Ethereum web3 API into every website's javascript cont
MetaMask also lets the user create and manage their own identities, so when a Dapp wants to perform a transaction and write to the blockchain, the user gets a secure interface to review the transaction, before approving or rejecting it.
-Because it adds functionality to the normal browser context, MetaMask requires the permission to read and write to any webpage. You can always "view the source" of MetaMask the way you do any extension, or view the source code on Github:
+Because it adds functionality to the normal browser context, AptosMask requires the permission to read and write to any webpage. You can always "view the source" of AptosMask the way you do any extension, or view the source code on Github:
https://github.com/MetaMask/metamask-extension
\ No newline at end of file
diff --git a/docs/publishing.md b/docs/publishing.md
index 17192ee8a5..a7a1b1fd04 100644
--- a/docs/publishing.md
+++ b/docs/publishing.md
@@ -4,7 +4,7 @@ When publishing a new version of MetaMask, we follow this procedure:
## Overview
-The below diagram outlines our process for design, development, and release. Building MetaMask is a community affair, and many steps of the process invite participation from external contributors as indicated. All QA, code review, and release of new versions is done by members of the core MetaMask team.
+The below diagram outlines our process for design, development, and release. Building AptosMask is a community affair, and many steps of the process invite participation from external contributors as indicated. All QA, code review, and release of new versions is done by members of the core AptosMask team.
diff --git a/docs/state_dump.md b/docs/state_dump.md
index 855445dca9..171ce68b27 100644
--- a/docs/state_dump.md
+++ b/docs/state_dump.md
@@ -2,11 +2,11 @@
Sometimes a UI bug is hard to reproduce, but we'd like to rapidly develop against the application state that caused the bug.
-In this case, a MetaMask developer will sometimes ask a user with a bug to perform a "state dump", so we can use some internal tools to reproduce and fix the bug.
+In this case, a AptosMask developer will sometimes ask a user with a bug to perform a "state dump", so we can use some internal tools to reproduce and fix the bug.
To take a state dump, follow these steps:
-1. Get the MetaMask popup to the point where it shows the bug (the developer will probably specify exactly where).
+1. Get the AptosMask popup to the point where it shows the bug (the developer will probably specify exactly where).
2. Right click on the extension popup UI, and in the menu, click "Inspect". This will open the developer tools.
3. In case it isn't already selected, click the "Console" tab in the new Developer Tools window.
4. In the console, type this command exactly: `logState()`. This should print a bunch of JSON text into your console.
diff --git a/docs/translating-guide.md b/docs/translating-guide.md
index 684316e4f7..85673e0a6b 100644
--- a/docs/translating-guide.md
+++ b/docs/translating-guide.md
@@ -1,6 +1,6 @@
-# MetaMask Translation Guide
+# AptosMask Translation Guide
-The MetaMask browser extension supports new translations added in the form of new locales files added in `app/_locales`.
+The AptosMask browser extension supports new translations added in the form of new locales files added in `app/_locales`.
- [The MDN Guide to Internationalizing Extensions](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Internationalization)
@@ -13,7 +13,7 @@ The MetaMask browser extension supports new translations added in the form of ne
- Add the language to the [locales index](https://github.com/MetaMask/metamask-extension/blob/master/app/_locales/index.json) `app/_locales/index.json`
-That's it! When MetaMask is loaded on a computer with that language set as the system language, they will see your translation instead of the default one.
+That's it! When AptosMask is loaded on a computer with that language set as the system language, they will see your translation instead of the default one.
## Testing
diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json
index 446584c421..b8306a600a 100644
--- a/lavamoat/browserify/flask/policy.json
+++ b/lavamoat/browserify/flask/policy.json
@@ -997,9 +997,6 @@
}
},
"@starcoin/stc-wallet": {
- "globals": {
- "console.log": true
- },
"packages": {
"@starcoin/starcoin": true,
"@starcoin/stc-util": true
@@ -2027,8 +2024,6 @@
"results": "write"
},
"packages": {
- "@metamask/safe-event-emitter": true,
- "async-mutex": true,
"await-semaphore": true,
"eth-json-rpc-middleware": true,
"eth-query": true,
diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json
index bbd4410842..fc7727f565 100644
--- a/lavamoat/browserify/main/policy.json
+++ b/lavamoat/browserify/main/policy.json
@@ -978,9 +978,6 @@
}
},
"@starcoin/stc-wallet": {
- "globals": {
- "console.log": true
- },
"packages": {
"@starcoin/starcoin": true,
"@starcoin/stc-util": true
@@ -2008,8 +2005,6 @@
"results": "write"
},
"packages": {
- "@metamask/safe-event-emitter": true,
- "async-mutex": true,
"await-semaphore": true,
"eth-json-rpc-middleware": true,
"eth-query": true,
diff --git a/packages/pontem-aptos-middleware/fetch.js b/packages/pontem-aptos-middleware/fetch.js
index b030f468b4..75ec4fa537 100644
--- a/packages/pontem-aptos-middleware/fetch.js
+++ b/packages/pontem-aptos-middleware/fetch.js
@@ -1,6 +1,6 @@
-const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware')
-const { ethErrors } = require('eth-rpc-errors')
-const fetch = require('node-fetch')
+const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware');
+const { ethErrors } = require('eth-rpc-errors');
+const fetch = require('node-fetch');
const RETRIABLE_ERRORS = [
// ignore server overload errors
@@ -10,24 +10,26 @@ const RETRIABLE_ERRORS = [
// ignore server sent html error pages
// or truncated json responses
'SyntaxError',
-]
+];
-module.exports = createFetchMiddleware
-module.exports.fetchConfigFromReq = fetchConfigFromReq
+module.exports = createFetchMiddleware;
+module.exports.fetchConfigFromReq = fetchConfigFromReq;
-function createFetchMiddleware (opts = {}) {
- const maxAttempts = opts.maxAttempts || 5
- const { rpcUrl, headers = {} } = opts
+function createFetchMiddleware(opts = {}) {
+ const maxAttempts = opts.maxAttempts || 5;
+ const { rpcUrl, headers = {} } = opts;
// validate options
if (!rpcUrl || typeof rpcUrl !== 'string') {
- throw new Error(`Invalid value for 'rpcUrl': "${rpcUrl}"`)
+ throw new Error(`Invalid value for 'rpcUrl': "${rpcUrl}"`);
}
if (!headers || typeof headers !== 'object') {
- throw new Error(`Invalid value for 'headers': "${headers}"`)
+ throw new Error(`Invalid value for 'headers': "${headers}"`);
}
if (!maxAttempts) {
- throw new Error(`Invalid value for 'maxAttempts': "${maxAttempts}" (${typeof maxAttempts})`)
+ throw new Error(
+ `Invalid value for 'maxAttempts': "${maxAttempts}" (${typeof maxAttempts})`,
+ );
}
return createAsyncMiddleware(async (req, res) => {
@@ -35,53 +37,59 @@ function createFetchMiddleware (opts = {}) {
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
// attempt request
- await performFetch(rpcUrl, headers, req, res)
+ await performFetch(rpcUrl, headers, req, res);
// request was successful
- break
+ break;
} catch (err) {
// an error was caught while performing the request
// if not retriable, resolve with the encountered error
if (!isRetriableError(err)) {
// abort with error
- throw err
+ throw err;
}
// if no more attempts remaining, throw an error
- const remainingAttempts = maxAttempts - attempt
+ const remainingAttempts = maxAttempts - attempt;
if (!remainingAttempts) {
- const errMsg = `RestProvider - cannot complete request. All retries exhausted.\nOriginal Error:\n${err.toString()}\n\n`
- throw new Error(errMsg)
+ const errMsg = `RestProvider - cannot complete request. All retries exhausted.\nOriginal Error:\n${err.toString()}\n\n`;
+ throw new Error(errMsg);
}
// otherwise, ignore error and retry again after timeout
- await timeout(1000)
+ await timeout(1000);
}
}
// request was handled correctly, end
- })
+ });
}
-function timeout (length) {
+function timeout(length) {
return new Promise((resolve) => {
- setTimeout(resolve, length)
- })
+ setTimeout(resolve, length);
+ });
}
-function isRetriableError (err) {
- const errMessage = err.toString()
- return RETRIABLE_ERRORS.some((phrase) => errMessage.includes(phrase))
+function isRetriableError(err) {
+ const errMessage = err.toString();
+ return RETRIABLE_ERRORS.some((phrase) => errMessage.includes(phrase));
}
-async function performFetch (rpcUrl, extraHeaders, req, res) {
+async function performFetch(rpcUrl, extraHeaders, req, res) {
// Check for ETH request
- if(req.method.startsWith('eth_')) {
- console.log(`[Pontem] Intercept ETH request "${req.method}". Sending mock success result.`);
+ if (req.method.startsWith('eth_')) {
+ console.log(
+ `[Pontem] Intercept ETH request "${req.method}". Sending mock success result.`,
+ );
res.result = {};
return;
}
- const { fetchUrl, fetchParams } = fetchConfigFromReq({ rpcUrl, extraHeaders, req })
+ const { fetchUrl, fetchParams } = fetchConfigFromReq({
+ rpcUrl,
+ extraHeaders,
+ req,
+ });
- const response = await fetch(fetchUrl, fetchParams)
- const rawData = await response.text()
+ const response = await fetch(fetchUrl, fetchParams);
+ const rawData = await response.text();
// handle errors
if (!response.ok) {
switch (response.status) {
@@ -90,56 +98,57 @@ async function performFetch (rpcUrl, extraHeaders, req, res) {
return;
}
case 405:
- throw ethErrors.rpc.methodNotFound()
+ throw ethErrors.rpc.methodNotFound();
case 429:
- throw createRatelimitError()
+ throw createRatelimitError();
case 503:
case 504:
- throw createTimeoutError()
+ throw createTimeoutError();
default:
- throw createInternalError(rawData)
+ throw createInternalError(rawData);
}
}
// special case for now
if (req.method === 'eth_getBlockByNumber' && rawData === 'Not Found') {
- res.result = null
- return
+ res.result = null;
+ return;
}
// parse JSON
- const data = JSON.parse(rawData)
+ const data = JSON.parse(rawData);
// finally return result
- res.result = data
- res.error = data.error
+ res.result = data;
+ res.error = data.error;
}
-function fetchConfigFromReq ({ rpcUrl, extraHeaders, req }) {
+function fetchConfigFromReq({ rpcUrl, extraHeaders, req }) {
const parsedUrl = new URL(rpcUrl);
const normalizedUrl = normalizeUrlFromParsed(parsedUrl);
- console.log('[Pontem] fetchConfigFromReq', { rpcUrl, extraHeaders, req });
- const headers = Object.assign({}, extraHeaders, {
- 'Accept': 'application/json',
+ // console.log('[Pontem] fetchConfigFromReq', { rpcUrl, extraHeaders, req });
+ const headers = {
+ ...extraHeaders,
+ Accept: 'application/json',
'Content-Type': 'application/json',
- })
+ };
const httpMethod = req.httpMethod ? req.httpMethod.toUpperCase() : 'GET';
// let fetchUrl = `https://fullnode.devnet.aptoslabs.com/${req.method}`
- let fetchUrl = `${normalizedUrl}${req.method}`
+ let fetchUrl = `${normalizedUrl}${req.method}`;
const fetchParams = {
method: httpMethod,
headers,
- }
+ };
- if(['POST'].includes(httpMethod)) {
- fetchParams.body = JSON.stringify(req.params.data)
+ if (['POST'].includes(httpMethod)) {
+ fetchParams.body = JSON.stringify(req.params.data);
}
- if(req.method === 'faucet/mint') {
+ if (req.method === 'faucet/mint') {
fetchUrl = `https://faucet.devnet.aptoslabs.com/mint?amount=10000000&pub_key=${req.params.publicKey}`;
fetchParams.body = undefined;
}
@@ -147,17 +156,17 @@ function fetchConfigFromReq ({ rpcUrl, extraHeaders, req }) {
return {
fetchUrl,
fetchParams,
- }
+ };
}
// strips out extra keys that could be rejected by strict nodes like parity
-function normalizeReq (req) {
+function normalizeReq(req) {
return {
id: req.id,
jsonrpc: req.jsonrpc,
method: req.method,
params: req.params,
- }
+ };
}
function normalizeUrlFromParsed(parsedUrl) {
@@ -172,17 +181,17 @@ function normalizeUrlFromParsed(parsedUrl) {
return result;
}
-function createRatelimitError () {
- const msg = `Request is being rate limited.`
- return createInternalError(msg)
+function createRatelimitError() {
+ const msg = `Request is being rate limited.`;
+ return createInternalError(msg);
}
-function createTimeoutError () {
- let msg = `Gateway timeout. The request took too long to process. `
- msg += `This can happen when querying logs over too wide a block range.`
- return createInternalError(msg)
+function createTimeoutError() {
+ let msg = `Gateway timeout. The request took too long to process. `;
+ msg += `This can happen when querying logs over too wide a block range.`;
+ return createInternalError(msg);
}
-function createInternalError (msg) {
- return ethErrors.rpc.internal(msg)
+function createInternalError(msg) {
+ return ethErrors.rpc.internal(msg);
}
diff --git a/packages/pontem-controllers/README.md b/packages/pontem-controllers/README.md
index 83bfcf63f7..478a425097 100644
--- a/packages/pontem-controllers/README.md
+++ b/packages/pontem-controllers/README.md
@@ -277,7 +277,7 @@ First, `yarn build:link` in this repository, then link `@metamask/controllers` b
### Release & Publishing
-The project follows the same release process as the other libraries in the MetaMask organization. The GitHub Actions [`action-create-release-pr`](https://github.com/MetaMask/action-create-release-pr) and [`action-publish-release`](https://github.com/MetaMask/action-publish-release) are used to automate the release process; see those repositories for more information about how they work.
+The project follows the same release process as the other libraries in the AptosMask organization. The GitHub Actions [`action-create-release-pr`](https://github.com/MetaMask/action-create-release-pr) and [`action-publish-release`](https://github.com/MetaMask/action-publish-release) are used to automate the release process; see those repositories for more information about how they work.
1. Choose a release version.
diff --git a/packages/pontem-controllers/src/message-manager/MessageManager.ts b/packages/pontem-controllers/src/message-manager/MessageManager.ts
index f8a72f51ac..5c64fad5ec 100644
--- a/packages/pontem-controllers/src/message-manager/MessageManager.ts
+++ b/packages/pontem-controllers/src/message-manager/MessageManager.ts
@@ -84,7 +84,7 @@ export class MessageManager extends AbstractMessageManager<
case 'rejected':
return reject(
new Error(
- 'MetaMask Message Signature: User denied message signature.',
+ 'AptosMask Message Signature: User denied message signature.',
),
);
default:
diff --git a/packages/pontem-controllers/src/message-manager/PersonalMessageManager.ts b/packages/pontem-controllers/src/message-manager/PersonalMessageManager.ts
index cb3bee49fd..5e12202fb2 100644
--- a/packages/pontem-controllers/src/message-manager/PersonalMessageManager.ts
+++ b/packages/pontem-controllers/src/message-manager/PersonalMessageManager.ts
@@ -85,7 +85,7 @@ export class PersonalMessageManager extends AbstractMessageManager<
case 'rejected':
return reject(
new Error(
- 'MetaMask Personal Message Signature: User denied message signature.',
+ 'AptosMask Personal Message Signature: User denied message signature.',
),
);
default:
diff --git a/packages/pontem-controllers/src/message-manager/TypedMessageManager.test.ts b/packages/pontem-controllers/src/message-manager/TypedMessageManager.test.ts
index 4f8deb4501..1dcdf52325 100644
--- a/packages/pontem-controllers/src/message-manager/TypedMessageManager.test.ts
+++ b/packages/pontem-controllers/src/message-manager/TypedMessageManager.test.ts
@@ -122,7 +122,7 @@ describe('TypedMessageManager', () => {
});
controller.setMessageStatusErrored(keys[0], 'error message');
await expect(result).rejects.toThrow(
- 'MetaMask Typed Message Signature: error message',
+ 'AptosMask Typed Message Signature: error message',
);
});
diff --git a/packages/pontem-controllers/src/message-manager/TypedMessageManager.ts b/packages/pontem-controllers/src/message-manager/TypedMessageManager.ts
index 18cb49d5ce..ac66c6248f 100644
--- a/packages/pontem-controllers/src/message-manager/TypedMessageManager.ts
+++ b/packages/pontem-controllers/src/message-manager/TypedMessageManager.ts
@@ -110,7 +110,7 @@ export class TypedMessageManager extends AbstractMessageManager<
case 'rejected':
return reject(
new Error(
- 'MetaMask Typed Message Signature: User denied message signature.',
+ 'AptosMask Typed Message Signature: User denied message signature.',
),
);
case 'errored':
diff --git a/packages/pontem-controllers/src/permissions/Permission.ts b/packages/pontem-controllers/src/permissions/Permission.ts
index df6b87db03..1d7a3c59f9 100644
--- a/packages/pontem-controllers/src/permissions/Permission.ts
+++ b/packages/pontem-controllers/src/permissions/Permission.ts
@@ -32,7 +32,7 @@ export type PermissionConstraint = {
* The context(s) in which this capability is meaningful.
*
* It is required by the standard, but we make it optional since there is only
- * one context in our usage (i.e. the user's MetaMask instance).
+ * one context in our usage (i.e. the user's AptosMask instance).
*/
readonly '@context'?: NonEmptyArray;
diff --git a/packages/pontem-controllers/src/permissions/README.md b/packages/pontem-controllers/src/permissions/README.md
index bb17c517d4..a2ac85b828 100644
--- a/packages/pontem-controllers/src/permissions/README.md
+++ b/packages/pontem-controllers/src/permissions/README.md
@@ -1,7 +1,7 @@
# PermissionController
The `PermissionController` is the heart of an object capability-inspired permission system.
-It is the successor of the original MetaMask permission system, [`rpc-cap`](https://github.com/MetaMask/rpc-cap).
+It is the successor of the original AptosMask permission system, [`rpc-cap`](https://github.com/MetaMask/rpc-cap).
## Conceptual Overview
@@ -16,13 +16,13 @@ Permissions can have **caveats**, which are host-defined attenuations of the aut
## Implementation Overview
-At any given moment, the `PermissionController` state tree describes the complete state of the permissions of all subjects known to the host (i.e., the MetaMask instance).
+At any given moment, the `PermissionController` state tree describes the complete state of the permissions of all subjects known to the host (i.e., the AptosMask instance).
The `PermissionController` also provides methods for adding, updating, and removing permissions, and enforcing the rules described by its state tree.
-Permission system concepts correspond to components of the MetaMask stack as follows:
+Permission system concepts correspond to components of the AptosMask stack as follows:
| Concept | Implementation |
| :---------------- | :-------------------------------------------------------------- |
-| Host | The MetaMask application |
+| Host | The AptosMask application |
| Subjects | Websites, Snaps, or other extensions |
| Targets | JSON-RPC methods, endowments |
| Invocations | JSON-RPC requests, endowment retrieval |
diff --git a/packages/pontem-hd-keyring/index.js b/packages/pontem-hd-keyring/index.js
index d4db81ba2a..2240c9bd90 100644
--- a/packages/pontem-hd-keyring/index.js
+++ b/packages/pontem-hd-keyring/index.js
@@ -6,7 +6,7 @@ const stcUtil = require('@starcoin/stc-util')
const bip39 = require('bip39')
const sigUtil = require('eth-sig-util')
const log = require('loglevel')
-const util = require('./util');
+const util = require('./util')
// Options:
const hdPathString = `m/44'/101010'/0'/0'`
@@ -15,18 +15,18 @@ const type = 'HD Key Tree'
class HdKeyring extends SimpleKeyring {
/* PUBLIC METHODS */
- constructor(opts = {}) {
+ constructor (opts = {}) {
super()
this.type = type
this.deserialize(opts)
}
- serialize() {
- let mnemonicAsString = this.mnemonic;
- if(Array.isArray(this.mnemonic)) {
- mnemonicAsString = Buffer.from(this.mnemonic);
- } else if(Buffer.isBuffer(this.mnemonic)) {
- mnemonicAsString = this.mnemonic.toString('utf8');
+ serialize () {
+ let mnemonicAsString = this.mnemonic
+ if (Array.isArray(this.mnemonic)) {
+ mnemonicAsString = Buffer.from(this.mnemonic)
+ } else if (Buffer.isBuffer(this.mnemonic)) {
+ mnemonicAsString = this.mnemonic.toString('utf8')
}
return Promise.resolve({
@@ -36,7 +36,7 @@ class HdKeyring extends SimpleKeyring {
})
}
- deserialize(opts = {}) {
+ deserialize (opts = {}) {
this.opts = opts || {}
this.wallets = []
this.mnemonic = null
@@ -54,7 +54,7 @@ class HdKeyring extends SimpleKeyring {
return Promise.resolve([])
}
- addAccounts(numberOfAccounts = 1) {
+ addAccounts (numberOfAccounts = 1) {
if (!this.root) {
this._initFromMnemonic(bip39.generateMnemonic())
}
@@ -76,7 +76,7 @@ class HdKeyring extends SimpleKeyring {
return Promise.all(hexWallets)
}
- getAccounts() {
+ getAccounts () {
return Promise.all(this.wallets.map((w) => {
return w.getAddress()
.then((address) => {
@@ -85,18 +85,18 @@ class HdKeyring extends SimpleKeyring {
}))
}
- exportAccount(address) {
+ exportAccount (address) {
return this._getWalletForAccount(address).then((wallet) => wallet.getPrivateKey().toString('hex'))
}
- signTransaction(address, tx, opts = {}) {
+ signTransaction (address, tx, opts = {}) {
return this._getWalletForAccount(address, opts)
.then(async (w) => {
- console.log('[Pontem][PontemHdKeyring] signTransaction', { address, tx });
+ console.log('[Pontem][PontemHdKeyring] signTransaction', { address, tx })
const privateKey = w.getPrivateKey()
const publicKeyString = await w.getPublicKeyString()
- const hex = util.signMessage({ message: tx, privateKey: privateKey })
+ const hex = util.signMessage({ message: tx, privateKey })
return Promise.resolve({
type: 'ed25519_signature',
@@ -106,7 +106,7 @@ class HdKeyring extends SimpleKeyring {
})
}
- signPersonalMessage(address, message, opts = {}) {
+ signPersonalMessage (address, message, opts = {}) {
return this._getWalletForAccount(address, opts)
.then((w) => {
const privKey = w.getPrivateKey()
@@ -118,14 +118,14 @@ class HdKeyring extends SimpleKeyring {
})
}
- getPublicKeyFor(withAccount, opts = {}) {
+ getPublicKeyFor (withAccount, opts = {}) {
return this._getWalletForAccount(withAccount, opts)
.then((w) => {
return w.getPublicKeyString()
})
}
- getEncryptionPublicKey(withAccount, opts = {}) {
+ getEncryptionPublicKey (withAccount, opts = {}) {
return this._getWalletForAccount(withAccount, opts)
.then((w) => {
const privKey = w.getPrivateKey()
@@ -134,12 +134,12 @@ class HdKeyring extends SimpleKeyring {
})
}
- getReceiptIdentifier(address) {
+ getReceiptIdentifier (address) {
return this._getWalletForAccount(address).then((wallet) => wallet.getReceiptIdentifier())
}
// For stc_decrypt:
- decryptMessage(withAccount, encryptedData, opts) {
+ decryptMessage (withAccount, encryptedData, opts) {
return this._getWalletForAccount(withAccount, opts)
.then((w) => {
const privKey = stcUtil.stripHexPrefix(w.getPrivateKeyString())
@@ -149,12 +149,12 @@ class HdKeyring extends SimpleKeyring {
}
/* PRIVATE METHODS */
- _initFromMnemonic(mnemonic) {
+ _initFromMnemonic (mnemonic) {
this.mnemonic = mnemonic
if (Array.isArray(mnemonic)) {
this.mnemonic = Buffer.from(mnemonic)
- } else if(Buffer.isBuffer(mnemonic)) {
- this.mnemonic = this.mnemonic.toString('utf8');
+ } else if (Buffer.isBuffer(mnemonic)) {
+ this.mnemonic = this.mnemonic.toString('utf8')
}
const seed = bip39.mnemonicToSeed(this.mnemonic).slice(32)
@@ -162,7 +162,7 @@ class HdKeyring extends SimpleKeyring {
this.root = this.hdWallet.derivePath(this.hdPath)
}
- _getWalletForAccount(account) {
+ _getWalletForAccount (account) {
const targetAddress = sigUtil.normalize(account)
return Promise.all(this.wallets.map(async (w) => {
const addressBytes = await w.getAddress()
diff --git a/packages/pontem-keyring-controller/README.md b/packages/pontem-keyring-controller/README.md
index f943326234..9371f92a46 100644
--- a/packages/pontem-keyring-controller/README.md
+++ b/packages/pontem-keyring-controller/README.md
@@ -1,6 +1,6 @@
# stc-keyring-controller
-A module for managing groups of Ethereum accounts called "Keyrings", defined originally for MetaMask's multiple-account-type feature.
+A module for managing groups of Ethereum accounts called "Keyrings", defined originally for AptosMask's multiple-account-type feature.
To add new account types to a `KeyringController`, just make sure it follows [The Keyring Class Protocol](./docs/keyring.md).
diff --git a/packages/pontem-keyring-controller/index.js b/packages/pontem-keyring-controller/index.js
index e5ac27d063..75e33153a8 100644
--- a/packages/pontem-keyring-controller/index.js
+++ b/packages/pontem-keyring-controller/index.js
@@ -144,7 +144,7 @@ class KeyringController extends EventEmitter {
* into memory.
*
* Temporarily also migrates any old-style vaults first, as well.
- * (Pre MetaMask 3.0.0)
+ * (Pre AptosMask 3.0.0)
*
* @emits KeyringController#unlock
* @param {string} password - The keyring controller password.
diff --git a/packages/pontem-wallet/hdkey.js b/packages/pontem-wallet/hdkey.js
new file mode 100644
index 0000000000..18ea6a175a
--- /dev/null
+++ b/packages/pontem-wallet/hdkey.js
@@ -0,0 +1,47 @@
+// const HDKey = require('@pontem/pontem-hdkey')
+const HDKey = require('@starcoin/stc-hdkey');
+const Wallet = require('./index.js');
+
+function AptosHDKey() {}
+
+/*
+ * Horrible wrapping.
+ */
+function fromHDKey(hdkey) {
+ var ret = new AptosHDKey();
+ ret._hdkey = hdkey;
+ return ret;
+}
+
+AptosHDKey.fromMasterSeed = function (seedBuffer) {
+ return fromHDKey(HDKey.fromMasterSeed(seedBuffer));
+};
+
+AptosHDKey.fromExtendedKey = function (base58key) {
+ return fromHDKey(HDKey.fromExtendedKey(base58key));
+};
+
+AptosHDKey.prototype.privateExtendedKey = function () {
+ if (!this._hdkey.privateExtendedKey) {
+ throw new Error('This is a public key only wallet');
+ }
+ return this._hdkey.privateExtendedKey;
+};
+
+AptosHDKey.prototype.publicExtendedKey = function () {
+ return this._hdkey.publicExtendedKey;
+};
+
+AptosHDKey.prototype.derivePath = function (path) {
+ return fromHDKey(this._hdkey.derive(path));
+};
+
+AptosHDKey.prototype.deriveChild = function (index) {
+ return fromHDKey(this._hdkey.deriveChild(index));
+};
+
+AptosHDKey.prototype.getWallet = function () {
+ return Wallet.fromPrivatePublic(this._hdkey._privateKey, this._hdkey._publicKey);
+};
+
+module.exports = AptosHDKey;
\ No newline at end of file
diff --git a/packages/pontem-wallet/index.js b/packages/pontem-wallet/index.js
new file mode 100644
index 0000000000..36f7e22791
--- /dev/null
+++ b/packages/pontem-wallet/index.js
@@ -0,0 +1,122 @@
+var stcUtil = require('@pontem/pontem-util');
+var encoding = require('@starcoin/starcoin').encoding;
+
+function assert(val, msg) {
+ if (!val) {
+ throw new Error(msg || 'Assertion failed');
+ }
+}
+
+var Wallet = function (priv, pub) {
+ // because ed.getPublicKey is an async function,
+ // so we have to generate the publicKey in ui and provide it directly to the constructor.
+ // otherwise we have to change every place that w.getAddress is used, from sync call to .then() or async/await
+ // and follow up the call chain among a lot of dependency npm packages.
+
+ // if (priv && pub) {
+ // throw new Error('Cannot supply both a private and a public key to the constructor')
+ // }
+
+ // if (priv && !stcUtil.isValidPrivate(priv)) {
+ // throw new Error('Private key does not satisfy the curve requirements (ie. it is invalid)')
+ // }
+ //
+ // if (pub && !stcUtil.isValidPublic(pub)) {
+ // throw new Error('Invalid public key')
+ // }
+
+ this._privKey = priv;
+ this._pubKey = pub;
+};
+
+Object.defineProperty(Wallet.prototype, 'privKey', {
+ get: function () {
+ assert(this._privKey, 'This is a public key only wallet');
+ return this._privKey;
+ }
+});
+
+Object.defineProperty(Wallet.prototype, 'pubKey', {
+ get: function () {
+ assert(this._pubKey, 'This is a private key only wallet');
+ return this._pubKey;
+ }
+});
+
+Wallet.prototype.checkValidPublicKey = async function () {
+ const privKeyStr = this.privKey.toString('hex');
+ const publicKeyStr = await stcUtil.privateToPublicED(this.privKey);
+ return this.pubKey.toString('hex') === publicKeyStr.toString('hex');
+};
+
+Wallet.prototype.getPrivateKey = function () {
+ return this.privKey;
+};
+
+Wallet.prototype.getPrivateKeyString = function () {
+ return stcUtil.bufferToHex(this.getPrivateKey());
+};
+
+Wallet.prototype.getPublicKey = function () {
+ // HD
+ if (this.pubKey.length == 33) {
+ // the original publicKey of hdkeyring's root hdkey is used for deriveChild, so we should keep it
+ // instead of override it with the ed25519 publicKey
+ // we calculate the ed25519 publicKey here
+ return stcUtil.privateToPublicED(this.privKey).then(pubKey => {
+ return pubKey;
+ });
+ }
+ // Simple
+ return this.pubKey;
+};
+
+Wallet.prototype.getPublicKeyString = function () {
+ // HD
+ if (this.pubKey.length == 33) {
+ return this.getPublicKey().then(pubKey => {
+ return stcUtil.bufferToHex(pubKey);
+ });
+ }
+ // Simple
+ return stcUtil.bufferToHex(this.getPublicKey());
+};
+
+Wallet.prototype.getAddress = function () {
+ // HD
+ if (this.pubKey.length == 33) {
+ // the original publicKey of hdkeyring's root hdkey is used for deriveChild, so we should keep it
+ // instead of override it with the ed25519 publicKey
+ // we calculate the ed25519 publicKey here, and get the address from it.
+ return stcUtil.privateToPublicED(this.privKey).then(pubKey => {
+ return stcUtil.publicToAddressED(pubKey);
+ });
+ }
+ // Simple
+ return stcUtil.publicToAddressED(this.pubKey);
+};
+
+Wallet.prototype.getReceiptIdentifier = function () {
+ // HD
+ if (this.pubKey.length == 33) {
+ return stcUtil.privateToPublicED(this.privKey).then(pubKey => {
+ return encoding.publicKeyToReceiptIdentifier(pubKey.toString('hex'));
+ });
+ }
+ // Simple
+ return Promise.resolve(encoding.publicKeyToReceiptIdentifier(this.getPublicKeyString()));
+};
+
+Wallet.prototype.getAddressString = function () {
+ return stcUtil.bufferToHex(this.getAddress());
+};
+
+Wallet.prototype.getChecksumAddressString = function () {
+ return stcUtil.toChecksumAddress(this.getAddressString());
+};
+
+Wallet.fromPrivatePublic = function (priv, pub) {
+ return new Wallet(priv, pub);
+};
+
+module.exports = Wallet;
\ No newline at end of file
diff --git a/packages/pontem-wallet/provider-engine.js b/packages/pontem-wallet/provider-engine.js
new file mode 100644
index 0000000000..1f701d7d8a
--- /dev/null
+++ b/packages/pontem-wallet/provider-engine.js
@@ -0,0 +1,26 @@
+'use strict';
+
+const inherits = require('util').inherits;
+const HookedWalletEthTxSubprovider = require('web3-provider-engine/subproviders/hooked-wallet-ethtx');
+
+module.exports = WalletSubprovider;
+
+inherits(WalletSubprovider, HookedWalletEthTxSubprovider);
+
+function WalletSubprovider(wallet, opts) {
+ opts = opts || {};
+
+ opts.getAccounts = function (cb) {
+ cb(null, [wallet.getAddressString()]);
+ };
+
+ opts.getPrivateKey = function (address, cb) {
+ if (address !== wallet.getAddressString()) {
+ cb(new Error('Account not found'));
+ } else {
+ cb(null, wallet.getPrivateKey());
+ }
+ };
+
+ WalletSubprovider.super_.call(this, opts);
+}
\ No newline at end of file
diff --git a/packages/pontem-wallet/test/hdkey.js b/packages/pontem-wallet/test/hdkey.js
new file mode 100644
index 0000000000..6cd88f58bc
--- /dev/null
+++ b/packages/pontem-wallet/test/hdkey.js
@@ -0,0 +1,84 @@
+var assert = require('assert');
+var HDKey = require('../hdkey.js');
+var Buffer = require('safe-buffer').Buffer;
+
+// from BIP39 mnemonic: awake book subject inch gentle blur grant damage process float month clown
+var fixtureseed = Buffer.from('747f302d9c916698912d5f70be53a6cf53bc495803a5523d3a7c3afa2afba94ec3803f838b3e1929ab5481f9da35441372283690fdcf27372c38f40ba134fe03', 'hex');
+var fixturehd = HDKey.fromMasterSeed(fixtureseed);
+
+describe('.fromMasterSeed()', function () {
+ it('should work', function () {
+ assert.doesNotThrow(function () {
+ HDKey.fromMasterSeed(fixtureseed);
+ });
+ });
+});
+
+describe('.privateExtendedKey()', function () {
+ it('should work', function () {
+ assert.strictEqual(fixturehd.privateExtendedKey(), 'xprv9s21ZrQH143K4KqQx9Zrf1eN8EaPQVFxM2Ast8mdHn7GKiDWzNEyNdduJhWXToy8MpkGcKjxeFWd8oBSvsz4PCYamxR7TX49pSpp3bmHVAY');
+ });
+});
+
+describe('.publicExtendedKey()', function () {
+ it('should work', function () {
+ assert.strictEqual(fixturehd.publicExtendedKey(), 'xpub661MyMwAqRbcGout4B6s29b6gGQsowyoiF6UgXBEr7eFCWYfXuZDvRxP9zEh1Kwq3TLqDQMbkbaRpSnoC28oWvjLeshoQz1StZ9YHM1EpcJ');
+ });
+});
+
+describe('.fromExtendedKey()', function () {
+ it('should work with public', function () {
+ var hdnode = HDKey.fromExtendedKey('xpub661MyMwAqRbcGout4B6s29b6gGQsowyoiF6UgXBEr7eFCWYfXuZDvRxP9zEh1Kwq3TLqDQMbkbaRpSnoC28oWvjLeshoQz1StZ9YHM1EpcJ');
+ assert.strictEqual(hdnode.publicExtendedKey(), 'xpub661MyMwAqRbcGout4B6s29b6gGQsowyoiF6UgXBEr7eFCWYfXuZDvRxP9zEh1Kwq3TLqDQMbkbaRpSnoC28oWvjLeshoQz1StZ9YHM1EpcJ');
+ assert.throws(function () {
+ hdnode.privateExtendedKey();
+ }, /^Error: This is a public key only wallet$/);
+ });
+ it('should work with private', function () {
+ var hdnode = HDKey.fromExtendedKey('xprv9s21ZrQH143K4KqQx9Zrf1eN8EaPQVFxM2Ast8mdHn7GKiDWzNEyNdduJhWXToy8MpkGcKjxeFWd8oBSvsz4PCYamxR7TX49pSpp3bmHVAY');
+ assert.strictEqual(hdnode.publicExtendedKey(), 'xpub661MyMwAqRbcGout4B6s29b6gGQsowyoiF6UgXBEr7eFCWYfXuZDvRxP9zEh1Kwq3TLqDQMbkbaRpSnoC28oWvjLeshoQz1StZ9YHM1EpcJ');
+ assert.strictEqual(hdnode.privateExtendedKey(), 'xprv9s21ZrQH143K4KqQx9Zrf1eN8EaPQVFxM2Ast8mdHn7GKiDWzNEyNdduJhWXToy8MpkGcKjxeFWd8oBSvsz4PCYamxR7TX49pSpp3bmHVAY');
+ });
+});
+
+describe('.deriveChild()', function () {
+ it('should work', function () {
+ var hdnode = fixturehd.deriveChild(1);
+ assert.strictEqual(hdnode.privateExtendedKey(), 'xprv9vYSvrg3eR5FaKbQE4Ao2vHdyvfFL27aWMyH6X818mKWMsqqQZAN6HmRqYDGDPLArzaqbLExRsxFwtx2B2X2QKkC9uoKsiBNi22tLPKZHNS');
+ });
+});
+
+describe('.derivePath()', function () {
+ it('should work with m', function () {
+ var hdnode = fixturehd.derivePath('m');
+ assert.strictEqual(hdnode.privateExtendedKey(), 'xprv9s21ZrQH143K4KqQx9Zrf1eN8EaPQVFxM2Ast8mdHn7GKiDWzNEyNdduJhWXToy8MpkGcKjxeFWd8oBSvsz4PCYamxR7TX49pSpp3bmHVAY');
+ });
+ it('should work with m/44\'/0\'/0/1', function () {
+ var hdnode = fixturehd.derivePath('m/44\'/0\'/0/1');
+ assert.strictEqual(hdnode.privateExtendedKey(), 'xprvA1ErCzsuXhpB8iDTsbmgpkA2P8ggu97hMZbAXTZCdGYeaUrDhyR8fEw47BNEgLExsWCVzFYuGyeDZJLiFJ9kwBzGojQ6NB718tjVJrVBSrG');
+ });
+});
+
+describe('.getWallet()', function () {
+ it('should work', function () {
+ console.log(fixturehd.getWallet().getAddress().then(a => console.log(a.toString('hex'))));
+ assert.strictEqual(fixturehd.getWallet().getPrivateKeyString(), '0x26cc9417b89cd77c4acdbe2e3cd286070a015d8e380f9cd1244ae103b7d89d81');
+ assert.strictEqual(fixturehd.getWallet().getPublicKeyString(), '0x0639797f6cc72aea0f3d309730844a9e67d9f1866e55845c5f7e0ab48402973defa5cb69df462bcc6d73c31e1c663c225650e80ef14a507b203f2a12aea55bc1');
+ });
+ it('should work with public nodes', function () {
+ var hdnode = HDKey.fromExtendedKey('xpub661MyMwAqRbcGout4B6s29b6gGQsowyoiF6UgXBEr7eFCWYfXuZDvRxP9zEh1Kwq3TLqDQMbkbaRpSnoC28oWvjLeshoQz1StZ9YHM1EpcJ');
+ assert.throws(function () {
+ hdnode.getWallet().getPrivateKeyString();
+ }, /^Error: This is a public key only wallet$/);
+ assert.strictEqual(hdnode.getWallet().getPublicKeyString(), '0x0639797f6cc72aea0f3d309730844a9e67d9f1866e55845c5f7e0ab48402973defa5cb69df462bcc6d73c31e1c663c225650e80ef14a507b203f2a12aea55bc1');
+ });
+});
+
+describe('getReceiptIdentifier', function () {
+ it('from HD', function () {
+ const wallet = fixturehd.getWallet();
+ wallet.getReceiptIdentifier().then(receiptIdentifier => {
+ assert.strictEqual(receiptIdentifier, 'stc1pgakstzpe570mddrdv34kphpg2l2s4cjyg5j8ae3kmw6tujty33d5wmg93qu608akk3kkg6mqms59wks3lm3');
+ });
+ });
+});
\ No newline at end of file
diff --git a/packages/pontem-wallet/test/index.js b/packages/pontem-wallet/test/index.js
new file mode 100644
index 0000000000..e046d1ee01
--- /dev/null
+++ b/packages/pontem-wallet/test/index.js
@@ -0,0 +1,83 @@
+var assert = require('assert');
+var Buffer = require('safe-buffer').Buffer;
+var Wallet = require('../');
+var Thirdparty = require('../thirdparty.js');
+var ethUtil = require('@starcoin/stc-util');
+
+var fixturePrivateKey = 'c228177c66fb41eb5d1f909966b188d8accdd1dda8f33ab064d1dddc71b78eb6';
+var fixturePrivateKeyStr = '0x' + fixturePrivateKey;
+var fixturePrivateKeyBuffer = Buffer.from(fixturePrivateKey, 'hex');
+
+var fixturePublicKey = 'ebbcaeafc931beee008e7a8b2ac8fbc51ef0d0c46090d654f113253f699ced40';
+var fixturePublicKeyStr = '0x' + fixturePublicKey;
+var fixturePublicKeyBuffer = Buffer.from(fixturePublicKey, 'hex');
+
+var fixtureAddressKey = 'b2c4c079d0e139ec8833ea00e80bb21b';
+var fixtureAddressKeyStr = '0x' + fixtureAddressKey;
+
+var fixtureWallet = Wallet.fromPrivatePublic(fixturePrivateKeyBuffer, fixturePublicKeyBuffer);
+
+describe('.getPrivateKey()', function () {
+ it('should work', function () {
+ assert.strictEqual(fixtureWallet.getPrivateKey().toString('hex'), fixturePrivateKey);
+ });
+});
+
+describe('.getPrivateKeyString()', function () {
+ it('should work', function () {
+ assert.strictEqual(fixtureWallet.getPrivateKeyString(), fixturePrivateKeyStr);
+ });
+});
+
+describe('.getPublicKey()', function () {
+ it('should work', function () {
+ const publicKey = fixtureWallet.getPublicKey();
+ assert.strictEqual(publicKey.toString('hex'), fixturePublicKey);
+ });
+});
+
+describe('.getPublicKeyString()', function () {
+ it('should work', function () {
+ const publicKeyString = fixtureWallet.getPublicKeyString();
+ assert.strictEqual(publicKeyString, fixturePublicKeyStr);
+ });
+});
+
+describe('.getAddress()', function () {
+ it('should work', function () {
+ const address = fixtureWallet.getAddress();
+ assert.strictEqual(address.toString('hex'), fixtureAddressKey);
+ });
+});
+
+describe('.getAddressString()', function () {
+ it('should work', function () {
+ assert.strictEqual(fixtureWallet.getAddressString(), fixtureAddressKeyStr);
+ });
+});
+
+describe('.checkValidPublicKey()', function () {
+ it('should work', async function () {
+ const result = await fixtureWallet.checkValidPublicKey();
+ assert.strictEqual(result, true);
+ });
+});
+
+describe('raw new Wallet() init', function () {
+ it('should ok when both priv and pub key provided', async function () {
+ const wallet = new Wallet(fixturePrivateKeyBuffer, fixturePublicKeyBuffer);
+ const result = await wallet.checkValidPublicKey();
+ assert.strictEqual(result, true);
+ });
+});
+
+describe('getReceiptIdentifier', function () {
+ it('from Simple', function () {
+ const privateKey = 'a6d8991ca3d6813f493d13216d6dedd30211a649d21b2ca102b860bea51045fd';
+ const publicKey = 'e8eba2c517d0b5012c20737b3627c58447ccd6098aaae84027520afcc82a4ded';
+ const wallet = Wallet.fromPrivatePublic(Buffer.from(privateKey, 'hex'), Buffer.from(publicKey, 'hex'));
+ wallet.getReceiptIdentifier().then(receiptIdentifier => {
+ assert.strictEqual(receiptIdentifier, 'stc1pgq8g7ms4737fy5v7y5nle4jt8gzf458ccaf5zfs7kd22hgfm8f85qr50dc2lglyj2x0z2flu6e9n59wnm3d');
+ });
+ });
+});
\ No newline at end of file
diff --git a/packages/pontem-wallet/thirdparty.js b/packages/pontem-wallet/thirdparty.js
new file mode 100644
index 0000000000..20bf9ebdd6
--- /dev/null
+++ b/packages/pontem-wallet/thirdparty.js
@@ -0,0 +1,230 @@
+var Wallet = require('./index.js');
+var ethUtil = require('ethereumjs-util');
+var crypto = require('crypto');
+var scryptsy = require('scrypt.js');
+var utf8 = require('utf8');
+var aesjs = require('aes-js');
+var Buffer = require('safe-buffer').Buffer;
+
+function assert(val, msg) {
+ if (!val) {
+ throw new Error(msg || 'Assertion failed');
+ }
+}
+
+function decipherBuffer(decipher, data) {
+ return Buffer.concat([decipher.update(data), decipher.final()]);
+}
+
+var Thirdparty = {};
+
+/*
+ * opts:
+ * - digest - digest algorithm, defaults to md5
+ * - count - hash iterations
+ * - keysize - desired key size
+ * - ivsize - desired IV size
+ *
+ * Algorithm form https://www.openssl.org/docs/manmaster/crypto/EVP_BytesToKey.html
+ *
+ * FIXME: not optimised at all
+ */
+function evp_kdf(data, salt, opts) {
+ // eslint-disable-line
+ // A single EVP iteration, returns `D_i`, where block equlas to `D_(i-1)`
+ function iter(block) {
+ var hash = crypto.createHash(opts.digest || 'md5');
+ hash.update(block);
+ hash.update(data);
+ hash.update(salt);
+ block = hash.digest();
+
+ for (var i = 1; i < (opts.count || 1); i++) {
+ hash = crypto.createHash(opts.digest || 'md5');
+ hash.update(block);
+ block = hash.digest();
+ }
+
+ return block;
+ }
+
+ var keysize = opts.keysize || 16;
+ var ivsize = opts.ivsize || 16;
+
+ var ret = [];
+
+ var i = 0;
+ while (Buffer.concat(ret).length < keysize + ivsize) {
+ ret[i] = iter(i === 0 ? Buffer.alloc(0) : ret[i - 1]);
+ i++;
+ }
+
+ var tmp = Buffer.concat(ret);
+
+ return {
+ key: tmp.slice(0, keysize),
+ iv: tmp.slice(keysize, keysize + ivsize)
+ };
+}
+
+// http://stackoverflow.com/questions/25288311/cryptojs-aes-pattern-always-ends-with
+function decodeCryptojsSalt(input) {
+ var ciphertext = Buffer.from(input, 'base64');
+ if (ciphertext.slice(0, 8).toString() === 'Salted__') {
+ return {
+ salt: ciphertext.slice(8, 16),
+ ciphertext: ciphertext.slice(16)
+ };
+ } else {
+ return {
+ ciphertext: ciphertext
+ };
+ }
+}
+
+/*
+ * This wallet format is created by https://github.com/SilentCicero/ethereumjs-accounts
+ * and used on https://www.myetherwallet.com/
+ */
+Thirdparty.fromEtherWallet = function (input, password) {
+ var json = typeof input === 'object' ? input : JSON.parse(input);
+
+ var privKey;
+ if (!json.locked) {
+ if (json.private.length !== 64) {
+ throw new Error('Invalid private key length');
+ }
+
+ privKey = Buffer.from(json.private, 'hex');
+ } else {
+ if (typeof password !== 'string') {
+ throw new Error('Password required');
+ }
+ if (password.length < 7) {
+ throw new Error('Password must be at least 7 characters');
+ }
+
+ // the "encrypted" version has the low 4 bytes
+ // of the hash of the address appended
+ var cipher = json.encrypted ? json.private.slice(0, 128) : json.private;
+
+ // decode openssl ciphertext + salt encoding
+ cipher = decodeCryptojsSalt(cipher);
+
+ if (!cipher.salt) {
+ throw new Error('Unsupported EtherWallet key format');
+ }
+
+ // derive key/iv using OpenSSL EVP as implemented in CryptoJS
+ var evp = evp_kdf(Buffer.from(password), cipher.salt, { keysize: 32, ivsize: 16 });
+
+ var decipher = crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv);
+ privKey = decipherBuffer(decipher, Buffer.from(cipher.ciphertext));
+
+ // NOTE: yes, they've run it through UTF8
+ privKey = Buffer.from(utf8.decode(privKey.toString()), 'hex');
+ }
+
+ var wallet = new Wallet(privKey);
+
+ if (wallet.getAddressString() !== json.address) {
+ throw new Error('Invalid private key or address');
+ }
+
+ return wallet;
+};
+
+Thirdparty.fromEtherCamp = function (passphrase) {
+ return new Wallet(ethUtil.keccak256(Buffer.from(passphrase)));
+};
+
+Thirdparty.fromKryptoKit = function (entropy, password) {
+ function kryptoKitBrokenScryptSeed(buf) {
+ // js-scrypt calls `Buffer.from(String(salt), 'utf8')` on the seed even though it is a buffer
+ //
+ // The `buffer`` implementation used does the below transformation (doesn't matches the current version):
+ // https://github.com/feross/buffer/blob/67c61181b938b17d10dbfc0a545f713b8bd59de8/index.js
+
+ function decodeUtf8Char(str) {
+ try {
+ return decodeURIComponent(str);
+ } catch (err) {
+ return String.fromCharCode(0xFFFD); // UTF 8 invalid char
+ }
+ }
+
+ var res = '';
+ var tmp = '';
+
+ for (var i = 0; i < buf.length; i++) {
+ if (buf[i] <= 0x7F) {
+ res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i]);
+ tmp = '';
+ } else {
+ tmp += '%' + buf[i].toString(16);
+ }
+ }
+
+ return Buffer.from(res + decodeUtf8Char(tmp));
+ }
+
+ if (entropy[0] === '#') {
+ entropy = entropy.slice(1);
+ }
+
+ var type = entropy[0];
+ entropy = entropy.slice(1);
+
+ var privKey;
+ if (type === 'd') {
+ privKey = ethUtil.sha256(entropy);
+ } else if (type === 'q') {
+ if (typeof password !== 'string') {
+ throw new Error('Password required');
+ }
+
+ var encryptedSeed = ethUtil.sha256(Buffer.from(entropy.slice(0, 30)));
+ var checksum = entropy.slice(30, 46);
+
+ var salt = kryptoKitBrokenScryptSeed(encryptedSeed);
+ var aesKey = scryptsy(Buffer.from(password, 'utf8'), salt, 16384, 8, 1, 32);
+
+ /* FIXME: try to use `crypto` instead of `aesjs`
+ // NOTE: ECB doesn't use the IV, so it can be anything
+ var decipher = crypto.createDecipheriv("aes-256-ecb", aesKey, Buffer.from(0))
+ // FIXME: this is a clear abuse, but seems to match how ECB in aesjs works
+ privKey = Buffer.concat([
+ decipher.update(encryptedSeed).slice(0, 16),
+ decipher.update(encryptedSeed).slice(0, 16),
+ ])
+ */
+
+ /* eslint-disable new-cap */
+ var decipher = new aesjs.ModeOfOperation.ecb(aesKey);
+ /* eslint-enable new-cap */
+ /* decrypt returns an Uint8Array, perhaps there is a better way to concatenate */
+ privKey = Buffer.concat([Buffer.from(decipher.decrypt(encryptedSeed.slice(0, 16))), Buffer.from(decipher.decrypt(encryptedSeed.slice(16, 32)))]);
+
+ if (checksum.length > 0) {
+ if (checksum !== ethUtil.sha256(ethUtil.sha256(privKey)).slice(0, 8).toString('hex')) {
+ throw new Error('Failed to decrypt input - possibly invalid passphrase');
+ }
+ }
+ } else {
+ throw new Error('Unsupported or invalid entropy type');
+ }
+
+ return new Wallet(privKey);
+};
+
+Thirdparty.fromQuorumWallet = function (passphrase, userid) {
+ assert(passphrase.length >= 10);
+ assert(userid.length >= 10);
+
+ var seed = passphrase + userid;
+ seed = crypto.pbkdf2Sync(seed, seed, 2000, 32, 'sha256');
+
+ return new Wallet(seed);
+};
+
+module.exports = Thirdparty;
\ No newline at end of file
diff --git a/patches/@babel+runtime+7.16.3.patch b/patches/@babel+runtime+7.16.3.patch
index eaa0fe3913..2df821646d 100644
--- a/patches/@babel+runtime+7.16.3.patch
+++ b/patches/@babel+runtime+7.16.3.patch
@@ -4,7 +4,7 @@ index 108b39a..e3c769b 100644
+++ b/node_modules/@babel/runtime/helpers/construct.js
@@ -1,26 +1,21 @@
-var setPrototypeOf = require("./setPrototypeOf.js");
-+// All of MetaMask's supported browsers include `Reflect.construct` support, so
++// All of AptosMask's supported browsers include `Reflect.construct` support, so
+// we don't need this polyfill.
-var isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
diff --git a/shared/constants/app.js b/shared/constants/app.js
index 6c099860dd..33a9d46501 100644
--- a/shared/constants/app.js
+++ b/shared/constants/app.js
@@ -52,7 +52,7 @@ export const MESSAGE_TYPE = {
};
/**
- * The different kinds of subjects that MetaMask may interact with, including
+ * The different kinds of subjects that AptosMask may interact with, including
* third parties and itself (e.g. when the background communicated with the UI).
*/
export const SUBJECT_TYPES = {
diff --git a/shared/constants/metametrics.js b/shared/constants/metametrics.js
index 7f5076ffd7..77575c127a 100644
--- a/shared/constants/metametrics.js
+++ b/shared/constants/metametrics.js
@@ -107,7 +107,7 @@
* track. Keys in this object must be in snake_case. These properties will be
* sent in an additional event that excludes the user's metaMetricsId
* @property {number} [revenue] - amount of currency that event creates in
- * revenue for MetaMask if fragment is successful.
+ * revenue for AptosMask if fragment is successful.
* @property {string} [currency] - ISO 4127 format currency for events with
* revenue, defaults to US dollars
* @property {number} [value] - Abstract business "value" attributable to
diff --git a/shared/constants/transaction.js b/shared/constants/transaction.js
index 8ac9defc14..dbe1c188e4 100644
--- a/shared/constants/transaction.js
+++ b/shared/constants/transaction.js
@@ -1,7 +1,7 @@
import { MESSAGE_TYPE } from './app';
/**
- * Transaction Type is a MetaMask construct used internally
+ * Transaction Type is a AptosMask construct used internally
*
* @typedef {Object} TransactionTypes
* @property {'transfer'} TOKEN_METHOD_TRANSFER - A token transaction where the user
@@ -19,10 +19,10 @@ import { MESSAGE_TYPE } from './app';
* @property {'contractDeployment'} DEPLOY_CONTRACT - A transaction that deployed
* a smart contract
* @property {'swap'} SWAP - A transaction swapping one token for another through
- * MetaMask Swaps
+ * AptosMask Swaps
* @property {'swapApproval'} SWAP_APPROVAL - Similar to the approve type, a swap
* approval is a special case of ERC20 approve method that requests an allowance of
- * the token to spend on behalf of the user for the MetaMask Swaps contract. The first
+ * the token to spend on behalf of the user for the AptosMask Swaps contract. The first
* swap for any token will have an accompanying swapApproval transaction.
* @property {'cancel'} CANCEL - A transaction submitted with the same nonce as a
* previous transaction, a higher gas price and a zeroed out send amount. Useful
@@ -92,16 +92,16 @@ export const TRANSACTION_ENVELOPE_TYPES = {
};
/**
- * Transaction Status is a mix of Ethereum and MetaMask terminology, used internally
+ * Transaction Status is a mix of Ethereum and AptosMask terminology, used internally
* for transaction processing.
*
* @typedef {Object} TransactionStatuses
* @property {'unapproved'} UNAPPROVED - A new transaction that the user has not
* approved or rejected
* @property {'approved'} APPROVED - The user has approved the transaction in the
- * MetaMask UI
+ * AptosMask UI
* @property {'rejected'} REJECTED - The user has rejected the transaction in the
- * MetaMask UI
+ * AptosMask UI
* @property {'signed'} SIGNED - The transaction has been signed
* @property {'submitted'} SUBMITTED - The transaction has been submitted to network
* @property {'failed'} FAILED - The transaction has failed for some reason
@@ -133,7 +133,7 @@ export const TRANSACTION_STATUSES = {
};
/**
- * Transaction Group Status is a MetaMask construct to track the status of groups
+ * Transaction Group Status is a AptosMask construct to track the status of groups
* of transactions.
*
* @typedef {Object} TransactionGroupStatuses
@@ -170,7 +170,7 @@ export const SMART_TRANSACTION_STATUSES = {
};
/**
- * Transaction Group Category is a MetaMask construct to categorize the intent
+ * Transaction Group Category is a AptosMask construct to categorize the intent
* of a group of transactions for purposes of displaying in the UI
*
* @typedef {Object} TransactionGroupCategories
@@ -187,7 +187,7 @@ export const SMART_TRANSACTION_STATUSES = {
* approval in the UI. Once the user approves or rejects it will no longer show in
* activity.
* @property {'swap'} SWAP - Transaction group representing a token swap through
- * MetaMask Swaps. This transaction group's primary currency changes depending
+ * AptosMask Swaps. This transaction group's primary currency changes depending
* on context. If the user is viewing an asset page for a token received from a swap,
* the primary currency will be the received token. Otherwise the token exchanged
* will be shown.
@@ -269,19 +269,19 @@ export const TRANSACTION_GROUP_CATEGORIES = {
* happens we fire the Transaction Added event to show that the transaction
* has been added to the user's MetaMask.
* @property {'Transaction Approved'} APPROVED - When an unapproved transaction
- * is in the controller state, MetaMask will render a confirmation screen for
+ * is in the controller state, AptosMask will render a confirmation screen for
* that transaction. If the user approves the transaction we fire this event
* to indicate that the user has approved the transaction for submission to
* the network.
* @property {'Transaction Rejected'} REJECTED - When an unapproved transaction
- * is in the controller state, MetaMask will render a confirmation screen for
+ * is in the controller state, AptosMask will render a confirmation screen for
* that transaction. If the user rejects the transaction we fire this event
* to indicate that the user has rejected the transaction. It will be removed
* from state as a result.
* @property {'Transaction Submitted'} SUBMITTED - After a transaction is
* approved by the user, it is then submitted to the network for inclusion in
* a block. When this happens we fire the Transaction Submitted event to
- * indicate that MetaMask is submitting a transaction at the user's request.
+ * indicate that AptosMask is submitting a transaction at the user's request.
* @property {'Transaction Finalized'} FINALIZED - All transactions that are
* submitted will finalized (eventually) by either being dropped, failing
* or being confirmed. When this happens we track this event, along with the
diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js
index 26db7f7d89..aef81b3332 100644
--- a/test/e2e/metamask-ui.spec.js
+++ b/test/e2e/metamask-ui.spec.js
@@ -11,7 +11,7 @@ const { ensureXServerIsRunning } = require('./x-server');
const ganacheServer = new Ganache();
const dappPort = 8080;
-describe('MetaMask', function () {
+describe('AptosMask', function () {
let driver;
let dappServer;
let tokenAddress;
@@ -328,7 +328,7 @@ describe('MetaMask', function () {
});
});
- describe('Send token from inside MetaMask', function () {
+ describe('Send token from inside AptosMask', function () {
it('starts to send a transaction', async function () {
await driver.clickElement('[data-testid="eth-overview-send"]');
await driver.delay(regularDelayMs);
diff --git a/test/e2e/tests/contract-interactions.spec.js b/test/e2e/tests/contract-interactions.spec.js
index 1e4ddecfaf..0148d410d9 100644
--- a/test/e2e/tests/contract-interactions.spec.js
+++ b/test/e2e/tests/contract-interactions.spec.js
@@ -59,7 +59,7 @@ describe('Deploy contract and call contract methods', function () {
await driver.waitUntilXWindowHandles(3);
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
- 'MetaMask Notification',
+ 'AptosMask Notification',
windowHandles,
);
await driver.clickElement({ text: 'Data', tag: 'button' });
@@ -94,7 +94,7 @@ describe('Deploy contract and call contract methods', function () {
await driver.delay(5000);
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
- 'MetaMask Notification',
+ 'AptosMask Notification',
windowHandles,
);
await driver.delay(regularDelayMs);
@@ -120,7 +120,7 @@ describe('Deploy contract and call contract methods', function () {
await driver.delay(5000);
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
- 'MetaMask Notification',
+ 'AptosMask Notification',
windowHandles,
);
await driver.delay(regularDelayMs);
diff --git a/test/e2e/tests/eth-sign.spec.js b/test/e2e/tests/eth-sign.spec.js
index c0502f93e0..5934f31ede 100644
--- a/test/e2e/tests/eth-sign.spec.js
+++ b/test/e2e/tests/eth-sign.spec.js
@@ -34,7 +34,7 @@ describe('Eth sign', function () {
await driver.waitUntilXWindowHandles(3);
let windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
- 'MetaMask Notification',
+ 'AptosMask Notification',
windowHandles,
);
diff --git a/test/e2e/tests/permissions.spec.js b/test/e2e/tests/permissions.spec.js
index 16f786718a..d391d40376 100644
--- a/test/e2e/tests/permissions.spec.js
+++ b/test/e2e/tests/permissions.spec.js
@@ -35,7 +35,7 @@ describe('Permissions', function () {
const windowHandles = await driver.getAllWindowHandles();
const extension = windowHandles[0];
await driver.switchToWindowWithTitle(
- 'MetaMask Notification',
+ 'AptosMask Notification',
windowHandles,
);
await driver.clickElement({
diff --git a/test/e2e/tests/personal-sign.spec.js b/test/e2e/tests/personal-sign.spec.js
index 040cde6095..a62575a4aa 100644
--- a/test/e2e/tests/personal-sign.spec.js
+++ b/test/e2e/tests/personal-sign.spec.js
@@ -31,7 +31,7 @@ describe('Personal sign', function () {
await driver.waitUntilXWindowHandles(3);
let windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
- 'MetaMask Notification',
+ 'AptosMask Notification',
windowHandles,
);
diff --git a/test/e2e/tests/provider-api.spec.js b/test/e2e/tests/provider-api.spec.js
index 14a4ff0eb3..ab3c3f1a3b 100644
--- a/test/e2e/tests/provider-api.spec.js
+++ b/test/e2e/tests/provider-api.spec.js
@@ -2,7 +2,7 @@ const { strict: assert } = require('assert');
const { errorCodes } = require('eth-rpc-errors');
const { convertToHexValue, withFixtures } = require('../helpers');
-describe('MetaMask', function () {
+describe('AptosMask', function () {
const ganacheOptions = {
accounts: [
{
diff --git a/test/e2e/tests/send-eth.spec.js b/test/e2e/tests/send-eth.spec.js
index 7c12e321b9..d8ae9eb2d2 100644
--- a/test/e2e/tests/send-eth.spec.js
+++ b/test/e2e/tests/send-eth.spec.js
@@ -5,7 +5,7 @@ const {
regularDelayMs,
} = require('../helpers');
-describe('Send ETH from inside MetaMask using default gas', function () {
+describe('Send ETH from inside AptosMask using default gas', function () {
const ganacheOptions = {
accounts: [
{
@@ -91,7 +91,7 @@ describe('Send ETH from inside MetaMask using default gas', function () {
});
});
-describe('Send ETH from inside MetaMask using advanced gas modal', function () {
+describe('Send ETH from inside AptosMask using advanced gas modal', function () {
const ganacheOptions = {
accounts: [
{
@@ -228,7 +228,7 @@ describe('Send ETH from dapp using advanced gas controls', function () {
await driver.delay(2000);
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
- 'MetaMask Notification',
+ 'AptosMask Notification',
windowHandles,
);
await driver.assertElementNotPresent({ text: 'Data', tag: 'li' });
diff --git a/test/e2e/tests/signature-request.spec.js b/test/e2e/tests/signature-request.spec.js
index 335826069d..fbdcf75c3d 100644
--- a/test/e2e/tests/signature-request.spec.js
+++ b/test/e2e/tests/signature-request.spec.js
@@ -37,7 +37,7 @@ describe('Sign Typed Data V4 Signature Request', function () {
await driver.waitUntilXWindowHandles(3);
let windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
- 'MetaMask Notification',
+ 'AptosMask Notification',
windowHandles,
);
@@ -118,7 +118,7 @@ describe('Sign Typed Data V3 Signature Request', function () {
await driver.waitUntilXWindowHandles(3);
let windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
- 'MetaMask Notification',
+ 'AptosMask Notification',
windowHandles,
);
@@ -196,7 +196,7 @@ describe('Sign Typed Data Signature Request', function () {
await driver.waitUntilXWindowHandles(3);
let windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
- 'MetaMask Notification',
+ 'AptosMask Notification',
windowHandles,
);
diff --git a/test/e2e/webdriver/chrome.js b/test/e2e/webdriver/chrome.js
index f5af2bad40..3099357a96 100644
--- a/test/e2e/webdriver/chrome.js
+++ b/test/e2e/webdriver/chrome.js
@@ -38,7 +38,7 @@ class ChromeDriver {
builder.setChromeService(service);
const driver = builder.build();
const chromeDriver = new ChromeDriver(driver);
- const extensionId = await chromeDriver.getExtensionIdByName('MetaMask');
+ const extensionId = await chromeDriver.getExtensionIdByName('AptosMask');
return {
driver,
diff --git a/test/e2e/webdriver/firefox.js b/test/e2e/webdriver/firefox.js
index bde4564c21..e35840aa4b 100644
--- a/test/e2e/webdriver/firefox.js
+++ b/test/e2e/webdriver/firefox.js
@@ -12,7 +12,7 @@ const { version } = require('../../../package.json');
*
* @type {string}
*/
-const TEMP_PROFILE_PATH_PREFIX = path.join(os.tmpdir(), 'MetaMask-Fx-Profile');
+const TEMP_PROFILE_PATH_PREFIX = path.join(os.tmpdir(), 'AptosMask-Fx-Profile');
/**
* Proxy host to use for HTTPS requests
diff --git a/test/stub/tx-meta-stub.js b/test/stub/tx-meta-stub.js
index c33ab758c1..751c450a5c 100644
--- a/test/stub/tx-meta-stub.js
+++ b/test/stub/tx-meta-stub.js
@@ -37,7 +37,7 @@ export const txMetaStub = {
op: 'add',
path: '/origin',
timestamp: 1572395156645,
- value: 'MetaMask',
+ value: 'AptosMask',
},
],
[],
@@ -187,7 +187,7 @@ export const txMetaStub = {
nextNetworkNonce: 4,
},
},
- origin: 'MetaMask',
+ origin: 'AptosMask',
r: '0x5f973e540f2d3c2f06d3725a626b75247593cb36477187ae07ecfe0a4db3cf57',
rawTx:
'0xf86204831e848082520894f231d46dd78806e1dd93442cf33c7671f853874880802ca05f973e540f2d3c2f06d3725a626b75247593cb36477187ae07ecfe0a4db3cf57a00259b52ee8c58baaa385fb05c3f96116e58de89bcc165cb3bfdfc708672fed8a',
diff --git a/ui/components/app/metamask-template-renderer/metamask-template-renderer.js b/ui/components/app/metamask-template-renderer/metamask-template-renderer.js
index 6aaca546b5..6bf9f09b7f 100644
--- a/ui/components/app/metamask-template-renderer/metamask-template-renderer.js
+++ b/ui/components/app/metamask-template-renderer/metamask-template-renderer.js
@@ -8,7 +8,7 @@ function getElement(section) {
const Element = safeComponentList[element];
if (!Element) {
throw new Error(
- `${element} is not in the safe component list for MetaMask template renderer`,
+ `${element} is not in the safe component list for AptosMask template renderer`,
);
}
return Element;
@@ -52,7 +52,7 @@ const MetaMaskTemplateRenderer = ({ sections }) => {
// be provided a key when a part of an array.
if (!child.key) {
throw new Error(
- 'When using array syntax in MetaMask Template Language, you must specify a key for each child of the array',
+ 'When using array syntax in AptosMask Template Language, you must specify a key for each child of the array',
);
}
if (typeof child?.children === 'object') {
diff --git a/ui/components/app/metamask-translation/README.mdx b/ui/components/app/metamask-translation/README.mdx
index df48074260..eeca638361 100644
--- a/ui/components/app/metamask-translation/README.mdx
+++ b/ui/components/app/metamask-translation/README.mdx
@@ -2,7 +2,7 @@ import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';
import MetaMaskTranslation from '.';
-# MetaMask Translation
+# AptosMask Translation
MetaMaskTranslation is a simple helper component for adding full translation
support to the template system. We do pass the translation function to the
diff --git a/ui/components/app/metamask-translation/metamask-translation.js b/ui/components/app/metamask-translation/metamask-translation.js
index 86944560f9..3e3a90d67c 100644
--- a/ui/components/app/metamask-translation/metamask-translation.js
+++ b/ui/components/app/metamask-translation/metamask-translation.js
@@ -38,7 +38,7 @@ export default function MetaMaskTranslation({ translationKey, variables }) {
) {
if (!variable.key) {
throw new Error(
- `When using MetaMask Template Language in a MetaMaskTranslation variable, you must provide a key for the section regardless of syntax.
+ `When using AptosMask Template Language in a MetaMaskTranslation variable, you must provide a key for the section regardless of syntax.
Section with element '${variable.element}' for translationKey: '${translationKey}' has no key property`,
);
}
diff --git a/ui/components/app/transaction-activity-log/transaction-activity-log.util.test.js b/ui/components/app/transaction-activity-log/transaction-activity-log.util.test.js
index 50a221a9e1..62bb42939d 100644
--- a/ui/components/app/transaction-activity-log/transaction-activity-log.util.test.js
+++ b/ui/components/app/transaction-activity-log/transaction-activity-log.util.test.js
@@ -289,7 +289,7 @@ describe('TransactionActivityLog utils', () => {
op: 'add',
path: '/origin',
timestamp: 1535507561516,
- value: 'MetaMask',
+ value: 'AptosMask',
},
[],
],
diff --git a/ui/components/ui/site-origin/site-origin.stories.js b/ui/components/ui/site-origin/site-origin.stories.js
index 53a11c190e..f570040341 100644
--- a/ui/components/ui/site-origin/site-origin.stories.js
+++ b/ui/components/ui/site-origin/site-origin.stories.js
@@ -25,6 +25,6 @@ DefaultStory.storyName = 'Default';
DefaultStory.args = {
siteOrigin: 'https://metamask.io',
- iconName: 'MetaMask',
+ iconName: 'AptosMask',
iconSrc: './metamark.svg',
};
diff --git a/ui/css/index.scss b/ui/css/index.scss
index bbbc050c13..049ee97656 100644
--- a/ui/css/index.scss
+++ b/ui/css/index.scss
@@ -1,5 +1,5 @@
/*
- MetaMask design system imports
+ AptosMask design system imports
The variables declared here should take precedence.
They are included first because they will be used to replace bad variable names in itcss
prior to it being fully removed from the system.
diff --git a/ui/css/itcss/README.md b/ui/css/itcss/README.md
index cf295969a7..527ccb0c4b 100644
--- a/ui/css/itcss/README.md
+++ b/ui/css/itcss/README.md
@@ -1,2 +1,2 @@
### Deprecated
-The [itcss](https://www.freecodecamp.org/news/managing-large-s-css-projects-using-the-inverted-triangle-architecture-3c03e4b1e6df/) folder is deprecated. The infrastructure here is from a former era of the extension. The files and some sporadic styling are still used in the codebase but should not be extended. The MetaMask team will gradually move the valid styles from this folder into the [css](/css) folder. Eventually the itcss folder will be removed.
+The [itcss](https://www.freecodecamp.org/news/managing-large-s-css-projects-using-the-inverted-triangle-architecture-3c03e4b1e6df/) folder is deprecated. The infrastructure here is from a former era of the extension. The files and some sporadic styling are still used in the codebase but should not be extended. The AptosMask team will gradually move the valid styles from this folder into the [css](/css) folder. Eventually the itcss folder will be removed.
diff --git a/ui/css/utilities/colors.scss b/ui/css/utilities/colors.scss
index 3409dc8a95..1527b49aaa 100644
--- a/ui/css/utilities/colors.scss
+++ b/ui/css/utilities/colors.scss
@@ -1,5 +1,5 @@
:root {
- // These are the colors of the MetaMask design system
+ // These are the colors of the AptosMask design system
// Only design system colors should be added, no superfluous variables
--Blue-000: #eaf6ff;
--Blue-100: #a7d9fe;
diff --git a/ui/ducks/metamask/metamask.js b/ui/ducks/metamask/metamask.js
index 7aa2e12205..d8f33d0825 100644
--- a/ui/ducks/metamask/metamask.js
+++ b/ui/ducks/metamask/metamask.js
@@ -441,7 +441,7 @@ export function isAddressLedger(state, address) {
}
/**
- * Given the redux state object, returns a boolean indicating whether the user has any Ledger accounts added to MetaMask (i.e. Ledger keyrings
+ * Given the redux state object, returns a boolean indicating whether the user has any Ledger accounts added to AptosMask (i.e. Ledger keyrings
* in state)
*
* @param {Object} state - the redux state object
diff --git a/ui/ducks/metamask/metamask.test.js b/ui/ducks/metamask/metamask.test.js
index b14c4ed5c1..44502e0ad6 100644
--- a/ui/ducks/metamask/metamask.test.js
+++ b/ui/ducks/metamask/metamask.test.js
@@ -11,7 +11,7 @@ import reduceMetamask, {
isNotEIP1559Network,
} from './metamask';
-describe('MetaMask Reducers', () => {
+describe('AptosMask Reducers', () => {
const mockState = {
metamask: reduceMetamask(
{
@@ -114,7 +114,7 @@ describe('MetaMask Reducers', () => {
expect.anything(initState);
});
- it('locks MetaMask', () => {
+ it('locks AptosMask', () => {
const unlockMetaMaskState = {
isUnlocked: true,
selectedAddress: 'test address',
diff --git a/ui/helpers/utils/util.js b/ui/helpers/utils/util.js
index e31bcfadf2..b92c617c7e 100644
--- a/ui/helpers/utils/util.js
+++ b/ui/helpers/utils/util.js
@@ -43,7 +43,7 @@ export function formatDateWithYearContext(
);
}
/**
- * Determines if the provided chainId is a default MetaMask chain
+ * Determines if the provided chainId is a default AptosMask chain
*
* @param {string} chainId - chainId to check
*/
diff --git a/ui/hooks/useMetricEvent.js b/ui/hooks/useMetricEvent.js
index f6e44574a6..ab31170341 100644
--- a/ui/hooks/useMetricEvent.js
+++ b/ui/hooks/useMetricEvent.js
@@ -25,7 +25,7 @@ export function useMetricEvent(config = {}, overrides = {}) {
/**
* track a metametrics event using segment
- * e.g metricsEvent({ event: 'Unlocked MetaMask', category: 'Navigation' })
+ * e.g metricsEvent({ event: 'Unlocked AptosMask', category: 'Navigation' })
*
* @param {UIMetricsEventPayload} payload - payload of the event to track
* @param {MetaMetricsEventOptions} options - options for handling/routing event
diff --git a/ui/pages/swaps/fee-card/fee-card.test.js b/ui/pages/swaps/fee-card/fee-card.test.js
index 218fba458f..6fc07814c6 100644
--- a/ui/pages/swaps/fee-card/fee-card.test.js
+++ b/ui/pages/swaps/fee-card/fee-card.test.js
@@ -108,7 +108,7 @@ describe('FeeCard', () => {
expect(getByText(props.primaryFee.fee)).toBeInTheDocument();
expect(getByText(props.secondaryFee.fee)).toBeInTheDocument();
expect(getByText(`: ${props.secondaryFee.maxFee}`)).toBeInTheDocument();
- expect(getByText('Includes a 0.875% MetaMask fee.')).toBeInTheDocument();
+ expect(getByText('Includes a 0.875% AptosMask fee.')).toBeInTheDocument();
expect(
document.querySelector('.fee-card__top-bordered-row'),
).toMatchSnapshot();
@@ -128,7 +128,7 @@ describe('FeeCard', () => {
expect(getByText(props.primaryFee.fee)).toBeInTheDocument();
expect(getByText(props.secondaryFee.fee)).toBeInTheDocument();
expect(getByText(`: ${props.secondaryFee.maxFee}`)).toBeInTheDocument();
- expect(getByText('Includes a 0.875% MetaMask fee.')).toBeInTheDocument();
+ expect(getByText('Includes a 0.875% AptosMask fee.')).toBeInTheDocument();
expect(
document.querySelector('.fee-card__top-bordered-row'),
).toMatchSnapshot();
@@ -200,7 +200,7 @@ describe('FeeCard', () => {
expect(getByText(props.primaryFee.fee)).toBeInTheDocument();
expect(getByText(props.secondaryFee.fee)).toBeInTheDocument();
expect(getByText(`: ${props.secondaryFee.maxFee}`)).toBeInTheDocument();
- expect(getByText('Includes a 0.875% MetaMask fee.')).toBeInTheDocument();
+ expect(getByText('Includes a 0.875% AptosMask fee.')).toBeInTheDocument();
expect(
document.querySelector('.fee-card__top-bordered-row'),
).toMatchSnapshot();
diff --git a/ui/pages/swaps/view-quote/view-quote.js b/ui/pages/swaps/view-quote/view-quote.js
index 6229855808..8b3826ecf2 100644
--- a/ui/pages/swaps/view-quote/view-quote.js
+++ b/ui/pages/swaps/view-quote/view-quote.js
@@ -617,7 +617,7 @@ export default function ViewQuote() {
showModal({
name: 'EDIT_APPROVAL_PERMISSION',
decimals: selectedFromToken.decimals,
- origin: 'MetaMask',
+ origin: 'AptosMask',
setCustomAmount: (newCustomPermissionAmount) => {
const customPermissionAmount =
newCustomPermissionAmount === ''
diff --git a/ui/selectors/permissions.js b/ui/selectors/permissions.js
index be0543ef5a..96494c5a69 100644
--- a/ui/selectors/permissions.js
+++ b/ui/selectors/permissions.js
@@ -263,7 +263,7 @@ export function activeTabHasPermissions(state) {
/**
* Get the connected accounts history for all origins.
*
- * @param {Record} state - The MetaMask state.
+ * @param {Record} state - The AptosMask state.
* @returns {Record }>} An object
* with account connection histories by origin.
*/
diff --git a/ui/store/actions.js b/ui/store/actions.js
index d9d1fb616d..93a68c5cfd 100644
--- a/ui/store/actions.js
+++ b/ui/store/actions.js
@@ -1330,7 +1330,7 @@ export function addToken(
) {
return async (dispatch) => {
if (!address) {
- throw new Error('MetaMask - Cannot add token without address');
+ throw new Error('AptosMask - Cannot add token without address');
}
if (!dontShowLoadingIndicator) {
dispatch(showLoadingIndication());
@@ -1350,10 +1350,10 @@ export function addToken(
export function addCollectible(address, tokenID, dontShowLoadingIndicator) {
return async (dispatch) => {
if (!address) {
- throw new Error('MetaMask - Cannot add collectible without address');
+ throw new Error('AptosMask - Cannot add collectible without address');
}
if (!tokenID) {
- throw new Error('MetaMask - Cannot add collectible without tokenID');
+ throw new Error('AptosMask - Cannot add collectible without tokenID');
}
if (!dontShowLoadingIndicator) {
dispatch(showLoadingIndication());
@@ -1377,10 +1377,10 @@ export function addCollectibleVerifyOwnership(
) {
return async (dispatch) => {
if (!address) {
- throw new Error('MetaMask - Cannot add collectible without address');
+ throw new Error('AptosMask - Cannot add collectible without address');
}
if (!tokenID) {
- throw new Error('MetaMask - Cannot add collectible without tokenID');
+ throw new Error('AptosMask - Cannot add collectible without tokenID');
}
if (!dontShowLoadingIndicator) {
dispatch(showLoadingIndication());
@@ -1414,10 +1414,10 @@ export function removeAndIgnoreCollectible(
) {
return async (dispatch) => {
if (!address) {
- throw new Error('MetaMask - Cannot ignore collectible without address');
+ throw new Error('AptosMask - Cannot ignore collectible without address');
}
if (!tokenID) {
- throw new Error('MetaMask - Cannot ignore collectible without tokenID');
+ throw new Error('AptosMask - Cannot ignore collectible without tokenID');
}
if (!dontShowLoadingIndicator) {
dispatch(showLoadingIndication());
@@ -1437,10 +1437,10 @@ export function removeAndIgnoreCollectible(
export function removeCollectible(address, tokenID, dontShowLoadingIndicator) {
return async (dispatch) => {
if (!address) {
- throw new Error('MetaMask - Cannot remove collectible without address');
+ throw new Error('AptosMask - Cannot remove collectible without address');
}
if (!tokenID) {
- throw new Error('MetaMask - Cannot remove collectible without tokenID');
+ throw new Error('AptosMask - Cannot remove collectible without tokenID');
}
if (!dontShowLoadingIndicator) {
dispatch(showLoadingIndication());
diff --git a/ui/store/store.js b/ui/store/store.js
index fd2790a158..b1961697ff 100644
--- a/ui/store/store.js
+++ b/ui/store/store.js
@@ -8,7 +8,7 @@ export default function configureStore(initialState) {
if (process.env.METAMASK_DEBUG && !process.env.IN_TEST) {
const composeEnhancers = composeWithDevTools({
- name: 'MetaMask',
+ name: 'AptosMask',
hostname: 'localhost',
port: 8000,
realtime: Boolean(process.env.METAMASK_DEBUG),