The UN has adopted a deal to inject $300 billion annually into developing countries as they struggle to fight climate change.