Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 8 additions & 3 deletions src/Facets/RelayFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -219,21 +219,26 @@ contract RelayFacet is
}

/// @notice get Relay specific chain id for non-EVM chains
/// IDs found here https://li.quest/v1/chains?chainTypes=UTXO,SVM
/// IDs found here https://api.relay.link/chains
/// @param chainId LIFI specific chain id
function _getMappedChainId(
uint256 chainId
) internal pure returns (uint256) {
// Bitcoin
if (chainId == 20000000000001) {
if (chainId == LIFI_CHAIN_ID_BTC) {
return 8253038;
}

// Solana
if (chainId == 1151111081099710) {
if (chainId == LIFI_CHAIN_ID_SOLANA) {
return 792703809;
}

// Sui
if (chainId == LIFI_CHAIN_ID_SUI) {
return 103665049;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

checked also other non-EVM chains for Relay and looking at list of currently existing from LiFiData we can only add SUI at this point

return chainId;
}
}
6 changes: 6 additions & 0 deletions test/solidity/Facets/RelayFacet.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,12 @@ contract RelayFacetTest is TestBaseFacet {
return;
}

// Sui
if (chainId == 9270000000000000) {
assertEq(mapped, 103665049);
return;
}

assertEq(mapped, chainId);
}

Expand Down
Loading