Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/core/BackgroundBridge/BackgroundBridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import {
getSessionScopes,
KnownSessionProperties,
} from '@metamask/chain-agnostic-permission';
import { ALLOWED_BRIDGE_CHAIN_IDS } from '@metamask/bridge-controller';
import {
makeMethodMiddlewareMaker,
UNSUPPORTED_RPC_METHODS,
Expand Down Expand Up @@ -808,6 +809,8 @@ export class BackgroundBridge extends EventEmitter {
transactionMeta: { chainId },
securityAlertId,
}),
isAuxiliaryFundsSupported: (chainId) =>
ALLOWED_BRIDGE_CHAIN_IDS.includes(chainId),
Comment on lines +812 to +813
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We landed on this as the sole criteria for this check, since the account check occurs using other hooks? I wonder if we should consolidate those hooks? And/or rename this to be more specific to what aspect of auxFunds support this particular value captures -> isAuxiliaryFundsSupportedForChain or something like that?

not blocking here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is where we landed on the checks, as per discussion.

Renaming the hook though would require us to backtrack on the work that's already been released on the previous work here, so I suggest tackling this in a future refactor.

},
Engine.controllerMessenger,
),
Expand Down Expand Up @@ -843,6 +846,8 @@ export class BackgroundBridge extends EventEmitter {
{},
);
},
isAuxiliaryFundsSupported: (chainId) =>
ALLOWED_BRIDGE_CHAIN_IDS.includes(chainId),
},
Engine.controllerMessenger,
),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
"@metamask/design-system-twrnc-preset": "^0.2.1",
"@metamask/design-tokens": "^8.1.1",
"@metamask/earn-controller": "^7.0.0",
"@metamask/eip-5792-middleware": "^1.1.0",
"@metamask/eip-5792-middleware": "^1.2.0",
"@metamask/eip1193-permission-middleware": "^1.0.0",
"@metamask/error-reporting-service": "^2.0.0",
"@metamask/eth-hd-keyring": "^12.1.0",
Expand Down
37 changes: 19 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5115,14 +5115,14 @@
resolved "https://registry.yarnpkg.com/@metamask/contract-metadata/-/contract-metadata-2.5.0.tgz#33921fa9c15eb1863f55dcd5f75467ae15614ebb"
integrity sha512-+j7jEcp0P1OUMEpa/OIwfJs/ahBC/akwgWxaRTSWX2SWABvlUKBVRMtslfL94Qj2wN2xw8xjaUy5nSHqrznqDA==

"@metamask/controller-utils@^11.0.0", "@metamask/controller-utils@^11.10.0", "@metamask/controller-utils@^11.11.0", "@metamask/controller-utils@^11.12.0", "@metamask/controller-utils@^11.3.0", "@metamask/controller-utils@^11.5.0", "@metamask/controller-utils@^11.9.0":
version "11.12.0"
resolved "https://registry.yarnpkg.com/@metamask/controller-utils/-/controller-utils-11.12.0.tgz#18d1339ed684fe11d3626b5a5cafabba4ca64b3f"
integrity sha512-RrVWfMVV+CgiRMB7a/+pNHccQPHnafoV7naU92zbxgO5rCqsNx93TG/qR05atQVzwwXv6sBIpusrFMJb5hd3hQ==
"@metamask/controller-utils@^11.0.0", "@metamask/controller-utils@^11.10.0", "@metamask/controller-utils@^11.11.0", "@metamask/controller-utils@^11.12.0", "@metamask/controller-utils@^11.14.0", "@metamask/controller-utils@^11.3.0", "@metamask/controller-utils@^11.5.0", "@metamask/controller-utils@^11.9.0":
version "11.14.0"
resolved "https://registry.yarnpkg.com/@metamask/controller-utils/-/controller-utils-11.14.0.tgz#4efe7a5838b039db025d521a6b53905d8770bce4"
integrity sha512-QimQHW+kL2pI3EbueuiCG92Q0hKTKuG+6DKHDs7jlHJjU7/EM1Ohq5zLALTOK7iudnFoYkkHjMtO9pY83SSpkw==
dependencies:
"@metamask/eth-query" "^4.0.0"
"@metamask/ethjs-unit" "^0.3.0"
"@metamask/utils" "^11.4.2"
"@metamask/utils" "^11.8.0"
"@spruceid/siwe-parser" "2.1.0"
"@types/bn.js" "^5.1.5"
bignumber.js "^9.1.2"
Expand Down Expand Up @@ -5173,15 +5173,16 @@
"@metamask/stake-sdk" "^3.2.1"
reselect "^5.1.1"

