LAS VEGAS — Linsanity got his money, but it looks like it won’t be from the Knicks.

In a stunning turn of events in the past 24 hours, the Knicks agreed to a sign-and-trade with the Trail Blazers to obtain former Knicks point guard Raymond Felton that all but ends the Jeremy Lin era prematurely and bitterly, according to league sources.

Linsanity was fun while it lasted.

One NBA source insisted the Knicks, with Felton’s addition, will not match Lin’s new, ramped-up $25 million offer sheet from the Rockets. The Knicks will have three days to reconsider amid a potential backlash.

In the trade, the Knicks got even older, adding another former Knick, Kurt Thomas, 39. Knicks free agent Jared Jeffries was signed in the deal and shipped to Portland in the package, along with Dan Gadzuric’s non-guaranteed $1.4 million contract.

The Post reported on its back page Saturday the Knicks were furious the Rockets changed the offer sheet for Lin and upgraded it to a $25 million guarantee over three years, according to a source. The Knicks were bitter because they told Lin immediately the club would match the original offer and Lin apparently shared the information with the Rockets. Lin and Houston then plotted to redo it.

Lin secretly flew into Las Vegas without informing the Knicks to renegotiate the contract and sign it.

The Knicks had been set to match Lin’s original offer sheet of four years, $28.9 million that had a $19 million guarantee before the Rockets threw a financial curveball that called for a $15 million third year that would have doomed owner James Dolan’s luxury-tax predicament.

So this likely ended the Knicks’ endless blabber across the past two months, swearing they would bring Lin back and that he was a “big part” of “what we’re trying to do,’’ as coach Mike Woodson put it three days ago.

The Knicks also would lose out on continuing to promote a global marketing sensation.

Lin also may be a young point guard with an All-Star future, but apparently Knicks officials didn’t think so. There was concern Lin’s success was a function of former coach Mike D’Antoni’s up-tempo offense and would not be as effective in Woodson’s isolation sets. Plus, Woodson does not like playing young players and Lin was coming off knee surgery that cut short his historic 26-game surge.

The Knicks had brought in Jason Kidd to be Lin’s mentor and Spanish League veteran Pablo Prigioni as another backup at the point. The 24-year-old undrafted Harvard point guard apparently had not earned the Knicks’ full confidence he was ready for a full-time starting role next season.

Though Woodson just three days ago anointed Lin to be the starter when training camp began, he didn’t reach further to say Lin would stay there. Now, Kidd and Felton likely will fight for the starting spot if the Knicks don’t match. It would seem odd Felton would come if he didn’t know Lin was out.

Last night, the Knicks also declined to match the offer sheet of Lin’s buddy, Landry Fields, as he and his famous couch head to Canada. The Raptors offered Fields a three-year, $19 million deal that was also backloaded in the third year at $8.5 million to thwart the Knicks’ attempt at a sign-and-trade for Steve Nash.

If Lin made $14.9 million in 2014-15, the Knicks’ payroll could include eight players costing $87 million — or as much as $17 million over the luxury-tax threshold. Originally, the Rockets offer sheet was for $9.3 million in the third year.

Felton was squarely on the Knicks’ radar when free agency began, but the team turned to Kidd because he was immediately available and Felton was still shopping.

Felton had great success with Amar’e Stoudemire two seasons ago before being traded in the Carmelo Anthony blockbuster. The Post quoted Felton’s agent, Tony Dutt, earlier this month, saying the Knicks had shown “great interest’’ and Felton would love to return.

Nevertheless, Felton’s offensive game was spotty last season. He shot just 40.7 percent with the Blazers and a sickly 30.5 percent from the 3-point line, amid reports he was out of shape.

A source confirmed the Rockets attempted to present the Knicks with Lin’s revised offer sheet Friday, but Knicks general manager Glen Grunwald appeared to be avoiding it, though he finally received the offer sheet late last night. It appears Grunwald was buying time to see if there are other alternatives than giving Lin $15 million in the third year of his contract.

The Houston Chronicle reported a courier went to the Knicks hotel in Las Vegas to deliver the offer sheet, but a Knicks official said they were not accepting deliveries. Now that Grunwald has the offer sheet, the Knicks will have 72 hours to match or lose Lin to Houston.

“There’s been a variety of ways the Rockets have tried to give Grunwald the offer sheet,’’ a source said.

Yesterday, Grunwald did not attend the Knicks summer-league opener against the Grizzlies as he hammered out the Felton deal and the Rockets sent an official to present him with the offer sheet.

Earlier in the day, after Team USA’s practice, Tyson Chandler, a big Lin supporter, warned it was no guarantee the Knicks would match the offer sheet for Lin.

“It’s difficult now,” Chandler said. “I don’t know what the situation will be. They put us in a tough situation as far as the organization goes, and I don’t know what’s going to happen here going forward.”

marc.berman@nypost.com