Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
da8e0be
feat: cow-swap
khanti42 Sep 1, 2025
0c8f25e
fix: include missing metadata on intent swap transaction
khanti42 Sep 3, 2025
cf9d91d
Merge branch 'main' into wip/cow-swap-intent
dawnseeker8 Sep 8, 2025
6cc5fe4
Fix all lint relative error and give proper type declaration.
dawnseeker8 Sep 8, 2025
c2bf9a2
Fix pipeline lint issue,
dawnseeker8 Sep 8, 2025
c76a00c
fix node 22 lint and build issue.
dawnseeker8 Sep 8, 2025
73604f1
Merge branch 'main' into wip/cow-swap-intent
dawnseeker8 Sep 8, 2025
63dc8ac
Update snapshot for unit tests.
dawnseeker8 Sep 8, 2025
331bec5
Fix all unit tests failure for bridge-status-controller.test.ts
dawnseeker8 Sep 8, 2025
37f72b5
Add stub module called `Intent-manager`
dawnseeker8 Sep 10, 2025
2493ab2
add ts-bridge as dev dependancies for build
dawnseeker8 Sep 10, 2025
1673f1f
wip: buildable version of intent manager and bridge-status-controller.
dawnseeker8 Sep 10, 2025
2ea099e
wip: fix the build issue.
dawnseeker8 Sep 10, 2025
74e6893
WIP: Remove the generateQuote and relative private method calls.
dawnseeker8 Sep 10, 2025
19fdb0e
feat: add a temp onlyIntent parameter.
dawnseeker8 Sep 24, 2025
dc76678
Merge branch 'main' into wip/intent-swap-architecture-refactory
dawnseeker8 Sep 24, 2025
018cd69
rebase from main
dawnseeker8 Sep 24, 2025
fdf4f04
Rebase from main
dawnseeker8 Sep 24, 2025
4e200c7
revert back to main version
dawnseeker8 Sep 24, 2025
83a36c1
update lock file
dawnseeker8 Sep 24, 2025
6a6ee79
update lock file to fix the pipeline failure
dawnseeker8 Sep 24, 2025
608187f
Merge branch 'main' into wip/intent-swap-architecture-refactory
dawnseeker8 Sep 24, 2025
7516d3b
fix unit tests and pipeline issue.
dawnseeker8 Sep 24, 2025
3e9f379
Try to fix the pipeline failure of lock file change.
dawnseeker8 Sep 24, 2025
9445620
try to avoid the pipeline failure of lock file change.
dawnseeker8 Sep 24, 2025
7f670b5
refactor: simplify logic for determining transaction hashes in Bridge…
dawnseeker8 Sep 24, 2025
e8eb450
Fix the lint error in node 22 version
dawnseeker8 Sep 24, 2025
ce7a2d1
Fix weird lock file change failure issue in pipeline.
dawnseeker8 Sep 24, 2025
7547553
Run prettier format the README.md file.
dawnseeker8 Sep 24, 2025
5d56313
change lock file again
dawnseeker8 Sep 24, 2025
07c15ac
Merge branch 'main' into wip/intent-swap-architecture-refactory
dawnseeker8 Sep 24, 2025
c5a0678
Merge branch 'main' into wip/intent-swap-architecture-refactory
dawnseeker8 Sep 25, 2025
60a4a13
update lock file after rebase from main to resolve conflict.
dawnseeker8 Sep 25, 2025
ae7c3cc
Reapply lock version with correct hash to pass the pipeline.
dawnseeker8 Sep 25, 2025
48b8230
Try to fix th lock file change pipeline broken
dawnseeker8 Sep 25, 2025
299f4c2
Merge branch 'main' into wip/intent-swap-architecture-refactory
dawnseeker8 Oct 15, 2025
586dfe6
Merge branch 'main' into wip/intent-swap-architecture-refactory
dawnseeker8 Oct 15, 2025
5863294
Resolve the conflict of merge from main
dawnseeker8 Oct 15, 2025
3930e27
Update Jest configuration to include the new `@metamask/intent-manage…
dawnseeker8 Oct 15, 2025
778df56
Remove temporary query parameters from `formatQueryParams` in `fetch.…
dawnseeker8 Oct 17, 2025
2fc981c
Fix the get order status sometimes the orderId contain url not friend…
dawnseeker8 Oct 17, 2025
cfbf731
Fix order ID formatting in CowSwapProvider by removing quotes from th…
dawnseeker8 Oct 17, 2025
d53f3e6
Update yarn.lock with new hash
dawnseeker8 Oct 19, 2025
1ca9d84
Merge branch 'main' into wip/intent-swap-architecture-refactory
dawnseeker8 Oct 20, 2025
0ab4bb0
Merge from `main` to resolve conflicts.
dawnseeker8 Oct 20, 2025
a4d00f9
feat: add SUBMITTED status type to enhance order status handling
dawnseeker8 Oct 21, 2025
312e0b2
Temprately disabled SSE after backend change is ready.
dawnseeker8 Oct 21, 2025
2e2ad4c
feat!: (wip) use crosschain api instead of intent manager for intent …
oscarwroche Nov 4, 2025
3ad0d66
feat: update api call with new param and error handling
oscarwroche Nov 5, 2025
0ea9cd2
refactor: remove obsolete cancelled intent order status
oscarwroche Nov 5, 2025
370b984
Merge branch 'main' into wip/intent-swap-architecture-refactory
oscarwroche Nov 14, 2025
d5d03a4
fix: replace chain id with src chain id
oscarwroche Nov 24, 2025
ae0e4ec
refactor: delete intent manager
oscarwroche Dec 8, 2025
b92b97a
Merge branch 'main' into wip/intent-swap-architecture-refactory
oscarwroche Dec 8, 2025
cf7c71f
refactor: finish removing intent manager
oscarwroche Dec 8, 2025
0b7c1fd
fix: fix linter errors
oscarwroche Dec 9, 2025
ee5be23
Merge remote-tracking branch 'origin' into wip/intent-swap-architectu…
Akaryatrh Dec 9, 2025
5c507fe
feat: remove unnecessary intent check when adding a transaction
Akaryatrh Dec 9, 2025
3bd6a6f
feat: remove useless linebreak
Akaryatrh Dec 10, 2025
433ac44
feat: remove unused intent manager ref in tsconfig files
Akaryatrh Dec 10, 2025
8fe3a7b
Merge remote-tracking branch 'origin/main' into wip/intent-swap-archi…
Akaryatrh Dec 10, 2025
1dde2ef
feat: move changelog entry to unreleased section
Akaryatrh Dec 10, 2025
84920fd
feat: update tx controller changelog
Akaryatrh Dec 10, 2025
512aae9
fix: typo in bridge controller changelog
Akaryatrh Dec 10, 2025
89dc6fd
Merge remote-tracking branch 'origin/main' into wip/intent-swap-archi…
Akaryatrh Dec 10, 2025
38e5ace
fix: move tx controller changelog to proper section
Akaryatrh Dec 10, 2025
ff233d7
feat; update bridge ctrler changelog
Akaryatrh Dec 10, 2025
4a32dec
fix: wrong link for changelog PRs
Akaryatrh Dec 10, 2025
0accdc8
feat: remove unused declaration file
Akaryatrh Dec 11, 2025
2763855
feat: remove unwanted changes
Akaryatrh Dec 11, 2025
b1888d8
feat: add back package resolutions
Akaryatrh Dec 11, 2025
e6740ec
feat: remove wrongly added eslint script
Akaryatrh Dec 11, 2025
9a1941f
Merge remote-tracking branch 'origin/main' into wip/intent-swap-archi…
Akaryatrh Dec 12, 2025
737ca58
feat: update lock file
Akaryatrh Dec 12, 2025
c8bfce8
fix: type issue with bridge status controller
Akaryatrh Dec 15, 2025
565dfca
fix: more types in bridge status controller
Akaryatrh Dec 15, 2025
989c057
chore: prune suppressions
oscarwroche Dec 15, 2025
fb520f4
fix: update snapshots for bridge-status-controller
Akaryatrh Dec 15, 2025
213ad76
fix: adjust bridge status controller because of failing tests
Akaryatrh Dec 16, 2025
8cfea65
Merge remote-tracking branch 'origin' into wip/intent-swap-architectu…
Akaryatrh Dec 16, 2025
8a0c757
feat: update eslint suppressions
Akaryatrh Dec 16, 2025
ed79add
test: add tests for intent api
oscarwroche Dec 16, 2025
0fdb78d
test: add tests for intent in bridge controller status
oscarwroche Dec 16, 2025
3ccca38
chore: remove unused export
oscarwroche Dec 18, 2025
4ef2bc6
refactor: change enum to generic string
oscarwroche Dec 18, 2025
2cc3585
refactor: add validation for intent api + move to utils
oscarwroche Dec 18, 2025
6bb1938
chore: add emacs files to .gitignore
oscarwroche Dec 18, 2025
b59021c
refactor: fix call to get account
oscarwroche Dec 18, 2025
4686816
refactor: remove tx update
oscarwroche Dec 18, 2025
6cfc1db
chore: remove duplicate comment
oscarwroche Dec 18, 2025
1827df3
Merge branch 'main' into wip/intent-swap-architecture-refactory
oscarwroche Dec 18, 2025
87b90ec
chore: fix import
oscarwroche Dec 18, 2025
0b666be
chore: remove unneeded parameter
oscarwroche Dec 18, 2025
550997b
doc: add jsdoc to schema
oscarwroche Dec 18, 2025
f2aa67e
fix: use superstruct type
oscarwroche Dec 18, 2025
4b28212
refactor: fix imports, remove dead code
oscarwroche Dec 18, 2025
c0c42c9
test: fix tests
oscarwroche Dec 18, 2025
749d063
fix: move skip gas estimate inside tx options
Akaryatrh Dec 19, 2025
b76343a
refactor: reinstate tracking for failed intent tx
oscarwroche Dec 19, 2025
05b4eb4
chore: add comment for synthetic tx
oscarwroche Dec 19, 2025
f620f5d
fix: fix gas calculation
oscarwroche Dec 19, 2025
44504c9
Merge branch 'main' into wip/intent-swap-architecture-refactory
oscarwroche Dec 23, 2025
bd12a28
test: add / fix tests
oscarwroche Dec 24, 2025
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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ scripts/coverage
!.yarn/versions

