Skip to content

Bridge functionality #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 201 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
cca002b
chore: update
jmoreira-valory Mar 25, 2025
996fc0f
Merge commit '317df3897234038c2e51215859102f041bb41cb3' into feat/bridge
jmoreira-valory Mar 25, 2025
712f419
feat: bridge_refill_requirements endpoint
jmoreira-valory Mar 26, 2025
a644545
chore: linters
jmoreira-valory Mar 26, 2025
8471156
docs: update
jmoreira-valory Mar 26, 2025
5f38843
chore: update
jmoreira-valory Mar 26, 2025
1c90c47
chore: update
jmoreira-valory Mar 26, 2025
ec81e99
fix: docs
jmoreira-valory Mar 27, 2025
0e55e21
chore: refactor
jmoreira-valory Mar 28, 2025
bd4c277
chore: update
jmoreira-valory Mar 31, 2025
4b307a0
chore: remove unused code
jmoreira-valory Mar 31, 2025
a211075
fix: linters
jmoreira-valory Mar 31, 2025
09349cd
Merge remote-tracking branch 'origin/main' into feat/bridge
jmoreira-valory Mar 31, 2025
c849d5c
chore: minor change
jmoreira-valory Mar 31, 2025
b9762de
chore: change input
jmoreira-valory Mar 31, 2025
7beebc0
chore: update
jmoreira-valory Apr 1, 2025
396c1fb
chore: update
jmoreira-valory Apr 1, 2025
a5f3092
chore: update
jmoreira-valory Apr 1, 2025
0d58179
chore: update
jmoreira-valory Apr 1, 2025
4083f84
chore: update safe creation transfer
jmoreira-valory Apr 2, 2025
0b3109f
feat: added execution and status
jmoreira-valory Apr 2, 2025
00ae72c
chore: update
jmoreira-valory Apr 2, 2025
bb6ac79
chore: uppercase enums
jmoreira-valory Apr 2, 2025
103e4fc
chore: update
jmoreira-valory Apr 3, 2025
765a3e2
doc: update
jmoreira-valory Apr 3, 2025
2ed3c1f
chore: api updates
jmoreira-valory Apr 3, 2025
e69b963
chore: update API output
jmoreira-valory Apr 3, 2025
e0dfd17
chore: refactor with framework methods
jmoreira-valory Apr 3, 2025
1546de7
chore: update
jmoreira-valory Apr 3, 2025
f67eb6d
chore: added status to all API endpoints
jmoreira-valory Apr 4, 2025
6924d4d
chore: refactor
jmoreira-valory Apr 5, 2025
0ee280b
chore: revert
jmoreira-valory Apr 5, 2025
25ccadb
Merge commit '9576b60ad204a5185c617a88df5d8633c433c38c' into feat/bridge
jmoreira-valory Apr 15, 2025
ca55aea
fix: resource
jmoreira-valory Apr 15, 2025
f60acac
doc: update doc
jmoreira-valory Apr 15, 2025
a288939
chore: update
jmoreira-valory Apr 16, 2025
c4fc26d
Merge commit '824cffcb3f5033f4da4c224110594e06c00a0607' into feat/bridge
jmoreira-valory Apr 16, 2025
43b6c4c
chore: keep placeholder for master safe
jmoreira-valory Apr 16, 2025
30dbddf
fix: endpoint
jmoreira-valory Apr 16, 2025
2f01dde
fix: cli
jmoreira-valory Apr 16, 2025
b0eb0cc
chore: maxPriceImpact
jmoreira-valory Apr 16, 2025
70b2ffe
Merge branch 'feat/bridge' into feat/bridge2
jmoreira-valory Apr 16, 2025
df08baf
chore: update
jmoreira-valory Apr 17, 2025
3b2c0bb
Merge commit '268b56262bcffa05340d52071bff8577a9251a0b' into feat/bridge
jmoreira-valory Apr 17, 2025
19a5f35
Merge commit '3b2c0bbca5ef042b7ef4772f919a6473c43f2d06' into feat/bri…
jmoreira-valory Apr 17, 2025
91e7b0f
chore: refactor bridge
jmoreira-valory Apr 22, 2025
8e72e2c
chore: tests
jmoreira-valory Apr 22, 2025
bf8d44c
chore: linters
jmoreira-valory Apr 22, 2025
cc91e82
chore: update to typing
jmoreira-valory Apr 23, 2025
29db7bb
chore: update docs
jmoreira-valory Apr 23, 2025
92a10b9
chore: error codes
jmoreira-valory Apr 23, 2025
58e94e4
fix: linters
jmoreira-valory Apr 23, 2025
282c28d
fix: linter
jmoreira-valory Apr 23, 2025
bcb9c26
Merge branch 'main' into feat/bridge2
jmoreira-valory Apr 23, 2025
338b2d3
Merge commit '5a49fd8376c149ef5e1957514cd42e334f55d203' into feat/bri…
jmoreira-valory Apr 23, 2025
895c224
chore: fix gas fees
jmoreira-valory Apr 23, 2025
06805f1
chore: fix gas price
jmoreira-valory Apr 23, 2025
32e6ae6
chore: update
jmoreira-valory Apr 23, 2025
7029074
fix: tests
jmoreira-valory Apr 23, 2025
3ad175c
fix: linters
jmoreira-valory Apr 23, 2025
3e7b3ad
chore: add hash to safe creation
jmoreira-valory Apr 24, 2025
c33a295
chore: update
jmoreira-valory Apr 24, 2025
4500319
chore: fixes
jmoreira-valory Apr 24, 2025
af0390e
chore: fix linters
jmoreira-valory Apr 24, 2025
4006b57
fix: linters
jmoreira-valory Apr 24, 2025
8376d86
Merge pull request #74 from valory-xyz/feat/add_create_safe_info
jmoreira-valory Apr 24, 2025
2ccfa2b
chore: update
jmoreira-valory Apr 24, 2025
27d1d4d
fix: tests
jmoreira-valory Apr 24, 2025
0e29b02
chore: added exception on get asset balance
jmoreira-valory Apr 24, 2025
41c3069
fix: linters
jmoreira-valory Apr 24, 2025
4128439
chore: fix test
jmoreira-valory Apr 25, 2025
d6a8a95
chore: remove enum
jmoreira-valory Apr 25, 2025
b68e148
feat: improve gas estimation
jmoreira-valory Apr 27, 2025
a404790
chore: save executed to files
jmoreira-valory Apr 29, 2025
0cb50e4
chore: fix
jmoreira-valory Apr 29, 2025
da9c7ce
chore: fix int
jmoreira-valory Apr 29, 2025
f8b330b
chore: remove global status
jmoreira-valory Apr 29, 2025
70c071a
doc: update api.md
jmoreira-valory Apr 29, 2025
deda90a
chore: update price impact
jmoreira-valory Apr 29, 2025
267a557
Merge branch 'main' into feat/bridge2
jmoreira-valory May 1, 2025
134e368
Merge commit 'deda90a2f3b72c5a7da8d50da274346d0c7c8d06' into feat/bri…
jmoreira-valory May 1, 2025
ac39114
Merge branch 'feat/bridge2' into feat/bridge3
jmoreira-valory May 1, 2025
26a7402
chore: update
jmoreira-valory May 1, 2025
cb58a62
refactor: split files
jmoreira-valory May 1, 2025
2c3d9a2
chore: refactor
jmoreira-valory May 2, 2025
dd69ab6
chore: remove tag from exceptions
jmoreira-valory May 2, 2025
cd4b960
chore: update
jmoreira-valory May 2, 2025
0c2bf69
chore: refactor
jmoreira-valory May 4, 2025
bf2a4dd
chroe: add file
jmoreira-valory May 4, 2025
cd6b2c3
chore: update
jmoreira-valory May 4, 2025
706fa4a
Merge branch 'feat/bridge3' into feat/bridge2
jmoreira-valory May 5, 2025
dbf495f
chore: add l1 standard bridge contract
jmoreira-valory May 5, 2025
86fe1db
feat: native bridge
jmoreira-valory May 6, 2025
df353fc
fix: linters
jmoreira-valory May 6, 2025
ac68ab8
chore: mypy
jmoreira-valory May 6, 2025
12d0285
Merge remote-tracking branch 'origin/main' into feat/bridge2
jmoreira-valory May 6, 2025
a446510
doc: readme
jmoreira-valory May 6, 2025
4db743b
fix: str to int
jmoreira-valory May 6, 2025
168d719
fix: int
jmoreira-valory May 6, 2025
419e480
chore: fix uuid
jmoreira-valory May 6, 2025
f5f3eef
chore: poetry
jmoreira-valory May 6, 2025
7ca1e16
fix: contracts
jmoreira-valory May 7, 2025
00d3690
chore: fixed gas
jmoreira-valory May 7, 2025
38eddca
fix: update refill requirements
jmoreira-valory May 7, 2025
298e197
fix: linters
jmoreira-valory May 7, 2025
5b42ade
chore: add eta
jmoreira-valory May 7, 2025
e84449d
chore: add total_requirements
jmoreira-valory May 8, 2025
814bcd3
chore: validate amount as nonnegative integer in bridge providers
jmoreira-valory May 9, 2025
d2bece2
feat: add flag transfer_excess_assets
jmoreira-valory May 9, 2025
cebde7c
Merge commit 'd2bece2337ba0f993d521716c4842085a7417154' into feat/bri…
jmoreira-valory May 10, 2025
416b3c6
chore: update
jmoreira-valory May 10, 2025
4e7dfa7
chore: ledger_api field
jmoreira-valory May 10, 2025
e105501
chore: update
jmoreira-valory May 11, 2025
79784b5
Merge commit 'e1055015c701cb45b0cbc2b643b28cdaef9d13e0' into feat/bri…
jmoreira-valory May 11, 2025
d88bf96
Merge commit '9ca362f302ae749dd99b236d062ccc5c722acabf' into feat/bri…
jmoreira-valory May 11, 2025
f63dc92
chore: fix test
jmoreira-valory May 11, 2025
1601daa
chore: remove bridge status
jmoreira-valory May 11, 2025
5029fb5
Merge commit '64da4a9ac7a73a33063484d5cc2041c3faa1dae8' into feat/bri…
jmoreira-valory May 12, 2025
81d3b38
refactor: merge sum
jmoreira-valory May 12, 2025
502cd37
chore: update tests
jmoreira-valory May 12, 2025
84d2479
chore: tests
jmoreira-valory May 12, 2025
8321e29
remove tx_status
jmoreira-valory May 12, 2025
0ca9d7b
chore: bridgerequest
jmoreira-valory May 12, 2025
9a40534
chore: linters
jmoreira-valory May 13, 2025
ac4c856
chore: update
jmoreira-valory May 13, 2025
4ab9a92
Merge commit '5c81ef95597f756e539f4017e3bb1e63f9225f1c' into feat/bri…
jmoreira-valory May 13, 2025
a93817d
chore: update
jmoreira-valory May 13, 2025
1d7d25f
chore: update
jmoreira-valory May 14, 2025
07d465e
chore: debug
jmoreira-valory May 14, 2025
10abb3e
Merge remote-tracking branch 'origin/main' into feat/bridge2
jmoreira-valory May 14, 2025
3495dda
chore: fix gas
jmoreira-valory May 14, 2025
65e53cb
fix: tests
jmoreira-valory May 14, 2025
7e9177c
fix: linters
jmoreira-valory May 14, 2025
01a2cd7
fix: linters
jmoreira-valory May 14, 2025
0a63933
chore: refactor bridge data
jmoreira-valory May 15, 2025
a02e0d3
chore: refactor
jmoreira-valory May 15, 2025
b64a229
Merge commit '38ee7888fd04a8b1fc75a778c59711f9dea98e2e' into feat/bri…
jmoreira-valory May 15, 2025
295839c
chore: consolidate bridge classes
jmoreira-valory May 15, 2025
90d35c9
chore: update
jmoreira-valory May 15, 2025
3bd378f
chore: fix validation
jmoreira-valory May 15, 2025
cdb1a66
chore: can process
jmoreira-valory May 17, 2025
3efed9b
chore: replace event search from get_logs to create_filter
jmoreira-valory May 17, 2025
ac9ef93
fix: tests
jmoreira-valory May 17, 2025
bcfabd3
chore: update
jmoreira-valory May 18, 2025
1a646a2
chore: refactor to contract adapter
jmoreira-valory May 18, 2025
80ee97a
chore: update
jmoreira-valory May 18, 2025
d484b37
chore: add omnibridge contracts
jmoreira-valory May 18, 2025
4c041b7
Merge commit '2c8ead687e689b3a32c7cf51c54b2fc740519d4a' into feat/bri…
jmoreira-valory May 18, 2025
6be1e94
chore: update
jmoreira-valory May 19, 2025
9830ce4
chore: update
jmoreira-valory May 19, 2025
d8e6ac5
chore: fix test
jmoreira-valory May 19, 2025
6319177
fix: linters
jmoreira-valory May 19, 2025
3ec9910
fix: sanitize wrong addresses
jmoreira-valory May 19, 2025
db0ff0b
Merge commit '51d043176399c836981be9d82e9cc847ce374d51' into feat/bri…
jmoreira-valory May 19, 2025
951f6f3
chore: omnibridge get event
jmoreira-valory May 19, 2025
4afefdf
chore: update
jmoreira-valory May 19, 2025
74ba423
chore: remove redundant code
jmoreira-valory May 19, 2025
0d514d3
chore: update
jmoreira-valory May 19, 2025
0740900
fix: linters
jmoreira-valory May 19, 2025
87d3f57
chore: update adaptors
jmoreira-valory May 20, 2025
a81862e
fix: remove eth filter
jmoreira-valory May 20, 2025
5842fe4
fix: linters
jmoreira-valory May 20, 2025
6fef95f
fix: checksum addresses
jmoreira-valory May 20, 2025
44f4e7a
chore: fix links
jmoreira-valory May 20, 2025
563c9e0
Merge remote-tracking branch 'origin/main' into feat/bridge2
jmoreira-valory May 20, 2025
0c04929
feat: add last requested bundle id endpoint
jmoreira-valory May 20, 2025
6a41fdd
fix: explorer link
jmoreira-valory May 20, 2025
c737adc
chore: fix
jmoreira-valory May 20, 2025
7a0fdd5
fix: linters
jmoreira-valory May 20, 2025
1d93293
chore: update
jmoreira-valory May 21, 2025
a9aea48
Merge commit '1d9329392e0baa2ce6510464d90ef173446e843a' into feat/bri…
jmoreira-valory May 21, 2025
52841c1
chore: update
jmoreira-valory May 21, 2025
0779c5c
fix: tests
jmoreira-valory May 21, 2025
3ecab40
fix: tests
jmoreira-valory May 21, 2025
bc051d2
chore: rename bridge configs to native_bridge_configs
jmoreira-valory May 21, 2025
44b0012
fix: linters
jmoreira-valory May 21, 2025
3df6aa5
refactor: remove _get_transactions
jmoreira-valory May 22, 2025
e67d349
refactor: remove _get_transactions
jmoreira-valory May 22, 2025
f911214
chore: fix tests
jmoreira-valory May 22, 2025
f12f441
chore: use local TxSettler for bridge module
jmoreira-valory May 22, 2025
396c14d
chore: remove custom TxSettler
jmoreira-valory May 23, 2025
df1e518
fix: native bridge
jmoreira-valory May 23, 2025
8be2238
fix: zero-amount bridges
jmoreira-valory May 23, 2025
eda9b9b
test: bridge and swap tests
jmoreira-valory May 23, 2025
2c89498
Merge commit '28ac9640c7577f9990e55a646053878514180b76' into feat/bri…
jmoreira-valory Jun 2, 2025
60f1c07
fix: optimism middleware
jmoreira-valory Jun 2, 2025
d707f28
fix: check native bridge remote tokens
jmoreira-valory Jun 2, 2025
c3cdc1f
tests: fix
jmoreira-valory Jun 2, 2025
7c1ab6f
fix: linters
jmoreira-valory Jun 2, 2025
32b0733
chore: review updates
jmoreira-valory Jun 2, 2025
2eab7bb
chore: remove comment
jmoreira-valory Jun 3, 2025
4484fc5
chore: refactor bridge_manager as a property
jmoreira-valory Jun 3, 2025
5d55ac0
chore: catch general exception
jmoreira-valory Jun 3, 2025
f8b7186
fix: nonce
jmoreira-valory Jun 3, 2025
06af632
chore: update README.md
jmoreira-valory Jun 3, 2025
f873156
Merge commit 'e0cfd96e130f63c4d38ca6085de7738705631561' into feat/bri…
jmoreira-valory Jun 3, 2025
5688df4
chore: fix mode rpc endpoint
jmoreira-valory Jun 4, 2025
308bacf
tests: skip
jmoreira-valory Jun 4, 2025
b6f391c
chore: github actions
jmoreira-valory Jun 4, 2025
02cc3f1
chore: tests
jmoreira-valory Jun 4, 2025
ecdb622
tests: fix
jmoreira-valory Jun 4, 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
194 changes: 194 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,200 @@ The refill requirements are computed based on the fund requirements present on t

