David Wright agreed to the richest contract in Mets history Friday and Tommy Hanson was traded to the Angels on a busy day in baseball when dozens of players were dumped by their teams.

Houston scooped up Philip Humber, hoping he’s a perfect fit, and Mariano Rivera returned for another season with the Yankees. He’ll be throwing to a new catcher, though, after Russell Martin completed his $17 million, two-year deal with Pittsburgh.

Jair Jurrjens, Mark Reynolds, Mike Pelfrey and Jack Hannahan were among the most notable names set to become free agents Saturday after their former clubs declined to offer them contracts for next season. Teams had until midnight EST on Friday to make 2013 offers to unsigned players on 40-man rosters.

Wright and the Mets settled on a $138 million, eight-year deal, a person familiar with the negotiations told The Associated Press. The agreement replaces the All-Star third baseman’s $16 million salary for next season and includes $122 million in new money, the person said, speaking on condition of anonymity because the contract had not been finalized.

Some of the money in Wright’s deal will be deferred.

A homegrown fan favorite, Wright is the club’s career leader in several major offensive categories, including hits, RBIs, runs and walks. He turns 30 on Dec. 20 and would have been eligible for free agency after next season.

Wright plans to attend teammate Daniel Murphy’s wedding in Jacksonville, Fla., this weekend, then travel to New York for a physical. His big deal probably will be announced at next week’s winter meetings in Nashville, Tenn., the person said.

Atlanta shipped Hanson to the Los Angeles Angels for former closer Jordan Walden, clearing a spot in the Braves’ rotation for Julio Teheran, Randall Delgado or another young starter.

Hanson’s velocity decreased as he battled rotator cuff tendinitis in 2011 and a lower back strain in 2012. But the 26-year-old right-hander was 45-32 with a 3.61 ERA in 108 starts over four big league seasons with the Braves.

“It’s a good risk on a pitcher we really believe in,” Angels general manager Jerry Dipoto said.

Walden had 32 saves in 2011, making the All-Star team as a rookie, but lost his closer’s role to Ernesto Frieri this year and finished 3-2 with a 3.46 ERA. He became expendable when the Angels agreed this week to a $3.5 million, one-year contract with reliever Ryan Madson.

Walden gives Atlanta another hard-thrower for its bullpen to help set up dominant closer Craig Kimbrel. His fastball has been clocked at close to 100 mph, and he had 48 strikeouts in 39 innings last season.

“We’ve been focused on adding a power arm to our bullpen all offseason,” Braves general manager Frank Wren said. “We felt if we added one power arm we would have a bullpen that would stack up with the best bullpens in our league. Jordan Walden has closing experience and the kind of arm that will stack up well in a seventh- and eighth-inning role for us.”

The ninth inning in New York belongs to Rivera, who accepted a cut in guaranteed money when he finalized a $10 million, one-year contract after missing most of the season with a knee injury.

The career saves leader, who turned 43 on Thursday, took a cut from his $30 million deal that covered the last two years _ but he can earn additional money in award bonuses.

Rivera was limited to nine games this year after tearing the anterior cruciate ligament in his right knee while shagging fly balls during batting practice in Kansas City on May 3.

“Like I’ve been saying, I didn’t want to go out like that,” he said in a statement. “I didn’t want that to be the last image. But it wasn’t an easy decision because there’s more than just baseball with me. … I’m not just coming back to play. I’m coming back to win.”

Rivera, with 608 saves in the regular season and 42 more in the postseason, is a 12-time All-Star. The Yankees say his recovery from June 12 knee surgery will be complete by opening day.

By then, Martin will be handling a new pitching staff in Pittsburgh after spending the past two seasons with New York.

The free-agent catcher goes from a franchise that’s won a record 27 World Series titles to a team that has endured a record 20 consecutive losing seasons.

“It’s going to be different,” Martin said. “It’s going to be a challenge but I think the Pirates have a young and electric club. There is a lot of talent there and I don’t think we’re as far away from winning as maybe people outside baseball think we are.”

Humber, who threw a perfect game for the Chicago White Sox last season, was claimed off waivers by the Astros and agreed to a one-year contract. He gets an $800,000 salary next year and Houston holds a club option for $3 million in 2014 with a $50,000 buyout.

The 29-year-old right-hander went 5-5 with a 6.44 ERA in 26 games last season, including 16 starts.

Jurrjens, an All-Star in 2011, was non-tendered by the Braves after getting demoted to the minors last season. Atlanta also declined to offer a 2013 contract to reliever Peter Moylan, but claimed right-hander David Carpenter off waivers from Boston.

The Red Sox cut ties with outfielder Ryan Sweeney and pitchers Scott Atchison and Rich Hill. Hannahan was let go by Cleveland, clearing the way for youngster Lonnie Chisenhall to start at third base.

Baltimore chose not to offer a contract to Reynolds, the strikeout-prone slugger who hit 23 home runs last season after connecting for 37 the previous year.

Pelfrey, a 15-game winner in 2010, made only three starts this year before having season-ending Tommy John surgery on his pitching elbow. The Mets let him go Friday, along with outfielder Andres Torres and reliever Manny Acosta.

In other moves, the Angels claimed outfielder Scott Cousins off waivers from Seattle, the Yankees claimed right-hander Jim Miller off waivers from Oakland, and Miami claimed first baseman-outfielder Joe Mahoney off waivers from Baltimore.

Pittsburgh made a pair of small trades, acquiring minor league right-hander Zach Thornton from Oakland for reliever Chris Resop, and minor league pitcher Jhondaniel Medina from Baltimore for infielder Yamaico Navarro.

Elsewhere, former big leaguer Chan Ho Park announced his retirement. The first South Korean-born player in the majors and a 2001 All-Star, he holds the major league record for wins by an Asian pitcher (124).