@metamask-previews/bridge-controller 44.0.0-preview-8ccfcb37 → 45.0.0-preview-c20b7569

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,10 +7,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [44.0.0]
10
+ ### Added
11
+
12
+ - Add support for Bitcoin bridge transactions ([#6705](https://github.com/MetaMask/core/pull/6705))
13
+ - Handle Bitcoin PSBT (Partially Signed Bitcoin Transaction) format in trade data
14
+ - Support Bitcoin chain ID (`ChainId.BTC = 20000000000001`) and CAIP format (`bip122:000000000019d6689c085ae165831e93`)
15
+ - Export `isNonEvmChainId` utility function to check for non-EVM chains (Solana, Bitcoin) ([#6705](https://github.com/MetaMask/core/pull/6705))
16
+
17
+ ### Changed
18
+
19
+ - **BREAKING:** Rename fee handling for non-EVM chains ([#6705](https://github.com/MetaMask/core/pull/6705))
20
+ - Replace `SolanaFees` type with `NonEvmFees` type (exported type)
21
+ - Replace `solanaFeesInLamports` property in quote responses with `nonEvmFeesInNative` property
22
+ - The `nonEvmFeesInNative` property stores fees in the native units for each chain (SOL for Solana, BTC for Bitcoin)
23
+ - **BREAKING:** Update Snap methods to use new unified interface for non-EVM chains ([#6705](https://github.com/MetaMask/core/pull/6705))
24
+ - Snaps must now implement `computeFee` method instead of `getFeeForTransaction` for fee calculation
25
+ - The `computeFee` method returns fees in native token units rather than smallest units
26
+
27
+ ## [45.0.0]
28
+
29
+ ### Changed
30
+
31
+ - Bump `@metamask/assets-controllers` from `^76.0.0` to `^77.0.0` ([#6716](https://github.com/MetaMask/core/pull/6716), [#6629](https://github.com/MetaMask/core/pull/6716))
32
+
33
+ ## [44.0.1]
34
+
35
+ ### Changed
36
+
37
+ - Revert accidental breaking changes included in v44.0.0 ([#6454](https://github.com/MetaMask/core/pull/6454))
38
+
39
+ ## [44.0.0] [DEPRECATED]
11
40
 
12
41
  ### Changed
13
42
 
43
+ - This version was deprecated because it accidentally included additional breaking changes; use v44.0.1 or later versions instead
14
44
  - **BREAKING:** Bump peer dependency `@metamask/assets-controllers` from `^75.0.0` to `^76.0.0` ([#6676](https://github.com/MetaMask/core/pull/6676))
15
45
 
16
46
  ## [43.2.1]
@@ -29,11 +59,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
29
59
 
30
60
  ### Added
31
61
 
32
- - Add support for Bitcoin bridge transactions ([#6454](https://github.com/MetaMask/core/pull/6454))
33
- - Handle Bitcoin PSBT (Partially Signed Bitcoin Transaction) format in trade data
34
- - Add `BitcoinTradeDataSchema` and `BitcoinQuoteResponseSchema` validators
35
- - Support Bitcoin chain ID (`ChainId.BTC = 20000000000001`) and CAIP format (`bip122:000000000019d6689c085ae165831e93`)
36
- - Export `isNonEvmChainId` utility function to check for non-EVM chains (Solana, Bitcoin) ([#6454](https://github.com/MetaMask/core/pull/6454))
37
62
  - Add `selectDefaultSlippagePercentage` that returns the default slippage for a chain and token combination ([#6616](https://github.com/MetaMask/core/pull/6616))
38
63
  - Return `0.5` if requesting a bridge quote
39
64
  - Return `undefined` (auto) if requesting a Solana swap
@@ -43,26 +68,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
43
68
 
44
69
  ### Changed
45
70
 
46
- - **BREAKING:** Rename fee handling for non-EVM chains ([#6454](https://github.com/MetaMask/core/pull/6454))
47
- - Replace `SolanaFees` type with `NonEvmFees` type
48
- - Replace `solanaFeesInLamports` field with `nonEvmFeesInNative` field
49
- - Update `#appendSolanaFees` to `#appendNonEvmFees` to support all non-EVM chains
50
- - The `nonEvmFeesInNative` field stores fees in the smallest units for each chain (lamports for Solana, satoshis for Bitcoin)
51
- - Update Snap methods to use new unified interface for non-EVM chains ([#6454](https://github.com/MetaMask/core/pull/6454))
52
- - Replace `getFeeForTransaction` with `computeFee` method that returns fees in native token units
53
- - Update fee calculation to handle different unit conversions per chain
54
- - Support fee computation for Bitcoin and Solana chains
55
- - Update quote validation to support Bitcoin-specific trade data format ([#6454](https://github.com/MetaMask/core/pull/6454))
56
- - Add separate validation for Bitcoin quotes that include `unsignedPsbtBase64` field
57
- - Update selectors and utilities to use `isNonEvmChainId` instead of `isSolanaChainId` for generic non-EVM handling ([#6454](https://github.com/MetaMask/core/pull/6454))
58
71
  - Bump `@metamask/controller-utils` from `^11.12.0` to `^11.14.0` ([#6620](https://github.com/MetaMask/core/pull/6620), [#6629](https://github.com/MetaMask/core/pull/6629))
59
72
  - Bump `@metamask/base-controller` from `^8.3.0` to `^8.4.0` ([#6632](https://github.com/MetaMask/core/pull/6632))
60
73
 
61
- ### Removed
62
-
63
- - **BREAKING:** Remove deprecated `SolanaFees` type - use `NonEvmFees` type instead ([#6454](https://github.com/MetaMask/core/pull/6454))
64
- - **BREAKING:** Remove `solanaFeesInLamports` field from quotes - use `nonEvmFeesInNative` field instead ([#6454](https://github.com/MetaMask/core/pull/6454))
65
-
66
74
  ## [43.0.0]
67
75
 
68
76
  ### Added
@@ -625,7 +633,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
625
633
 
626
634
  - Initial release ([#5317](https://github.com/MetaMask/core/pull/5317))
627
635
 
628
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@44.0.0...HEAD
636
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@45.0.0...HEAD
637
+ [45.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@44.0.1...@metamask/bridge-controller@45.0.0
638
+ [44.0.1]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@44.0.0...@metamask/bridge-controller@44.0.1
629
639
  [44.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@43.2.1...@metamask/bridge-controller@44.0.0
630
640
  [43.2.1]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@43.2.0...@metamask/bridge-controller@43.2.1
631
641
  [43.2.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@43.1.0...@metamask/bridge-controller@43.2.0
@@ -36,6 +36,7 @@ exports.getMinimumBalanceForRentExemptionRequest = getMinimumBalanceForRentExemp
36
36
  */
37
37
  const computeFeeRequest = (snapId, transaction, accountId, scope) => {
38
38
  return {
39
+ // TODO: remove 'as never' typing.
39
40
  snapId: snapId,
40
41
  origin: 'metamask',
41
42
  handler: 'onClientRequest',
@@ -1 +1 @@
1
- {"version":3,"file":"snaps.cjs","sourceRoot":"","sources":["../../src/utils/snaps.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAEjD,+BAAkC;AAE3B,MAAM,wCAAwC,GAAG,CAAC,MAAc,EAAE,EAAE;IACzE,OAAO;QACL,MAAM,EAAE,MAAe;QACvB,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,mBAA4B;QACrC,OAAO,EAAE;YACP,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,KAAK;YACd,MAAM,EAAE;gBACN,KAAK,EAAE,sBAAQ,CAAC,OAAO;gBACvB,OAAO,EAAE;oBACP,EAAE,EAAE,IAAA,SAAI,GAAE;oBACV,OAAO,EAAE,KAAK;oBACd,MAAM,EAAE,mCAAmC;oBAC3C,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;iBACzC;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,wCAAwC,4CAmBnD;AAEF;;;;;;;;;GASG;AACI,MAAM,iBAAiB,GAAG,CAC/B,MAAc,EACd,WAAmB,EACnB,SAAiB,EACjB,KAAkB,EAClB,EAAE;IACF,OAAO;QACL,MAAM,EAAE,MAAe;QACvB,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,iBAA0B;QACnC,OAAO,EAAE;YACP,EAAE,EAAE,IAAA,SAAI,GAAE;YACV,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,YAAY;YACpB,MAAM,EAAE;gBACN,WAAW;gBACX,SAAS;gBACT,KAAK;aACN;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,iBAAiB,qBAqB5B","sourcesContent":["import { SolScope } from '@metamask/keyring-api';\nimport type { CaipChainId } from '@metamask/utils';\nimport { v4 as uuid } from 'uuid';\n\nexport const getMinimumBalanceForRentExemptionRequest = (snapId: string) => {\n return {\n snapId: snapId as never,\n origin: 'metamask',\n handler: 'onProtocolRequest' as never,\n request: {\n method: ' ',\n jsonrpc: '2.0',\n params: {\n scope: SolScope.Mainnet,\n request: {\n id: uuid(),\n jsonrpc: '2.0',\n method: 'getMinimumBalanceForRentExemption',\n params: [0, { commitment: 'confirmed' }],\n },\n },\n },\n };\n};\n\n/**\n * Creates a request to compute fees for a transaction using the new unified interface\n * Returns fees in native token amount (e.g., Solana instead of Lamports)\n *\n * @param snapId - The snap ID to send the request to\n * @param transaction - The base64 encoded transaction string\n * @param accountId - The account ID\n * @param scope - The CAIP-2 chain scope\n * @returns The snap request object\n */\nexport const computeFeeRequest = (\n snapId: string,\n transaction: string,\n accountId: string,\n scope: CaipChainId,\n) => {\n return {\n snapId: snapId as never,\n origin: 'metamask',\n handler: 'onClientRequest' as never,\n request: {\n id: uuid(),\n jsonrpc: '2.0',\n method: 'computeFee',\n params: {\n transaction,\n accountId,\n scope,\n },\n },\n };\n};\n"]}
1
+ {"version":3,"file":"snaps.cjs","sourceRoot":"","sources":["../../src/utils/snaps.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAEjD,+BAAkC;AAE3B,MAAM,wCAAwC,GAAG,CAAC,MAAc,EAAE,EAAE;IACzE,OAAO;QACL,MAAM,EAAE,MAAe;QACvB,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,mBAA4B;QACrC,OAAO,EAAE;YACP,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,KAAK;YACd,MAAM,EAAE;gBACN,KAAK,EAAE,sBAAQ,CAAC,OAAO;gBACvB,OAAO,EAAE;oBACP,EAAE,EAAE,IAAA,SAAI,GAAE;oBACV,OAAO,EAAE,KAAK;oBACd,MAAM,EAAE,mCAAmC;oBAC3C,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;iBACzC;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,wCAAwC,4CAmBnD;AAEF;;;;;;;;;GASG;AACI,MAAM,iBAAiB,GAAG,CAC/B,MAAc,EACd,WAAmB,EACnB,SAAiB,EACjB,KAAkB,EAClB,EAAE;IACF,OAAO;QACL,kCAAkC;QAClC,MAAM,EAAE,MAAe;QACvB,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,iBAA0B;QACnC,OAAO,EAAE;YACP,EAAE,EAAE,IAAA,SAAI,GAAE;YACV,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,YAAY;YACpB,MAAM,EAAE;gBACN,WAAW;gBACX,SAAS;gBACT,KAAK;aACN;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,iBAAiB,qBAsB5B","sourcesContent":["import { SolScope } from '@metamask/keyring-api';\nimport type { CaipChainId } from '@metamask/utils';\nimport { v4 as uuid } from 'uuid';\n\nexport const getMinimumBalanceForRentExemptionRequest = (snapId: string) => {\n return {\n snapId: snapId as never,\n origin: 'metamask',\n handler: 'onProtocolRequest' as never,\n request: {\n method: ' ',\n jsonrpc: '2.0',\n params: {\n scope: SolScope.Mainnet,\n request: {\n id: uuid(),\n jsonrpc: '2.0',\n method: 'getMinimumBalanceForRentExemption',\n params: [0, { commitment: 'confirmed' }],\n },\n },\n },\n };\n};\n\n/**\n * Creates a request to compute fees for a transaction using the new unified interface\n * Returns fees in native token amount (e.g., Solana instead of Lamports)\n *\n * @param snapId - The snap ID to send the request to\n * @param transaction - The base64 encoded transaction string\n * @param accountId - The account ID\n * @param scope - The CAIP-2 chain scope\n * @returns The snap request object\n */\nexport const computeFeeRequest = (\n snapId: string,\n transaction: string,\n accountId: string,\n scope: CaipChainId,\n) => {\n return {\n // TODO: remove 'as never' typing.\n snapId: snapId as never,\n origin: 'metamask',\n handler: 'onClientRequest' as never,\n request: {\n id: uuid(),\n jsonrpc: '2.0',\n method: 'computeFee',\n params: {\n transaction,\n accountId,\n scope,\n },\n },\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"snaps.d.cts","sourceRoot":"","sources":["../../src/utils/snaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB;AAGnD,eAAO,MAAM,wCAAwC,WAAY,MAAM;;;;;;;;;;;;;;;;;;;CAmBtE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,WACpB,MAAM,eACD,MAAM,aACR,MAAM,SACV,WAAW;;;;;;;;;;;;;;CAiBnB,CAAC"}
1
+ {"version":3,"file":"snaps.d.cts","sourceRoot":"","sources":["../../src/utils/snaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB;AAGnD,eAAO,MAAM,wCAAwC,WAAY,MAAM;;;;;;;;;;;;;;;;;;;CAmBtE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,WACpB,MAAM,eACD,MAAM,aACR,MAAM,SACV,WAAW;;;;;;;;;;;;;;CAkBnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"snaps.d.mts","sourceRoot":"","sources":["../../src/utils/snaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB;AAGnD,eAAO,MAAM,wCAAwC,WAAY,MAAM;;;;;;;;;;;;;;;;;;;CAmBtE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,WACpB,MAAM,eACD,MAAM,aACR,MAAM,SACV,WAAW;;;;;;;;;;;;;;CAiBnB,CAAC"}
1
+ {"version":3,"file":"snaps.d.mts","sourceRoot":"","sources":["../../src/utils/snaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB;AAGnD,eAAO,MAAM,wCAAwC,WAAY,MAAM;;;;;;;;;;;;;;;;;;;CAmBtE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,WACpB,MAAM,eACD,MAAM,aACR,MAAM,SACV,WAAW;;;;;;;;;;;;;;CAkBnB,CAAC"}
@@ -32,6 +32,7 @@ export const getMinimumBalanceForRentExemptionRequest = (snapId) => {
32
32
  */
33
33
  export const computeFeeRequest = (snapId, transaction, accountId, scope) => {
34
34
  return {
35
+ // TODO: remove 'as never' typing.
35
36
  snapId: snapId,
36
37
  origin: 'metamask',
37
38
  handler: 'onClientRequest',
@@ -1 +1 @@
1
- {"version":3,"file":"snaps.mjs","sourceRoot":"","sources":["../../src/utils/snaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AAEjD,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,aAAa;AAElC,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,MAAc,EAAE,EAAE;IACzE,OAAO;QACL,MAAM,EAAE,MAAe;QACvB,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,mBAA4B;QACrC,OAAO,EAAE;YACP,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,KAAK;YACd,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ,CAAC,OAAO;gBACvB,OAAO,EAAE;oBACP,EAAE,EAAE,IAAI,EAAE;oBACV,OAAO,EAAE,KAAK;oBACd,MAAM,EAAE,mCAAmC;oBAC3C,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;iBACzC;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAc,EACd,WAAmB,EACnB,SAAiB,EACjB,KAAkB,EAClB,EAAE;IACF,OAAO;QACL,MAAM,EAAE,MAAe;QACvB,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,iBAA0B;QACnC,OAAO,EAAE;YACP,EAAE,EAAE,IAAI,EAAE;YACV,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,YAAY;YACpB,MAAM,EAAE;gBACN,WAAW;gBACX,SAAS;gBACT,KAAK;aACN;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { SolScope } from '@metamask/keyring-api';\nimport type { CaipChainId } from '@metamask/utils';\nimport { v4 as uuid } from 'uuid';\n\nexport const getMinimumBalanceForRentExemptionRequest = (snapId: string) => {\n return {\n snapId: snapId as never,\n origin: 'metamask',\n handler: 'onProtocolRequest' as never,\n request: {\n method: ' ',\n jsonrpc: '2.0',\n params: {\n scope: SolScope.Mainnet,\n request: {\n id: uuid(),\n jsonrpc: '2.0',\n method: 'getMinimumBalanceForRentExemption',\n params: [0, { commitment: 'confirmed' }],\n },\n },\n },\n };\n};\n\n/**\n * Creates a request to compute fees for a transaction using the new unified interface\n * Returns fees in native token amount (e.g., Solana instead of Lamports)\n *\n * @param snapId - The snap ID to send the request to\n * @param transaction - The base64 encoded transaction string\n * @param accountId - The account ID\n * @param scope - The CAIP-2 chain scope\n * @returns The snap request object\n */\nexport const computeFeeRequest = (\n snapId: string,\n transaction: string,\n accountId: string,\n scope: CaipChainId,\n) => {\n return {\n snapId: snapId as never,\n origin: 'metamask',\n handler: 'onClientRequest' as never,\n request: {\n id: uuid(),\n jsonrpc: '2.0',\n method: 'computeFee',\n params: {\n transaction,\n accountId,\n scope,\n },\n },\n };\n};\n"]}
1
+ {"version":3,"file":"snaps.mjs","sourceRoot":"","sources":["../../src/utils/snaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AAEjD,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,aAAa;AAElC,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,MAAc,EAAE,EAAE;IACzE,OAAO;QACL,MAAM,EAAE,MAAe;QACvB,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,mBAA4B;QACrC,OAAO,EAAE;YACP,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,KAAK;YACd,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ,CAAC,OAAO;gBACvB,OAAO,EAAE;oBACP,EAAE,EAAE,IAAI,EAAE;oBACV,OAAO,EAAE,KAAK;oBACd,MAAM,EAAE,mCAAmC;oBAC3C,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;iBACzC;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAc,EACd,WAAmB,EACnB,SAAiB,EACjB,KAAkB,EAClB,EAAE;IACF,OAAO;QACL,kCAAkC;QAClC,MAAM,EAAE,MAAe;QACvB,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,iBAA0B;QACnC,OAAO,EAAE;YACP,EAAE,EAAE,IAAI,EAAE;YACV,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,YAAY;YACpB,MAAM,EAAE;gBACN,WAAW;gBACX,SAAS;gBACT,KAAK;aACN;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { SolScope } from '@metamask/keyring-api';\nimport type { CaipChainId } from '@metamask/utils';\nimport { v4 as uuid } from 'uuid';\n\nexport const getMinimumBalanceForRentExemptionRequest = (snapId: string) => {\n return {\n snapId: snapId as never,\n origin: 'metamask',\n handler: 'onProtocolRequest' as never,\n request: {\n method: ' ',\n jsonrpc: '2.0',\n params: {\n scope: SolScope.Mainnet,\n request: {\n id: uuid(),\n jsonrpc: '2.0',\n method: 'getMinimumBalanceForRentExemption',\n params: [0, { commitment: 'confirmed' }],\n },\n },\n },\n };\n};\n\n/**\n * Creates a request to compute fees for a transaction using the new unified interface\n * Returns fees in native token amount (e.g., Solana instead of Lamports)\n *\n * @param snapId - The snap ID to send the request to\n * @param transaction - The base64 encoded transaction string\n * @param accountId - The account ID\n * @param scope - The CAIP-2 chain scope\n * @returns The snap request object\n */\nexport const computeFeeRequest = (\n snapId: string,\n transaction: string,\n accountId: string,\n scope: CaipChainId,\n) => {\n return {\n // TODO: remove 'as never' typing.\n snapId: snapId as never,\n origin: 'metamask',\n handler: 'onClientRequest' as never,\n request: {\n id: uuid(),\n jsonrpc: '2.0',\n method: 'computeFee',\n params: {\n transaction,\n accountId,\n scope,\n },\n },\n };\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/bridge-controller",
3
- "version": "44.0.0-preview-8ccfcb37",
3
+ "version": "45.0.0-preview-c20b7569",
4
4
  "description": "Manages bridge-related quote fetching functionality for MetaMask",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@metamask/accounts-controller": "^33.1.0",
69
- "@metamask/assets-controllers": "^76.0.0",
69
+ "@metamask/assets-controllers": "^77.0.0",
70
70
  "@metamask/auto-changelog": "^3.4.4",
71
71
  "@metamask/eth-json-rpc-provider": "^5.0.0",
72
72
  "@metamask/network-controller": "^24.2.0",
@@ -87,7 +87,7 @@
87
87
  },
88
88
  "peerDependencies": {
89
89
  "@metamask/accounts-controller": "^33.0.0",
90
- "@metamask/assets-controllers": "^76.0.0",
90
+ "@metamask/assets-controllers": "^77.0.0",
91
91
  "@metamask/network-controller": "^24.0.0",
92
92
  "@metamask/remote-feature-flag-controller": "^1.6.0",
93
93
  "@metamask/snaps-controllers": "^14.0.0",