---

## Bridge

### `POST /api/bridge/bridge_refill_requirements`

Creates a quote bundle to fulfill the bridge requests and returns

- the refill requirements on the source chain for bridging assets to target chains,
- the quote bundle id to execute the request.

<details>
<summary>Request</summary>

```json
{
"bridge_requests": [
{
"from": {
"chain": "ethereum",
"address": "0xDe6B572A049B27D349e89aD0cBEF102227e31473",
"token": "0x0000000000000000000000000000000000000000"
},
"to": {
"chain": "gnosis",
"address": "0xDe6B572A049B27D349e89aD0cBEF102227e31473",
"token": "0x0000000000000000000000000000000000000000",
"amount": 10000000000000000000
},
},
{
"from": {
"chain": "ethereum",
"address": "0xDe6B572A049B27D349e89aD0cBEF102227e31473",
"token": "0x0000000000000000000000000000000000000000"
},
"to": {
"chain": "gnosis",
"address": "0x28580196F52DB3C95C3d40Df88426e251d115842",
"token": "0x0000000000000000000000000000000000000000",
"amount": 10000000000000000000
}
}
],
"force_update": false
}
```

</details>

<details>
<summary>Response</summary>

```json
{
"id": "qb-bdaafd7f-0698-4e10-83dd-d742cc0e656d",
"balances": {
"ethereum": {
"0xDe6B572A049B27D349e89aD0cBEF102227e31473": {
"0x0000000000000000000000000000000000000000": 0,
"0x0001A500A6B18995B03f44bb040A5fFc28E45CB0": 0
}
}
},
"bridge_total_requirements": {
"ethereum": {
"0x0000000000000000000000000000000000000000": 10073082159280405,
"0x0001A500A6B18995B03f44bb040A5fFc28E45CB0": 61944358967139717502
}
},
"bridge_refill_requirements": {
"ethereum": {
"0xDe6B572A049B27D349e89aD0cBEF102227e31473": {
"0x0000000000000000000000000000000000000000": 10073082159280405,
"0x0001A500A6B18995B03f44bb040A5fFc28E45CB0": 61944358967139717502
}
}
},
"expiration_timestamp": 1743000251,
"is_refill_required": true,
"bridge_request_status": [
{
"message": "",
"status": "QUOTE_DONE",
},
{
"message": "",
"status": "QUOTE_DONE",
}
],
"error": false
}
```

