Thrym (or Trym) is foiled in his scheme by the knowledge of Heimdall, the cunning of Loki and the sheer violence of Thor. In fact, mighty Thor, son of Odin, kills Thrym, his sister, and all of his giant kin, which had been present at the wedding reception.
The poem Trymskvida gives the details of how Thor gets his hammer back but does not tell who gets to inherit Trym's fabulous treasures now that all of his kin are gone.