Skip to content

Commit c5ea32e

Browse files
refactor: move polyfills to infrastructure directory (#414)
1 parent 4207354 commit c5ea32e

11 files changed

Lines changed: 15 additions & 6 deletions

File tree

packages/snap/snap.manifest.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snap-solana-wallet.git"
88
},
99
"source": {
10-
"shasum": "ssZ6XwPzUpBCXstPx6ko5dEVFVlcF6aqcaO9LhE4gj8=",
10+
"shasum": "CudxHbESLzWfWs4S3q0ZpuPNKer2CcnzKqlBek8bDGA=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",
@@ -16,7 +16,9 @@
1616
"registry": "https://registry.npmjs.org/"
1717
}
1818
},
19-
"locales": ["locales/en.json"]
19+
"locales": [
20+
"locales/en.json"
21+
]
2022
},
2123
"initialConnections": {
2224
"https://portfolio.metamask.io": {}
@@ -27,11 +29,17 @@
2729
"snaps": false
2830
},
2931
"endowment:keyring": {
30-
"allowedOrigins": ["https://portfolio.metamask.io"]
32+
"allowedOrigins": [
33+
"https://portfolio.metamask.io"
34+
]
3135
},
3236
"snap_getBip32Entropy": [
3337
{
34-
"path": ["m", "44'", "501'"],
38+
"path": [
39+
"m",
40+
"44'",
41+
"501'"
42+
],
3543
"curve": "ed25519"
3644
}
3745
],

packages/snap/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { CronjobMethod } from './core/handlers/onCronjob/cronjobs/CronjobMethod'
2929
import { onProtocolRequest as onProtocolRequestHandler } from './core/handlers/onProtocolRequest/onProtocolRequest';
3030
import { handlers as onRpcRequestHandlers } from './core/handlers/onRpcRequest';
3131
import { RpcRequestMethod } from './core/handlers/onRpcRequest/types';
32-
import { install as installPolyfills } from './core/polyfills';
3332
import { isSnapRpcError } from './core/utils/errors';
3433
import { getClientStatus } from './core/utils/interface';
3534
import logger from './core/utils/logger';
@@ -39,6 +38,7 @@ import { eventHandlers as confirmSignMessageEvents } from './features/confirmati
3938
import { eventHandlers as confirmSignAndSendTransactionEvents } from './features/confirmation/views/ConfirmTransactionRequest/events';
4039
import { eventHandlers as sendFormEvents } from './features/send/views/SendForm/events';
4140
import { eventHandlers as transactionConfirmationEvents } from './features/send/views/TransactionConfirmation/events';
41+
import { installPolyfills } from './infrastructure';
4242
import snapContext, {
4343
clientRequestHandler,
4444
keyring,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './polyfills';

packages/snap/src/core/polyfills/dom-exception/index.ts renamed to packages/snap/src/infrastructure/polyfills/dom-exception/index.ts

File renamed without changes.

packages/snap/src/core/polyfills/ed25519/index.ts renamed to packages/snap/src/infrastructure/polyfills/ed25519/index.ts

File renamed without changes.

packages/snap/src/core/polyfills/ed25519/polyfill.ts renamed to packages/snap/src/infrastructure/polyfills/ed25519/polyfill.ts

File renamed without changes.

packages/snap/src/core/polyfills/ed25519/utils/buffer-source-as-uint8-array.ts renamed to packages/snap/src/infrastructure/polyfills/ed25519/utils/buffer-source-as-uint8-array.ts

File renamed without changes.

packages/snap/src/core/polyfills/ed25519/utils/is-ed25519-algorithm.ts renamed to packages/snap/src/infrastructure/polyfills/ed25519/utils/is-ed25519-algorithm.ts

File renamed without changes.

packages/snap/src/core/polyfills/ed25519/utils/uint8-array-as-buffer-source.ts renamed to packages/snap/src/infrastructure/polyfills/ed25519/utils/uint8-array-as-buffer-source.ts

File renamed without changes.

packages/snap/src/core/polyfills/index.ts renamed to packages/snap/src/infrastructure/polyfills/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { install as installQueueMicrotaskPolyfill } from './queue-microtask';
55
/**
66
* Installs all polyfills.
77
*/
8-
export function install() {
8+
export function installPolyfills() {
99
installDOMExceptionPolyfill();
1010
installEd25519Polyfill();
1111
installQueueMicrotaskPolyfill();

0 commit comments

Comments
 (0)