Was Abraham considered righteous because of his goods deeds or his faith?

And now he’s quoting genesis 15:6: Abraham believed God and it was counted to him as righteousness. God came to Abraham, who was a pagan demon-worshiping, idol-worshiper in the land of Er. He came to him though he didn’t love God, didn’t know God, didn’t care about God but he worshiped false gods. He came to Abraham, called him out of that false pagan idolatry and said “I’m going to make you the father of a great nation.” Abraham’s like “okay” so he gets out and he goes and follows the Lord and then later in Genesis chapter 15, he tells Abraham that he is going to bless him and Abraham says “How? I don’t have an heir. I don’t have anyone that has been born (literally says “from my loins”). My descendant, my heir is Eleazar from Damascus. He’s just a relative. He’s not my heir, my son, so how on earth are you going to make me the father of a great nation if I don’t even have a son?” And then the Lord promises Abraham. He says “Look up at the stars, count the stars if you can count them. I’m going to give you an heir. It will not be Eliezer of Damascus. I will give you a son and you will be the father of many nations and your descendants will be greater than the number of the stars.” And Abraham believed God’s promise and it was counted to him as righteousness. Abraham didn’t do anything but God gave him a promise that he would save the world through his lineage, he would give him a son and eventually Jesus the savior would come through his line and Abraham trusted God’s promise to save. That’s what Genesis 15:6 is about. That’s why Paul quotes it. He didn’t do anything; he just trusted God’s promise and said “I trust that your promise will be fulfilled” and it was counted to him as righteousness. He didn’t achieve it. He received it. God declared him righteous through faith. He accepted him through his faith.