"@metamask/eip-5792-middleware@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@metamask/eip-5792-middleware/-/eip-5792-middleware-1.1.0.tgz#3dc25e31711f0045766da9d473ae9306de75d2df"
integrity sha512-zgI9uLSwi+U2x2fkIFMViI/RFJQFGp2B38YoWSgIQ1L7kshy0p0eNYrkOXnNX5Y+oDfbZLTSJeeAYBQ+suSNcA==
"@metamask/eip-5792-middleware@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@metamask/eip-5792-middleware/-/eip-5792-middleware-1.2.0.tgz#c47d9e56caf103ae1c56f883b2e77b42826865cc"
integrity sha512-BWTxQlsZLNgCw8fgHH5AtSbNkwSnWSYQC5SndDpIp0byq0YXK8GK+0/DezbNRoAoPbf32QQ3bAYJPawMGcd0Bg==
dependencies:
"@metamask/eth-json-rpc-middleware" "^17.0.1"
"@metamask/superstruct" "^3.1.0"
"@metamask/transaction-controller" "^60.2.0"
"@metamask/utils" "^11.4.2"
"@metamask/transaction-controller" "^60.4.0"
"@metamask/utils" "^11.8.0"
lodash "^4.17.21"
uuid "^8.3.2"

"@metamask/eip1193-permission-middleware@^1.0.0":
Expand Down Expand Up @@ -6334,10 +6335,10 @@
"@toruslabs/http-helpers" "^8.1.1"
bn.js "^5.2.1"

"@metamask/transaction-controller@^60.2.0", "@metamask/transaction-controller@^60.3.0":
version "60.3.0"
resolved "https://registry.yarnpkg.com/@metamask/transaction-controller/-/transaction-controller-60.3.0.tgz#acb1f8bfae954e484c494bd631cb93db1e4dc067"
integrity sha512-dFgK72ckx98PkmxWQx+j3ODCB06uY0lj4hZxtW1Hx3szW0mmDb+tuqdY0Z+vbv8vyf0S1ZSFDD5CDxz7CMM69A==
"@metamask/transaction-controller@^60.3.0", "@metamask/transaction-controller@^60.4.0":
version "60.4.0"
resolved "https://registry.yarnpkg.com/@metamask/transaction-controller/-/transaction-controller-60.4.0.tgz#15b30016c324ee7b6f403b59206b40f1fdd6d516"
integrity sha512-sIV5cnt4pqgX0i7C7s7su1QOVO1d30Ldb7O14P5tWCHlDGZ/+XRBe7h7gOd9XeMweF1HJpYnhKfZJEgJ/XX6Eg==
dependencies:
"@ethereumjs/common" "^4.4.0"
"@ethereumjs/tx" "^5.4.0"
Expand All @@ -6346,13 +6347,13 @@
"@ethersproject/contracts" "^5.7.0"
"@ethersproject/providers" "^5.7.0"
"@ethersproject/wallet" "^5.7.0"
"@metamask/base-controller" "^8.3.0"
"@metamask/controller-utils" "^11.12.0"
"@metamask/base-controller" "^8.4.0"
"@metamask/controller-utils" "^11.14.0"
"@metamask/eth-query" "^4.0.0"
"@metamask/metamask-eth-abis" "^3.1.1"
"@metamask/nonce-tracker" "^6.0.0"
"@metamask/rpc-errors" "^7.0.2"
"@metamask/utils" "^11.4.2"
"@metamask/utils" "^11.8.0"
async-mutex "^0.5.0"
bn.js "^5.2.1"
eth-method-registry "^4.0.0"
Expand Down
Loading