Skip to content

Commit

Permalink
Merge pull request #1 from MetaMask/MMI-XXX-custodial-rename-institut…
Browse files Browse the repository at this point in the history
…ional

chore: rename everything to institutional
  • Loading branch information
PatrykLucka authored Dec 2, 2024
2 parents 3322336 + f5b9936 commit 895209c
Show file tree
Hide file tree
Showing 19 changed files with 73 additions and 70 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Custodial Wallet Snap
# Institutional Wallet Snap

## Description

The custodian snap allows users to use custodial wallets with MetaMask. It acts as a client to any custodian which implements the Ethereum Custodian API.
The institutional snap allows users to use custodial wallets with MetaMask. It acts as a client to any custodian which implements the Ethereum Custodian API.

Information on how to implement the Ethereum Custodian API and be supported in MetaMask can be found in the [integration docs](integration-docs/index.md).

Expand All @@ -14,7 +14,7 @@ yarn install && yarn start

## Testing

The custodial snap supports any of the custodians previously supported by MetaMask Institutional. The easiest way to test the snap is to run this repo and use the local companion site to test it with the local dev custodian.
The institutional snap supports any of the custodians previously supported by MetaMask Institutional. The easiest way to test the snap is to run this repo and use the local companion site to test it with the local dev custodian.

