@@ -39,20 +39,55 @@ GoldRushDecoder.on(
39
39
} ;
40
40
} ;
41
41
42
+ const date = timestampParser ( tx . block_signed_at , "YYYY-MM-DD" ) ;
43
+
44
+ const { data : PetNFT } =
45
+ await covalent_client . NftService . getNftMetadataForGivenTokenIdForContract (
46
+ chain_name ,
47
+ // * INFO: Hero NFT Contract Address
48
+ "0x1990F87d6BC9D9385917E3EDa0A7674411C3Cd7F" ,
49
+ decoded . petId . toString ( ) ,
50
+ {
51
+ withUncached : true ,
52
+ }
53
+ ) ;
54
+
55
+ const nfts : EventNFTs = [
56
+ {
57
+ heading : `Pet ID: ${ decoded . petId . toString ( ) } ` ,
58
+ collection_address : PetNFT ?. items ?. [ 0 ] ?. contract_address ,
59
+ collection_name :
60
+ PetNFT ?. items ?. [ 0 ] ?. nft_data ?. external_data ?. name || null ,
61
+ token_identifier : decoded . petId . toString ( ) ,
62
+ images : {
63
+ default :
64
+ PetNFT ?. items ?. [ 0 ] ?. nft_data ?. external_data ?. image ||
65
+ null ,
66
+ 256 :
67
+ PetNFT ?. items ?. [ 0 ] ?. nft_data ?. external_data
68
+ ?. image_256 || null ,
69
+ 512 :
70
+ PetNFT ?. items ?. [ 0 ] ?. nft_data ?. external_data
71
+ ?. image_512 || null ,
72
+ 1024 :
73
+ PetNFT ?. items ?. [ 0 ] ?. nft_data ?. external_data
74
+ ?. image_1024 || null ,
75
+ } ,
76
+ } ,
77
+ ] ;
78
+
42
79
const details : EventDetails = [
43
80
{
44
81
heading : "Fed By" ,
45
82
value : decoded . fedBy ,
46
83
type : "address" ,
47
84
} ,
48
- {
49
- heading : "Pet ID" ,
50
- value : decoded . petId . toString ( ) ,
51
- type : "text" ,
52
- } ,
53
85
{
54
86
heading : "Food Type" ,
55
- value : decoded . foodType . toString ( ) ,
87
+ value :
88
+ Number ( decoded . foodType ) === 1
89
+ ? "Premium Pet Treat"
90
+ : "Regular Pet Treat" ,
56
91
type : "text" ,
57
92
} ,
58
93
{
@@ -75,6 +110,7 @@ GoldRushDecoder.on(
75
110
} ,
76
111
...( options . raw_logs ? { raw_log : log_event } : { } ) ,
77
112
details,
113
+ nfts,
78
114
} ;
79
115
}
80
116
) ;
0 commit comments