# typescript
packages/*/*.tsbuildinfo
packages/*/*.tsbuildinfo

# Emacs
\#*\#
.#*
19 changes: 0 additions & 19 deletions eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -770,25 +770,6 @@
"count": 1
}
},
"packages/bridge-status-controller/src/bridge-status-controller.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 20
},
"@typescript-eslint/naming-convention": {
"count": 5
},
"camelcase": {
"count": 8
},
"id-length": {
"count": 1
}
},
"packages/bridge-status-controller/src/types.ts": {
"@typescript-eslint/naming-convention": {
"count": 7
}
},
"packages/bridge-status-controller/src/utils/bridge-status.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 3
Expand Down
4 changes: 4 additions & 0 deletions packages/bridge-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add intent based transaction support ([#6547](https://github.com/MetaMask/core/pull/6547))

### Changed

- Bump `@metamask/remote-feature-flag-controller` from `^3.1.0` to `^4.0.0` ([#7546](https://github.com/MetaMask/core/pull/7546))
Expand Down
2 changes: 2 additions & 0 deletions packages/bridge-controller/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export type {
QuoteResponse,
FeeData,
TxData,
Intent,
IntentOrderLike,
BitcoinTradeData,
TronTradeData,
BridgeControllerState,
Expand Down
5 changes: 5 additions & 0 deletions packages/bridge-controller/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import type {
ChainConfigurationSchema,
FeatureId,
FeeDataSchema,
IntentSchema,
PlatformConfigSchema,
ProtocolSchema,
QuoteResponseSchema,
Expand Down Expand Up @@ -223,6 +224,7 @@ export type QuoteRequest<
};

export enum StatusTypes {
SUBMITTED = 'SUBMITTED',
UNKNOWN = 'UNKNOWN',
FAILED = 'FAILED',
PENDING = 'PENDING',
Expand Down Expand Up @@ -251,6 +253,9 @@ export type Quote = Infer<typeof QuoteSchema>;

export type TxData = Infer<typeof TxDataSchema>;

export type Intent = Infer<typeof IntentSchema>;
export type IntentOrderLike = Intent['order'];

export type BitcoinTradeData = Infer<typeof BitcoinTradeDataSchema>;

export type TronTradeData = Infer<typeof TronTradeDataSchema>;
Expand Down
122 changes: 122 additions & 0 deletions packages/bridge-controller/src/utils/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,127 @@ export const StepSchema = type({

const RefuelDataSchema = StepSchema;

// Allow digit strings for amounts/validTo for flexibility across providers
const DigitStringOrNumberSchema = union([TruthyDigitStringSchema, number()]);

/**
* Identifier of the intent protocol used for order creation and submission.
*
* Examples:
* - CoW Swap
* - Other EIP-712–based intent protocols
*/
const IntentProtocolSchema = string();

/**
* Schema for an intent-based order used for EIP-712 signing and submission.
*
* This represents the minimal subset of fields required by intent-based
* protocols (e.g. CoW Swap) to build, sign, and submit an order.
*/
export const IntentOrderSchema = type({
/**
* Address of the token being sold.
*/
sellToken: HexAddressSchema,

/**
* Address of the token being bought.
*/
buyToken: HexAddressSchema,

/**
* Optional receiver of the bought tokens.
* If omitted, defaults to the signer / order owner.
*/
receiver: optional(HexAddressSchema),

/**
* Order expiration time.
*
* Can be provided as a UNIX timestamp in seconds, either as a number
* or as a digit string, depending on provider requirements.
*/
validTo: DigitStringOrNumberSchema,

/**
* Arbitrary application-specific data attached to the order.
*/
appData: string(),

/**
* Hash of the `appData` field, used for EIP-712 signing.
*/
appDataHash: HexStringSchema,

/**
* Fee amount paid for order execution, expressed as a digit string.
*/
feeAmount: TruthyDigitStringSchema,

/**
* Order kind.
*
* - `sell`: exact sell amount, variable buy amount
* - `buy`: exact buy amount, variable sell amount
*/
kind: enums(['sell', 'buy']),

/**
* Whether the order can be partially filled.
*/
partiallyFillable: boolean(),

/**
* Exact amount of the sell token.
*
* Required for `sell` orders.
*/
sellAmount: optional(TruthyDigitStringSchema),

/**
* Exact amount of the buy token.
*
* Required for `buy` orders.
*/
buyAmount: optional(TruthyDigitStringSchema),

/**
* Optional order owner / sender address.
*
* Provided for convenience when building the EIP-712 domain and message.
*/
from: optional(HexAddressSchema),
});

/**
* Schema representing an intent submission payload.
*
* Wraps the intent order along with protocol and optional routing metadata
* required by the backend or relayer infrastructure.
*/
export const IntentSchema = type({
/**
* Identifier of the intent protocol used to interpret the order.
*/
protocol: IntentProtocolSchema,

/**
* The intent order to be signed and submitted.
*/
order: IntentOrderSchema,

/**
* Optional settlement contract address used for execution.
*/
settlementContract: optional(HexAddressSchema),

/**
* Optional relayer address responsible for order submission.
*/
relayer: optional(HexAddressSchema),
});

export const QuoteSchema = type({
requestId: string(),
srcChainId: ChainIdSchema,
Expand Down Expand Up @@ -244,6 +365,7 @@ export const QuoteSchema = type({
totalFeeAmountUsd: optional(string()),
}),
),
intent: optional(IntentSchema),
/**
* A third party sponsors the gas. If true, then gasIncluded7702 is also true.
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/bridge-status-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **BREAKING** Use CrossChain API instead of the intent manager package for intent order submission ([#6547](https://github.com/MetaMask/core/pull/6547))
- Upgrade `@metamask/utils` from `^11.8.1` to `^11.9.0` ([#7511](https://github.com/MetaMask/core/pull/7511))
- Bump `@metamask/network-controller` from `^27.0.0` to `^27.1.0` ([#7534](https://github.com/MetaMask/core/pull/7534))
- Bump `@metamask/controller-utils` from `^11.16.0` to `^11.17.0` ([#7534](https://github.com/MetaMask/core/pull/7534))
Expand All @@ -17,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

>>>>>>> main
- Bump `@metamask/transaction-controller` from `^62.5.0` to `^62.7.0` ([#7430](https://github.com/MetaMask/core/pull/7430), [#7494](https://github.com/MetaMask/core/pull/7494))
- Bump `@metamask/bridge-controller` from `^64.1.0` to `^64.2.0` ([#7509](https://github.com/MetaMask/core/pull/7509))

Expand Down
4 changes: 3 additions & 1 deletion packages/bridge-status-controller/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ module.exports = merge(baseConfig, {
// The display name when running multiple projects
displayName,

coverageProvider: 'v8',

// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
branches: 94,
branches: 91,
functions: 100,
lines: 100,
statements: 100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Object {
"hasApprovalTx": false,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "bridgeTxMetaId1",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": undefined,
Expand Down Expand Up @@ -214,6 +215,7 @@ Object {
"hasApprovalTx": false,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "bridgeTxMetaId1",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": undefined,
Expand Down Expand Up @@ -415,6 +417,7 @@ Object {
"hasApprovalTx": true,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "test-tx-id",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": "1.01",
Expand Down Expand Up @@ -650,6 +653,7 @@ Object {
"hasApprovalTx": true,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "test-tx-id",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": "1.01",
Expand Down Expand Up @@ -885,6 +889,7 @@ Object {
"hasApprovalTx": true,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "test-tx-id",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": "1.01",
Expand Down Expand Up @@ -1121,6 +1126,7 @@ Object {
"hasApprovalTx": false,
"initialDestAssetBalance": undefined,
"isStxEnabled": true,
"originalTransactionId": "test-tx-id",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": "1.01",
Expand Down Expand Up @@ -1382,6 +1388,7 @@ Object {
"hasApprovalTx": true,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "test-tx-id",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": "1.01",
Expand Down Expand Up @@ -1617,6 +1624,7 @@ Object {
"hasApprovalTx": true,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "test-tx-id",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": "1.01",
Expand Down Expand Up @@ -1852,6 +1860,7 @@ Object {
"hasApprovalTx": true,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "test-tx-id",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": "1.01",
Expand Down Expand Up @@ -2191,6 +2200,7 @@ Object {
"hasApprovalTx": true,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "test-tx-id",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": "1.01",
Expand Down Expand Up @@ -2446,6 +2456,7 @@ Object {
"hasApprovalTx": false,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "test-tx-id",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": "1.01",
Expand Down Expand Up @@ -2852,6 +2863,7 @@ Object {
"hasApprovalTx": true,
"initialDestAssetBalance": undefined,
"isStxEnabled": true,
"originalTransactionId": "test-tx-id",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": "1.01",
Expand Down Expand Up @@ -3204,6 +3216,7 @@ Object {
"hasApprovalTx": false,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "test-tx-id",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": "1.01",
Expand Down Expand Up @@ -3416,6 +3429,7 @@ Object {
"hasApprovalTx": false,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "test-tx-id",
"pricingData": Object {
"amountSent": "1.234",
"amountSentInUsd": "1.01",
Expand Down Expand Up @@ -3714,6 +3728,7 @@ Object {
"hasApprovalTx": false,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "signature",
"pricingData": Object {
"amountSent": "1",
"amountSentInUsd": "100",
Expand Down Expand Up @@ -4048,6 +4063,7 @@ Object {
"hasApprovalTx": false,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "signature",
"pricingData": Object {
"amountSent": "1",
"amountSentInUsd": "100",
Expand Down Expand Up @@ -4423,6 +4439,7 @@ Object {
"hasApprovalTx": true,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "bridge-signature",
"pricingData": Object {
"amountSent": "1",
"amountSentInUsd": "1",
Expand Down Expand Up @@ -4641,6 +4658,7 @@ Object {
"hasApprovalTx": true,
"initialDestAssetBalance": undefined,
"isStxEnabled": false,
"originalTransactionId": "swap-signature",
"pricingData": Object {
"amountSent": "1",
"amountSentInUsd": "1",
Expand Down
Loading
Loading