It should also function with Neptune Custody which has a UI located at https://neptune-custody-ui.dev.metamask-institutional.io/

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "@metamask/snap-custodial-wallet",
"name": "@metamask/snap-institutional-wallet",
"version": "0.0.1",
"description": "Custodial accounts in MetaMask",
"description": "Institutional accounts in MetaMask",
"keywords": [
"metamask",
"snap",
"keyring",
"account"
],
"homepage": "https://github.com/MetaMask/snap-custodial-wallet#readme",
"homepage": "https://github.com/MetaMask/snap-institutional-wallet#readme",
"bugs": {
"url": "https://github.com/MetaMask/snap-custodial-wallet/issues"
"url": "https://github.com/MetaMask/snap-institutional-wallet/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/MetaMask/snap-custodial-wallet.git"
"url": "https://github.com/MetaMask/snap-institutional-wallet.git"
},
"license": "(MIT-0 OR Apache-2.0)",
"author": "",
Expand All @@ -23,8 +23,8 @@
],
"scripts": {
"build": "yarn workspaces foreach --parallel --verbose --topological run build",
"build:dapp": "yarn workspace @metamask/snap-custodial-wallet-site build",
"build:snap": "yarn workspace @metamask/snap-custodial-wallet-snap build",
"build:dapp": "yarn workspace @metamask/snap-institutional-wallet-site build",
"build:snap": "yarn workspace @metamask/snap-institutional-wallet-snap build",
"lint": "yarn workspaces foreach --parallel --verbose run lint",
"lint:deps": "yarn workspaces foreach --parallel --verbose run depcheck",
"lint:eslint": "yarn workspaces foreach --parallel --verbose run lint:eslint",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

[Unreleased]: https://github.com/MetaMask/snap-custodial-wallet/
[Unreleased]: https://github.com/MetaMask/snap-institutional-wallet/
2 changes: 1 addition & 1 deletion packages/api/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Local Custodian API

The local custodian API partly implements the [Ethereum Custodian API version 3](https://consensys-vertical-apps.github.io/ethereum-custodian-api/) (ECA-3) for use with the custodial snap.
The local custodian API partly implements the [Ethereum Custodian API version 3](https://consensys-vertical-apps.github.io/ethereum-custodian-api/) (ECA-3) for use with the institutional snap.

It makes available a refresh token API at

Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@metamask/custodial-wallet-api",
"name": "@metamask/institutional-wallet-api",
"description": "Example custodian API",
"packageManager": "[email protected]",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/site/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial commit

[Unreleased]: https://github.com/MetaMask/snap-custodial-wallet/compare/v0.0.1...HEAD
[0.0.1]: https://github.com/MetaMask/snap-custodial-wallet/releases/tag/v0.0.1
[Unreleased]: https://github.com/MetaMask/snap-insitutional-wallet/compare/v0.0.1...HEAD
[0.0.1]: https://github.com/MetaMask/snap-insitutional-wallet/releases/tag/v0.0.1
4 changes: 2 additions & 2 deletions packages/site/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Custodial snap frontend
# Institutional snap frontend

This project was forked from the original [Simple Snap Keyring Frontend](https://github.com/MetaMask/snap-simple-keyring/tree/main/packages/site)

It's intended to work with the custodial snap as well as the Local Custodian API (in the /api package). By default that runs at http://localhost:3330.
It's intended to work with the institutional snap as well as the Local Custodian API (in the /api package). By default that runs at http://localhost:3330.

## Available Scripts

Expand Down
2 changes: 1 addition & 1 deletion packages/site/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@metamask/snap-custodial-wallet-site",
"name": "@metamask/snap-insitutional-wallet-site",
"version": "0.0.1",
"private": true,
"license": "(MIT-0 OR Apache-2.0)",
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial commit

[Unreleased]: https://github.com/MetaMask/snap-custodial-wallet/compare/v0.0.1...HEAD
[0.0.1]: https://github.com/MetaMask/snap-custodial-wallet/releases/tag/v0.0.1
[Unreleased]: https://github.com/MetaMask/snap-insitutional-wallet/compare/v0.0.1...HEAD
[0.0.1]: https://github.com/MetaMask/snap-insitutional-wallet/releases/tag/v0.0.1
2 changes: 1 addition & 1 deletion packages/snap/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Custodial snap
# Institutional snap

See the [main README](../../README.md) for more information.
10 changes: 5 additions & 5 deletions packages/snap/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "@metamask/snap-custodial-wallet-snap",
"name": "@metamask/snap-institutional-wallet-snap",
"version": "0.0.1",
"description": "Custodial accounts in MetaMask.",
"description": "Institutional accounts in MetaMask.",
"keywords": [
"metamask",
"snap",
"keyring",
"account"
],
"homepage": "https://github.com/MetaMask/snap-custodial-wallet#readme",
"homepage": "https://github.com/MetaMask/snap-institutional-wallet#readme",
"bugs": {
"url": "https://github.com/MetaMask/snap-custodial-wallet/issues"
"url": "https://github.com/MetaMask/snap-institutional-wallet/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/MetaMask/snap-custodial-wallet.git"
"url": "git+https://github.com/MetaMask/snap-institutional-wallet.git"
},
"license": "(MIT-0 OR Apache-2.0)",
"main": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/scripts/build-preinstalled-snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ try {
} catch (error) {
console.error('Error writing combined file to disk:', error);
throw error;
}
}
3 changes: 2 additions & 1 deletion packages/snap/snap.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const config: SnapConfig = {
crypto: true,
},
environment: {
DAPP_ORIGIN_PRODUCTION: 'https://metamask.github.io/snap-custodial-wallet/',
DAPP_ORIGIN_PRODUCTION:
'https://metamask.github.io/snap-insitutional-wallet/',
DAPP_ORIGIN_DEVELOPMENT: 'http://localhost:8000/',
},
stats: {
Expand Down
10 changes: 5 additions & 5 deletions packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"version": "0.0.1",
"description": "Custodial accounts in MetaMask.",
"proposedName": "MetaMask Custodial Wallet",
"description": "Institutional accounts in MetaMask.",
"proposedName": "Institutional Wallet",
"repository": {
"type": "git",
"url": "git+https://github.com/MetaMask/snap-custodial-wallet.git"
"url": "git+https://github.com/MetaMask/snap-institutional-wallet.git"
},
"source": {
"shasum": "vwn1nQknjYrb8+VxmW28i9j4fVxjyVJm4uQzryaUMAI=",
"shasum": "pAM+McrqnMYKY0ctbnqvhb2POFwcXh5wdz8DnklnoXc=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
"iconPath": "images/icon.svg",
"packageName": "@metamask/snap-custodial-wallet-snap",
"packageName": "@metamask/snap-institutional-wallet-snap",
"registry": "https://registry.npmjs.org/"
}
}
Expand Down
4 changes: 3 additions & 1 deletion packages/snap/src/features/homepage/components/AddToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export const AddToken: SnapComponent<AddTokenProps> = ({
<Field label="Paste your Refresh Token">
<Input name="token" placeholder="Enter your Refresh Token" />
</Field>
<Field label={`${!selectedCustodian?.displayName} API URL`}>
<Field
label={`${selectedCustodian?.displayName ?? 'Custodian'} API URL`}
>
<Input name="apiUrl" placeholder={selectedCustodian?.apiBaseUrl} />
</Field>
</Form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export class ECA1CustodianApi extends EventEmitter implements ICustodianApi {
};
}

// MMI Legacy feature that is not used in the custodial snap
// MMI Legacy feature that is not used in the Institutional snap
public async getCustomerProof(): Promise<string> {
const { result } = await this.#client.getCustomerProof();
return result.jwt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class ECA3CustodianApi extends EventEmitter implements ICustodianApi {
);
}

// MMI Legacy feature that is n ot used in the custodial snap
// MMI Legacy feature that is n ot used in the Institutional snap
async getListAccountsSigned(): Promise<string> {
const { result } = await this.#client.listAccountsSigned();

Expand Down Expand Up @@ -149,7 +149,7 @@ export class ECA3CustodianApi extends EventEmitter implements ICustodianApi {
...(typeof txMeta.custodianPublishesTransaction === 'boolean' && {
custodianPublishesTransaction: txMeta.custodianPublishesTransaction,
}),
...(txMeta.rpcUrl && { rpcUrl: txMeta.rpcUrl }), // MMI Legacy feature that is not used in the custodial snap
...(txMeta.rpcUrl && { rpcUrl: txMeta.rpcUrl }), // MMI Legacy feature that is not used in the Institutional snap
};

const { result } = await this.#client.createTransaction([
Expand Down Expand Up @@ -201,7 +201,7 @@ export class ECA3CustodianApi extends EventEmitter implements ICustodianApi {
};
}

// MMI Legacy feature that is not used in the custodial snap
// MMI Legacy feature that is not used in the Institutional snap
async replaceTransaction(
txParams: ReplaceTransactionParams,
): Promise<{ transactionId: string }> {
Expand Down Expand Up @@ -297,7 +297,7 @@ export class ECA3CustodianApi extends EventEmitter implements ICustodianApi {
};
}

// MMI Legacy feature that is not used in the custodial snap
// MMI Legacy feature that is not used in the Institutional snap
public async getCustomerProof(): Promise<string> {
const { result } = await this.#client.getCustomerProof();
return result.jwt;
Expand Down
10 changes: 5 additions & 5 deletions packages/snap/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@
const logger = {
log: (...args: any[]) =>
console.log(
'[Custodial snap]',
'[Institutional snap]',
...args.map((arg) =>
typeof arg === 'object' ? JSON.stringify(arg, null, 2) : arg,
),
),
info: (...args: any[]) =>
console.info(
'[Custodial snap]',
'[Institutional snap]',
...args.map((arg) =>
typeof arg === 'object' ? JSON.stringify(arg, null, 2) : arg,
),
),
warn: (...args: any[]) =>
console.warn(
'[Custodial snap]',
'[Institutional snap]',
...args.map((arg) =>
typeof arg === 'object' ? JSON.stringify(arg, null, 2) : arg,
),
),
error: (...args: any[]) => {
console.error(
'[Custodial snap]',
'[Institutional snap]',
...args.map((arg) =>
typeof arg === 'object' ? JSON.stringify(arg, null, 2) : arg,
),
Expand All @@ -37,7 +37,7 @@ const logger = {
},
debug: (...args: any[]) =>
console.debug(
'[Custodial snap]',
'[Institutional snap]',
...args.map((arg) =>
typeof arg === 'object' ? JSON.stringify(arg, null, 2) : arg,
),
Expand Down
52 changes: 26 additions & 26 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4756,26 +4756,6 @@ __metadata:
languageName: node
linkType: hard

"@metamask/custodial-wallet-api@workspace:packages/api":
version: 0.0.0-use.local
resolution: "@metamask/custodial-wallet-api@workspace:packages/api"
dependencies:
"@ethereumjs/common": ^4.4.0
"@ethereumjs/tx": ^5.4.0
"@metamask/eth-hd-keyring": ^8.0.0
"@open-rpc/schema-utils-js": ^2.0.5
"@open-rpc/server-js": ^1.9.5
"@types/connect": ^3.4.38
dotenv: ^16.4.5
eip-712: ^1.0.0
ethers: ^6.13.4
express: ^4.21.1
nodemon: ^3.1.7
ts-node: ^10.9.2
typescript: ^5.6.3
languageName: unknown
linkType: soft

"@metamask/eslint-config-jest@npm:^12.1.0":
version: 12.1.0
resolution: "@metamask/eslint-config-jest@npm:12.1.0"
Expand Down Expand Up @@ -4944,6 +4924,26 @@ __metadata:
languageName: node
linkType: hard

"@metamask/institutional-wallet-api@workspace:packages/api":
version: 0.0.0-use.local
resolution: "@metamask/institutional-wallet-api@workspace:packages/api"
dependencies:
"@ethereumjs/common": ^4.4.0
"@ethereumjs/tx": ^5.4.0
"@metamask/eth-hd-keyring": ^8.0.0
"@open-rpc/schema-utils-js": ^2.0.5
"@open-rpc/server-js": ^1.9.5
"@types/connect": ^3.4.38
dotenv: ^16.4.5
eip-712: ^1.0.0
ethers: ^6.13.4
express: ^4.21.1
nodemon: ^3.1.7
ts-node: ^10.9.2
typescript: ^5.6.3
languageName: unknown
linkType: soft

"@metamask/json-rpc-engine@npm:^10.0.0, @metamask/json-rpc-engine@npm:^10.0.1":
version: 10.0.1
resolution: "@metamask/json-rpc-engine@npm:10.0.1"
Expand Down Expand Up @@ -5292,9 +5292,9 @@ __metadata:
languageName: node
linkType: hard

"@metamask/snap-custodial-wallet-site@workspace:packages/site":
"@metamask/snap-insitutional-wallet-site@workspace:packages/site":
version: 0.0.0-use.local
resolution: "@metamask/snap-custodial-wallet-site@workspace:packages/site"
resolution: "@metamask/snap-insitutional-wallet-site@workspace:packages/site"
dependencies:
"@emotion/react": ^11.11.1
"@emotion/styled": ^11.11.0
Expand Down Expand Up @@ -5344,9 +5344,9 @@ __metadata:
languageName: unknown
linkType: soft

"@metamask/snap-custodial-wallet-snap@workspace:packages/snap":
"@metamask/snap-institutional-wallet-snap@workspace:packages/snap":
version: 0.0.0-use.local
resolution: "@metamask/snap-custodial-wallet-snap@workspace:packages/snap"
resolution: "@metamask/snap-institutional-wallet-snap@workspace:packages/snap"
dependencies:
"@ethereumjs/common": ^3.1.2
"@ethereumjs/tx": ^4.1.2
Expand Down Expand Up @@ -5389,9 +5389,9 @@ __metadata:
languageName: unknown
linkType: soft

"@metamask/snap-custodial-wallet@workspace:.":
"@metamask/snap-institutional-wallet@workspace:.":
version: 0.0.0-use.local
resolution: "@metamask/snap-custodial-wallet@workspace:."
resolution: "@metamask/snap-institutional-wallet@workspace:."
dependencies:
"@metamask/eslint-config": ^12.2.0
"@metamask/eslint-config-jest": ^12.1.0
Expand Down

0 comments on commit 895209c

Please sign in to comment.