</details>

---

### `POST /api/bridge/execute`

Executes a quote bundle. See [GET /api/bridge/status/{quote_bundle_id}](#get-apibridgestatusquote_bundle_id) for status values.

<details>
<summary>Request</summary>

```json
{
"id": "qb-bdaafd7f-0698-4e10-83dd-d742cc0e656d"
}
```

</details>

<details>
<summary>Response</summary>

```json
{
"id": "qb-bdaafd7f-0698-4e10-83dd-d742cc0e656d",
"bridge_request_status": [
{
"explorer_link": "https://scan.li.fi/tx/0x3795206347eae1537d852bea05e36c3e76b08cefdfa2d772e24bac2e24f31db3",
"message": null,
"status": "EXECUTION_DONE",
"tx_hash": "0x3795206347eae1537d852bea05e36c3e76b08cefdfa2d772e24bac2e24f31db3",
},
{
"explorer_link": "https://scan.li.fi/tx/0x0e53f1b6aa5552f2d4cfe8e623dd95e54ca079c4b23b89d0c0aa6ed4a6442384",
"message": null,
"status": "EXECUTION_PENDING",
"tx_hash": "0x0e53f1b6aa5552f2d4cfe8e623dd95e54ca079c4b23b89d0c0aa6ed4a6442384",
}
],
"error": false
}
```

</details>

---

### `GET /api/bridge/status/{quote_bundle_id}`

Gets the status of a quote bundle. Individual bridge request status:

- `QUOTE_DONE`: A quote is available.
- `QUOTE_FAILED`: Failed to request a quote.
- `EXECUTION_PENDING`: Execution submitted and pending to be finalized.
- `EXECUTION_DONE`: Execution finalized successfully.
- `EXECUTION_FAILED`: Execution failed.

<details>
<summary>Response</summary>

```json
{
"id": "qb-bdaafd7f-0698-4e10-83dd-d742cc0e656d",
"bridge_request_status": [
{
"explorer_link": "https://scan.li.fi/tx/0x3795206347eae1537d852bea05e36c3e76b08cefdfa2d772e24bac2e24f31db3",
"message": null,
"status": "EXECUTION_DONE",
"tx_hash": "0x3795206347eae1537d852bea05e36c3e76b08cefdfa2d772e24bac2e24f31db3",
},
{
"explorer_link": "https://scan.li.fi/tx/0x0e53f1b6aa5552f2d4cfe8e623dd95e54ca079c4b23b89d0c0aa6ed4a6442384",
"message": null,
"status": "EXECUTION_PENDING",
"tx_hash": "0x0e53f1b6aa5552f2d4cfe8e623dd95e54ca079c4b23b89d0c0aa6ed4a6442384",
}
],
"error": false
}
```

</details>

---

### `GET /api/bridge/last_executed_bundle_id`

Gets the last executed quote bundle id.

<details>
<summary>Response</summary>

```json
{
"id": "br-52e3f945-b495-49bd-8ea2-cafa67468ed3"
}
```

</details>

---

## Unused endpoints

### `POST /api/services/{service}/onchain/deploy`
Expand Down
Loading